diff --git a/core/prelude/destroy.carbon b/core/prelude/destroy.carbon index 4682c90f0122..e25f5601b0ed 100644 --- a/core/prelude/destroy.carbon +++ b/core/prelude/destroy.carbon @@ -1,16 +1,35 @@ // Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception - package Core library "prelude/destroy"; -// TODO: Add `Destructor`, as in: -// interface Destructor { -// private fn Op(ref self); +// TODO: uncomment when `require impls` adds a witness table entry. +// interface SubobjectDestroy { +// final fn Op(ref self) = "subobject.destroy"; // } -// Destroys objects. This will invoke `Destructor` impls recursively on members; -// it does not deallocate memory. interface Destroy { + // TODO: uncomment when `require impls` adds a witness table entry. + // require impls SubobjectDestroy; + + // TODO: change `Self` to `partial Self`. fn Op(ref self); + + // TODO: remove when `require impls` adds a witness table entry. + final fn SubobjectDestroy(unused ref self) { + // This function body is ignored by the toolchain. We can't use + // a built-in because the compiler treats it as an error. We + // should address this at some point, but it's not a high + // priority right now. + } + + final fn SelfDestruct(ref self) { + self.Op(); + self.SubobjectDestroy(); + } } + +// TODO: uncomment when `require impls` adds a witness table entry. +// impl forall [T: SubobjectDestroy] partial T as Destroy { +// alias Op = T.Op; +// } diff --git a/toolchain/check/control_flow.cpp b/toolchain/check/control_flow.cpp index 3ef7874748c1..2bc4e463e41c 100644 --- a/toolchain/check/control_flow.cpp +++ b/toolchain/check/control_flow.cpp @@ -157,7 +157,9 @@ static auto AddCleanups(Context& context, ScopeStack::CleanupScopeDepth depth) // cleanup blocks, so we'll want to avoid this in the future. BuildUnaryOperator(context, context.insts().GetLocIdForDesugaring(destroy_id), - {.interface_name = CoreIdentifier::Destroy}, destroy_id); + {.interface_name = CoreIdentifier::Destroy, + .op_name = CoreIdentifier::SelfDestruct}, + destroy_id); } } diff --git a/toolchain/check/core_identifier.def b/toolchain/check/core_identifier.def index 0647777ecebc..b318ec9ebce9 100644 --- a/toolchain/check/core_identifier.def +++ b/toolchain/check/core_identifier.def @@ -76,9 +76,11 @@ CARBON_CORE_IDENTIFIER(Optional) CARBON_CORE_IDENTIFIER(OrderedWith) CARBON_CORE_IDENTIFIER(RightShiftAssignWith) CARBON_CORE_IDENTIFIER(RightShiftWith) +CARBON_CORE_IDENTIFIER(SelfDestruct) CARBON_CORE_IDENTIFIER(String) CARBON_CORE_IDENTIFIER(SubAssignWith) CARBON_CORE_IDENTIFIER(SubWith) +CARBON_CORE_IDENTIFIER(SubobjectDestroy) CARBON_CORE_IDENTIFIER(UInt) CARBON_CORE_IDENTIFIER(ULong32) CARBON_CORE_IDENTIFIER(ULong64) diff --git a/toolchain/check/cpp/impl_lookup.cpp b/toolchain/check/cpp/impl_lookup.cpp index 367af41da719..2b42996f73c6 100644 --- a/toolchain/check/cpp/impl_lookup.cpp +++ b/toolchain/check/cpp/impl_lookup.cpp @@ -241,7 +241,7 @@ static auto BuildDefaultWitness( query_specific_interface, {fn_id}); } -static auto BuildDestroyWitness( +static auto BuildCppDestroyWitness( Context& context, SemIR::LocId loc_id, SemIR::ConstantId query_self_const_id, SemIR::SpecificInterface query_specific_interface) -> SemIR::InstId { @@ -264,8 +264,11 @@ static auto BuildDestroyWitness( if (fn_id == SemIR::ErrorInst::InstId || fn_id == SemIR::InstId::None) { return fn_id; } - return BuildCustomWitness(context, loc_id, query_self_const_id, - query_specific_interface, {fn_id}); + return BuildDestroyWitness( + context, loc_id, + GetFacetAccessType( + context, context.constant_values().GetInstId(query_self_const_id)), + query_self_const_id, query_specific_interface, {fn_id}); } // Attempts to build a witness table entry for a C++ unary operator. @@ -610,8 +613,8 @@ auto LookupCppImpl(Context& context, SemIR::LocId loc_id, return BuildDefaultWitness(context, loc_id, query_self_const_id, query_specific_interface); case SemIR::CoreInterface::Destroy: - return BuildDestroyWitness(context, loc_id, query_self_const_id, - query_specific_interface); + return BuildCppDestroyWitness(context, loc_id, query_self_const_id, + query_specific_interface); case SemIR::CoreInterface::CppRangeForIterate: return BuildCppRangeForIterateWitness( diff --git a/toolchain/check/cpp/operators.cpp b/toolchain/check/cpp/operators.cpp index 5a1acbf8738c..1065b183537e 100644 --- a/toolchain/check/cpp/operators.cpp +++ b/toolchain/check/cpp/operators.cpp @@ -39,6 +39,8 @@ static auto GetClangOperatorKind(Context& context, SemIR::LocId loc_id, switch (interface_name) { // Unary operators. case CoreIdentifier::Destroy: + case CoreIdentifier::SubobjectDestroy: + case CoreIdentifier::SelfDestruct: case CoreIdentifier::As: case CoreIdentifier::ImplicitAs: case CoreIdentifier::Iterate: diff --git a/toolchain/check/custom_witness.cpp b/toolchain/check/custom_witness.cpp index 4090e0e3f0ee..fbfe1fecf682 100644 --- a/toolchain/check/custom_witness.cpp +++ b/toolchain/check/custom_witness.cpp @@ -6,6 +6,7 @@ #include "llvm/ADT/APFloat.h" #include "toolchain/base/kind_switch.h" +#include "toolchain/check/call.h" #include "toolchain/check/convert.h" #include "toolchain/check/eval.h" #include "toolchain/check/facet_type.h" @@ -15,13 +16,18 @@ #include "toolchain/check/impl_lookup.h" #include "toolchain/check/import_ref.h" #include "toolchain/check/inst.h" +#include "toolchain/check/member_access.h" #include "toolchain/check/name_lookup.h" +#include "toolchain/check/operator.h" +#include "toolchain/check/return.h" #include "toolchain/check/type.h" #include "toolchain/check/type_completion.h" +#include "toolchain/diagnostics/format_providers.h" #include "toolchain/sem_ir/associated_constant.h" #include "toolchain/sem_ir/builtin_function_kind.h" #include "toolchain/sem_ir/constant.h" #include "toolchain/sem_ir/function.h" +#include "toolchain/sem_ir/generic.h" #include "toolchain/sem_ir/ids.h" #include "toolchain/sem_ir/type_info.h" #include "toolchain/sem_ir/typed_insts.h" @@ -350,14 +356,14 @@ static auto CanDestroyType(Context& context, SemIR::LocId loc_id, } } -// Returns the body for `Destroy.Op`. +// Returns the body for `SubobjectDestroy.Op`. // // TODO: This is a placeholder still not actually destroying things, intended to // maintain mostly-consistent behavior with current logic while working. That // also means using `self`. -static auto MakeDestroyOpBody(Context& context, SemIR::LocId loc_id, - SemIR::TypeId self_type_id, - SemIR::InstId self_param_id) +static auto MakeSubobjectDestroyOpBody(Context& context, SemIR::LocId loc_id, + SemIR::TypeId self_type_id, + SemIR::InstId self_param_id) -> SemIR::InstBlockId { context.inst_block_stack().Push(); auto inst = context.types().GetAsInst(self_type_id); @@ -374,7 +380,7 @@ static auto MakeDestroyOpBody(Context& context, SemIR::LocId loc_id, // TODO: Implement destruction of the type. break; default: - CARBON_FATAL("Unexpected type for MakeDestroyOpBody: {0}", inst); + CARBON_FATAL("Unexpected type for MakeSubobjectDestroyOpBody: {0}", inst); } AddInst(context, loc_id, SemIR::Return{}); @@ -385,15 +391,48 @@ static auto MakeDestroyOpBody(Context& context, SemIR::LocId loc_id, // to `self_type_id`. static auto MakeDestroyOpFunction(Context& context, SemIR::LocId loc_id, SemIR::TypeId self_type_id, - SemIR::InterfaceId interface_id, - DestroyFormat format) -> SemIR::InstId { + SemIR::InterfaceId interface_id) + -> SemIR::InstId { auto name_id = context.core_identifiers().AddNameId(CoreIdentifier::Op); + const auto& interface = context.interfaces().Get(interface_id); auto specific_interface = MakeCoreSpecificInterface( context, loc_id, interface_id, interface.generic_id, {}); auto canonical_key = MakeGeneratedFunctionKey(context, specific_interface, self_type_id, name_id); auto [decl_id, function_id] = TryGetGeneratedFunction(context, canonical_key); + if (!decl_id.has_value()) { + std::tie(decl_id, function_id) = MakeGeneratedFunctionDecl( + context, loc_id, + {.parent_scope_id = interface.scope_with_self_id, + .name_id = name_id, + .self_type_id = self_type_id, + .self_kind = ParamPatternKind::Ref}); + auto& function = context.functions().Get(function_id); + function.SetGenerated(context.generated_functions().Add( + {.canonical_key = canonical_key, + .function_id = function_id, + .decl_id = decl_id, + .builtin_function_kind = SemIR::BuiltinFunctionKind::NoOp})); + } + + return decl_id; +} + +static auto MakeSubobjectDestroyOpFunction( + Context& context, SemIR::LocId loc_id, SemIR::TypeId self_type_id, + SemIR::InterfaceId interface_id, DestroyFormat format) -> SemIR::InstId { + // TODO: replace with `CoreIdentifier::Op` when `require impls` adds a witness + // table entry. + auto name_id = + context.core_identifiers().AddNameId(CoreIdentifier::SubobjectDestroy); + const auto& interface = context.interfaces().Get(interface_id); + auto specific_interface = MakeCoreSpecificInterface( + context, loc_id, interface_id, interface.generic_id, {}); + auto canonical_key = MakeGeneratedFunctionKey(context, specific_interface, + self_type_id, name_id); + + auto [decl_id, function_id] = TryGetGeneratedFunction(context, canonical_key); if (!decl_id.has_value()) { std::tie(decl_id, function_id) = MakeGeneratedFunctionDecl( context, loc_id, @@ -410,8 +449,8 @@ static auto MakeDestroyOpFunction(Context& context, SemIR::LocId loc_id, builtin_kind = SemIR::BuiltinFunctionKind::NoOp; break; case DestroyFormat::NonTrivial: { - auto body_id = MakeDestroyOpBody(context, loc_id, self_type_id, - function.self_param_id); + auto body_id = MakeSubobjectDestroyOpBody(context, loc_id, self_type_id, + function.self_param_id); function.body_block_ids.push_back(body_id); break; } @@ -425,7 +464,54 @@ static auto MakeDestroyOpFunction(Context& context, SemIR::LocId loc_id, .decl_id = decl_id, .builtin_function_kind = builtin_kind})); } + return decl_id; +} +// Returns a manufactured `Destroy.SelfDestruct` function with the `self` +// parameter typed to `self_type_id`. +static auto MakeDestroySelfDestructFunction( + Context& context, SemIR::LocId loc_id, SemIR::TypeId self_type_id, + SemIR::InterfaceId interface_id, SemIR::InstId op_id, + [[maybe_unused]] SemIR::InstId subobject_destroy_id) -> SemIR::InstId { + auto name_id = + context.core_identifiers().AddNameId(CoreIdentifier::SelfDestruct); + const auto& interface = context.interfaces().Get(interface_id); + auto specific_interface = MakeCoreSpecificInterface( + context, loc_id, interface_id, interface.generic_id, {}); + auto canonical_key = MakeGeneratedFunctionKey(context, specific_interface, + self_type_id, name_id); + + auto [decl_id, function_id] = TryGetGeneratedFunction(context, canonical_key); + if (!decl_id.has_value()) { + std::tie(decl_id, function_id) = MakeGeneratedFunctionDecl( + context, loc_id, + {.parent_scope_id = interface.scope_with_self_id, + .name_id = name_id, + .self_type_id = self_type_id, + .self_kind = ParamPatternKind::Ref}); + + auto& function = context.functions().Get(function_id); + context.inst_block_stack().Push(); + StartFunctionDefinition(context, decl_id, function_id); + auto params = context.inst_blocks().Get(function.call_params_id); + CARBON_CHECK( + params.size() == 1, + "`Core.Destroy.SelfDestruct` should only have `ref self` as its " + "parameter"); + op_id = PerformCall(context, loc_id, op_id, {params[0]}, true); + DiscardExpr(context, op_id); + subobject_destroy_id = + PerformCall(context, loc_id, subobject_destroy_id, {params[0]}, true); + DiscardExpr(context, subobject_destroy_id); + BuildReturnWithNoExpr(context, loc_id); + FinishFunctionDefinition(context, function_id); + context.inst_block_stack().Pop(); + function.SetGenerated(context.generated_functions().Add( + {.canonical_key = canonical_key, + .function_id = function_id, + .decl_id = decl_id, + .builtin_function_kind = SemIR::BuiltinFunctionKind::None})); + } return decl_id; } @@ -656,9 +742,36 @@ auto BuildPrimitiveCopyWitness( query_specific_interface, {op_id}); } +auto BuildDestroyWitness(Context& context, SemIR::LocId loc_id, + SemIR::TypeId self_type_id, + SemIR::ConstantId query_self_const_id, + SemIR::SpecificInterface query_specific_interface, + SemIR::InstId subobject_destroy_fn_id) + -> SemIR::InstId { + auto interface = + context.interfaces().Get(query_specific_interface.interface_id); + auto assoc_entities = + context.inst_blocks().Get(interface.associated_entities_id); + CARBON_CHECK(assoc_entities.size() == 3, + "{} only has {} associated functions", + context.names().GetAsStringIfIdentifier(interface.name_id), + assoc_entities.size()); + + auto op_id = MakeDestroyOpFunction(context, loc_id, self_type_id, + query_specific_interface.interface_id); + + auto self_destruct_fn_id = MakeDestroySelfDestructFunction( + context, loc_id, self_type_id, query_specific_interface.interface_id, + op_id, subobject_destroy_fn_id); + + return BuildCustomWitness( + context, loc_id, query_self_const_id, query_specific_interface, + {op_id, subobject_destroy_fn_id, self_destruct_fn_id}); +} + // Builds and returns a custom witness that performs the specified kind of // destruction for the given type. -static auto BuildDestroyWitness( +static auto BuildCarbonDestroyWitness( Context& context, SemIR::LocId loc_id, SemIR::ConstantId query_self_const_id, SemIR::SpecificInterface query_specific_interface, DestroyFormat format) @@ -667,11 +780,11 @@ static auto BuildDestroyWitness( auto self_type_id = GetFacetAccessType( context, context.constant_values().GetInstId(query_self_const_id)); - auto op_id = - MakeDestroyOpFunction(context, loc_id, self_type_id, - query_specific_interface.interface_id, format); - return BuildCustomWitness(context, loc_id, query_self_const_id, - query_specific_interface, {op_id}); + auto subobject_destroy_op_id = MakeSubobjectDestroyOpFunction( + context, loc_id, self_type_id, query_specific_interface.interface_id, + format); + return BuildDestroyWitness(context, loc_id, self_type_id, query_self_const_id, + query_specific_interface, subobject_destroy_op_id); } // Returns the custom witness to use for destruction of the given type. See @@ -692,16 +805,17 @@ static auto LookupDestroyWitness( return SemIR::InstId::None; } - return BuildDestroyWitness(context, loc_id, query_self_const_id, - query_specific_interface, format); + return BuildCarbonDestroyWitness(context, loc_id, query_self_const_id, + query_specific_interface, format); } auto BuildTrivialDestroyWitness( Context& context, SemIR::LocId loc_id, SemIR::ConstantId query_self_const_id, SemIR::SpecificInterface query_specific_interface) -> SemIR::InstId { - return BuildDestroyWitness(context, loc_id, query_self_const_id, - query_specific_interface, DestroyFormat::Trivial); + return BuildCarbonDestroyWitness(context, loc_id, query_self_const_id, + query_specific_interface, + DestroyFormat::Trivial); } static auto MakeIntFitsInWitness( diff --git a/toolchain/check/custom_witness.h b/toolchain/check/custom_witness.h index 519598ff45a9..0b046790ae33 100644 --- a/toolchain/check/custom_witness.h +++ b/toolchain/check/custom_witness.h @@ -67,6 +67,17 @@ auto LookupCustomWitness(Context& context, SemIR::LocId loc_id, SemIR::SpecificInterface query_specific_interface, bool build_witness) -> std::optional; +// Builds a witness for the `Destroy` interface. +// +// `op_id` refers to the synthesised `Destroy.Op` and is generated differently +// based on whether the specific is a Carbon type or a C++ type. +auto BuildDestroyWitness(Context& context, SemIR::LocId loc_id, + SemIR::TypeId self_type_id, + SemIR::ConstantId query_self_const_id, + SemIR::SpecificInterface query_specific_interface, + SemIR::InstId subobject_destroy_fn_id) + -> SemIR::InstId; + } // namespace Carbon::Check #endif // CARBON_TOOLCHAIN_CHECK_CUSTOM_WITNESS_H_ diff --git a/toolchain/check/handle_interface.cpp b/toolchain/check/handle_interface.cpp index c0d598e2892a..0f03be572873 100644 --- a/toolchain/check/handle_interface.cpp +++ b/toolchain/check/handle_interface.cpp @@ -40,6 +40,92 @@ auto HandleParseNode(Context& context, Parse::InterfaceIntroducerId node_id) return true; } +static auto ValidateCoreInterfaceAssociatedFunction( + Context& context, SemIR::InstId decl_id, int index, CoreIdentifier name_id, + SemIR::Function::InterfaceModifier interface_modifier = + SemIR::Function::InterfaceModifier::None) -> bool { + auto loc_id = context.insts().GetCanonicalLocId(decl_id); + auto decl = context.insts().TryGetAs(decl_id); + if (!decl) { + context.TODO(loc_id, "associated entity must be a method"); + return false; + } + + auto fn = context.functions().Get(decl->function_id); + + if (fn.name_id != context.core_identifiers().AddNameId(name_id)) { + context.TODO(loc_id, + llvm::formatv("associated function #{} must be named `{}`", + index, name_id)); + return false; + } + + auto call_params = context.inst_blocks().Get(fn.call_param_patterns_id); + + // TODO: extend to support arbitrary parameters. + if (call_params.size() != 1) { + context.TODO(loc_id, "associated function must have exactly 1 parameter"); + return false; + } + + auto self = context.insts().TryGetAs(call_params[0]); + if (!self.has_value() || self->pretty_name_id != SemIR::NameId::SelfValue) { + context.TODO(loc_id, + "associated function must take `ref self` as its parameter"); + return false; + } + + // TODO: extend to support arbitrary return types. + if (fn.return_type_inst_id.has_value()) { + context.TODO(loc_id, "associated function must not have a return type"); + return false; + } + + if (fn.interface_modifier != interface_modifier) { + context.TODO( + loc_id, + interface_modifier == SemIR::Function::InterfaceModifier::None + ? std::string( + "associated function must not have an interface modifier") + : llvm::formatv("associated function must be `{}`", + interface_modifier)); + return false; + } + + return true; +} + +static auto ValidateCoreDestroy(Context& context, SemIR::LocId loc_id, + SemIR::InstBlockId associated_entities_id) + -> bool { + auto assoc_entities = context.inst_blocks().Get(associated_entities_id); + if (assoc_entities.size() != 3) { + context.TODO( + loc_id, + "interface `Core.Destroy` needs exactly 3 associated functions"); + return false; + } + + if (!ValidateCoreInterfaceAssociatedFunction(context, assoc_entities[0], 1, + CoreIdentifier::Op)) { + return false; + } + + if (!ValidateCoreInterfaceAssociatedFunction( + context, assoc_entities[1], 2, CoreIdentifier::SubobjectDestroy, + SemIR::Function::InterfaceModifier::Final)) { + return false; + } + + if (!ValidateCoreInterfaceAssociatedFunction( + context, assoc_entities[2], 3, CoreIdentifier::SelfDestruct, + SemIR::Function::InterfaceModifier::Final)) { + return false; + } + + return true; +} + static auto BuildInterfaceDecl(Context& context, Parse::AnyInterfaceDeclId node_id, bool is_definition) @@ -218,7 +304,7 @@ auto HandleParseNode(Context& context, return true; } -auto HandleParseNode(Context& context, Parse::InterfaceDefinitionId /*node_id*/) +auto HandleParseNode(Context& context, Parse::InterfaceDefinitionId node_id) -> bool { auto interface_id = context.node_stack().Pop(); @@ -251,6 +337,38 @@ auto HandleParseNode(Context& context, Parse::InterfaceDefinitionId /*node_id*/) // Finish the definition of interface-without-self. FinishGenericDefinition(context, interface_info.generic_id); + if (context.sem_ir().package_id() == PackageNameId::Core) { + switch (interface_info.core_interface) { + case SemIR::CoreInterface::Destroy: + return ValidateCoreDestroy(context, node_id, + interface_info.associated_entities_id); + case SemIR::CoreInterface::AddAssignWith: + case SemIR::CoreInterface::AddWith: + case SemIR::CoreInterface::Copy: + case SemIR::CoreInterface::CppRangeForIterate: + case SemIR::CoreInterface::CppUnsafeDeref: + case SemIR::CoreInterface::Dec: + case SemIR::CoreInterface::Default: + case SemIR::CoreInterface::FloatFitsIn: + case SemIR::CoreInterface::DivAssignWith: + case SemIR::CoreInterface::DivWith: + case SemIR::CoreInterface::EqWith: + case SemIR::CoreInterface::Inc: + case SemIR::CoreInterface::IntFitsIn: + case SemIR::CoreInterface::ModAssignWith: + case SemIR::CoreInterface::ModWith: + case SemIR::CoreInterface::MulAssignWith: + case SemIR::CoreInterface::MulWith: + case SemIR::CoreInterface::Negate: + case SemIR::CoreInterface::OrderedWith: + case SemIR::CoreInterface::SubAssignWith: + case SemIR::CoreInterface::SubWith: + case SemIR::CoreInterface::Unknown: + // TODO: validate other core interfaces + return true; + } + } + // The decl_name_stack and scopes are popped by `ProcessNodeIds`. return true; } diff --git a/toolchain/check/testdata/array/basics.carbon b/toolchain/check/testdata/array/basics.carbon index 584cf26bed7d..6731e9162587 100644 --- a/toolchain/check/testdata/array/basics.carbon +++ b/toolchain/check/testdata/array/basics.carbon @@ -178,6 +178,7 @@ var a: array(1, 1); // CHECK:STDOUT: %tuple.type.531: type = tuple_type (type, type, type) [concrete] // CHECK:STDOUT: %tuple: %tuple.type.531 = tuple_value (%C, %C, %C) [concrete] // CHECK:STDOUT: %tuple.type.a8c: type = tuple_type (%C, %C, %C) [concrete] +// CHECK:STDOUT: %pattern_type.730: type = pattern_type %tuple.type.a8c [concrete] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] @@ -189,8 +190,93 @@ var a: array(1, 1); // CHECK:STDOUT: %tuple.type.8c7: type = tuple_type (%tuple.type.a8c, %tuple.type.a8c) [concrete] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc10_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.98b: type = pattern_type %C [concrete] +// CHECK:STDOUT: %self.param_patt.99a: %pattern_type.98b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.cbd: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt.99a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc10_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.bed: %pattern_type.730 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.d67: %pattern_type.730 = wrapper_binding_pattern self, %self.param_patt.bed [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc10_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.e5f: %pattern_type.c3e = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.1ad: %pattern_type.c3e = wrapper_binding_pattern self, %self.param_patt.e5f [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_3.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc10_3.4 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10_3.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc10_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc10_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.730 = ref_param_pattern [concrete = constants.%self.param_patt.bed] +// CHECK:STDOUT: %self.patt: %pattern_type.730 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d67] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.a8c = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.a8c = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc10_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.730 = ref_param_pattern [concrete = constants.%self.param_patt.bed] +// CHECK:STDOUT: %self.patt: %pattern_type.730 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d67] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.a8c = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.a8c = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_3.4 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.c3e = ref_param_pattern [concrete = constants.%self.param_patt.e5f] +// CHECK:STDOUT: %self.patt: %pattern_type.c3e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.1ad] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc10_3.4 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.c3e = ref_param_pattern [concrete = constants.%self.param_patt.e5f] +// CHECK:STDOUT: %self.patt: %pattern_type.c3e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.1ad] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @G() { @@ -226,25 +312,61 @@ var a: array(1, 1); // CHECK:STDOUT: %v.patt: %pattern_type.c3e = ref_binding_pattern v [concrete = constants.%v.patt] // CHECK:STDOUT: %v.var_patt: %pattern_type.c3e = var_pattern %v.patt [concrete = constants.%v.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %v.var, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%v.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %v.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%v.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_3.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_3.2(%self.param: ref %C) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_3.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_3.2(%self.param: ref %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_3.3(%self.param: ref %tuple.type.a8c) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_3.2(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_3.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_3.3(%self.param: ref %tuple.type.a8c) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_3.4(%self.param: ref %array_type) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_3.3(%self.param: ref %tuple.type.a8c) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_3.3(%self.param: ref %tuple.type.a8c) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_3.4(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_3.4(%self.param: ref %array_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_3.4(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -272,10 +394,29 @@ var a: array(1, 1); // CHECK:STDOUT: %b.var_patt: %pattern_type.8c1 = var_pattern %b.patt [concrete] // CHECK:STDOUT: %DefaultOrUnformed.impl_witness.b33: = impl_witness imports.%DefaultOrUnformed.impl_witness_table.856, @T.as.DefaultOrUnformed.impl(%tuple.type) [concrete] // CHECK:STDOUT: %DefaultOrUnformed.facet.f59: %DefaultOrUnformed.type = facet_value %tuple.type, (%DefaultOrUnformed.impl_witness.b33) [concrete] +// CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete] +// CHECK:STDOUT: %self.param_patt.65a: %pattern_type.cb1 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.df1: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt.65a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc8_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.327: %pattern_type.8c1 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.570: %pattern_type.8c1 = wrapper_binding_pattern self, %self.param_patt.327 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc8_3.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.279: %pattern_type.035 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.06d: %pattern_type.035 = wrapper_binding_pattern self, %self.param_patt.279 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc7 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc7 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc7 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -283,6 +424,51 @@ var a: array(1, 1); // CHECK:STDOUT: %DefaultOrUnformed.impl_witness_table.856 = impl_witness_table (%Core.import_ref.cc8), @T.as.DefaultOrUnformed.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc8_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.8c1 = ref_param_pattern [concrete = constants.%self.param_patt.327] +// CHECK:STDOUT: %self.patt: %pattern_type.8c1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.570] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc8_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.8c1 = ref_param_pattern [concrete = constants.%self.param_patt.327] +// CHECK:STDOUT: %self.patt: %pattern_type.8c1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.570] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc7 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.035 = ref_param_pattern [concrete = constants.%self.param_patt.279] +// CHECK:STDOUT: %self.patt: %pattern_type.035 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.06d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc7 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.035 = ref_param_pattern [concrete = constants.%self.param_patt.279] +// CHECK:STDOUT: %self.patt: %pattern_type.035 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.06d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @G() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.var: ref %array_type = var_storage %a.var_patt @@ -329,22 +515,49 @@ var a: array(1, 1); // CHECK:STDOUT: %b.patt: %pattern_type.8c1 = ref_binding_pattern b [concrete = constants.%b.patt] // CHECK:STDOUT: %b.var_patt: %pattern_type.8c1 = var_pattern %b.patt [concrete = constants.%b.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc8: = bound_method %b.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc8(%b.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc7: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc7: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc7(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: = bound_method %b.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%b.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc7: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc7: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc7(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.1(%self.param: ref %empty_tuple.type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.1(%self.param: ref %empty_tuple.type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.2(%self.param: ref %tuple.type) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.1(%self.param: ref %empty_tuple.type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.2(%self.param: ref %tuple.type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7(%self.param: ref %array_type) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.2(%self.param: ref %tuple.type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.2(%self.param: ref %tuple.type) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc7(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7(%self.param: ref %array_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc7(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -355,6 +568,7 @@ var a: array(1, 1); // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] // CHECK:STDOUT: %tuple.type: type = tuple_type (%empty_tuple.type) [concrete] +// CHECK:STDOUT: %pattern_type.559: type = pattern_type %tuple.type [concrete] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete] @@ -364,10 +578,74 @@ var a: array(1, 1); // CHECK:STDOUT: %t.var_patt: %pattern_type.fe8 = var_pattern %t.patt [concrete] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete] // CHECK:STDOUT: %array: %array_type = tuple_value (%empty_tuple) [concrete] +// CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete] +// CHECK:STDOUT: %self.param_patt.65a: %pattern_type.cb1 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.df1: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt.65a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_34.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc8_34.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.383: %pattern_type.559 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.363: %pattern_type.559 = wrapper_binding_pattern self, %self.param_patt.383 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_34.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc8_34.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8_34.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.f73: %pattern_type.fe8 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.741: %pattern_type.fe8 = wrapper_binding_pattern self, %self.param_patt.f73 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc8_3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8_3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_34.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc8_34.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_34.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.559 = ref_param_pattern [concrete = constants.%self.param_patt.383] +// CHECK:STDOUT: %self.patt: %pattern_type.559 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.363] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc8_34.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.559 = ref_param_pattern [concrete = constants.%self.param_patt.383] +// CHECK:STDOUT: %self.patt: %pattern_type.559 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.363] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.fe8 = ref_param_pattern [concrete = constants.%self.param_patt.f73] +// CHECK:STDOUT: %self.patt: %pattern_type.fe8 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.741] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc8_3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.fe8 = ref_param_pattern [concrete = constants.%self.param_patt.f73] +// CHECK:STDOUT: %self.patt: %pattern_type.fe8 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.741] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { @@ -397,22 +675,49 @@ var a: array(1, 1); // CHECK:STDOUT: %t.patt: %pattern_type.fe8 = ref_binding_pattern t [concrete = constants.%t.patt] // CHECK:STDOUT: %t.var_patt: %pattern_type.fe8 = var_pattern %t.patt [concrete = constants.%t.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc8_34: = bound_method %.loc8_34.2, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc8_34: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc8_34(%.loc8_34.2) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc8_3: = bound_method %t.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc8_3: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc8_3(%t.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8_34: = bound_method %.loc8_34.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8_34: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8_34(%.loc8_34.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8_3: = bound_method %t.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8_3: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8_3(%t.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_34.1(%self.param: ref %empty_tuple.type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_34.1(%self.param: ref %empty_tuple.type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_34.2(%self.param: ref %tuple.type) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_34.1(%self.param: ref %empty_tuple.type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_34.2(%self.param: ref %tuple.type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3(%self.param: ref %array_type) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_34.2(%self.param: ref %tuple.type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_34.2(%self.param: ref %tuple.type) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3(%self.param: ref %array_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/array/import.carbon b/toolchain/check/testdata/array/import.carbon index 9ec877d5d752..b0dcaa298bf5 100644 --- a/toolchain/check/testdata/array/import.carbon +++ b/toolchain/check/testdata/array/import.carbon @@ -58,11 +58,13 @@ fn F() -> i32 { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] +// CHECK:STDOUT: %pattern_type.6b6: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] // CHECK:STDOUT: %int_42: Core.IntLiteral = int_value 42 [concrete] // CHECK:STDOUT: %array_type: type = array_type %int_42, %i32 [concrete] +// CHECK:STDOUT: %pattern_type.c07: type = pattern_type %array_type [concrete] // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.type.ac8: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] // CHECK:STDOUT: %Int.as.Copy.impl.Op.5e0: %Int.as.Copy.impl.Op.type.ac8 = struct_value () [symbolic] @@ -73,8 +75,27 @@ fn F() -> i32 { // CHECK:STDOUT: %Copy.WithSelf.Op.type.381: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet) [concrete] // CHECK:STDOUT: %.737: type = fn_type_with_self_type %Copy.WithSelf.Op.type.381, %Copy.facet [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.4f6, @Int.as.Copy.impl.Op(%int_32) [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc6_12.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc6_12.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc6_12.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc6_12.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.087: %pattern_type.c07 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.b22: %pattern_type.c07 = wrapper_binding_pattern self, %self.param_patt.087 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc6_12.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc6_12.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc6_12.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -83,6 +104,51 @@ fn F() -> i32 { // CHECK:STDOUT: %Copy.impl_witness_table.8d2 = impl_witness_table (%Core.import_ref.cd6), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc6_12.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc6_12.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc6_12.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc6_12.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc6_12.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.c07 = ref_param_pattern [concrete = constants.%self.param_patt.087] +// CHECK:STDOUT: %self.patt: %pattern_type.c07 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.b22] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc6_12.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.c07 = ref_param_pattern [concrete = constants.%self.param_patt.087] +// CHECK:STDOUT: %self.patt: %pattern_type.c07 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.b22] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @G(%n.param: %i32) -> out %return.param: %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%Main.F [concrete = constants.%F] @@ -97,20 +163,47 @@ fn F() -> i32 { // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] // CHECK:STDOUT: %bound_method.loc6_15.2: = bound_method %.loc6_15.2, %specific_fn // CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc6_15.2(%.loc6_15.2) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.loc6_12.2, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%.loc6_12.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc6_12.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc6_12.2) // CHECK:STDOUT: return %Int.as.Copy.impl.Op.call // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc6_12.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc6_12.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc6_12.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc6_12.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc6_12.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc6_12.3(%self.param: ref %array_type) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc6_12.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc6_12.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc6_12.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc6_12.3(%self.param: ref %array_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc6_12.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/array/index_not_literal.carbon b/toolchain/check/testdata/array/index_not_literal.carbon index 390330b00784..f9846a2056f0 100644 --- a/toolchain/check/testdata/array/index_not_literal.carbon +++ b/toolchain/check/testdata/array/index_not_literal.carbon @@ -56,6 +56,8 @@ fn F(a: array({}, 3)) -> {} { // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete] // CHECK:STDOUT: %array_type: type = array_type %int_3.1ba, %i32 [concrete] +// CHECK:STDOUT: %pattern_type.771: type = pattern_type %array_type [concrete] +// CHECK:STDOUT: %pattern_type.6b6: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] @@ -96,9 +98,28 @@ fn F(a: array({}, 3)) -> {} { // CHECK:STDOUT: %int_3.410: %i32 = int_value 3 [concrete] // CHECK:STDOUT: %array: %array_type = tuple_value (%int_1.0c6, %int_2.295, %int_3.410) [concrete] // CHECK:STDOUT: %.981: ref %array_type = temporary invalid, %array [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_20.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc10_20.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_20.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc10_20.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.c42: %pattern_type.771 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.3bc: %pattern_type.771 = wrapper_binding_pattern self, %self.param_patt.c42 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_20.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc10_20.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.981, %Destroy.WithSelf.Op.403171.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10_20.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.981, %Destroy.WithSelf.SelfDestruct.db3fdb.3 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -108,6 +129,51 @@ fn F(a: array({}, 3)) -> {} { // CHECK:STDOUT: %ImplicitAs.impl_witness_table.1aa = impl_witness_table (%Core.import_ref.edf), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_20.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc10_20.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_20.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc10_20.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_20.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.771 = ref_param_pattern [concrete = constants.%self.param_patt.c42] +// CHECK:STDOUT: %self.patt: %pattern_type.771 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.3bc] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc10_20.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.771 = ref_param_pattern [concrete = constants.%self.param_patt.c42] +// CHECK:STDOUT: %self.patt: %pattern_type.771 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.3bc] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F(%arr.param: %array_type, %i.param: %i32) -> out %return.param: %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %arr.ref: %array_type = name_ref arr, %arr @@ -171,19 +237,46 @@ fn F(a: array({}, 3)) -> {} { // CHECK:STDOUT: %.loc10_23.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc10_23 [concrete = constants.%int_1.0c6] // CHECK:STDOUT: %.loc10_23.2: %i32 = converted %int_1.loc10_23, %.loc10_23.1 [concrete = constants.%int_1.0c6] // CHECK:STDOUT: %F.call: init %i32 = call %F.ref(%.loc10_20.15, %.loc10_23.2) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.981) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.981) // CHECK:STDOUT: return %F.call // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_20.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_20.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_20.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_20.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_20.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_20.3(%self.param: ref %array_type) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_20.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_20.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_20.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_20.3(%self.param: ref %array_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_20.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/array/init_dependent_bound.carbon b/toolchain/check/testdata/array/init_dependent_bound.carbon index 6e0cfaf233e7..27de2f66cae9 100644 --- a/toolchain/check/testdata/array/init_dependent_bound.carbon +++ b/toolchain/check/testdata/array/init_dependent_bound.carbon @@ -66,19 +66,19 @@ fn H() { G(3); } // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete] // CHECK:STDOUT: %array_type.1b3: type = array_type %int_0, %T [symbolic] -// CHECK:STDOUT: %require_complete: = require_complete_type %array_type.1b3 [symbolic] +// CHECK:STDOUT: %require_complete.cc5: = require_complete_type %array_type.1b3 [symbolic] // CHECK:STDOUT: %pattern_type.bd6: type = pattern_type %array_type.1b3 [symbolic] // CHECK:STDOUT: %arr.patt.770: %pattern_type.bd6 = ref_binding_pattern arr [symbolic] // CHECK:STDOUT: %arr.var_patt.5fc: %pattern_type.bd6 = var_pattern %arr.patt.770 [symbolic] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] // CHECK:STDOUT: %array.ca4: %array_type.1b3 = tuple_value () [symbolic] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %array_type.1b3, @Destroy [symbolic] -// CHECK:STDOUT: %Destroy.facet.a52: %Destroy.type = facet_value %array_type.1b3, (%Destroy.lookup_impl_witness) [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.a67: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Destroy.facet.a52) [symbolic] -// CHECK:STDOUT: %.1e5: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.a67, %Destroy.facet.a52 [symbolic] -// CHECK:STDOUT: %impl.elem0: %.1e5 = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn: = specific_impl_function %impl.elem0, @Destroy.WithSelf.Op.1(%Destroy.facet.a52) [symbolic] +// CHECK:STDOUT: %Destroy.lookup_impl_witness.ac5: = lookup_impl_witness %array_type.1b3, @Destroy [symbolic] +// CHECK:STDOUT: %Destroy.facet.a52: %Destroy.type = facet_value %array_type.1b3, (%Destroy.lookup_impl_witness.ac5) [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.e30: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.a52) [symbolic] +// CHECK:STDOUT: %.c54: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.e30, %Destroy.facet.a52 [symbolic] +// CHECK:STDOUT: %impl.elem2: %.c54 = impl_witness_access %Destroy.lookup_impl_witness.ac5, element2 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.0cb: = specific_impl_function %impl.elem2, @Destroy.WithSelf.SelfDestruct.1(%Destroy.facet.a52) [symbolic] // CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %array_type.988: type = array_type %int_0, %C [concrete] // CHECK:STDOUT: %complete_type.e80: = complete_type_witness %array_type.988 [concrete] @@ -86,12 +86,35 @@ fn H() { G(3); } // CHECK:STDOUT: %arr.patt.c91: %pattern_type.6be = ref_binding_pattern arr [concrete] // CHECK:STDOUT: %arr.var_patt.9dd: %pattern_type.6be = var_pattern %arr.patt.c91 [concrete] // CHECK:STDOUT: %array.497: %array_type.988 = tuple_value () [concrete] +// CHECK:STDOUT: %self.param_patt.5c1: %pattern_type.6be = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.1a6: %pattern_type.6be = wrapper_binding_pattern self, %self.param_patt.5c1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfc: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc7 [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.loc7 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.6c4: = custom_witness (%Destroy.WithSelf.Op.403), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.a8f: %Destroy.type = facet_value %array_type.988, (%custom_witness.6c4) [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.3eb: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Destroy.facet.a8f) [concrete] -// CHECK:STDOUT: %.2c2: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.3eb, %Destroy.facet.a8f [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc7 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f8f: = custom_witness (%Destroy.WithSelf.Op.403, %Destroy.WithSelf.SubobjectDestroy.d01, %Destroy.WithSelf.SelfDestruct.db3), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.23c: %Destroy.type = facet_value %array_type.988, (%custom_witness.f8f) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.180: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.23c) [concrete] +// CHECK:STDOUT: %.a26: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.180, %Destroy.facet.23c [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl: %Destroy.WithSelf.SubobjectDestroy.type.dfc = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc7 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6be = ref_param_pattern [concrete = constants.%self.param_patt.5c1] +// CHECK:STDOUT: %self.patt: %pattern_type.6be = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.1a6] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type.988 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type.988 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc7 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6be = ref_param_pattern [concrete = constants.%self.param_patt.5c1] +// CHECK:STDOUT: %self.patt: %pattern_type.6be = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.1a6] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type.988 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type.988 = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generic fn @G(%T.loc4_15.2: type) { @@ -99,17 +122,17 @@ fn H() { G(3); } // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %array_type.loc7_29.2: type = array_type constants.%int_0, %T.loc4_15.1 [symbolic = %array_type.loc7_29.2 (constants.%array_type.1b3)] -// CHECK:STDOUT: %require_complete: = require_complete_type %array_type.loc7_29.2 [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type %array_type.loc7_29.2 [symbolic = %require_complete (constants.%require_complete.cc5)] // CHECK:STDOUT: %pattern_type: type = pattern_type %array_type.loc7_29.2 [symbolic = %pattern_type (constants.%pattern_type.bd6)] // CHECK:STDOUT: %arr.patt.loc7_17.2: @G.%pattern_type (%pattern_type.bd6) = ref_binding_pattern arr [symbolic = %arr.patt.loc7_17.2 (constants.%arr.patt.770)] // CHECK:STDOUT: %arr.var_patt.loc7_3.2: @G.%pattern_type (%pattern_type.bd6) = var_pattern %arr.patt.loc7_17.2 [symbolic = %arr.var_patt.loc7_3.2 (constants.%arr.var_patt.5fc)] // CHECK:STDOUT: %array: @G.%array_type.loc7_29.2 (%array_type.1b3) = tuple_value () [symbolic = %array (constants.%array.ca4)] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %array_type.loc7_29.2, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)] +// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %array_type.loc7_29.2, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.ac5)] // CHECK:STDOUT: %Destroy.facet.loc7_3.3: %Destroy.type = facet_value %array_type.loc7_29.2, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.loc7_3.3 (constants.%Destroy.facet.a52)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Destroy.facet.loc7_3.3) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.a67)] -// CHECK:STDOUT: %.loc7_3.4: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet.loc7_3.3 [symbolic = %.loc7_3.4 (constants.%.1e5)] -// CHECK:STDOUT: %impl.elem0.loc7_3.2: @G.%.loc7_3.4 (%.1e5) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc7_3.2 (constants.%impl.elem0)] -// CHECK:STDOUT: %specific_impl_fn.loc7_3.2: = specific_impl_function %impl.elem0.loc7_3.2, @Destroy.WithSelf.Op.1(%Destroy.facet.loc7_3.3) [symbolic = %specific_impl_fn.loc7_3.2 (constants.%specific_impl_fn)] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.loc7_3.3) [symbolic = %Destroy.WithSelf.SelfDestruct.type (constants.%Destroy.WithSelf.SelfDestruct.type.e30)] +// CHECK:STDOUT: %.loc7_3.4: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type, %Destroy.facet.loc7_3.3 [symbolic = %.loc7_3.4 (constants.%.c54)] +// CHECK:STDOUT: %impl.elem2.loc7_3.2: @G.%.loc7_3.4 (%.c54) = impl_witness_access %Destroy.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc7_3.2 (constants.%impl.elem2)] +// CHECK:STDOUT: %specific_impl_fn.loc7_3.2: = specific_impl_function %impl.elem2.loc7_3.2, @Destroy.WithSelf.SelfDestruct.1(%Destroy.facet.loc7_3.3) [symbolic = %specific_impl_fn.loc7_3.2 (constants.%specific_impl_fn.0cb)] // CHECK:STDOUT: // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: @@ -128,21 +151,30 @@ fn H() { G(3); } // CHECK:STDOUT: %arr.patt.loc7_17.1: @G.%pattern_type (%pattern_type.bd6) = ref_binding_pattern arr [symbolic = %arr.patt.loc7_17.2 (constants.%arr.patt.770)] // CHECK:STDOUT: %arr.var_patt.loc7_3.1: @G.%pattern_type (%pattern_type.bd6) = var_pattern %arr.patt.loc7_17.1 [symbolic = %arr.var_patt.loc7_3.2 (constants.%arr.var_patt.5fc)] // CHECK:STDOUT: } -// CHECK:STDOUT: %impl.elem0.loc7_3.1: @G.%.loc7_3.4 (%.1e5) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc7_3.2 (constants.%impl.elem0)] -// CHECK:STDOUT: %bound_method.loc7_3.1: = bound_method %arr.var, %impl.elem0.loc7_3.1 -// CHECK:STDOUT: %Destroy.facet.loc7_3.1: %Destroy.type = facet_value constants.%array_type.1b3, (constants.%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.loc7_3.3 (constants.%Destroy.facet.a52)] +// CHECK:STDOUT: %impl.elem2.loc7_3.1: @G.%.loc7_3.4 (%.c54) = impl_witness_access constants.%Destroy.lookup_impl_witness.ac5, element2 [symbolic = %impl.elem2.loc7_3.2 (constants.%impl.elem2)] +// CHECK:STDOUT: %bound_method.loc7_3.1: = bound_method %arr.var, %impl.elem2.loc7_3.1 +// CHECK:STDOUT: %Destroy.facet.loc7_3.1: %Destroy.type = facet_value constants.%array_type.1b3, (constants.%Destroy.lookup_impl_witness.ac5) [symbolic = %Destroy.facet.loc7_3.3 (constants.%Destroy.facet.a52)] // CHECK:STDOUT: %.loc7_3.2: %Destroy.type = converted constants.%array_type.1b3, %Destroy.facet.loc7_3.1 [symbolic = %Destroy.facet.loc7_3.3 (constants.%Destroy.facet.a52)] -// CHECK:STDOUT: %Destroy.facet.loc7_3.2: %Destroy.type = facet_value constants.%array_type.1b3, (constants.%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.loc7_3.3 (constants.%Destroy.facet.a52)] +// CHECK:STDOUT: %Destroy.facet.loc7_3.2: %Destroy.type = facet_value constants.%array_type.1b3, (constants.%Destroy.lookup_impl_witness.ac5) [symbolic = %Destroy.facet.loc7_3.3 (constants.%Destroy.facet.a52)] // CHECK:STDOUT: %.loc7_3.3: %Destroy.type = converted constants.%array_type.1b3, %Destroy.facet.loc7_3.2 [symbolic = %Destroy.facet.loc7_3.3 (constants.%Destroy.facet.a52)] -// CHECK:STDOUT: %specific_impl_fn.loc7_3.1: = specific_impl_function %impl.elem0.loc7_3.1, @Destroy.WithSelf.Op.1(constants.%Destroy.facet.a52) [symbolic = %specific_impl_fn.loc7_3.2 (constants.%specific_impl_fn)] +// CHECK:STDOUT: %specific_impl_fn.loc7_3.1: = specific_impl_function %impl.elem2.loc7_3.1, @Destroy.WithSelf.SelfDestruct.1(constants.%Destroy.facet.a52) [symbolic = %specific_impl_fn.loc7_3.2 (constants.%specific_impl_fn.0cb)] // CHECK:STDOUT: %bound_method.loc7_3.2: = bound_method %arr.var, %specific_impl_fn.loc7_3.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc7_3.2(%arr.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %bound_method.loc7_3.2(%arr.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc7(%self.param: ref %array_type.988) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7(%self.param: ref %array_type.988) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc7(%self.param: ref %array_type.988) { +// 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) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: specific @G(constants.%T) { // CHECK:STDOUT: %T.patt.loc4_15.2 => constants.%T.patt // CHECK:STDOUT: %T.loc4_15.1 => constants.%T @@ -159,12 +191,12 @@ fn H() { G(3); } // CHECK:STDOUT: %arr.patt.loc7_17.2 => constants.%arr.patt.c91 // CHECK:STDOUT: %arr.var_patt.loc7_3.2 => constants.%arr.var_patt.9dd // CHECK:STDOUT: %array => constants.%array.497 -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.6c4 -// CHECK:STDOUT: %Destroy.facet.loc7_3.3 => constants.%Destroy.facet.a8f -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.3eb -// CHECK:STDOUT: %.loc7_3.4 => constants.%.2c2 -// CHECK:STDOUT: %impl.elem0.loc7_3.2 => constants.%Destroy.WithSelf.Op.403 -// CHECK:STDOUT: %specific_impl_fn.loc7_3.2 => constants.%Destroy.WithSelf.Op.403 +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.f8f +// CHECK:STDOUT: %Destroy.facet.loc7_3.3 => constants.%Destroy.facet.23c +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.180 +// CHECK:STDOUT: %.loc7_3.4 => constants.%.a26 +// CHECK:STDOUT: %impl.elem2.loc7_3.2 => constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %specific_impl_fn.loc7_3.2 => constants.%Destroy.WithSelf.SelfDestruct.db3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_init_template_dependent_bound.carbon @@ -191,14 +223,14 @@ fn H() { G(3); } // CHECK:STDOUT: %tuple: %tuple.type = tuple_value (%int_1, %int_2, %int_3.1ba) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %Self.0e7: %Destroy.type = symbolic_binding Self, 0 [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.d3e: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Self.0e7) [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.42b: %Destroy.WithSelf.Op.type.d3e = struct_value () [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.4e5: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Self.0e7) [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.4a0: %Destroy.WithSelf.SelfDestruct.type.4e5 = struct_value () [symbolic] // CHECK:STDOUT: %Destroy.assoc_type: type = assoc_entity_type @Destroy [concrete] -// CHECK:STDOUT: %assoc0.ae8: %Destroy.assoc_type = assoc_entity element0, imports.%Core.import_ref.918 [concrete] -// CHECK:STDOUT: %.0be: type = type_of_inst @G.%.loc11_3.5 [template] -// CHECK:STDOUT: %.db2: %.0be = splice_inst @G.%.loc11_3.5 [template] -// CHECK:STDOUT: %.76e: type = type_of_inst @G.%.loc11_3.8 [template] -// CHECK:STDOUT: %.772: %.76e = splice_inst @G.%.loc11_3.8 [template] +// CHECK:STDOUT: %assoc2: %Destroy.assoc_type = assoc_entity element2, imports.%Core.import_ref.71d [concrete] +// CHECK:STDOUT: %.19c: type = type_of_inst @G.%.loc11_3.5 [template] +// CHECK:STDOUT: %.11f: %.19c = splice_inst @G.%.loc11_3.5 [template] +// CHECK:STDOUT: %.e86: type = type_of_inst @G.%.loc11_3.8 [template] +// CHECK:STDOUT: %.9d4: %.e86 = splice_inst @G.%.loc11_3.8 [template] // CHECK:STDOUT: %From: Core.IntLiteral = symbolic_binding From, 0 [symbolic] // CHECK:STDOUT: %ImplicitAs.type.7cb: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [concrete] // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.type.48d: type = fn_type @Int.as.ImplicitAs.impl.Convert, @Int.as.ImplicitAs.impl(%From) [symbolic] @@ -228,30 +260,94 @@ fn H() { G(3); } // CHECK:STDOUT: %pattern_type.771: type = pattern_type %array_type.dc7 [concrete] // CHECK:STDOUT: %arr.patt.316: %pattern_type.771 = ref_binding_pattern arr [concrete] // CHECK:STDOUT: %arr.var_patt.c63: %pattern_type.771 = var_pattern %arr.patt.316 [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc11_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc11_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.c42: %pattern_type.771 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.3bc: %pattern_type.771 = wrapper_binding_pattern self, %self.param_patt.c42 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc11_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.6c4ec3.3: = custom_witness (%Destroy.WithSelf.Op.403171.3), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.87b: %Destroy.type = facet_value %array_type.dc7, (%custom_witness.6c4ec3.3) [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.d31: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Destroy.facet.87b) [concrete] -// CHECK:STDOUT: %.6e0: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.d31, %Destroy.facet.87b [concrete] -// CHECK:STDOUT: %inst.splice_block.c0d: = inst_value [concrete] { -// CHECK:STDOUT: %.729: = splice_block %bound_method.7de { +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc11_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f8f19d.3: = custom_witness (%Destroy.WithSelf.Op.403171.3, %Destroy.WithSelf.SubobjectDestroy.d01daf.3, %Destroy.WithSelf.SelfDestruct.db3fdb.3), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.149: %Destroy.type = facet_value %array_type.dc7, (%custom_witness.f8f19d.3) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.95e: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.149) [concrete] +// CHECK:STDOUT: %.7f7: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.95e, %Destroy.facet.149 [concrete] +// CHECK:STDOUT: %inst.splice_block.11c: = inst_value [concrete] { +// CHECK:STDOUT: %.214: = splice_block %bound_method.e27 { // CHECK:STDOUT: %.875: ref %array_type.dc7 = specific_inst @G.%arr.var, @G(%int_3.410) -// CHECK:STDOUT: %impl.elem0.6b3: %.6e0 = impl_witness_access %custom_witness.6c4ec3.3, element0 [concrete = %Destroy.WithSelf.Op.403171.3] -// CHECK:STDOUT: %bound_method.7de: = bound_method %.875, %impl.elem0.6b3 +// CHECK:STDOUT: %impl.elem2: %.7f7 = impl_witness_access %custom_witness.f8f19d.3, element2 [concrete = %Destroy.WithSelf.SelfDestruct.db3fdb.3] +// CHECK:STDOUT: %bound_method.e27: = bound_method %.875, %impl.elem2 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: %inst.call: = inst_value [concrete] { -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %.729(%.875) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %.214(%.875) // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core.import_ref.918: @Destroy.WithSelf.%Destroy.WithSelf.Op.type (%Destroy.WithSelf.Op.type.d3e) = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [symbolic = @Destroy.WithSelf.%Destroy.WithSelf.Op (constants.%Destroy.WithSelf.Op.42b)] +// CHECK:STDOUT: %Core.import_ref.71d: @Destroy.WithSelf.%Destroy.WithSelf.SelfDestruct.type (%Destroy.WithSelf.SelfDestruct.type.4e5) = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [symbolic = @Destroy.WithSelf.%Destroy.WithSelf.SelfDestruct (constants.%Destroy.WithSelf.SelfDestruct.4a0)] // CHECK:STDOUT: %Core.import_ref.32e: @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert.type (%Int.as.ImplicitAs.impl.Convert.type.48d) = 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.0f9)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.204 = impl_witness_table (%Core.import_ref.32e), @Int.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc11_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc11_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.771 = ref_param_pattern [concrete = constants.%self.param_patt.c42] +// CHECK:STDOUT: %self.patt: %pattern_type.771 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.3bc] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type.dc7 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type.dc7 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc11_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.771 = ref_param_pattern [concrete = constants.%self.param_patt.c42] +// CHECK:STDOUT: %self.patt: %pattern_type.771 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.3bc] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type.dc7 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type.dc7 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: generic fn @G(%N.loc5_16.2: %i32) { // CHECK:STDOUT: // CHECK:STDOUT: @@ -263,12 +359,12 @@ fn H() { G(3); } // CHECK:STDOUT: %pattern_type: type = pattern_type %array_type.loc11_31.2 [template = %pattern_type (constants.%pattern_type.ed3)] // CHECK:STDOUT: %arr.patt.loc11_17.2: @G.%pattern_type (%pattern_type.ed3) = ref_binding_pattern arr [template = %arr.patt.loc11_17.2 (constants.%arr.patt.515)] // CHECK:STDOUT: %arr.var_patt.loc11_3.2: @G.%pattern_type (%pattern_type.ed3) = var_pattern %arr.patt.loc11_17.2 [template = %arr.var_patt.loc11_3.2 (constants.%arr.var_patt.821)] -// CHECK:STDOUT: %.loc11_3.5: = compound_member_access_action %arr.var, constants.%assoc0.ae8 [template] -// CHECK:STDOUT: %.loc11_3.6: type = type_of_inst %.loc11_3.5 [template = %.loc11_3.6 (constants.%.0be)] -// CHECK:STDOUT: %.loc11_3.7: @G.%.loc11_3.6 (%.0be) = splice_inst %.loc11_3.5 [template = %.loc11_3.7 (constants.%.db2)] +// CHECK:STDOUT: %.loc11_3.5: = compound_member_access_action %arr.var, constants.%assoc2 [template] +// CHECK:STDOUT: %.loc11_3.6: type = type_of_inst %.loc11_3.5 [template = %.loc11_3.6 (constants.%.19c)] +// CHECK:STDOUT: %.loc11_3.7: @G.%.loc11_3.6 (%.19c) = splice_inst %.loc11_3.5 [template = %.loc11_3.7 (constants.%.11f)] // CHECK:STDOUT: %.loc11_3.8: = call_action (%.loc11_3.2), true [template] -// CHECK:STDOUT: %.loc11_3.9: type = type_of_inst %.loc11_3.8 [template = %.loc11_3.9 (constants.%.76e)] -// CHECK:STDOUT: %.loc11_3.10: @G.%.loc11_3.9 (%.76e) = splice_inst %.loc11_3.8 [template = %.loc11_3.10 (constants.%.772)] +// CHECK:STDOUT: %.loc11_3.9: type = type_of_inst %.loc11_3.8 [template = %.loc11_3.9 (constants.%.e86)] +// CHECK:STDOUT: %.loc11_3.10: @G.%.loc11_3.9 (%.e86) = splice_inst %.loc11_3.8 [template = %.loc11_3.10 (constants.%.9d4)] // CHECK:STDOUT: // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: @@ -289,23 +385,50 @@ fn H() { G(3); } // CHECK:STDOUT: %arr.patt.loc11_17.1: @G.%pattern_type (%pattern_type.ed3) = ref_binding_pattern arr [template = %arr.patt.loc11_17.2 (constants.%arr.patt.515)] // CHECK:STDOUT: %arr.var_patt.loc11_3.1: @G.%pattern_type (%pattern_type.ed3) = var_pattern %arr.patt.loc11_17.1 [template = %arr.var_patt.loc11_3.2 (constants.%arr.var_patt.821)] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc11_3.1: type = type_of_inst %.loc11_3.5 [template = %.loc11_3.6 (constants.%.0be)] -// CHECK:STDOUT: %.loc11_3.2: @G.%.loc11_3.6 (%.0be) = splice_inst %.loc11_3.5 [template = %.loc11_3.7 (constants.%.db2)] -// CHECK:STDOUT: %.loc11_3.3: type = type_of_inst %.loc11_3.8 [template = %.loc11_3.9 (constants.%.76e)] -// CHECK:STDOUT: %.loc11_3.4: @G.%.loc11_3.9 (%.76e) = splice_inst %.loc11_3.8 [template = %.loc11_3.10 (constants.%.772)] +// CHECK:STDOUT: %.loc11_3.1: type = type_of_inst %.loc11_3.5 [template = %.loc11_3.6 (constants.%.19c)] +// CHECK:STDOUT: %.loc11_3.2: @G.%.loc11_3.6 (%.19c) = splice_inst %.loc11_3.5 [template = %.loc11_3.7 (constants.%.11f)] +// CHECK:STDOUT: %.loc11_3.3: type = type_of_inst %.loc11_3.8 [template = %.loc11_3.9 (constants.%.e86)] +// CHECK:STDOUT: %.loc11_3.4: @G.%.loc11_3.9 (%.e86) = splice_inst %.loc11_3.8 [template = %.loc11_3.10 (constants.%.9d4)] // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_3.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_3.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_3.3(%self.param: ref %array_type.dc7) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_3.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_3.3(%self.param: ref %array_type.dc7) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_3.3(%self.param: ref %array_type.dc7) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_3.3(%self.param: ref %array_type.dc7) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -326,7 +449,7 @@ fn H() { G(3); } // CHECK:STDOUT: %pattern_type => constants.%pattern_type.771 // CHECK:STDOUT: %arr.patt.loc11_17.2 => constants.%arr.patt.316 // CHECK:STDOUT: %arr.var_patt.loc11_3.2 => constants.%arr.var_patt.c63 -// CHECK:STDOUT: %.loc11_3.5 => constants.%inst.splice_block.c0d +// CHECK:STDOUT: %.loc11_3.5 => constants.%inst.splice_block.11c // CHECK:STDOUT: %.loc11_3.6 => // CHECK:STDOUT: %.loc11_3.7 => invalid // CHECK:STDOUT: %.loc11_3.8 => constants.%inst.call diff --git a/toolchain/check/testdata/as/basics.carbon b/toolchain/check/testdata/as/basics.carbon index 1f5c8c1e5334..63f0a9a620bd 100644 --- a/toolchain/check/testdata/as/basics.carbon +++ b/toolchain/check/testdata/as/basics.carbon @@ -209,6 +209,7 @@ let n: {.x: ()} = {.x = ()} as {.x = ()}; // CHECK:STDOUT: type: type = facet_type [concrete] // CHECK:STDOUT: %X: type = class_type @X [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] +// CHECK:STDOUT: %pattern_type.6cb: type = pattern_type %X [concrete] // CHECK:STDOUT: %Make.type: type = fn_type @Make [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Make: %Make.type = struct_value () [concrete] @@ -217,12 +218,76 @@ let n: {.x: ()} = {.x = ()} as {.x = ()}; // CHECK:STDOUT: %tuple.type.359: type = tuple_type (%X, %X) [concrete] // CHECK:STDOUT: %pattern_type.3ee: type = pattern_type %tuple.type.359 [concrete] // CHECK:STDOUT: %a.patt: %pattern_type.3ee = value_binding_pattern a [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc13_40.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc13_40.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.925: %pattern_type.6cb = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.617: %pattern_type.6cb = wrapper_binding_pattern self, %self.param_patt.925 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc13_40.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc13_40.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc13_40.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: %b.patt: %pattern_type.3ee = ref_binding_pattern b [concrete] // CHECK:STDOUT: %b.var_patt: %pattern_type.3ee = var_pattern %b.patt [concrete] +// CHECK:STDOUT: %self.param_patt.bc5: %pattern_type.3ee = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.15e: %pattern_type.3ee = wrapper_binding_pattern self, %self.param_patt.bc5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc20 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc20 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc20 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc13_40.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc13_40.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc13_40.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6cb = ref_param_pattern [concrete = constants.%self.param_patt.925] +// CHECK:STDOUT: %self.patt: %pattern_type.6cb = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.617] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %X = ref_param call_param0 +// CHECK:STDOUT: %self: ref %X = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc13_40.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6cb = ref_param_pattern [concrete = constants.%self.param_patt.925] +// CHECK:STDOUT: %self.patt: %pattern_type.6cb = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.617] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %X = ref_param call_param0 +// CHECK:STDOUT: %self: ref %X = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc20 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.3ee = ref_param_pattern [concrete = constants.%self.param_patt.bc5] +// CHECK:STDOUT: %self.patt: %pattern_type.3ee = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.15e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.359 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.359 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc20 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.3ee = ref_param_pattern [concrete = constants.%self.param_patt.bc5] +// CHECK:STDOUT: %self.patt: %pattern_type.3ee = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.15e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.359 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.359 = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Let() { @@ -254,17 +319,35 @@ let n: {.x: ()} = {.x = ()} as {.x = ()}; // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %a.patt: %pattern_type.3ee = value_binding_pattern a [concrete = constants.%a.patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc13_40: = bound_method %.loc13_40.2, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc13_40: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc13_40(%.loc13_40.2) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc13_32: = bound_method %.loc13_32.2, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc13_32: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc13_32(%.loc13_32.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc13_40: = bound_method %.loc13_40.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc13_40: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc13_40(%.loc13_40.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc13_32: = bound_method %.loc13_32.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc13_32: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc13_32(%.loc13_32.2) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc13_40.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc13_40.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc13_40.2(%self.param: ref %X) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc13_40.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc13_40.2(%self.param: ref %X) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc13_40.2(%self.param: ref %X) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc13_40.2(%self.param: ref %X) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -296,16 +379,25 @@ let n: {.x: ()} = {.x = ()} as {.x = ()}; // CHECK:STDOUT: %b.patt: %pattern_type.3ee = ref_binding_pattern b [concrete = constants.%b.patt] // CHECK:STDOUT: %b.var_patt: %pattern_type.3ee = var_pattern %b.patt [concrete = constants.%b.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %b.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%b.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %b.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%b.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc20(%self.param: ref %tuple.type.359) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc20(%self.param: ref %tuple.type.359) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc20(%self.param: ref %tuple.type.359) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc20(%self.param: ref %tuple.type.359) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- identity.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -322,8 +414,52 @@ let n: {.x: ()} = {.x = ()} as {.x = ()}; // CHECK:STDOUT: %Make: %Make.type = struct_value () [concrete] // CHECK:STDOUT: %x.patt: %pattern_type.6cb = ref_binding_pattern x [concrete] // CHECK:STDOUT: %x.var_patt: %pattern_type.6cb = var_pattern %x.patt [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc24_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc24_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.925: %pattern_type.6cb = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.617: %pattern_type.6cb = wrapper_binding_pattern self, %self.param_patt.925 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc24_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc24_3.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc24_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc24_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc24_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc24_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6cb = ref_param_pattern [concrete = constants.%self.param_patt.925] +// CHECK:STDOUT: %self.patt: %pattern_type.6cb = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.617] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %X = ref_param call_param0 +// CHECK:STDOUT: %self: ref %X = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc24_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6cb = ref_param_pattern [concrete = constants.%self.param_patt.925] +// CHECK:STDOUT: %self.patt: %pattern_type.6cb = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.617] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %X = ref_param call_param0 +// CHECK:STDOUT: %self: ref %X = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Value(%n.param: %X) { @@ -369,15 +505,33 @@ let n: {.x: ()} = {.x = ()} as {.x = ()}; // CHECK:STDOUT: %x.patt: %pattern_type.6cb = ref_binding_pattern x [concrete = constants.%x.patt] // CHECK:STDOUT: %x.var_patt: %pattern_type.6cb = var_pattern %x.patt [concrete = constants.%x.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %x.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%x.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %x.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%x.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc24_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_3.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_3.2(%self.param: ref %X) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc24_3.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc24_3.2(%self.param: ref %X) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_3.2(%self.param: ref %X) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc24_3.2(%self.param: ref %X) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/as/const.carbon b/toolchain/check/testdata/as/const.carbon index 8111772287ae..60b8906b0e2a 100644 --- a/toolchain/check/testdata/as/const.carbon +++ b/toolchain/check/testdata/as/const.carbon @@ -98,6 +98,7 @@ fn Use() { // CHECK:STDOUT: type: type = facet_type [concrete] // CHECK:STDOUT: %X: type = class_type @X [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] +// CHECK:STDOUT: %pattern_type.6cb: type = pattern_type %X [concrete] // CHECK:STDOUT: %Init.type: type = fn_type @Init [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Init: %Init.type = struct_value () [concrete] @@ -113,8 +114,72 @@ fn Use() { // CHECK:STDOUT: %reference.var: ref %const = var_storage file.%reference.var_patt [concrete] // CHECK:STDOUT: %addr.daa: %ptr.faf = addr_of %reference.var [concrete] // CHECK:STDOUT: %b.patt: %pattern_type.7f7 = value_binding_pattern b [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc14_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc14_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.925: %pattern_type.6cb = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.617: %pattern_type.6cb = wrapper_binding_pattern self, %self.param_patt.925 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc14_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc14_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.b9b: %pattern_type.dfd = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.a99: %pattern_type.dfd = wrapper_binding_pattern self, %self.param_patt.b9b [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc14_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc14_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc14_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc14_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc14_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc14_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6cb = ref_param_pattern [concrete = constants.%self.param_patt.925] +// CHECK:STDOUT: %self.patt: %pattern_type.6cb = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.617] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %X = ref_param call_param0 +// CHECK:STDOUT: %self: ref %X = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc14_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6cb = ref_param_pattern [concrete = constants.%self.param_patt.925] +// CHECK:STDOUT: %self.patt: %pattern_type.6cb = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.617] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %X = ref_param call_param0 +// CHECK:STDOUT: %self: ref %X = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc14_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.dfd = ref_param_pattern [concrete = constants.%self.param_patt.b9b] +// CHECK:STDOUT: %self.patt: %pattern_type.dfd = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a99] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %const = ref_param call_param0 +// CHECK:STDOUT: %self: ref %const = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc14_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.dfd = ref_param_pattern [concrete = constants.%self.param_patt.b9b] +// CHECK:STDOUT: %self.patt: %pattern_type.dfd = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a99] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %const = ref_param call_param0 +// CHECK:STDOUT: %self: ref %const = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Use() { @@ -180,20 +245,47 @@ fn Use() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %b.patt: %pattern_type.7f7 = value_binding_pattern b [concrete = constants.%b.patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %i.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%i.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %i.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%i.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc14_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc14_3.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc14_3.2(%self.param: ref %X) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc14_3.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc14_3.2(%self.param: ref %X) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc14_3.3(%self.param: ref %const) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc14_3.2(%self.param: ref %X) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc14_3.2(%self.param: ref %X) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc14_3.3(%self.param: ref %const) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc14_3.3(%self.param: ref %const) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc14_3.3(%self.param: ref %const) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -216,8 +308,52 @@ fn Use() { // CHECK:STDOUT: %i.patt: %pattern_type.6cb = ref_binding_pattern i [concrete] // CHECK:STDOUT: %i.var_patt: %pattern_type.6cb = var_pattern %i.patt [concrete] // CHECK:STDOUT: %v.patt: %pattern_type.6cb = value_binding_pattern v [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc12_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc12_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.925: %pattern_type.6cb = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.617: %pattern_type.6cb = wrapper_binding_pattern self, %self.param_patt.925 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc12_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc12_3.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc12_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc12_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc12_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc12_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6cb = ref_param_pattern [concrete = constants.%self.param_patt.925] +// CHECK:STDOUT: %self.patt: %pattern_type.6cb = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.617] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %X = ref_param call_param0 +// CHECK:STDOUT: %self: ref %X = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc12_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6cb = ref_param_pattern [concrete = constants.%self.param_patt.925] +// CHECK:STDOUT: %self.patt: %pattern_type.6cb = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.617] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %X = ref_param call_param0 +// CHECK:STDOUT: %self: ref %X = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Use() { @@ -245,15 +381,33 @@ fn Use() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %v.patt: %pattern_type.6cb = value_binding_pattern v [concrete = constants.%v.patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %i.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%i.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %i.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%i.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc12_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc12_3.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc12_3.2(%self.param: ref %X) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc12_3.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc12_3.2(%self.param: ref %X) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc12_3.2(%self.param: ref %X) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc12_3.2(%self.param: ref %X) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/as/maybe_unformed.carbon b/toolchain/check/testdata/as/maybe_unformed.carbon index 7a6e42c5ea7f..7292035421b6 100644 --- a/toolchain/check/testdata/as/maybe_unformed.carbon +++ b/toolchain/check/testdata/as/maybe_unformed.carbon @@ -216,6 +216,7 @@ fn Use() { // CHECK:STDOUT: type: type = facet_type [concrete] // CHECK:STDOUT: %X: type = class_type @X [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] +// CHECK:STDOUT: %pattern_type.6cb: type = pattern_type %X [concrete] // CHECK:STDOUT: %Init.type: type = fn_type @Init [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Init: %Init.type = struct_value () [concrete] @@ -230,8 +231,34 @@ fn Use() { // CHECK:STDOUT: %As.generic: %As.type.116 = struct_value () [concrete] // CHECK:STDOUT: %v.patt: %pattern_type.009 = value_binding_pattern v [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc19_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc19_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.925: %pattern_type.6cb = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.617: %pattern_type.6cb = wrapper_binding_pattern self, %self.param_patt.925 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc19_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc19_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.b19: type = pattern_type %.f01 [concrete] +// CHECK:STDOUT: %self.param_patt.64e: %pattern_type.b19 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.00a: %pattern_type.b19 = wrapper_binding_pattern self, %self.param_patt.64e [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc19_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc19_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.bd6: %pattern_type.009 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.eed: %pattern_type.009 = wrapper_binding_pattern self, %self.param_patt.bd6 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc19_3.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc19_3.4 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc19_3.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -247,6 +274,65 @@ fn Use() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc19_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc19_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc19_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6cb = ref_param_pattern [concrete = constants.%self.param_patt.925] +// CHECK:STDOUT: %self.patt: %pattern_type.6cb = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.617] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %X = ref_param call_param0 +// CHECK:STDOUT: %self: ref %X = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc19_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6cb = ref_param_pattern [concrete = constants.%self.param_patt.925] +// CHECK:STDOUT: %self.patt: %pattern_type.6cb = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.617] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %X = ref_param call_param0 +// CHECK:STDOUT: %self: ref %X = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc19_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b19 = ref_param_pattern [concrete = constants.%self.param_patt.64e] +// CHECK:STDOUT: %self.patt: %pattern_type.b19 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.00a] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %.f01 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %.f01 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc19_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b19 = ref_param_pattern [concrete = constants.%self.param_patt.64e] +// CHECK:STDOUT: %self.patt: %pattern_type.b19 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.00a] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %.f01 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %.f01 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc19_3.4 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.009 = ref_param_pattern [concrete = constants.%self.param_patt.bd6] +// CHECK:STDOUT: %self.patt: %pattern_type.009 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.eed] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %MaybeUnformed.198 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %MaybeUnformed.198 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc19_3.4 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.009 = ref_param_pattern [concrete = constants.%self.param_patt.bd6] +// CHECK:STDOUT: %self.patt: %pattern_type.009 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.eed] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %MaybeUnformed.198 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %MaybeUnformed.198 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @Use() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %i.var: ref %MaybeUnformed.198 = var_storage %i.var_patt @@ -286,25 +372,61 @@ fn Use() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %v.patt: %pattern_type.009 = value_binding_pattern v [concrete = constants.%v.patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %i.var, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%i.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %i.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%i.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc19_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc19_3.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc19_3.2(%self.param: ref %X) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc19_3.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc19_3.2(%self.param: ref %X) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc19_3.3(%self.param: ref %.f01) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc19_3.2(%self.param: ref %X) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc19_3.2(%self.param: ref %X) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc19_3.3(%self.param: ref %.f01) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc19_3.4(%self.param: ref %MaybeUnformed.198) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc19_3.3(%self.param: ref %.f01) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc19_3.3(%self.param: ref %.f01) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc19_3.4(%self.param: ref %MaybeUnformed.198) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc19_3.4(%self.param: ref %MaybeUnformed.198) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc19_3.4(%self.param: ref %MaybeUnformed.198) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/as/partial.carbon b/toolchain/check/testdata/as/partial.carbon index 41a23a2381cc..11a60e9496fd 100644 --- a/toolchain/check/testdata/as/partial.carbon +++ b/toolchain/check/testdata/as/partial.carbon @@ -127,8 +127,52 @@ fn Use() { // CHECK:STDOUT: %reference.var: ref %.d74 = var_storage file.%reference.var_patt [concrete] // CHECK:STDOUT: %addr.3a0: %ptr.44a = addr_of %reference.var [concrete] // CHECK:STDOUT: %b.patt: %pattern_type.12c = value_binding_pattern b [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc14_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc14_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.9b7: %pattern_type.53b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.8cb: %pattern_type.53b = wrapper_binding_pattern self, %self.param_patt.9b7 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc14_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc14_3.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc14_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc14_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc14_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc14_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.53b = ref_param_pattern [concrete = constants.%self.param_patt.9b7] +// CHECK:STDOUT: %self.patt: %pattern_type.53b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.8cb] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %.d74 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %.d74 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc14_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.53b = ref_param_pattern [concrete = constants.%self.param_patt.9b7] +// CHECK:STDOUT: %self.patt: %pattern_type.53b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.8cb] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %.d74 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %.d74 = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Use() { @@ -194,15 +238,33 @@ fn Use() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %b.patt: %pattern_type.12c = value_binding_pattern b [concrete = constants.%b.patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %i.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%i.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %i.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%i.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc14_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc14_3.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc14_3.2(%self.param: ref %.d74) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc14_3.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc14_3.2(%self.param: ref %.d74) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc14_3.2(%self.param: ref %.d74) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc14_3.2(%self.param: ref %.d74) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -228,8 +290,52 @@ fn Use() { // CHECK:STDOUT: %j.var_patt: %pattern_type.6cb = var_pattern %j.patt [concrete] // CHECK:STDOUT: %k.patt: %pattern_type.6cb = ref_binding_pattern k [concrete] // CHECK:STDOUT: %k.var_patt: %pattern_type.6cb = var_pattern %k.patt [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc12_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc12_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.925: %pattern_type.6cb = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.617: %pattern_type.6cb = wrapper_binding_pattern self, %self.param_patt.925 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc12_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc12_3.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc12_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc12_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc12_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc12_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6cb = ref_param_pattern [concrete = constants.%self.param_patt.925] +// CHECK:STDOUT: %self.patt: %pattern_type.6cb = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.617] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %X = ref_param call_param0 +// CHECK:STDOUT: %self: ref %X = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc12_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6cb = ref_param_pattern [concrete = constants.%self.param_patt.925] +// CHECK:STDOUT: %self.patt: %pattern_type.6cb = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.617] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %X = ref_param call_param0 +// CHECK:STDOUT: %self: ref %X = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Use() { @@ -275,19 +381,37 @@ fn Use() { // CHECK:STDOUT: %k.patt: %pattern_type.6cb = ref_binding_pattern k [concrete = constants.%k.patt] // CHECK:STDOUT: %k.var_patt: %pattern_type.6cb = var_pattern %k.patt [concrete = constants.%k.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc12: = bound_method %k.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc12: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc12(%k.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc11: = bound_method %j.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc11: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc11(%j.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc10: = bound_method %i.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc10: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc10(%i.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc12: = bound_method %k.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc12: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc12(%k.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc11: = bound_method %j.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc11: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc11(%j.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10: = bound_method %i.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10(%i.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc12_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc12_3.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc12_3.2(%self.param: ref %X) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc12_3.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc12_3.2(%self.param: ref %X) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc12_3.2(%self.param: ref %X) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc12_3.2(%self.param: ref %X) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/as/var_init.carbon b/toolchain/check/testdata/as/var_init.carbon index 83482d52986d..0f2bb7994d82 100644 --- a/toolchain/check/testdata/as/var_init.carbon +++ b/toolchain/check/testdata/as/var_init.carbon @@ -46,8 +46,52 @@ fn Convert(unused t: ()) { // CHECK:STDOUT: %x.var_patt: %pattern_type.6cb = var_pattern %x.patt [concrete] // CHECK:STDOUT: %.b8c: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.dd7, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %empty_tuple.type.as.ImplicitAs.impl.Convert.bound: = bound_method %empty_tuple, %empty_tuple.type.as.ImplicitAs.impl.Convert [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc12_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc12_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.925: %pattern_type.6cb = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.617: %pattern_type.6cb = wrapper_binding_pattern self, %self.param_patt.925 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc12_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc12_3.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc12_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc12_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc12_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc12_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6cb = ref_param_pattern [concrete = constants.%self.param_patt.925] +// CHECK:STDOUT: %self.patt: %pattern_type.6cb = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.617] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %X = ref_param call_param0 +// CHECK:STDOUT: %self: ref %X = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc12_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6cb = ref_param_pattern [concrete = constants.%self.param_patt.925] +// CHECK:STDOUT: %self.patt: %pattern_type.6cb = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.617] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %X = ref_param call_param0 +// CHECK:STDOUT: %self: ref %X = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Convert(%t.param: %empty_tuple.type) { @@ -68,15 +112,33 @@ fn Convert(unused t: ()) { // CHECK:STDOUT: %x.patt: %pattern_type.6cb = ref_binding_pattern x [concrete = constants.%x.patt] // CHECK:STDOUT: %x.var_patt: %pattern_type.6cb = var_pattern %x.patt [concrete = constants.%x.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %x.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%x.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %x.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%x.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc12_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc12_3.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc12_3.2(%self.param: ref %X) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc12_3.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc12_3.2(%self.param: ref %X) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc12_3.2(%self.param: ref %X) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc12_3.2(%self.param: ref %X) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/basics/dump_sem_ir_ranges.carbon b/toolchain/check/testdata/basics/dump_sem_ir_ranges.carbon index 50d653da189d..a4777af3fe31 100644 --- a/toolchain/check/testdata/basics/dump_sem_ir_ranges.carbon +++ b/toolchain/check/testdata/basics/dump_sem_ir_ranges.carbon @@ -106,8 +106,8 @@ library "[[@TEST_NAME]]"; // CHECK:STDOUT: %A: %A.type = struct_value () [concrete] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] // CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc5 [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: %.262: Core.Form = init_form %empty_tuple.type [concrete] // CHECK:STDOUT: %return.param_patt: %pattern_type.cb1 = out_param_pattern [concrete] // CHECK:STDOUT: %return.patt: %pattern_type.cb1 = return_slot_pattern %return.param_patt, %empty_tuple.type [concrete] @@ -165,8 +165,8 @@ library "[[@TEST_NAME]]"; // CHECK:STDOUT: %c.ref.loc20: ref %empty_tuple.type = name_ref c, %c // CHECK:STDOUT: %.loc20_10: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc20_11: init %empty_tuple.type = converted %c.ref.loc20, %.loc20_10 [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %c.var, constants.%Destroy.WithSelf.Op.403 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%c.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %c.var, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%c.var) // CHECK:STDOUT: return %.loc20_11 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -219,12 +219,36 @@ library "[[@TEST_NAME]]"; // CHECK:STDOUT: type: type = facet_type [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] +// CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete] // CHECK:STDOUT: %A.type: type = fn_type @A [concrete] // CHECK:STDOUT: %A: %A.type = struct_value () [concrete] // CHECK:STDOUT: %C.type: type = fn_type @C [concrete] // CHECK:STDOUT: %C: %C.type = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.65a: %pattern_type.cb1 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.df1: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt.65a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfc: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc17 [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.loc17 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc17 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl: %Destroy.WithSelf.SubobjectDestroy.type.dfc = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc17 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc17 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @G() { @@ -245,16 +269,25 @@ library "[[@TEST_NAME]]"; // CHECK:STDOUT: %empty_tuple.loc17: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc17_7.3: %empty_tuple.type = converted %C.call, %empty_tuple.loc17 [concrete = constants.%empty_tuple] // CHECK:STDOUT: -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc17: = bound_method %.loc17_7.2, constants.%Destroy.WithSelf.Op.403 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc17: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc17(%.loc17_7.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc17: = bound_method %.loc17_7.2, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc17: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc17(%.loc17_7.2) // CHECK:STDOUT: -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc13: = bound_method %.loc13_7.2, constants.%Destroy.WithSelf.Op.403 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc13: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc13(%.loc13_7.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc13: = bound_method %.loc13_7.2, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc13: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc13(%.loc13_7.2) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc17(%self.param: ref %empty_tuple.type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc17(%self.param: ref %empty_tuple.type) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc17(%self.param: ref %empty_tuple.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) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- file_without_ranges.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { diff --git a/toolchain/check/testdata/basics/duplicate_name_same_line.carbon b/toolchain/check/testdata/basics/duplicate_name_same_line.carbon index 51bbe465a55c..c282fc5c87fa 100644 --- a/toolchain/check/testdata/basics/duplicate_name_same_line.carbon +++ b/toolchain/check/testdata/basics/duplicate_name_same_line.carbon @@ -29,12 +29,35 @@ fn A() { // CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete] // CHECK:STDOUT: %n.patt.785a0d.1: %pattern_type.cb1 = ref_binding_pattern n [concrete] // CHECK:STDOUT: %n.var_patt.961036.1: %pattern_type.cb1 = var_pattern %n.patt.785a0d.1 [concrete] +// CHECK:STDOUT: %self.param_patt.65a: %pattern_type.cb1 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.df1: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt.65a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfc: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc18 [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.loc18 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc18 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: %n.patt.785a0d.2: %pattern_type.cb1 = ref_binding_pattern n [concrete] // CHECK:STDOUT: %n.var_patt.961036.2: %pattern_type.cb1 = var_pattern %n.patt.785a0d.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl: %Destroy.WithSelf.SubobjectDestroy.type.dfc = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc18 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc18 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @A() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: @@ -54,8 +77,8 @@ fn A() { // CHECK:STDOUT: %n.patt.loc18_17: %pattern_type.cb1 = ref_binding_pattern n [concrete = constants.%n.patt.785a0d.1] // CHECK:STDOUT: %n.var_patt.loc18_5: %pattern_type.cb1 = var_pattern %n.patt.loc18_17 [concrete = constants.%n.var_patt.961036.1] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc18_5: = bound_method %n.var.loc18_5, constants.%Destroy.WithSelf.Op.403 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc18_5: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc18_5(%n.var.loc18_5) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc18_5: = bound_method %n.var.loc18_5, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc18_5: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc18_5(%n.var.loc18_5) // CHECK:STDOUT: // CHECK:STDOUT: // CHECK:STDOUT: !if.else: @@ -73,13 +96,22 @@ fn A() { // CHECK:STDOUT: %n.patt.loc18_49: %pattern_type.cb1 = ref_binding_pattern n [concrete = constants.%n.patt.785a0d.2] // CHECK:STDOUT: %n.var_patt.loc18_37: %pattern_type.cb1 = var_pattern %n.patt.loc18_49 [concrete = constants.%n.var_patt.961036.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc18_37: = bound_method %n.var.loc18_37, constants.%Destroy.WithSelf.Op.403 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc18_37: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc18_37(%n.var.loc18_37) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc18_37: = bound_method %n.var.loc18_37, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc18_37: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc18_37(%n.var.loc18_37) // CHECK:STDOUT: // CHECK:STDOUT: // CHECK:STDOUT: !if.done: // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc18(%self.param: ref %empty_tuple.type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18(%self.param: ref %empty_tuple.type) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc18(%self.param: ref %empty_tuple.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) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/access/access_modifiers.carbon b/toolchain/check/testdata/class/access/access_modifiers.carbon index 5a662f91ae8e..f326656e7509 100644 --- a/toolchain/check/testdata/class/access/access_modifiers.carbon +++ b/toolchain/check/testdata/class/access/access_modifiers.carbon @@ -194,8 +194,34 @@ class A { // CHECK:STDOUT: %Circle.val: %Circle = struct_value (%int_5.eef) [concrete] // CHECK:STDOUT: %circle.patt: %pattern_type.f70 = value_binding_pattern circle [concrete] // CHECK:STDOUT: %radius.patt: %pattern_type.6b6 = value_binding_pattern radius [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc20_36.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc20_36.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc20_36.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc20_36.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.e8f: type = pattern_type %struct_type.radius.c2c [concrete] +// CHECK:STDOUT: %self.param_patt.19b: %pattern_type.e8f = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.35a: %pattern_type.e8f = wrapper_binding_pattern self, %self.param_patt.19b [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc20_36.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc20_36.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.2a8: %pattern_type.f70 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.4be: %pattern_type.f70 = wrapper_binding_pattern self, %self.param_patt.2a8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc20_36.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc20_36.4 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc20_36.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -203,6 +229,65 @@ class A { // CHECK:STDOUT: %ImplicitAs.impl_witness_table.1aa = impl_witness_table (%Core.import_ref.edf), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc20_36.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc20_36.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc20_36.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc20_36.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc20_36.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e8f = ref_param_pattern [concrete = constants.%self.param_patt.19b] +// CHECK:STDOUT: %self.patt: %pattern_type.e8f = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.35a] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.radius.c2c = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.radius.c2c = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc20_36.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e8f = ref_param_pattern [concrete = constants.%self.param_patt.19b] +// CHECK:STDOUT: %self.patt: %pattern_type.e8f = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.35a] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.radius.c2c = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.radius.c2c = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc20_36.4 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f70 = ref_param_pattern [concrete = constants.%self.param_patt.2a8] +// CHECK:STDOUT: %self.patt: %pattern_type.f70 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.4be] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Circle = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Circle = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc20_36.4 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f70 = ref_param_pattern [concrete = constants.%self.param_patt.2a8] +// CHECK:STDOUT: %self.patt: %pattern_type.f70 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.4be] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Circle = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Circle = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: class @Circle { // CHECK:STDOUT: // CHECK:STDOUT: complete_type_witness = %complete_type @@ -260,25 +345,61 @@ class A { // CHECK:STDOUT: %SOME_INTERNAL_CONSTANT.ref: = name_ref SOME_INTERNAL_CONSTANT, [concrete = ] // CHECK:STDOUT: %circle.ref.loc53: %Circle = name_ref circle, %circle // CHECK:STDOUT: %SomeInternalFunction.ref: = name_ref SomeInternalFunction, [concrete = ] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.loc20_36.2, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%.loc20_36.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc20_36.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc20_36.2) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc20_36.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc20_36.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc20_36.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc20_36.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc20_36.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc20_36.3(%self.param: ref %struct_type.radius.c2c) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc20_36.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc20_36.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc20_36.3(%self.param: ref %struct_type.radius.c2c) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc20_36.4(%self.param: ref %Circle) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc20_36.3(%self.param: ref %struct_type.radius.c2c) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc20_36.3(%self.param: ref %struct_type.radius.c2c) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc20_36.4(%self.param: ref %Circle) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc20_36.4(%self.param: ref %Circle) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc20_36.4(%self.param: ref %Circle) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/adapter/adapt_copy.carbon b/toolchain/check/testdata/class/adapter/adapt_copy.carbon index e390a38b5cbd..5481a38ea2cf 100644 --- a/toolchain/check/testdata/class/adapter/adapt_copy.carbon +++ b/toolchain/check/testdata/class/adapter/adapt_copy.carbon @@ -189,8 +189,28 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %d.var_patt.b13: %pattern_type.3b9 = var_pattern %d.patt.467 [concrete] // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc16_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc16_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.6b6: type = pattern_type %i32 [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc16_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc16_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.f36: %pattern_type.3b9 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.205: %pattern_type.3b9 = wrapper_binding_pattern self, %self.param_patt.f36 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc16_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc16_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc16_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] // CHECK:STDOUT: %UInt.type: type = generic_class_type @UInt [concrete] // CHECK:STDOUT: %UInt.generic: %UInt.type = struct_value () [concrete] // CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(%int_32) [concrete] @@ -208,8 +228,28 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %u32.builtin: type = int_type unsigned, %int_32 [concrete] // CHECK:STDOUT: %d.patt.e01: %pattern_type.c42 = ref_binding_pattern d [concrete] // CHECK:STDOUT: %d.var_patt.d22: %pattern_type.c42 = var_pattern %d.patt.e01 [concrete] +// CHECK:STDOUT: %pattern_type.b1b: type = pattern_type %u32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.a81: %pattern_type.b1b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.095: %pattern_type.b1b = wrapper_binding_pattern self, %self.param_patt.a81 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc35_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc35_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.668: type = pattern_type %u32 [concrete] +// CHECK:STDOUT: %self.param_patt.e4c: %pattern_type.668 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.77f: %pattern_type.668 = wrapper_binding_pattern self, %self.param_patt.e4c [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc35_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.5: type = fn_type @Destroy.WithSelf.Op.loc35_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.5: %Destroy.WithSelf.Op.type.ef016f.5 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.6d5: %pattern_type.c42 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.4b7: %pattern_type.c42 = wrapper_binding_pattern self, %self.param_patt.6d5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc35_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.6: type = fn_type @Destroy.WithSelf.Op.loc35_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.6: %Destroy.WithSelf.Op.type.ef016f.6 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.6: type = fn_type @Destroy.WithSelf.SelfDestruct.loc35_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.6: %Destroy.WithSelf.SelfDestruct.type.fbceb5.6 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -227,6 +267,93 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %Core.UInt: %UInt.type = import_ref Core//prelude/parts/uint, UInt, loaded [concrete = constants.%UInt.generic] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc16_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc16_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc16_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc16_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc16_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.3b9 = ref_param_pattern [concrete = constants.%self.param_patt.f36] +// CHECK:STDOUT: %self.patt: %pattern_type.3b9 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.205] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %AdaptCopyable = ref_param call_param0 +// CHECK:STDOUT: %self: ref %AdaptCopyable = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc16_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.3b9 = ref_param_pattern [concrete = constants.%self.param_patt.f36] +// CHECK:STDOUT: %self.patt: %pattern_type.3b9 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.205] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %AdaptCopyable = ref_param call_param0 +// CHECK:STDOUT: %self: ref %AdaptCopyable = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc35_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b1b = ref_param_pattern [concrete = constants.%self.param_patt.a81] +// CHECK:STDOUT: %self.patt: %pattern_type.b1b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.095] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %u32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %u32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc35_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b1b = ref_param_pattern [concrete = constants.%self.param_patt.a81] +// CHECK:STDOUT: %self.patt: %pattern_type.b1b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.095] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %u32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %u32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc35_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.668 = ref_param_pattern [concrete = constants.%self.param_patt.e4c] +// CHECK:STDOUT: %self.patt: %pattern_type.668 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.77f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %u32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %u32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.5: %Destroy.WithSelf.Op.type.ef016f.5 = fn_decl @Destroy.WithSelf.Op.loc35_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.668 = ref_param_pattern [concrete = constants.%self.param_patt.e4c] +// CHECK:STDOUT: %self.patt: %pattern_type.668 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.77f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %u32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %u32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc35_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.c42 = ref_param_pattern [concrete = constants.%self.param_patt.6d5] +// CHECK:STDOUT: %self.patt: %pattern_type.c42 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.4b7] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.28f = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.28f = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.6: %Destroy.WithSelf.Op.type.ef016f.6 = fn_decl @Destroy.WithSelf.Op.loc35_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.c42 = ref_param_pattern [concrete = constants.%self.param_patt.6d5] +// CHECK:STDOUT: %self.patt: %pattern_type.c42 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.4b7] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.28f = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.28f = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -297,20 +424,47 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: } // CHECK:STDOUT: %d.ref: ref %AdaptCopyable = name_ref d, %d // CHECK:STDOUT: %.loc24: %AdaptCopyable = acquire_value %d.ref -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %d.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%d.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %d.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%d.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc16_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16_3.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc16_3.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc16_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16_3.3(%self.param: ref %AdaptCopyable) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16_3.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc16_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc16_3.3(%self.param: ref %AdaptCopyable) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16_3.3(%self.param: ref %AdaptCopyable) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc16_3.3(%self.param: ref %AdaptCopyable) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -334,20 +488,47 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %d.ref: ref %tuple.type.28f = name_ref d, %d // CHECK:STDOUT: %tuple.elem0.loc43: ref %AdaptCopyable = tuple_access %d.ref, element0 // CHECK:STDOUT: %.loc43: %AdaptCopyable = acquire_value %tuple.elem0.loc43 -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %d.var, constants.%Destroy.WithSelf.Op.403171.6 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%d.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %d.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.6 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%d.var) // CHECK:STDOUT: return to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc35_3.1(%self.param: ref %u32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc35_3.1(%self.param: ref %u32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc35_3.2(%self.param: ref %u32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc35_3.1(%self.param: ref %u32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc35_3.2(%self.param: ref %u32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc35_3.3(%self.param: ref %tuple.type.28f) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc35_3.2(%self.param: ref %u32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc35_3.2(%self.param: ref %u32) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.5(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.5(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc35_3.3(%self.param: ref %tuple.type.28f) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc35_3.3(%self.param: ref %tuple.type.28f) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc35_3.3(%self.param: ref %tuple.type.28f) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.6(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.6(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -386,10 +567,37 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %Copy.facet.1e1: %Copy.type = facet_value %i32, (%Copy.impl_witness.b51) [concrete] // CHECK:STDOUT: %Copy.WithSelf.Op.type.381: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet.1e1) [concrete] // CHECK:STDOUT: %.737: type = fn_type_with_self_type %Copy.WithSelf.Op.type.381, %Copy.facet.1e1 [concrete] +// CHECK:STDOUT: %pattern_type.6b6: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.4f6, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc9_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.394: type = pattern_type %tuple.type.e55 [concrete] +// CHECK:STDOUT: %self.param_patt.f5e: %pattern_type.394 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.7eb: %pattern_type.394 = wrapper_binding_pattern self, %self.param_patt.f5e [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.8a0: %pattern_type.ea1 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.656: %pattern_type.ea1 = wrapper_binding_pattern self, %self.param_patt.8a0 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc9_3.4 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9_3.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] // CHECK:STDOUT: %UInt.type: type = generic_class_type @UInt [concrete] // CHECK:STDOUT: %UInt.generic: %UInt.type = struct_value () [concrete] // CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(%int_32) [concrete] @@ -414,9 +622,29 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %Copy.facet.e98: %Copy.type = facet_value %u32, (%Copy.impl_witness.441) [concrete] // CHECK:STDOUT: %Copy.WithSelf.Op.type.94a: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet.e98) [concrete] // CHECK:STDOUT: %.4ed: type = fn_type_with_self_type %Copy.WithSelf.Op.type.94a, %Copy.facet.e98 [concrete] +// CHECK:STDOUT: %pattern_type.668: type = pattern_type %u32 [concrete] // CHECK:STDOUT: %UInt.as.Copy.impl.Op.specific_fn: = specific_function %UInt.as.Copy.impl.Op.46f, @UInt.as.Copy.impl.Op(%int_32) [concrete] +// CHECK:STDOUT: %pattern_type.b1b: type = pattern_type %u32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.a81: %pattern_type.b1b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.095: %pattern_type.b1b = wrapper_binding_pattern self, %self.param_patt.a81 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc14_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.5: type = fn_type @Destroy.WithSelf.Op.loc14_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.5: %Destroy.WithSelf.Op.type.ef016f.5 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.e4c: %pattern_type.668 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.77f: %pattern_type.668 = wrapper_binding_pattern self, %self.param_patt.e4c [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc14_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.6: type = fn_type @Destroy.WithSelf.Op.loc14_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.6: %Destroy.WithSelf.Op.type.ef016f.6 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.1a1: %pattern_type.996 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.62d: %pattern_type.996 = wrapper_binding_pattern self, %self.param_patt.1a1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc14_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.7: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.7: type = fn_type @Destroy.WithSelf.Op.loc14_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.7: %Destroy.WithSelf.Op.type.ef016f.7 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.7: type = fn_type @Destroy.WithSelf.SelfDestruct.loc14_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.7: %Destroy.WithSelf.SelfDestruct.type.fbceb5.7 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -438,6 +666,107 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %Copy.impl_witness_table.ae7 = impl_witness_table (%Core.import_ref.791), @UInt.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc9_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc9_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.394 = ref_param_pattern [concrete = constants.%self.param_patt.f5e] +// CHECK:STDOUT: %self.patt: %pattern_type.394 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.7eb] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.e55 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.e55 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc9_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.394 = ref_param_pattern [concrete = constants.%self.param_patt.f5e] +// CHECK:STDOUT: %self.patt: %pattern_type.394 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.7eb] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.e55 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.e55 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.4 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.ea1 = ref_param_pattern [concrete = constants.%self.param_patt.8a0] +// CHECK:STDOUT: %self.patt: %pattern_type.ea1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.656] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %AdaptTuple = ref_param call_param0 +// CHECK:STDOUT: %self: ref %AdaptTuple = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc9_3.4 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.ea1 = ref_param_pattern [concrete = constants.%self.param_patt.8a0] +// CHECK:STDOUT: %self.patt: %pattern_type.ea1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.656] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %AdaptTuple = ref_param call_param0 +// CHECK:STDOUT: %self: ref %AdaptTuple = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc14_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b1b = ref_param_pattern [concrete = constants.%self.param_patt.a81] +// CHECK:STDOUT: %self.patt: %pattern_type.b1b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.095] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %u32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %u32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.5: %Destroy.WithSelf.Op.type.ef016f.5 = fn_decl @Destroy.WithSelf.Op.loc14_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b1b = ref_param_pattern [concrete = constants.%self.param_patt.a81] +// CHECK:STDOUT: %self.patt: %pattern_type.b1b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.095] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %u32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %u32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc14_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.668 = ref_param_pattern [concrete = constants.%self.param_patt.e4c] +// CHECK:STDOUT: %self.patt: %pattern_type.668 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.77f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %u32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %u32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.6: %Destroy.WithSelf.Op.type.ef016f.6 = fn_decl @Destroy.WithSelf.Op.loc14_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.668 = ref_param_pattern [concrete = constants.%self.param_patt.e4c] +// CHECK:STDOUT: %self.patt: %pattern_type.668 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.77f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %u32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %u32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.7: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc14_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.7] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.996 = ref_param_pattern [concrete = constants.%self.param_patt.1a1] +// CHECK:STDOUT: %self.patt: %pattern_type.996 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.62d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.e88 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.e88 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.7: %Destroy.WithSelf.Op.type.ef016f.7 = fn_decl @Destroy.WithSelf.Op.loc14_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.7] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.996 = ref_param_pattern [concrete = constants.%self.param_patt.1a1] +// CHECK:STDOUT: %self.patt: %pattern_type.996 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.62d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.e88 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.e88 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -554,25 +883,61 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %.loc10_11.7: init %tuple.type.e55 to %.loc10_11.3 = tuple_init (%.loc10_11.4, %.loc10_11.6) // CHECK:STDOUT: %.loc10_11.8: init %AdaptTuple = as_compatible %.loc10_11.7 // CHECK:STDOUT: %.loc10_11.9: init %AdaptTuple = converted %d.ref, %.loc10_11.8 -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %d.var, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%d.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %d.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%d.var) // CHECK:STDOUT: return %.loc10_11.9 to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.3(%self.param: ref %tuple.type.e55) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.3(%self.param: ref %tuple.type.e55) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.4(%self.param: ref %AdaptTuple) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.3(%self.param: ref %tuple.type.e55) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.3(%self.param: ref %tuple.type.e55) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.4(%self.param: ref %AdaptTuple) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.4(%self.param: ref %AdaptTuple) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.4(%self.param: ref %AdaptTuple) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -662,20 +1027,47 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %.loc15_10.11: init %u32 to %tuple.elem1.loc15_10.4 = in_place_init %UInt.as.Copy.impl.Op.call.loc15 // CHECK:STDOUT: %.loc15_10.12: init %tuple.type.e88 to %return.param = tuple_init (%.loc15_10.9, %.loc15_10.11) // CHECK:STDOUT: %.loc15_11: init %tuple.type.e88 = converted %d.ref, %.loc15_10.12 -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %d.var, constants.%Destroy.WithSelf.Op.403171.7 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%d.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %d.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.7 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%d.var) // CHECK:STDOUT: return %.loc15_11 to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc14_3.1(%self.param: ref %u32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc14_3.1(%self.param: ref %u32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc14_3.2(%self.param: ref %u32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc14_3.1(%self.param: ref %u32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.5(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.5(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc14_3.2(%self.param: ref %u32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc14_3.3(%self.param: ref %tuple.type.e88) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc14_3.2(%self.param: ref %u32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc14_3.2(%self.param: ref %u32) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.6(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.6(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc14_3.3(%self.param: ref %tuple.type.e88) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc14_3.3(%self.param: ref %tuple.type.e88) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc14_3.3(%self.param: ref %tuple.type.e88) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.7(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.7(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -700,8 +1092,28 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %b.var_patt: %pattern_type.d14 = var_pattern %b.patt [concrete] // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc20_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc20_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.944: type = pattern_type %Noncopyable [concrete] +// CHECK:STDOUT: %self.param_patt.648: %pattern_type.944 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.e5a: %pattern_type.944 = wrapper_binding_pattern self, %self.param_patt.648 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc20_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc20_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.f20: %pattern_type.d14 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.b09: %pattern_type.d14 = wrapper_binding_pattern self, %self.param_patt.f20 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc20_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc20_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc20_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -715,6 +1127,51 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc20_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc20_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc20_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.944 = ref_param_pattern [concrete = constants.%self.param_patt.648] +// CHECK:STDOUT: %self.patt: %pattern_type.944 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.e5a] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Noncopyable = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Noncopyable = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc20_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.944 = ref_param_pattern [concrete = constants.%self.param_patt.648] +// CHECK:STDOUT: %self.patt: %pattern_type.944 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.e5a] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Noncopyable = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Noncopyable = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc20_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.d14 = ref_param_pattern [concrete = constants.%self.param_patt.f20] +// CHECK:STDOUT: %self.patt: %pattern_type.d14 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.b09] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %AdaptNoncopyable = ref_param call_param0 +// CHECK:STDOUT: %self: ref %AdaptNoncopyable = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc20_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.d14 = ref_param_pattern [concrete = constants.%self.param_patt.f20] +// CHECK:STDOUT: %self.patt: %pattern_type.d14 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.b09] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %AdaptNoncopyable = ref_param call_param0 +// CHECK:STDOUT: %self: ref %AdaptNoncopyable = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -773,20 +1230,47 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: } // CHECK:STDOUT: %b.ref: ref %AdaptNoncopyable = name_ref b, %b // CHECK:STDOUT: %.loc28: %AdaptNoncopyable = acquire_value %b.ref -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %b.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%b.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %b.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%b.var) // CHECK:STDOUT: return to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc20_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc20_3.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc20_3.2(%self.param: ref %Noncopyable) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc20_3.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc20_3.2(%self.param: ref %Noncopyable) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc20_3.3(%self.param: ref %AdaptNoncopyable) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc20_3.2(%self.param: ref %Noncopyable) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc20_3.2(%self.param: ref %Noncopyable) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc20_3.3(%self.param: ref %AdaptNoncopyable) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc20_3.3(%self.param: ref %AdaptNoncopyable) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc20_3.3(%self.param: ref %AdaptNoncopyable) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -828,10 +1312,51 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %i32, (%Copy.impl_witness.b51) [concrete] // CHECK:STDOUT: %Copy.WithSelf.Op.type.381: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet) [concrete] // CHECK:STDOUT: %.737: type = fn_type_with_self_type %Copy.WithSelf.Op.type.381, %Copy.facet [concrete] +// CHECK:STDOUT: %pattern_type.6b6: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.4f6, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc23_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc23_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc23_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc23_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc23_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc23_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.944: type = pattern_type %Noncopyable [concrete] +// CHECK:STDOUT: %self.param_patt.648: %pattern_type.944 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.e5a: %pattern_type.944 = wrapper_binding_pattern self, %self.param_patt.648 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc23_3.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc23_3.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.db4: type = pattern_type %tuple.type.227 [concrete] +// CHECK:STDOUT: %self.param_patt.908: %pattern_type.db4 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.da7: %pattern_type.db4 = wrapper_binding_pattern self, %self.param_patt.908 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc23_3.5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.5: type = fn_type @Destroy.WithSelf.Op.loc23_3.5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.5: %Destroy.WithSelf.Op.type.ef016f.5 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.f8a: %pattern_type.be3 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.021: %pattern_type.be3 = wrapper_binding_pattern self, %self.param_patt.f8a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc23_3.6 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.6: type = fn_type @Destroy.WithSelf.Op.loc23_3.6 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.6: %Destroy.WithSelf.Op.type.ef016f.6 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.6: type = fn_type @Destroy.WithSelf.SelfDestruct.loc23_3.6 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.6: %Destroy.WithSelf.SelfDestruct.type.fbceb5.6 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -849,6 +1374,93 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc23_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc23_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc23_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc23_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc23_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// 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.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc23_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// 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.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc23_3.4 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.944 = ref_param_pattern [concrete = constants.%self.param_patt.648] +// CHECK:STDOUT: %self.patt: %pattern_type.944 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.e5a] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Noncopyable = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Noncopyable = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc23_3.4 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.944 = ref_param_pattern [concrete = constants.%self.param_patt.648] +// CHECK:STDOUT: %self.patt: %pattern_type.944 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.e5a] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Noncopyable = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Noncopyable = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc23_3.5 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.db4 = ref_param_pattern [concrete = constants.%self.param_patt.908] +// CHECK:STDOUT: %self.patt: %pattern_type.db4 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.da7] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.227 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.227 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.5: %Destroy.WithSelf.Op.type.ef016f.5 = fn_decl @Destroy.WithSelf.Op.loc23_3.5 [concrete = constants.%Destroy.WithSelf.Op.403171.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.db4 = ref_param_pattern [concrete = constants.%self.param_patt.908] +// CHECK:STDOUT: %self.patt: %pattern_type.db4 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.da7] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.227 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.227 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc23_3.6 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.be3 = ref_param_pattern [concrete = constants.%self.param_patt.f8a] +// CHECK:STDOUT: %self.patt: %pattern_type.be3 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.021] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %AdaptNoncopyableIndirect = ref_param call_param0 +// CHECK:STDOUT: %self: ref %AdaptNoncopyableIndirect = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.6: %Destroy.WithSelf.Op.type.ef016f.6 = fn_decl @Destroy.WithSelf.Op.loc23_3.6 [concrete = constants.%Destroy.WithSelf.Op.403171.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.be3 = ref_param_pattern [concrete = constants.%self.param_patt.f8a] +// CHECK:STDOUT: %self.patt: %pattern_type.be3 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.021] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %AdaptNoncopyableIndirect = ref_param call_param0 +// CHECK:STDOUT: %self: ref %AdaptNoncopyableIndirect = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -934,32 +1546,86 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %.loc34_11.4: init %i32 to %tuple.elem0.loc34_11.2 = in_place_init %Int.as.Copy.impl.Op.call.loc34 // CHECK:STDOUT: %tuple.elem1.loc34: ref %Noncopyable = tuple_access %.loc34_11.1, element1 // CHECK:STDOUT: %.loc34_11.5: %Noncopyable = acquire_value %tuple.elem1.loc34 -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %b.var, constants.%Destroy.WithSelf.Op.403171.6 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%b.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %b.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.6 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%b.var) // CHECK:STDOUT: return to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc23_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc23_3.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc23_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc23_3.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc23_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc23_3.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc23_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc23_3.3(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc23_3.3(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc23_3.4(%self.param: ref %Noncopyable) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc23_3.3(%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.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc23_3.4(%self.param: ref %Noncopyable) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc23_3.5(%self.param: ref %tuple.type.227) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc23_3.4(%self.param: ref %Noncopyable) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc23_3.4(%self.param: ref %Noncopyable) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc23_3.5(%self.param: ref %tuple.type.227) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc23_3.6(%self.param: ref %AdaptNoncopyableIndirect) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc23_3.5(%self.param: ref %tuple.type.227) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc23_3.5(%self.param: ref %tuple.type.227) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.5(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.5(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc23_3.6(%self.param: ref %AdaptNoncopyableIndirect) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc23_3.6(%self.param: ref %AdaptNoncopyableIndirect) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc23_3.6(%self.param: ref %AdaptNoncopyableIndirect) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.6(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.6(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -996,10 +1662,37 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %Copy.facet.1e1: %Copy.type = facet_value %i32, (%Copy.impl_witness.b51) [concrete] // CHECK:STDOUT: %Copy.WithSelf.Op.type.381: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet.1e1) [concrete] // CHECK:STDOUT: %.737: type = fn_type_with_self_type %Copy.WithSelf.Op.type.381, %Copy.facet.1e1 [concrete] +// CHECK:STDOUT: %pattern_type.6b6: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.4f6, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc9_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.f7f: type = pattern_type %struct_type.e.f [concrete] +// CHECK:STDOUT: %self.param_patt.723: %pattern_type.f7f = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.c79: %pattern_type.f7f = wrapper_binding_pattern self, %self.param_patt.723 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.58e: %pattern_type.27f = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.682: %pattern_type.27f = wrapper_binding_pattern self, %self.param_patt.58e [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc9_3.4 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9_3.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] // CHECK:STDOUT: %UInt.type: type = generic_class_type @UInt [concrete] // CHECK:STDOUT: %UInt.generic: %UInt.type = struct_value () [concrete] // CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(%int_32) [concrete] @@ -1025,9 +1718,29 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %Copy.facet.e98: %Copy.type = facet_value %u32, (%Copy.impl_witness.441) [concrete] // CHECK:STDOUT: %Copy.WithSelf.Op.type.94a: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet.e98) [concrete] // CHECK:STDOUT: %.4ed: type = fn_type_with_self_type %Copy.WithSelf.Op.type.94a, %Copy.facet.e98 [concrete] +// CHECK:STDOUT: %pattern_type.668: type = pattern_type %u32 [concrete] // CHECK:STDOUT: %UInt.as.Copy.impl.Op.specific_fn: = specific_function %UInt.as.Copy.impl.Op.46f, @UInt.as.Copy.impl.Op(%int_32) [concrete] +// CHECK:STDOUT: %pattern_type.b1b: type = pattern_type %u32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.a81: %pattern_type.b1b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.095: %pattern_type.b1b = wrapper_binding_pattern self, %self.param_patt.a81 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc14_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.5: type = fn_type @Destroy.WithSelf.Op.loc14_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.5: %Destroy.WithSelf.Op.type.ef016f.5 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.e4c: %pattern_type.668 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.77f: %pattern_type.668 = wrapper_binding_pattern self, %self.param_patt.e4c [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc14_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.6: type = fn_type @Destroy.WithSelf.Op.loc14_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.6: %Destroy.WithSelf.Op.type.ef016f.6 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.528: %pattern_type.418 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.f1f: %pattern_type.418 = wrapper_binding_pattern self, %self.param_patt.528 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc14_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.7: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.7: type = fn_type @Destroy.WithSelf.Op.loc14_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.7: %Destroy.WithSelf.Op.type.ef016f.7 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.7: type = fn_type @Destroy.WithSelf.SelfDestruct.loc14_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.7: %Destroy.WithSelf.SelfDestruct.type.fbceb5.7 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1049,6 +1762,107 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %Copy.impl_witness_table.ae7 = impl_witness_table (%Core.import_ref.791), @UInt.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc9_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc9_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f7f = ref_param_pattern [concrete = constants.%self.param_patt.723] +// CHECK:STDOUT: %self.patt: %pattern_type.f7f = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.c79] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.e.f = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.e.f = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc9_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f7f = ref_param_pattern [concrete = constants.%self.param_patt.723] +// CHECK:STDOUT: %self.patt: %pattern_type.f7f = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.c79] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.e.f = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.e.f = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.4 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.27f = ref_param_pattern [concrete = constants.%self.param_patt.58e] +// CHECK:STDOUT: %self.patt: %pattern_type.27f = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.682] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %AdaptStruct = ref_param call_param0 +// CHECK:STDOUT: %self: ref %AdaptStruct = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc9_3.4 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.27f = ref_param_pattern [concrete = constants.%self.param_patt.58e] +// CHECK:STDOUT: %self.patt: %pattern_type.27f = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.682] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %AdaptStruct = ref_param call_param0 +// CHECK:STDOUT: %self: ref %AdaptStruct = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc14_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b1b = ref_param_pattern [concrete = constants.%self.param_patt.a81] +// CHECK:STDOUT: %self.patt: %pattern_type.b1b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.095] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %u32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %u32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.5: %Destroy.WithSelf.Op.type.ef016f.5 = fn_decl @Destroy.WithSelf.Op.loc14_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b1b = ref_param_pattern [concrete = constants.%self.param_patt.a81] +// CHECK:STDOUT: %self.patt: %pattern_type.b1b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.095] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %u32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %u32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc14_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.668 = ref_param_pattern [concrete = constants.%self.param_patt.e4c] +// CHECK:STDOUT: %self.patt: %pattern_type.668 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.77f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %u32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %u32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.6: %Destroy.WithSelf.Op.type.ef016f.6 = fn_decl @Destroy.WithSelf.Op.loc14_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.668 = ref_param_pattern [concrete = constants.%self.param_patt.e4c] +// CHECK:STDOUT: %self.patt: %pattern_type.668 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.77f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %u32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %u32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.7: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc14_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.7] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.418 = ref_param_pattern [concrete = constants.%self.param_patt.528] +// CHECK:STDOUT: %self.patt: %pattern_type.418 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.f1f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.e00 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.e00 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.7: %Destroy.WithSelf.Op.type.ef016f.7 = fn_decl @Destroy.WithSelf.Op.loc14_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.7] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.418 = ref_param_pattern [concrete = constants.%self.param_patt.528] +// CHECK:STDOUT: %self.patt: %pattern_type.418 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.f1f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.e00 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.e00 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -1164,25 +1978,61 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %.loc10_11.11: init %struct_type.e.f to %.loc10_11.4 = struct_init (%.loc10_11.6, %.loc10_11.10) // CHECK:STDOUT: %.loc10_11.12: init %AdaptStruct = as_compatible %.loc10_11.11 // CHECK:STDOUT: %.loc10_11.13: init %AdaptStruct = converted %h.ref, %.loc10_11.12 -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %h.var, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%h.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %h.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%h.var) // CHECK:STDOUT: return %.loc10_11.13 to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.3(%self.param: ref %struct_type.e.f) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.3(%self.param: ref %struct_type.e.f) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.4(%self.param: ref %AdaptStruct) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.3(%self.param: ref %struct_type.e.f) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.3(%self.param: ref %struct_type.e.f) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.4(%self.param: ref %AdaptStruct) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.4(%self.param: ref %AdaptStruct) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.4(%self.param: ref %AdaptStruct) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1272,20 +2122,47 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %.loc15_10.15: init %u32 to %tuple.elem1.loc15_10.2 = in_place_init %UInt.as.Copy.impl.Op.call.loc15 // CHECK:STDOUT: %.loc15_10.16: init %tuple.type.e00 to %return.param = tuple_init (%.loc15_10.13, %.loc15_10.15) // CHECK:STDOUT: %.loc15_11: init %tuple.type.e00 = converted %d.ref, %.loc15_10.16 -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %d.var, constants.%Destroy.WithSelf.Op.403171.7 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%d.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %d.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.7 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%d.var) // CHECK:STDOUT: return %.loc15_11 to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc14_3.1(%self.param: ref %u32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc14_3.1(%self.param: ref %u32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc14_3.2(%self.param: ref %u32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc14_3.1(%self.param: ref %u32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.5(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.5(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc14_3.2(%self.param: ref %u32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc14_3.3(%self.param: ref %tuple.type.e00) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc14_3.2(%self.param: ref %u32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc14_3.2(%self.param: ref %u32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.6(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.6(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc14_3.3(%self.param: ref %tuple.type.e00) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc14_3.3(%self.param: ref %tuple.type.e00) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc14_3.3(%self.param: ref %tuple.type.e00) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.7(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.7(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/destroy_calls.carbon b/toolchain/check/testdata/class/destroy_calls.carbon index 35275e601caa..eb96067a3573 100644 --- a/toolchain/check/testdata/class/destroy_calls.carbon +++ b/toolchain/check/testdata/class/destroy_calls.carbon @@ -123,12 +123,96 @@ fn G() { F({}); } // CHECK:STDOUT: %c.patt: %pattern_type.98b = ref_binding_pattern c [concrete] // CHECK:STDOUT: %c.var_patt: %pattern_type.98b = var_pattern %c.patt [concrete] // CHECK:STDOUT: %C.val: %C = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc12_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc12_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.99a: %pattern_type.98b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.cbd: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt.99a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc12_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc12_3.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc12_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.039: %pattern_type.e39 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.535: %pattern_type.e39 = wrapper_binding_pattern self, %self.param_patt.039 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc11 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc11 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.8fb: %pattern_type.9ef = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.e64: %pattern_type.9ef = wrapper_binding_pattern self, %self.param_patt.8fb [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc10 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc12_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc12_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc12_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc12_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e39 = ref_param_pattern [concrete = constants.%self.param_patt.039] +// CHECK:STDOUT: %self.patt: %pattern_type.e39 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.535] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %B = ref_param call_param0 +// CHECK:STDOUT: %self: ref %B = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc11 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e39 = ref_param_pattern [concrete = constants.%self.param_patt.039] +// CHECK:STDOUT: %self.patt: %pattern_type.e39 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.535] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %B = ref_param call_param0 +// CHECK:STDOUT: %self: ref %B = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.9ef = ref_param_pattern [concrete = constants.%self.param_patt.8fb] +// CHECK:STDOUT: %self.patt: %pattern_type.9ef = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.e64] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %A = ref_param call_param0 +// CHECK:STDOUT: %self: ref %A = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc10 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.9ef = ref_param_pattern [concrete = constants.%self.param_patt.8fb] +// CHECK:STDOUT: %self.patt: %pattern_type.9ef = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.e64] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %A = ref_param call_param0 +// CHECK:STDOUT: %self: ref %A = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -170,29 +254,65 @@ fn G() { F({}); } // CHECK:STDOUT: %c.patt: %pattern_type.98b = ref_binding_pattern c [concrete = constants.%c.patt] // CHECK:STDOUT: %c.var_patt: %pattern_type.98b = var_pattern %c.patt [concrete = constants.%c.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc12: = bound_method %c.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc12: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc12(%c.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc11: = bound_method %b.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc11: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc11(%b.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc10: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc10: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc10(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc12: = bound_method %c.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc12: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc12(%c.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc11: = bound_method %b.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc11: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc11(%b.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10(%a.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc12_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc12_3.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc12_3.2(%self.param: ref %C) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc12_3.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc12_3.2(%self.param: ref %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11(%self.param: ref %B) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc12_3.2(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc12_3.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11(%self.param: ref %B) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10(%self.param: ref %A) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11(%self.param: ref %B) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11(%self.param: ref %B) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10(%self.param: ref %A) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10(%self.param: ref %A) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10(%self.param: ref %A) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -221,12 +341,96 @@ fn G() { F({}); } // CHECK:STDOUT: %c.patt: %pattern_type.98b = ref_binding_pattern c [concrete] // CHECK:STDOUT: %c.var_patt: %pattern_type.98b = var_pattern %c.patt [concrete] // CHECK:STDOUT: %C.val: %C = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc13_5.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc13_5.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.99a: %pattern_type.98b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.cbd: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt.99a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc13_5.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc13_5.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc13_5.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.039: %pattern_type.e39 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.535: %pattern_type.e39 = wrapper_binding_pattern self, %self.param_patt.039 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc11 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc11 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.8fb: %pattern_type.9ef = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.e64: %pattern_type.9ef = wrapper_binding_pattern self, %self.param_patt.8fb [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc10 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc13_5.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc13_5.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc13_5.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc13_5.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e39 = ref_param_pattern [concrete = constants.%self.param_patt.039] +// CHECK:STDOUT: %self.patt: %pattern_type.e39 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.535] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %B = ref_param call_param0 +// CHECK:STDOUT: %self: ref %B = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc11 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e39 = ref_param_pattern [concrete = constants.%self.param_patt.039] +// CHECK:STDOUT: %self.patt: %pattern_type.e39 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.535] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %B = ref_param call_param0 +// CHECK:STDOUT: %self: ref %B = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.9ef = ref_param_pattern [concrete = constants.%self.param_patt.8fb] +// CHECK:STDOUT: %self.patt: %pattern_type.9ef = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.e64] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %A = ref_param call_param0 +// CHECK:STDOUT: %self: ref %A = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc10 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.9ef = ref_param_pattern [concrete = constants.%self.param_patt.8fb] +// CHECK:STDOUT: %self.patt: %pattern_type.9ef = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.e64] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %A = ref_param call_param0 +// CHECK:STDOUT: %self: ref %A = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -272,32 +476,68 @@ fn G() { F({}); } // CHECK:STDOUT: %c.patt: %pattern_type.98b = ref_binding_pattern c [concrete = constants.%c.patt] // CHECK:STDOUT: %c.var_patt: %pattern_type.98b = var_pattern %c.patt [concrete = constants.%c.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc13: = bound_method %c.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc13: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc13(%c.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc13: = bound_method %c.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc13: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc13(%c.var) // CHECK:STDOUT: br !if.else // CHECK:STDOUT: // CHECK:STDOUT: !if.else: -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc11: = bound_method %b.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc11: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc11(%b.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc10: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc10: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc10(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc11: = bound_method %b.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc11: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc11(%b.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10(%a.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc13_5.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc13_5.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc13_5.2(%self.param: ref %C) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc13_5.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc13_5.2(%self.param: ref %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11(%self.param: ref %B) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc13_5.2(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc13_5.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11(%self.param: ref %B) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10(%self.param: ref %A) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11(%self.param: ref %B) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11(%self.param: ref %B) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10(%self.param: ref %A) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10(%self.param: ref %A) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10(%self.param: ref %A) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -306,24 +546,111 @@ fn G() { F({}); } // CHECK:STDOUT: constants { // CHECK:STDOUT: type: type = facet_type [concrete] // CHECK:STDOUT: %A: type = class_type @A [concrete] +// CHECK:STDOUT: %pattern_type.9ef: type = pattern_type %A [concrete] // CHECK:STDOUT: %A.Make.type: type = fn_type @A.Make [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %A.Make: %A.Make.type = struct_value () [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %B: type = class_type @B [concrete] +// CHECK:STDOUT: %pattern_type.e39: type = pattern_type %B [concrete] // CHECK:STDOUT: %B.Make.type: type = fn_type @B.Make [concrete] // CHECK:STDOUT: %B.Make: %B.Make.type = struct_value () [concrete] // CHECK:STDOUT: %C: type = class_type @C [concrete] +// CHECK:STDOUT: %pattern_type.98b: type = pattern_type %C [concrete] // CHECK:STDOUT: %C.Make.type: type = fn_type @C.Make [concrete] // CHECK:STDOUT: %C.Make: %C.Make.type = struct_value () [concrete] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_10.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc10_10.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.8fb: %pattern_type.9ef = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.e64: %pattern_type.9ef = wrapper_binding_pattern self, %self.param_patt.8fb [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_10.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc10_10.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10_10.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.039: %pattern_type.e39 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.535: %pattern_type.e39 = wrapper_binding_pattern self, %self.param_patt.039 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc11 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc11 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.99a: %pattern_type.98b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.cbd: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt.99a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc12 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc12 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc12 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_10.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc10_10.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_10.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.9ef = ref_param_pattern [concrete = constants.%self.param_patt.8fb] +// CHECK:STDOUT: %self.patt: %pattern_type.9ef = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.e64] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %A = ref_param call_param0 +// CHECK:STDOUT: %self: ref %A = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc10_10.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.9ef = ref_param_pattern [concrete = constants.%self.param_patt.8fb] +// CHECK:STDOUT: %self.patt: %pattern_type.9ef = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.e64] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %A = ref_param call_param0 +// CHECK:STDOUT: %self: ref %A = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e39 = ref_param_pattern [concrete = constants.%self.param_patt.039] +// CHECK:STDOUT: %self.patt: %pattern_type.e39 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.535] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %B = ref_param call_param0 +// CHECK:STDOUT: %self: ref %B = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc11 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e39 = ref_param_pattern [concrete = constants.%self.param_patt.039] +// CHECK:STDOUT: %self.patt: %pattern_type.e39 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.535] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %B = ref_param call_param0 +// CHECK:STDOUT: %self: ref %B = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc12 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc12 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -337,39 +664,75 @@ fn G() { F({}); } // CHECK:STDOUT: %.loc10_10.1: ref %A = temporary_storage // CHECK:STDOUT: %A.Make.call: init %A to %.loc10_10.1 = call %Make.ref.loc10() // CHECK:STDOUT: %.loc10_10.2: ref %A = temporary %.loc10_10.1, %A.Make.call -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc10: = bound_method %.loc10_10.2, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc10: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc10(%.loc10_10.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10: = bound_method %.loc10_10.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10(%.loc10_10.2) // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [concrete = constants.%B] // CHECK:STDOUT: %Make.ref.loc11: %B.Make.type = name_ref Make, @B.%B.Make.decl [concrete = constants.%B.Make] // CHECK:STDOUT: %.loc11_10.1: ref %B = temporary_storage // CHECK:STDOUT: %B.Make.call: init %B to %.loc11_10.1 = call %Make.ref.loc11() // CHECK:STDOUT: %.loc11_10.2: ref %B = temporary %.loc11_10.1, %B.Make.call -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc11: = bound_method %.loc11_10.2, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc11: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc11(%.loc11_10.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc11: = bound_method %.loc11_10.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc11: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc11(%.loc11_10.2) // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] // CHECK:STDOUT: %Make.ref.loc12: %C.Make.type = name_ref Make, @C.%C.Make.decl [concrete = constants.%C.Make] // CHECK:STDOUT: %.loc12_10.1: ref %C = temporary_storage // CHECK:STDOUT: %C.Make.call: init %C to %.loc12_10.1 = call %Make.ref.loc12() // CHECK:STDOUT: %.loc12_10.2: ref %C = temporary %.loc12_10.1, %C.Make.call -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc12: = bound_method %.loc12_10.2, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc12: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc12(%.loc12_10.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc12: = bound_method %.loc12_10.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc12: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc12(%.loc12_10.2) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_10.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_10.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_10.2(%self.param: ref %A) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_10.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_10.2(%self.param: ref %A) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11(%self.param: ref %B) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_10.2(%self.param: ref %A) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_10.2(%self.param: ref %A) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11(%self.param: ref %B) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc12(%self.param: ref %C) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11(%self.param: ref %B) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11(%self.param: ref %B) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc12(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc12(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc12(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -390,8 +753,52 @@ fn G() { F({}); } // CHECK:STDOUT: %a.var_patt: %pattern_type.6fa = var_pattern %a.patt [concrete] // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete] // CHECK:STDOUT: %D.val: %D.dee = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc9_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.555: %pattern_type.6fa = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.0a8: %pattern_type.6fa = wrapper_binding_pattern self, %self.param_patt.555 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc9_3.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc9_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6fa = ref_param_pattern [concrete = constants.%self.param_patt.555] +// CHECK:STDOUT: %self.patt: %pattern_type.6fa = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.0a8] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %D.dee = ref_param call_param0 +// CHECK:STDOUT: %self: ref %D.dee = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc9_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6fa = ref_param_pattern [concrete = constants.%self.param_patt.555] +// CHECK:STDOUT: %self.patt: %pattern_type.6fa = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.0a8] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %D.dee = ref_param call_param0 +// CHECK:STDOUT: %self: ref %D.dee = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -415,15 +822,33 @@ fn G() { F({}); } // CHECK:STDOUT: %a.patt: %pattern_type.6fa = ref_binding_pattern a [concrete = constants.%a.patt] // CHECK:STDOUT: %a.var_patt: %pattern_type.6fa = var_pattern %a.patt [concrete = constants.%a.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%a.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.2(%self.param: ref %D.dee) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.2(%self.param: ref %D.dee) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.2(%self.param: ref %D.dee) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.2(%self.param: ref %D.dee) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -443,30 +868,74 @@ fn G() { F({}); } // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] -// CHECK:STDOUT: %require_complete: = require_complete_type %C.1d0 [symbolic] +// CHECK:STDOUT: %require_complete.74a: = require_complete_type %C.1d0 [symbolic] // CHECK:STDOUT: %pattern_type.ebe: type = pattern_type %C.1d0 [symbolic] // CHECK:STDOUT: %v.patt.f9d: %pattern_type.ebe = ref_binding_pattern v [symbolic] // CHECK:STDOUT: %v.var_patt.ca3: %pattern_type.ebe = var_pattern %v.patt.f9d [symbolic] // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete] // CHECK:STDOUT: %C.val.d4f: %C.1d0 = struct_value () [symbolic] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %C.1d0, @Destroy [symbolic] -// CHECK:STDOUT: %Destroy.facet.19f: %Destroy.type = facet_value %C.1d0, (%Destroy.lookup_impl_witness) [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.fc4: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Destroy.facet.19f) [symbolic] -// CHECK:STDOUT: %.cb3: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.fc4, %Destroy.facet.19f [symbolic] -// CHECK:STDOUT: %impl.elem0: %.cb3 = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn: = specific_impl_function %impl.elem0, @Destroy.WithSelf.Op.1(%Destroy.facet.19f) [symbolic] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc7_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc7_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.lookup_impl_witness.64e: = lookup_impl_witness %C.1d0, @Destroy [symbolic] +// CHECK:STDOUT: %Destroy.facet.19f: %Destroy.type = facet_value %C.1d0, (%Destroy.lookup_impl_witness.64e) [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.bd6: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.19f) [symbolic] +// CHECK:STDOUT: %.6bd: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.bd6, %Destroy.facet.19f [symbolic] +// CHECK:STDOUT: %impl.elem2: %.6bd = impl_witness_access %Destroy.lookup_impl_witness.64e, element2 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.d42: = specific_impl_function %impl.elem2, @Destroy.WithSelf.SelfDestruct.1(%Destroy.facet.19f) [symbolic] // CHECK:STDOUT: %C.d8e: type = class_type @C, @C(%empty_struct_type) [concrete] // CHECK:STDOUT: %pattern_type.2fd: type = pattern_type %C.d8e [concrete] // CHECK:STDOUT: %v.patt.0e7: %pattern_type.2fd = ref_binding_pattern v [concrete] // CHECK:STDOUT: %v.var_patt.259: %pattern_type.2fd = var_pattern %v.patt.0e7 [concrete] // CHECK:STDOUT: %C.val.58e: %C.d8e = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.1d7: %pattern_type.2fd = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.b54: %pattern_type.2fd = wrapper_binding_pattern self, %self.param_patt.1d7 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc7_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc7_3.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.6c4ec3.2: = custom_witness (%Destroy.WithSelf.Op.403171.2), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.492: %Destroy.type = facet_value %C.d8e, (%custom_witness.6c4ec3.2) [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.e51: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Destroy.facet.492) [concrete] -// CHECK:STDOUT: %.441: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.e51, %Destroy.facet.492 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc7_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f8f19d.2: = custom_witness (%Destroy.WithSelf.Op.403171.2, %Destroy.WithSelf.SubobjectDestroy.d01daf.2, %Destroy.WithSelf.SelfDestruct.db3fdb.2), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.097: %Destroy.type = facet_value %C.d8e, (%custom_witness.f8f19d.2) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.3da: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.097) [concrete] +// CHECK:STDOUT: %.cbc: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.3da, %Destroy.facet.097 [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc7_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc7_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc7_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.2fd = ref_param_pattern [concrete = constants.%self.param_patt.1d7] +// CHECK:STDOUT: %self.patt: %pattern_type.2fd = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.b54] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C.d8e = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C.d8e = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc7_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.2fd = ref_param_pattern [concrete = constants.%self.param_patt.1d7] +// CHECK:STDOUT: %self.patt: %pattern_type.2fd = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.b54] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C.d8e = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C.d8e = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -487,17 +956,17 @@ fn G() { F({}); } // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %C.loc7_20.2: type = class_type @C, @C(%T.loc6_15.1) [symbolic = %C.loc7_20.2 (constants.%C.1d0)] -// CHECK:STDOUT: %require_complete: = require_complete_type %C.loc7_20.2 [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type %C.loc7_20.2 [symbolic = %require_complete (constants.%require_complete.74a)] // CHECK:STDOUT: %pattern_type: type = pattern_type %C.loc7_20.2 [symbolic = %pattern_type (constants.%pattern_type.ebe)] // CHECK:STDOUT: %v.patt.loc7_15.2: @F.%pattern_type (%pattern_type.ebe) = ref_binding_pattern v [symbolic = %v.patt.loc7_15.2 (constants.%v.patt.f9d)] // CHECK:STDOUT: %v.var_patt.loc7_3.2: @F.%pattern_type (%pattern_type.ebe) = var_pattern %v.patt.loc7_15.2 [symbolic = %v.var_patt.loc7_3.2 (constants.%v.var_patt.ca3)] // CHECK:STDOUT: %C.val: @F.%C.loc7_20.2 (%C.1d0) = struct_value () [symbolic = %C.val (constants.%C.val.d4f)] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %C.loc7_20.2, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)] +// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %C.loc7_20.2, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.64e)] // CHECK:STDOUT: %Destroy.facet.loc7_3.3: %Destroy.type = facet_value %C.loc7_20.2, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.loc7_3.3 (constants.%Destroy.facet.19f)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Destroy.facet.loc7_3.3) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.fc4)] -// CHECK:STDOUT: %.loc7_3.4: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet.loc7_3.3 [symbolic = %.loc7_3.4 (constants.%.cb3)] -// CHECK:STDOUT: %impl.elem0.loc7_3.2: @F.%.loc7_3.4 (%.cb3) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc7_3.2 (constants.%impl.elem0)] -// CHECK:STDOUT: %specific_impl_fn.loc7_3.2: = specific_impl_function %impl.elem0.loc7_3.2, @Destroy.WithSelf.Op.1(%Destroy.facet.loc7_3.3) [symbolic = %specific_impl_fn.loc7_3.2 (constants.%specific_impl_fn)] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.loc7_3.3) [symbolic = %Destroy.WithSelf.SelfDestruct.type (constants.%Destroy.WithSelf.SelfDestruct.type.bd6)] +// CHECK:STDOUT: %.loc7_3.4: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type, %Destroy.facet.loc7_3.3 [symbolic = %.loc7_3.4 (constants.%.6bd)] +// CHECK:STDOUT: %impl.elem2.loc7_3.2: @F.%.loc7_3.4 (%.6bd) = impl_witness_access %Destroy.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc7_3.2 (constants.%impl.elem2)] +// CHECK:STDOUT: %specific_impl_fn.loc7_3.2: = specific_impl_function %impl.elem2.loc7_3.2, @Destroy.WithSelf.SelfDestruct.1(%Destroy.facet.loc7_3.3) [symbolic = %specific_impl_fn.loc7_3.2 (constants.%specific_impl_fn.d42)] // CHECK:STDOUT: // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: @@ -516,23 +985,41 @@ fn G() { F({}); } // CHECK:STDOUT: %v.patt.loc7_15.1: @F.%pattern_type (%pattern_type.ebe) = ref_binding_pattern v [symbolic = %v.patt.loc7_15.2 (constants.%v.patt.f9d)] // CHECK:STDOUT: %v.var_patt.loc7_3.1: @F.%pattern_type (%pattern_type.ebe) = var_pattern %v.patt.loc7_15.1 [symbolic = %v.var_patt.loc7_3.2 (constants.%v.var_patt.ca3)] // CHECK:STDOUT: } -// CHECK:STDOUT: %impl.elem0.loc7_3.1: @F.%.loc7_3.4 (%.cb3) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc7_3.2 (constants.%impl.elem0)] -// CHECK:STDOUT: %bound_method.loc7_3.1: = bound_method %v.var, %impl.elem0.loc7_3.1 -// CHECK:STDOUT: %Destroy.facet.loc7_3.1: %Destroy.type = facet_value constants.%C.1d0, (constants.%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.loc7_3.3 (constants.%Destroy.facet.19f)] +// CHECK:STDOUT: %impl.elem2.loc7_3.1: @F.%.loc7_3.4 (%.6bd) = impl_witness_access constants.%Destroy.lookup_impl_witness.64e, element2 [symbolic = %impl.elem2.loc7_3.2 (constants.%impl.elem2)] +// CHECK:STDOUT: %bound_method.loc7_3.1: = bound_method %v.var, %impl.elem2.loc7_3.1 +// CHECK:STDOUT: %Destroy.facet.loc7_3.1: %Destroy.type = facet_value constants.%C.1d0, (constants.%Destroy.lookup_impl_witness.64e) [symbolic = %Destroy.facet.loc7_3.3 (constants.%Destroy.facet.19f)] // CHECK:STDOUT: %.loc7_3.2: %Destroy.type = converted constants.%C.1d0, %Destroy.facet.loc7_3.1 [symbolic = %Destroy.facet.loc7_3.3 (constants.%Destroy.facet.19f)] -// CHECK:STDOUT: %Destroy.facet.loc7_3.2: %Destroy.type = facet_value constants.%C.1d0, (constants.%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.loc7_3.3 (constants.%Destroy.facet.19f)] +// CHECK:STDOUT: %Destroy.facet.loc7_3.2: %Destroy.type = facet_value constants.%C.1d0, (constants.%Destroy.lookup_impl_witness.64e) [symbolic = %Destroy.facet.loc7_3.3 (constants.%Destroy.facet.19f)] // CHECK:STDOUT: %.loc7_3.3: %Destroy.type = converted constants.%C.1d0, %Destroy.facet.loc7_3.2 [symbolic = %Destroy.facet.loc7_3.3 (constants.%Destroy.facet.19f)] -// CHECK:STDOUT: %specific_impl_fn.loc7_3.1: = specific_impl_function %impl.elem0.loc7_3.1, @Destroy.WithSelf.Op.1(constants.%Destroy.facet.19f) [symbolic = %specific_impl_fn.loc7_3.2 (constants.%specific_impl_fn)] +// CHECK:STDOUT: %specific_impl_fn.loc7_3.1: = specific_impl_function %impl.elem2.loc7_3.1, @Destroy.WithSelf.SelfDestruct.1(constants.%Destroy.facet.19f) [symbolic = %specific_impl_fn.loc7_3.2 (constants.%specific_impl_fn.d42)] // CHECK:STDOUT: %bound_method.loc7_3.2: = bound_method %v.var, %specific_impl_fn.loc7_3.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc7_3.2(%v.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %bound_method.loc7_3.2(%v.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc7_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_3.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_3.2(%self.param: ref %C.d8e) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc7_3.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc7_3.2(%self.param: ref %C.d8e) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_3.2(%self.param: ref %C.d8e) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc7_3.2(%self.param: ref %C.d8e) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -552,12 +1039,12 @@ fn G() { F({}); } // CHECK:STDOUT: %v.patt.loc7_15.2 => constants.%v.patt.0e7 // CHECK:STDOUT: %v.var_patt.loc7_3.2 => constants.%v.var_patt.259 // CHECK:STDOUT: %C.val => constants.%C.val.58e -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.6c4ec3.2 -// CHECK:STDOUT: %Destroy.facet.loc7_3.3 => constants.%Destroy.facet.492 -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.e51 -// CHECK:STDOUT: %.loc7_3.4 => constants.%.441 -// CHECK:STDOUT: %impl.elem0.loc7_3.2 => constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %specific_impl_fn.loc7_3.2 => constants.%Destroy.WithSelf.Op.403171.2 +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.f8f19d.2 +// CHECK:STDOUT: %Destroy.facet.loc7_3.3 => constants.%Destroy.facet.097 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.3da +// CHECK:STDOUT: %.loc7_3.4 => constants.%.cbc +// CHECK:STDOUT: %impl.elem2.loc7_3.2 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %specific_impl_fn.loc7_3.2 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- generic_use_inside_template.carbon @@ -578,7 +1065,7 @@ fn G() { F({}); } // CHECK:STDOUT: %.c44: type = type_of_inst @F.%.loc7_20.5 [template] // CHECK:STDOUT: %.d24: %.c44 = splice_inst @F.%.loc7_20.5 [template] // CHECK:STDOUT: %.8bb: type = splice_inst @F.%.loc7_20.8 [template] -// CHECK:STDOUT: %require_complete: = require_complete_type %.8bb [template] +// CHECK:STDOUT: %require_complete.afd: = require_complete_type %.8bb [template] // CHECK:STDOUT: %pattern_type.6b2: type = pattern_type %.8bb [template] // CHECK:STDOUT: %v.patt.404: %pattern_type.6b2 = ref_binding_pattern v [template] // CHECK:STDOUT: %v.var_patt.3f1: %pattern_type.6b2 = var_pattern %v.patt.404 [template] @@ -596,14 +1083,14 @@ fn G() { F({}); } // CHECK:STDOUT: %.d6d: %.8bb = splice_inst @F.%.loc7_3.27 [template] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %Self.0e7: %Destroy.type = symbolic_binding Self, 0 [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.d3e: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Self.0e7) [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.42b: %Destroy.WithSelf.Op.type.d3e = struct_value () [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.4e5: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Self.0e7) [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.4a0: %Destroy.WithSelf.SelfDestruct.type.4e5 = struct_value () [symbolic] // CHECK:STDOUT: %Destroy.assoc_type: type = assoc_entity_type @Destroy [concrete] -// CHECK:STDOUT: %assoc0.ae8: %Destroy.assoc_type = assoc_entity element0, imports.%Core.import_ref.918 [concrete] -// CHECK:STDOUT: %.a04: type = type_of_inst @F.%.loc7_3.29 [template] -// CHECK:STDOUT: %.84d: %.a04 = splice_inst @F.%.loc7_3.29 [template] -// CHECK:STDOUT: %.ecf: type = type_of_inst @F.%.loc7_3.32 [template] -// CHECK:STDOUT: %.8b8: %.ecf = splice_inst @F.%.loc7_3.32 [template] +// CHECK:STDOUT: %assoc2: %Destroy.assoc_type = assoc_entity element2, imports.%Core.import_ref.71d [concrete] +// CHECK:STDOUT: %.ec4: type = type_of_inst @F.%.loc7_3.29 [template] +// CHECK:STDOUT: %.f75: %.ec4 = splice_inst @F.%.loc7_3.29 [template] +// CHECK:STDOUT: %.99a: type = type_of_inst @F.%.loc7_3.32 [template] +// CHECK:STDOUT: %.04f: %.99a = splice_inst @F.%.loc7_3.32 [template] // CHECK:STDOUT: %C.d8efcc.1: type = class_type @C, @C(%empty_struct_type) [concrete] // CHECK:STDOUT: %inst.class_type: = inst_value [concrete] { // CHECK:STDOUT: %C.d8efcc.2: type = class_type @C, @C(%empty_struct_type) [concrete = %C.d8efcc.1] @@ -628,26 +1115,70 @@ fn G() { F({}); } // CHECK:STDOUT: %.0f6: %.e10 = splice_inst %.37a [template] // CHECK:STDOUT: %.afa: = convert_to_category_action %.0f6, element10 [template] // CHECK:STDOUT: %.610: %C.d8efcc.1 = splice_inst %.afa [template] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc7_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc7_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.1d7: %pattern_type.2fd = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.b54: %pattern_type.2fd = wrapper_binding_pattern self, %self.param_patt.1d7 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc7_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc7_3.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.6c4ec3.2: = custom_witness (%Destroy.WithSelf.Op.403171.2), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.492: %Destroy.type = facet_value %C.d8efcc.1, (%custom_witness.6c4ec3.2) [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.e51: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Destroy.facet.492) [concrete] -// CHECK:STDOUT: %.441: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.e51, %Destroy.facet.492 [concrete] -// CHECK:STDOUT: %inst.splice_block.ff7: = inst_value [concrete] { -// CHECK:STDOUT: %.e85: = splice_block %bound_method { +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc7_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f8f19d.2: = custom_witness (%Destroy.WithSelf.Op.403171.2, %Destroy.WithSelf.SubobjectDestroy.d01daf.2, %Destroy.WithSelf.SelfDestruct.db3fdb.2), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.097: %Destroy.type = facet_value %C.d8efcc.1, (%custom_witness.f8f19d.2) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.3da: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.097) [concrete] +// CHECK:STDOUT: %.cbc: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.3da, %Destroy.facet.097 [concrete] +// CHECK:STDOUT: %inst.splice_block.51d: = inst_value [concrete] { +// CHECK:STDOUT: %.cb7: = splice_block %bound_method { // CHECK:STDOUT: %.464: ref %C.d8efcc.1 = specific_inst @F.%v.var, @F(%empty_struct_type) -// CHECK:STDOUT: %impl.elem0: %.441 = impl_witness_access %custom_witness.6c4ec3.2, element0 [concrete = %Destroy.WithSelf.Op.403171.2] -// CHECK:STDOUT: %bound_method: = bound_method %.464, %impl.elem0 +// CHECK:STDOUT: %impl.elem2: %.cbc = impl_witness_access %custom_witness.f8f19d.2, element2 [concrete = %Destroy.WithSelf.SelfDestruct.db3fdb.2] +// CHECK:STDOUT: %bound_method: = bound_method %.464, %impl.elem2 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: %inst.call: = inst_value [concrete] { -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %.e85(%.464) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %.cb7(%.464) // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core.import_ref.918: @Destroy.WithSelf.%Destroy.WithSelf.Op.type (%Destroy.WithSelf.Op.type.d3e) = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [symbolic = @Destroy.WithSelf.%Destroy.WithSelf.Op (constants.%Destroy.WithSelf.Op.42b)] +// CHECK:STDOUT: %Core.import_ref.71d: @Destroy.WithSelf.%Destroy.WithSelf.SelfDestruct.type (%Destroy.WithSelf.SelfDestruct.type.4e5) = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [symbolic = @Destroy.WithSelf.%Destroy.WithSelf.SelfDestruct (constants.%Destroy.WithSelf.SelfDestruct.4a0)] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc7_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc7_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc7_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.2fd = ref_param_pattern [concrete = constants.%self.param_patt.1d7] +// CHECK:STDOUT: %self.patt: %pattern_type.2fd = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.b54] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C.d8efcc.1 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C.d8efcc.1 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc7_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.2fd = ref_param_pattern [concrete = constants.%self.param_patt.1d7] +// CHECK:STDOUT: %self.patt: %pattern_type.2fd = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.b54] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C.d8efcc.1 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C.d8efcc.1 = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -672,7 +1203,7 @@ fn G() { F({}); } // CHECK:STDOUT: %.loc7_20.7: @F.%.loc7_20.6 (%.c44) = splice_inst %.loc7_20.5 [template = %.loc7_20.7 (constants.%.d24)] // CHECK:STDOUT: %.loc7_20.8: = convert_to_value_action %.loc7_20.3, type [template] // CHECK:STDOUT: %.loc7_20.9: type = splice_inst %.loc7_20.8 [template = %.loc7_20.9 (constants.%.8bb)] -// CHECK:STDOUT: %require_complete: = require_complete_type %.loc7_20.9 [template = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type %.loc7_20.9 [template = %require_complete (constants.%require_complete.afd)] // CHECK:STDOUT: %pattern_type: type = pattern_type %.loc7_20.9 [template = %pattern_type (constants.%pattern_type.6b2)] // CHECK:STDOUT: %v.patt.loc7_15.2: @F.%pattern_type (%pattern_type.6b2) = ref_binding_pattern v [template = %v.patt.loc7_15.2 (constants.%v.patt.404)] // CHECK:STDOUT: %v.var_patt.loc7_3.2: @F.%pattern_type (%pattern_type.6b2) = var_pattern %v.patt.loc7_15.2 [template = %v.var_patt.loc7_3.2 (constants.%v.var_patt.3f1)] @@ -690,12 +1221,12 @@ fn G() { F({}); } // CHECK:STDOUT: %.loc7_3.26: @F.%.loc7_3.25 (%.d5b) = splice_inst %.loc7_3.24 [template = %.loc7_3.26 (constants.%.b20)] // CHECK:STDOUT: %.loc7_3.27: = convert_to_category_action %.loc7_3.9, element10 [template] // CHECK:STDOUT: %.loc7_3.28: @F.%.loc7_20.9 (%.8bb) = splice_inst %.loc7_3.27 [template = %.loc7_3.28 (constants.%.d6d)] -// CHECK:STDOUT: %.loc7_3.29: = compound_member_access_action %v.var, constants.%assoc0.ae8 [template] -// CHECK:STDOUT: %.loc7_3.30: type = type_of_inst %.loc7_3.29 [template = %.loc7_3.30 (constants.%.a04)] -// CHECK:STDOUT: %.loc7_3.31: @F.%.loc7_3.30 (%.a04) = splice_inst %.loc7_3.29 [template = %.loc7_3.31 (constants.%.84d)] +// CHECK:STDOUT: %.loc7_3.29: = compound_member_access_action %v.var, constants.%assoc2 [template] +// CHECK:STDOUT: %.loc7_3.30: type = type_of_inst %.loc7_3.29 [template = %.loc7_3.30 (constants.%.ec4)] +// CHECK:STDOUT: %.loc7_3.31: @F.%.loc7_3.30 (%.ec4) = splice_inst %.loc7_3.29 [template = %.loc7_3.31 (constants.%.f75)] // CHECK:STDOUT: %.loc7_3.32: = call_action (%.loc7_3.12), true [template] -// CHECK:STDOUT: %.loc7_3.33: type = type_of_inst %.loc7_3.32 [template = %.loc7_3.33 (constants.%.ecf)] -// CHECK:STDOUT: %.loc7_3.34: @F.%.loc7_3.33 (%.ecf) = splice_inst %.loc7_3.32 [template = %.loc7_3.34 (constants.%.8b8)] +// CHECK:STDOUT: %.loc7_3.33: type = type_of_inst %.loc7_3.32 [template = %.loc7_3.33 (constants.%.99a)] +// CHECK:STDOUT: %.loc7_3.34: @F.%.loc7_3.33 (%.99a) = splice_inst %.loc7_3.32 [template = %.loc7_3.34 (constants.%.04f)] // CHECK:STDOUT: // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: @@ -724,18 +1255,36 @@ fn G() { F({}); } // CHECK:STDOUT: %v.patt.loc7_15.1: @F.%pattern_type (%pattern_type.6b2) = ref_binding_pattern v [template = %v.patt.loc7_15.2 (constants.%v.patt.404)] // CHECK:STDOUT: %v.var_patt.loc7_3.1: @F.%pattern_type (%pattern_type.6b2) = var_pattern %v.patt.loc7_15.1 [template = %v.var_patt.loc7_3.2 (constants.%v.var_patt.3f1)] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc7_3.11: type = type_of_inst %.loc7_3.29 [template = %.loc7_3.30 (constants.%.a04)] -// CHECK:STDOUT: %.loc7_3.12: @F.%.loc7_3.30 (%.a04) = splice_inst %.loc7_3.29 [template = %.loc7_3.31 (constants.%.84d)] -// CHECK:STDOUT: %.loc7_3.13: type = type_of_inst %.loc7_3.32 [template = %.loc7_3.33 (constants.%.ecf)] -// CHECK:STDOUT: %.loc7_3.14: @F.%.loc7_3.33 (%.ecf) = splice_inst %.loc7_3.32 [template = %.loc7_3.34 (constants.%.8b8)] +// CHECK:STDOUT: %.loc7_3.11: type = type_of_inst %.loc7_3.29 [template = %.loc7_3.30 (constants.%.ec4)] +// CHECK:STDOUT: %.loc7_3.12: @F.%.loc7_3.30 (%.ec4) = splice_inst %.loc7_3.29 [template = %.loc7_3.31 (constants.%.f75)] +// CHECK:STDOUT: %.loc7_3.13: type = type_of_inst %.loc7_3.32 [template = %.loc7_3.33 (constants.%.99a)] +// CHECK:STDOUT: %.loc7_3.14: @F.%.loc7_3.33 (%.99a) = splice_inst %.loc7_3.32 [template = %.loc7_3.34 (constants.%.04f)] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc7_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_3.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_3.2(%self.param: ref %C.d8efcc.1) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc7_3.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc7_3.2(%self.param: ref %C.d8efcc.1) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_3.2(%self.param: ref %C.d8efcc.1) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc7_3.2(%self.param: ref %C.d8efcc.1) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -772,7 +1321,7 @@ fn G() { F({}); } // CHECK:STDOUT: %.loc7_3.26 => constants.%.0f6 // CHECK:STDOUT: %.loc7_3.27 => constants.%.afa // CHECK:STDOUT: %.loc7_3.28 => constants.%.610 -// CHECK:STDOUT: %.loc7_3.29 => constants.%inst.splice_block.ff7 +// CHECK:STDOUT: %.loc7_3.29 => constants.%inst.splice_block.51d // CHECK:STDOUT: %.loc7_3.30 => // CHECK:STDOUT: %.loc7_3.31 => invalid // CHECK:STDOUT: %.loc7_3.32 => constants.%inst.call diff --git a/toolchain/check/testdata/class/field/field_access.carbon b/toolchain/check/testdata/class/field/field_access.carbon index 1c7d99e02d97..597d529a9332 100644 --- a/toolchain/check/testdata/class/field/field_access.carbon +++ b/toolchain/check/testdata/class/field/field_access.carbon @@ -91,10 +91,36 @@ fn Run() { // CHECK:STDOUT: %ck.patt: %pattern_type.6b6 = ref_binding_pattern ck [concrete] // CHECK:STDOUT: %ck.var_patt: %pattern_type.6b6 = var_pattern %ck.patt [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc25_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc25_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc25_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc25_3.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc25_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.d84: type = pattern_type %struct_type.j.k [concrete] +// CHECK:STDOUT: %self.param_patt.423: %pattern_type.d84 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.4a1: %pattern_type.d84 = wrapper_binding_pattern self, %self.param_patt.423 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc21_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc21_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.b2b: %pattern_type.f15 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.f19: %pattern_type.f15 = wrapper_binding_pattern self, %self.param_patt.b2b [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc21_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc21_3.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc21_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -120,6 +146,65 @@ fn Run() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc25_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc25_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc25_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc25_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc21_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.d84 = ref_param_pattern [concrete = constants.%self.param_patt.423] +// CHECK:STDOUT: %self.patt: %pattern_type.d84 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.4a1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.j.k = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.j.k = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc21_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.d84 = ref_param_pattern [concrete = constants.%self.param_patt.423] +// CHECK:STDOUT: %self.patt: %pattern_type.d84 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.4a1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.j.k = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.j.k = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc21_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f15 = ref_param_pattern [concrete = constants.%self.param_patt.b2b] +// CHECK:STDOUT: %self.patt: %pattern_type.f15 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.f19] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Class = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Class = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc21_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f15 = ref_param_pattern [concrete = constants.%self.param_patt.b2b] +// CHECK:STDOUT: %self.patt: %pattern_type.f15 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.f19] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Class = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Class = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -220,29 +305,65 @@ fn Run() { // CHECK:STDOUT: %ck.patt: %pattern_type.6b6 = ref_binding_pattern ck [concrete = constants.%ck.patt] // CHECK:STDOUT: %ck.var_patt: %pattern_type.6b6 = var_pattern %ck.patt [concrete = constants.%ck.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc25: = bound_method %ck.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc25: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc25(%ck.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc24: = bound_method %cj.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc24: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc24(%cj.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc21: = bound_method %c.var, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc21: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc21(%c.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc25: = bound_method %ck.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc25: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc25(%ck.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc24: = bound_method %cj.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc24: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc24(%cj.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc21: = bound_method %c.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc21: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc21(%c.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc25_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc25_3.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc25_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc25_3.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc25_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc21_3.1(%self.param: ref %struct_type.j.k) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc25_3.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc25_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc21_3.1(%self.param: ref %struct_type.j.k) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc21_3.2(%self.param: ref %Class) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc21_3.1(%self.param: ref %struct_type.j.k) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc21_3.1(%self.param: ref %struct_type.j.k) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc21_3.2(%self.param: ref %Class) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc21_3.2(%self.param: ref %Class) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc21_3.2(%self.param: ref %Class) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/field/field_access_in_value.carbon b/toolchain/check/testdata/class/field/field_access_in_value.carbon index 44d66241fd08..35c210c1fa8a 100644 --- a/toolchain/check/testdata/class/field/field_access_in_value.carbon +++ b/toolchain/check/testdata/class/field/field_access_in_value.carbon @@ -93,10 +93,36 @@ fn Test() { // CHECK:STDOUT: %ck.patt: %pattern_type.6b6 = ref_binding_pattern ck [concrete] // CHECK:STDOUT: %ck.var_patt: %pattern_type.6b6 = var_pattern %ck.patt [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc26_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc26_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc26_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc26_3.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc26_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.d84: type = pattern_type %struct_type.j.k [concrete] +// CHECK:STDOUT: %self.param_patt.423: %pattern_type.d84 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.4a1: %pattern_type.d84 = wrapper_binding_pattern self, %self.param_patt.423 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc21_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc21_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.b2b: %pattern_type.f15 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.f19: %pattern_type.f15 = wrapper_binding_pattern self, %self.param_patt.b2b [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc21_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc21_3.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc21_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -122,6 +148,65 @@ fn Test() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc26_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc26_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc26_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc26_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc21_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.d84 = ref_param_pattern [concrete = constants.%self.param_patt.423] +// CHECK:STDOUT: %self.patt: %pattern_type.d84 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.4a1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.j.k = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.j.k = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc21_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.d84 = ref_param_pattern [concrete = constants.%self.param_patt.423] +// CHECK:STDOUT: %self.patt: %pattern_type.d84 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.4a1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.j.k = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.j.k = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc21_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f15 = ref_param_pattern [concrete = constants.%self.param_patt.b2b] +// CHECK:STDOUT: %self.patt: %pattern_type.f15 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.f19] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Class = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Class = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc21_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f15 = ref_param_pattern [concrete = constants.%self.param_patt.b2b] +// CHECK:STDOUT: %self.patt: %pattern_type.f15 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.f19] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Class = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Class = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -229,29 +314,65 @@ fn Test() { // CHECK:STDOUT: %ck.patt: %pattern_type.6b6 = ref_binding_pattern ck [concrete = constants.%ck.patt] // CHECK:STDOUT: %ck.var_patt: %pattern_type.6b6 = var_pattern %ck.patt [concrete = constants.%ck.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc26: = bound_method %ck.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc26: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc26(%ck.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc25: = bound_method %cj.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc25: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc25(%cj.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc21: = bound_method %cv.var, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc21: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc21(%cv.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc26: = bound_method %ck.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc26: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc26(%ck.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc25: = bound_method %cj.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc25: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc25(%cj.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc21: = bound_method %cv.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc21: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc21(%cv.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc26_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc26_3.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc26_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc26_3.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc26_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc21_3.1(%self.param: ref %struct_type.j.k) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc26_3.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc26_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc21_3.1(%self.param: ref %struct_type.j.k) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc21_3.2(%self.param: ref %Class) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc21_3.1(%self.param: ref %struct_type.j.k) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc21_3.1(%self.param: ref %struct_type.j.k) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc21_3.2(%self.param: ref %Class) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc21_3.2(%self.param: ref %Class) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc21_3.2(%self.param: ref %Class) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/import.carbon b/toolchain/check/testdata/class/generic/import.carbon index 7e8c94bac5d1..4ddffff7d1f3 100644 --- a/toolchain/check/testdata/class/generic/import.carbon +++ b/toolchain/check/testdata/class/generic/import.carbon @@ -521,8 +521,34 @@ class Class(U: type) { // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] // CHECK:STDOUT: %CompleteClass.F.specific_fn: = specific_function %CompleteClass.F.623, @CompleteClass.F(%i32) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc6_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc6_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc6_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc6_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.b13: type = pattern_type %struct_type.n [concrete] +// CHECK:STDOUT: %self.param_patt.e77: %pattern_type.b13 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.b1b: %pattern_type.b13 = wrapper_binding_pattern self, %self.param_patt.e77 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc6_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc6_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.932: %pattern_type.97d = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.060: %pattern_type.97d = wrapper_binding_pattern self, %self.param_patt.932 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc6_3.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc6_3.4 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc6_3.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] // CHECK:STDOUT: %UseField.type: type = fn_type @UseField [concrete] // CHECK:STDOUT: %UseField: %UseField.type = struct_value () [concrete] // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] @@ -563,6 +589,65 @@ class Class(U: type) { // CHECK:STDOUT: %Copy.impl_witness_table.8d2 = impl_witness_table (%Core.import_ref.cd6), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc6_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc6_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc6_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc6_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc6_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b13 = ref_param_pattern [concrete = constants.%self.param_patt.e77] +// CHECK:STDOUT: %self.patt: %pattern_type.b13 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.b1b] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.n = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.n = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc6_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b13 = ref_param_pattern [concrete = constants.%self.param_patt.e77] +// CHECK:STDOUT: %self.patt: %pattern_type.b13 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.b1b] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.n = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.n = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc6_3.4 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.97d = ref_param_pattern [concrete = constants.%self.param_patt.932] +// CHECK:STDOUT: %self.patt: %pattern_type.97d = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.060] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %CompleteClass.d55 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %CompleteClass.d55 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc6_3.4 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.97d = ref_param_pattern [concrete = constants.%self.param_patt.932] +// CHECK:STDOUT: %self.patt: %pattern_type.97d = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.060] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %CompleteClass.d55 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %CompleteClass.d55 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Class = imports.%Main.Class @@ -636,8 +721,8 @@ class Class(U: type) { // CHECK:STDOUT: %F.ref.loc7: %CompleteClass.F.type.dac = name_ref F, %.loc7 [concrete = constants.%CompleteClass.F.623] // CHECK:STDOUT: %CompleteClass.F.specific_fn: = specific_function %F.ref.loc7, @CompleteClass.F(constants.%i32) [concrete = constants.%CompleteClass.F.specific_fn] // CHECK:STDOUT: %CompleteClass.F.call: init %i32 = call %CompleteClass.F.specific_fn() -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %v.var, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%v.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %v.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%v.var) // CHECK:STDOUT: return %CompleteClass.F.call // CHECK:STDOUT: } // CHECK:STDOUT: @@ -649,20 +734,56 @@ class Class(U: type) { // CHECK:STDOUT: // CHECK:STDOUT: fn @F [from "foo.carbon"]; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc6_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc6_3.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc6_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc6_3.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc6_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc6_3.3(%self.param: ref %struct_type.n) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc6_3.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc6_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc6_3.3(%self.param: ref %struct_type.n) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc6_3.4(%self.param: ref %CompleteClass.d55) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc6_3.3(%self.param: ref %struct_type.n) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc6_3.3(%self.param: ref %struct_type.n) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc6_3.4(%self.param: ref %CompleteClass.d55) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc6_3.4(%self.param: ref %CompleteClass.d55) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc6_3.4(%self.param: ref %CompleteClass.d55) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -692,8 +813,8 @@ class Class(U: type) { // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] // CHECK:STDOUT: %bound_method.loc12_11.2: = bound_method %.loc12_11.2, %specific_fn // CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc12_11.2(%.loc12_11.2) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %v.var, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%v.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %v.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%v.var) // CHECK:STDOUT: return %Int.as.Copy.impl.Op.call // CHECK:STDOUT: } // CHECK:STDOUT: @@ -745,6 +866,7 @@ class Class(U: type) { // CHECK:STDOUT: %CompleteClass.bae: type = class_type @CompleteClass, @CompleteClass(%T) [symbolic] // CHECK:STDOUT: %CompleteClass.F.type.4ea: type = fn_type @CompleteClass.F, @CompleteClass(%T) [symbolic] // CHECK:STDOUT: %CompleteClass.F.c7a: %CompleteClass.F.type.4ea = struct_value () [symbolic] +// CHECK:STDOUT: %pattern_type.6b6: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %CompleteClass.elem.c1f: type = unbound_element_type %CompleteClass.bae, %i32 [symbolic] // CHECK:STDOUT: %pattern_type.9a5: type = pattern_type type [concrete] // CHECK:STDOUT: %T.patt: %pattern_type.9a5 = symbolic_binding_pattern T, 0 [symbolic] @@ -765,8 +887,34 @@ class Class(U: type) { // CHECK:STDOUT: %ImplicitAs.type.0ff: type = generic_interface_type @ImplicitAs [concrete] // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.0ff = struct_value () [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc13_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc13_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc13_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc13_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.b13: type = pattern_type %struct_type.n [concrete] +// CHECK:STDOUT: %self.param_patt.e77: %pattern_type.b13 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.b1b: %pattern_type.b13 = wrapper_binding_pattern self, %self.param_patt.e77 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc13_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc13_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.404: %pattern_type.ff3 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.79e: %pattern_type.ff3 = wrapper_binding_pattern self, %self.param_patt.404 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc13_3.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc13_3.4 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc13_3.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -791,6 +939,65 @@ class Class(U: type) { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc13_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc13_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc13_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc13_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc13_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b13 = ref_param_pattern [concrete = constants.%self.param_patt.e77] +// CHECK:STDOUT: %self.patt: %pattern_type.b13 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.b1b] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.n = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.n = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc13_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b13 = ref_param_pattern [concrete = constants.%self.param_patt.e77] +// CHECK:STDOUT: %self.patt: %pattern_type.b13 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.b1b] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.n = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.n = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc13_3.4 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.ff3 = ref_param_pattern [concrete = constants.%self.param_patt.404] +// CHECK:STDOUT: %self.patt: %pattern_type.ff3 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.79e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %CompleteClass.22b = ref_param call_param0 +// CHECK:STDOUT: %self: ref %CompleteClass.22b = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc13_3.4 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.ff3 = ref_param_pattern [concrete = constants.%self.param_patt.404] +// CHECK:STDOUT: %self.patt: %pattern_type.ff3 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.79e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %CompleteClass.22b = ref_param call_param0 +// CHECK:STDOUT: %self: ref %CompleteClass.22b = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Class = imports.%Main.Class @@ -843,8 +1050,8 @@ class Class(U: type) { // CHECK:STDOUT: %v.patt: %pattern_type.ff3 = ref_binding_pattern v [concrete = constants.%v.patt] // CHECK:STDOUT: %v.var_patt: %pattern_type.ff3 = var_pattern %v.patt [concrete = constants.%v.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %v.var, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%v.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %v.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%v.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -856,20 +1063,56 @@ class Class(U: type) { // CHECK:STDOUT: // CHECK:STDOUT: fn @F [from "foo.carbon"]; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc13_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc13_3.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc13_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc13_3.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc13_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc13_3.3(%self.param: ref %struct_type.n) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc13_3.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc13_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc13_3.3(%self.param: ref %struct_type.n) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc13_3.4(%self.param: ref %CompleteClass.22b) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc13_3.3(%self.param: ref %struct_type.n) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc13_3.3(%self.param: ref %struct_type.n) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc13_3.4(%self.param: ref %CompleteClass.22b) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc13_3.4(%self.param: ref %CompleteClass.22b) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc13_3.4(%self.param: ref %CompleteClass.22b) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/init.carbon b/toolchain/check/testdata/class/generic/init.carbon index 82c02b8ddd9b..97213f94897a 100644 --- a/toolchain/check/testdata/class/generic/init.carbon +++ b/toolchain/check/testdata/class/generic/init.carbon @@ -100,10 +100,10 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %specific_impl_fn.be5: = specific_impl_function %impl.elem0.170, @Copy.WithSelf.Op(%Copy.facet.3f0) [symbolic] // CHECK:STDOUT: %Destroy.lookup_impl_witness.62e: = lookup_impl_witness %Class.55b, @Destroy [symbolic] // CHECK:STDOUT: %Destroy.facet.25e: %Destroy.type = facet_value %Class.55b, (%Destroy.lookup_impl_witness.62e) [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.d76: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Destroy.facet.25e) [symbolic] -// CHECK:STDOUT: %.0da: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.d76, %Destroy.facet.25e [symbolic] -// CHECK:STDOUT: %impl.elem0.730: %.0da = impl_witness_access %Destroy.lookup_impl_witness.62e, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.fa9: = specific_impl_function %impl.elem0.730, @Destroy.WithSelf.Op.1(%Destroy.facet.25e) [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.94e: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.25e) [symbolic] +// CHECK:STDOUT: %.761: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.94e, %Destroy.facet.25e [symbolic] +// CHECK:STDOUT: %impl.elem2: %.761 = impl_witness_access %Destroy.lookup_impl_witness.62e, element2 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.d33: = specific_impl_function %impl.elem2, @Destroy.WithSelf.SelfDestruct.1(%Destroy.facet.25e) [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] @@ -118,16 +118,29 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %InitFromStructSpecific.type: type = fn_type @InitFromStructSpecific [concrete] // CHECK:STDOUT: %InitFromStructSpecific: %InitFromStructSpecific.type = struct_value () [concrete] // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc15_19.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc15_19.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc15_19.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc15_19.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.6c4ec3.2: = custom_witness (%Destroy.WithSelf.Op.403171.2), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.6de: %Destroy.type = facet_value %i32, (%custom_witness.6c4ec3.2) [concrete] -// CHECK:STDOUT: %Class.a90: type = class_type @Class, @Class(%Destroy.facet.6de) [concrete] -// CHECK:STDOUT: %Class.elem.2e7: type = unbound_element_type %Class.a90, %i32 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc15_19.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f8f19d.2: = custom_witness (%Destroy.WithSelf.Op.403171.2, %Destroy.WithSelf.SubobjectDestroy.d01daf.2, %Destroy.WithSelf.SelfDestruct.db3fdb.2), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.b41: %Destroy.type = facet_value %i32, (%custom_witness.f8f19d.2) [concrete] +// CHECK:STDOUT: %Class.58f: type = class_type @Class, @Class(%Destroy.facet.b41) [concrete] +// CHECK:STDOUT: %Class.elem.33c: type = unbound_element_type %Class.58f, %i32 [concrete] // CHECK:STDOUT: %struct_type.k.e7c: type = struct_type {.k: %i32} [concrete] -// CHECK:STDOUT: %pattern_type.d45: type = pattern_type %Class.a90 [concrete] -// CHECK:STDOUT: %v.patt.130: %pattern_type.d45 = ref_binding_pattern v [concrete] -// CHECK:STDOUT: %v.var_patt.9b5: %pattern_type.d45 = var_pattern %v.patt.130 [concrete] +// CHECK:STDOUT: %pattern_type.160: type = pattern_type %Class.58f [concrete] +// CHECK:STDOUT: %v.patt.62e: %pattern_type.160 = ref_binding_pattern v [concrete] +// CHECK:STDOUT: %v.var_patt.c46: %pattern_type.160 = var_pattern %v.patt.62e [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.type.ac8: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] // CHECK:STDOUT: %Int.as.Copy.impl.Op.5e0: %Int.as.Copy.impl.Op.type.ac8 = struct_value () [symbolic] // CHECK:STDOUT: %Copy.impl_witness.b51: = impl_witness imports.%Copy.impl_witness_table.8d2, @Int.as.Copy.impl(%int_32) [concrete] @@ -137,8 +150,21 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %Copy.WithSelf.Op.type.381: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet.1e1) [concrete] // CHECK:STDOUT: %.737: type = fn_type_with_self_type %Copy.WithSelf.Op.type.381, %Copy.facet.1e1 [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.4f6, @Int.as.Copy.impl.Op(%int_32) [concrete] +// CHECK:STDOUT: %pattern_type.cec: type = pattern_type %struct_type.k.e7c [concrete] +// CHECK:STDOUT: %self.param_patt.c92: %pattern_type.cec = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.1bc: %pattern_type.cec = wrapper_binding_pattern self, %self.param_patt.c92 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc15_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc15_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.036: %pattern_type.160 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.48f: %pattern_type.160 = wrapper_binding_pattern self, %self.param_patt.036 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc15_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc15_3.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc15_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -160,6 +186,65 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %Copy.impl_witness_table.8d2 = impl_witness_table (%Core.import_ref.cd6), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc15_19.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc15_19.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc15_19.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc15_19.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc15_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cec = ref_param_pattern [concrete = constants.%self.param_patt.c92] +// CHECK:STDOUT: %self.patt: %pattern_type.cec = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.1bc] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.k.e7c = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.k.e7c = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc15_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cec = ref_param_pattern [concrete = constants.%self.param_patt.c92] +// CHECK:STDOUT: %self.patt: %pattern_type.cec = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.1bc] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.k.e7c = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.k.e7c = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc15_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.160 = ref_param_pattern [concrete = constants.%self.param_patt.036] +// CHECK:STDOUT: %self.patt: %pattern_type.160 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.48f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Class.58f = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Class.58f = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc15_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.160 = ref_param_pattern [concrete = constants.%self.param_patt.036] +// CHECK:STDOUT: %self.patt: %pattern_type.160 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.48f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Class.58f = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Class.58f = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: %InitFromStructGeneric.decl: %InitFromStructGeneric.type = fn_decl @InitFromStructGeneric [concrete = constants.%InitFromStructGeneric] { // CHECK:STDOUT: %T.patt.loc9_35.1: %pattern_type.709 = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc9_35.2 (constants.%T.patt.478)] @@ -241,10 +326,10 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class.loc10_17.2, %T.as_type.loc9_66.1 [symbolic = %Class.elem (constants.%Class.elem.b97)] // CHECK:STDOUT: %Destroy.lookup_impl_witness.loc10_3: = lookup_impl_witness %Class.loc10_17.2, @Destroy [symbolic = %Destroy.lookup_impl_witness.loc10_3 (constants.%Destroy.lookup_impl_witness.62e)] // CHECK:STDOUT: %Destroy.facet.loc10_3.3: %Destroy.type = facet_value %Class.loc10_17.2, (%Destroy.lookup_impl_witness.loc10_3) [symbolic = %Destroy.facet.loc10_3.3 (constants.%Destroy.facet.25e)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Destroy.facet.loc10_3.3) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.d76)] -// CHECK:STDOUT: %.loc10_3.4: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet.loc10_3.3 [symbolic = %.loc10_3.4 (constants.%.0da)] -// CHECK:STDOUT: %impl.elem0.loc10_3.2: @InitFromStructGeneric.%.loc10_3.4 (%.0da) = impl_witness_access %Destroy.lookup_impl_witness.loc10_3, element0 [symbolic = %impl.elem0.loc10_3.2 (constants.%impl.elem0.730)] -// CHECK:STDOUT: %specific_impl_fn.loc10_3.2: = specific_impl_function %impl.elem0.loc10_3.2, @Destroy.WithSelf.Op.1(%Destroy.facet.loc10_3.3) [symbolic = %specific_impl_fn.loc10_3.2 (constants.%specific_impl_fn.fa9)] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.loc10_3.3) [symbolic = %Destroy.WithSelf.SelfDestruct.type (constants.%Destroy.WithSelf.SelfDestruct.type.94e)] +// CHECK:STDOUT: %.loc10_3.4: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type, %Destroy.facet.loc10_3.3 [symbolic = %.loc10_3.4 (constants.%.761)] +// CHECK:STDOUT: %impl.elem2.loc10_3.2: @InitFromStructGeneric.%.loc10_3.4 (%.761) = impl_witness_access %Destroy.lookup_impl_witness.loc10_3, element2 [symbolic = %impl.elem2.loc10_3.2 (constants.%impl.elem2)] +// CHECK:STDOUT: %specific_impl_fn.loc10_3.2: = specific_impl_function %impl.elem2.loc10_3.2, @Destroy.WithSelf.SelfDestruct.1(%Destroy.facet.loc10_3.3) [symbolic = %specific_impl_fn.loc10_3.2 (constants.%specific_impl_fn.d33)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%x.param: @InitFromStructGeneric.%T.as_type.loc9_66.1 (%T.as_type.74b)) -> out %return.param: @InitFromStructGeneric.%T.as_type.loc9_66.1 (%T.as_type.74b) { // CHECK:STDOUT: !entry: @@ -292,22 +377,22 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %bound_method.loc11_11.2: = bound_method %.loc11_11.2, %specific_impl_fn.loc11 // CHECK:STDOUT: %.loc9_72.1: ref @InitFromStructGeneric.%T.as_type.loc9_66.1 (%T.as_type.74b) = splice_block %return.param {} // CHECK:STDOUT: %Copy.WithSelf.Op.call.loc11: init @InitFromStructGeneric.%T.as_type.loc9_66.1 (%T.as_type.74b) to %.loc9_72.1 = call %bound_method.loc11_11.2(%.loc11_11.2) -// CHECK:STDOUT: %impl.elem0.loc10_3.1: @InitFromStructGeneric.%.loc10_3.4 (%.0da) = impl_witness_access constants.%Destroy.lookup_impl_witness.62e, element0 [symbolic = %impl.elem0.loc10_3.2 (constants.%impl.elem0.730)] -// CHECK:STDOUT: %bound_method.loc10_3.1: = bound_method %v.var, %impl.elem0.loc10_3.1 +// CHECK:STDOUT: %impl.elem2.loc10_3.1: @InitFromStructGeneric.%.loc10_3.4 (%.761) = impl_witness_access constants.%Destroy.lookup_impl_witness.62e, element2 [symbolic = %impl.elem2.loc10_3.2 (constants.%impl.elem2)] +// CHECK:STDOUT: %bound_method.loc10_3.1: = bound_method %v.var, %impl.elem2.loc10_3.1 // CHECK:STDOUT: %Destroy.facet.loc10_3.1: %Destroy.type = facet_value constants.%Class.55b, (constants.%Destroy.lookup_impl_witness.62e) [symbolic = %Destroy.facet.loc10_3.3 (constants.%Destroy.facet.25e)] // CHECK:STDOUT: %.loc10_3.2: %Destroy.type = converted constants.%Class.55b, %Destroy.facet.loc10_3.1 [symbolic = %Destroy.facet.loc10_3.3 (constants.%Destroy.facet.25e)] // CHECK:STDOUT: %Destroy.facet.loc10_3.2: %Destroy.type = facet_value constants.%Class.55b, (constants.%Destroy.lookup_impl_witness.62e) [symbolic = %Destroy.facet.loc10_3.3 (constants.%Destroy.facet.25e)] // CHECK:STDOUT: %.loc10_3.3: %Destroy.type = converted constants.%Class.55b, %Destroy.facet.loc10_3.2 [symbolic = %Destroy.facet.loc10_3.3 (constants.%Destroy.facet.25e)] -// CHECK:STDOUT: %specific_impl_fn.loc10_3.1: = specific_impl_function %impl.elem0.loc10_3.1, @Destroy.WithSelf.Op.1(constants.%Destroy.facet.25e) [symbolic = %specific_impl_fn.loc10_3.2 (constants.%specific_impl_fn.fa9)] +// CHECK:STDOUT: %specific_impl_fn.loc10_3.1: = specific_impl_function %impl.elem2.loc10_3.1, @Destroy.WithSelf.SelfDestruct.1(constants.%Destroy.facet.25e) [symbolic = %specific_impl_fn.loc10_3.2 (constants.%specific_impl_fn.d33)] // CHECK:STDOUT: %bound_method.loc10_3.2: = bound_method %v.var, %specific_impl_fn.loc10_3.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc10_3.2(%v.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %bound_method.loc10_3.2(%v.var) // CHECK:STDOUT: return %Copy.WithSelf.Op.call.loc11 to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @InitFromStructSpecific(%x.param: %i32) -> out %return.param: %i32 { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %v.var: ref %Class.a90 = var_storage %v.var_patt +// CHECK:STDOUT: %v.var: ref %Class.58f = var_storage %v.var_patt // CHECK:STDOUT: %x.ref: %i32 = name_ref x, %x // CHECK:STDOUT: %.loc15_30.1: %struct_type.k.e7c = struct_literal (%x.ref) // CHECK:STDOUT: %impl.elem0.loc15: %.737 = impl_witness_access constants.%Copy.impl_witness.b51, element0 [concrete = constants.%Int.as.Copy.impl.Op.4f6] @@ -317,23 +402,23 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc15: init %i32 = call %bound_method.loc15_29.2(%x.ref) // CHECK:STDOUT: %.loc15_30.2: ref %i32 = class_element_access %v.var, element0 // CHECK:STDOUT: %.loc15_30.3: init %i32 to %.loc15_30.2 = in_place_init %Int.as.Copy.impl.Op.call.loc15 -// CHECK:STDOUT: %.loc15_30.4: init %Class.a90 to %v.var = class_init (%.loc15_30.3) -// CHECK:STDOUT: %.loc15_3: init %Class.a90 = converted %.loc15_30.1, %.loc15_30.4 +// CHECK:STDOUT: %.loc15_30.4: init %Class.58f to %v.var = class_init (%.loc15_30.3) +// CHECK:STDOUT: %.loc15_3: init %Class.58f = converted %.loc15_30.1, %.loc15_30.4 // CHECK:STDOUT: assign %v.var, %.loc15_3 -// CHECK:STDOUT: %.loc15_19.1: type = splice_block %Class [concrete = constants.%Class.a90] { +// CHECK:STDOUT: %.loc15_19.1: type = splice_block %Class [concrete = constants.%Class.58f] { // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [concrete = constants.%Class.generic] // CHECK:STDOUT: %i32.loc15: type = type_literal constants.%i32 [concrete = constants.%i32] -// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %i32.loc15, (constants.%custom_witness.6c4ec3.2) [concrete = constants.%Destroy.facet.6de] -// CHECK:STDOUT: %.loc15_19.2: %Destroy.type = converted %i32.loc15, %Destroy.facet [concrete = constants.%Destroy.facet.6de] -// CHECK:STDOUT: %Class: type = class_type @Class, @Class(constants.%Destroy.facet.6de) [concrete = constants.%Class.a90] +// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %i32.loc15, (constants.%custom_witness.f8f19d.2) [concrete = constants.%Destroy.facet.b41] +// CHECK:STDOUT: %.loc15_19.2: %Destroy.type = converted %i32.loc15, %Destroy.facet [concrete = constants.%Destroy.facet.b41] +// CHECK:STDOUT: %Class: type = class_type @Class, @Class(constants.%Destroy.facet.b41) [concrete = constants.%Class.58f] // CHECK:STDOUT: } -// CHECK:STDOUT: %v: ref %Class.a90 = wrapper_binding v, %v.var +// CHECK:STDOUT: %v: ref %Class.58f = wrapper_binding v, %v.var // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %v.patt: %pattern_type.d45 = ref_binding_pattern v [concrete = constants.%v.patt.130] -// CHECK:STDOUT: %v.var_patt: %pattern_type.d45 = var_pattern %v.patt [concrete = constants.%v.var_patt.9b5] +// CHECK:STDOUT: %v.patt: %pattern_type.160 = ref_binding_pattern v [concrete = constants.%v.patt.62e] +// CHECK:STDOUT: %v.var_patt: %pattern_type.160 = var_pattern %v.patt [concrete = constants.%v.var_patt.c46] // CHECK:STDOUT: } -// CHECK:STDOUT: %v.ref: ref %Class.a90 = name_ref v, %v -// CHECK:STDOUT: %k.ref: %Class.elem.2e7 = name_ref k, @Class.%field_decl [concrete = @Class.%field_decl] +// CHECK:STDOUT: %v.ref: ref %Class.58f = name_ref v, %v +// CHECK:STDOUT: %k.ref: %Class.elem.33c = name_ref k, @Class.%field_decl [concrete = @Class.%field_decl] // CHECK:STDOUT: %.loc16_11.1: ref %i32 = class_element_access %v.ref, element0 // CHECK:STDOUT: %.loc16_11.2: %i32 = acquire_value %.loc16_11.1 // CHECK:STDOUT: %impl.elem0.loc16: %.737 = impl_witness_access constants.%Copy.impl_witness.b51, element0 [concrete = constants.%Int.as.Copy.impl.Op.4f6] @@ -341,25 +426,61 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %specific_fn.loc16: = specific_function %impl.elem0.loc16, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] // CHECK:STDOUT: %bound_method.loc16_11.2: = bound_method %.loc16_11.2, %specific_fn.loc16 // CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc16: init %i32 = call %bound_method.loc16_11.2(%.loc16_11.2) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %v.var, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%v.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %v.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%v.var) // CHECK:STDOUT: return %Int.as.Copy.impl.Op.call.loc16 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc15_19.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc15_19.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc15_19.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc15_19.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc15_19.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc15_3.1(%self.param: ref %struct_type.k.e7c) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc15_19.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc15_19.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc15_3.1(%self.param: ref %struct_type.k.e7c) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc15_3.2(%self.param: ref %Class.a90) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc15_3.1(%self.param: ref %struct_type.k.e7c) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc15_3.1(%self.param: ref %struct_type.k.e7c) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc15_3.2(%self.param: ref %Class.58f) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc15_3.2(%self.param: ref %Class.58f) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc15_3.2(%self.param: ref %Class.58f) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/member_type.carbon b/toolchain/check/testdata/class/generic/member_type.carbon index 3c62fd9e900d..7ab6de0529a7 100644 --- a/toolchain/check/testdata/class/generic/member_type.carbon +++ b/toolchain/check/testdata/class/generic/member_type.carbon @@ -151,8 +151,34 @@ fn Test() -> i32 { // CHECK:STDOUT: %.737: type = fn_type_with_self_type %Copy.WithSelf.Op.type.381, %Copy.facet.1e1 [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.4f6, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc13_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc13_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc13_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc13_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.b13: type = pattern_type %struct_type.n.9ed [concrete] +// CHECK:STDOUT: %self.param_patt.e77: %pattern_type.b13 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.b1b: %pattern_type.b13 = wrapper_binding_pattern self, %self.param_patt.e77 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc13_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc13_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.065: %pattern_type.4f49 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.4c1: %pattern_type.4f49 = wrapper_binding_pattern self, %self.param_patt.065 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc13_3.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc13_3.4 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc13_3.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -176,6 +202,65 @@ fn Test() -> i32 { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc13_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc13_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc13_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc13_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc13_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b13 = ref_param_pattern [concrete = constants.%self.param_patt.e77] +// CHECK:STDOUT: %self.patt: %pattern_type.b13 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.b1b] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.n.9ed = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.n.9ed = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc13_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b13 = ref_param_pattern [concrete = constants.%self.param_patt.e77] +// CHECK:STDOUT: %self.patt: %pattern_type.b13 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.b1b] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.n.9ed = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.n.9ed = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc13_3.4 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.4f49 = ref_param_pattern [concrete = constants.%self.param_patt.065] +// CHECK:STDOUT: %self.patt: %pattern_type.4f49 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.4c1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Inner.84a = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Inner.84a = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc13_3.4 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.4f49 = ref_param_pattern [concrete = constants.%self.param_patt.065] +// CHECK:STDOUT: %self.patt: %pattern_type.4f49 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.4c1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Inner.84a = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Inner.84a = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -361,25 +446,61 @@ fn Test() -> i32 { // CHECK:STDOUT: %specific_fn.loc14: = specific_function %impl.elem0.loc14, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] // CHECK:STDOUT: %bound_method.loc14_11.2: = bound_method %.loc14_11.2, %specific_fn.loc14 // CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc14_11.2(%.loc14_11.2) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %c.var, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%c.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %c.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%c.var) // CHECK:STDOUT: return %Int.as.Copy.impl.Op.call // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc13_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc13_3.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc13_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc13_3.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc13_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc13_3.3(%self.param: ref %struct_type.n.9ed) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc13_3.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc13_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc13_3.3(%self.param: ref %struct_type.n.9ed) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc13_3.4(%self.param: ref %Inner.84a) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc13_3.3(%self.param: ref %struct_type.n.9ed) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc13_3.3(%self.param: ref %struct_type.n.9ed) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc13_3.4(%self.param: ref %Inner.84a) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc13_3.4(%self.param: ref %Inner.84a) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc13_3.4(%self.param: ref %Inner.84a) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -509,8 +630,8 @@ fn Test() -> i32 { // CHECK:STDOUT: %Inner.WithSelf.F.type.26a: type = fn_type @Inner.WithSelf.F, @Inner.WithSelf(%T, %Inner.facet.8ef) [symbolic] // CHECK:STDOUT: %Inner.WithSelf.F.3e0: %Inner.WithSelf.F.type.26a = struct_value () [symbolic] // CHECK:STDOUT: %.35d: type = fn_type_with_self_type %Inner.WithSelf.F.type.26a, %Inner.facet.8ef [symbolic] -// CHECK:STDOUT: %impl.elem0: %.35d = impl_witness_access %Inner.lookup_impl_witness, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn: = specific_impl_function %impl.elem0, @Inner.WithSelf.F(%T, %Inner.facet.8ef) [symbolic] +// CHECK:STDOUT: %impl.elem0.f16: %.35d = impl_witness_access %Inner.lookup_impl_witness, element0 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.ddc: = specific_impl_function %impl.elem0.f16, @Inner.WithSelf.F(%T, %Inner.facet.8ef) [symbolic] // CHECK:STDOUT: %D: type = class_type @D [concrete] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] @@ -561,8 +682,21 @@ fn Test() -> i32 { // CHECK:STDOUT: %self.patt.2f9: %pattern_type.9d0 = wrapper_binding_pattern self, %self.param_patt.edf [concrete] // CHECK:STDOUT: %C.as.Inner.impl.F.specific_fn: = specific_function %C.as.Inner.impl.F.e77, @C.as.Inner.impl.F(%i32) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc23_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc23_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.348: %pattern_type.9d0 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.a42: %pattern_type.9d0 = wrapper_binding_pattern self, %self.param_patt.348 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc23_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc23_3.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc23_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -576,6 +710,37 @@ fn Test() -> i32 { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc23_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc23_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc23_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.9d0 = ref_param_pattern [concrete = constants.%self.param_patt.348] +// CHECK:STDOUT: %self.patt: %pattern_type.9d0 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a42] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C.b7f = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C.b7f = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc23_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.9d0 = ref_param_pattern [concrete = constants.%self.param_patt.348] +// CHECK:STDOUT: %self.patt: %pattern_type.9d0 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a42] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C.b7f = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C.b7f = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -820,8 +985,8 @@ fn Test() -> i32 { // CHECK:STDOUT: %Inner.facet: @C.as.Inner.impl.F.%Inner.type (%Inner.type.84b) = facet_value %C, (%Inner.lookup_impl_witness) [symbolic = %Inner.facet (constants.%Inner.facet.8ef)] // CHECK:STDOUT: %Inner.WithSelf.F.type: type = fn_type @Inner.WithSelf.F, @Inner.WithSelf(%T, %Inner.facet) [symbolic = %Inner.WithSelf.F.type (constants.%Inner.WithSelf.F.type.26a)] // CHECK:STDOUT: %.loc11_39.2: type = fn_type_with_self_type %Inner.WithSelf.F.type, %Inner.facet [symbolic = %.loc11_39.2 (constants.%.35d)] -// CHECK:STDOUT: %impl.elem0.loc11_39.2: @C.as.Inner.impl.F.%.loc11_39.2 (%.35d) = impl_witness_access %Inner.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc11_39.2 (constants.%impl.elem0)] -// CHECK:STDOUT: %specific_impl_fn.loc11_39.2: = specific_impl_function %impl.elem0.loc11_39.2, @Inner.WithSelf.F(%T, %Inner.facet) [symbolic = %specific_impl_fn.loc11_39.2 (constants.%specific_impl_fn)] +// CHECK:STDOUT: %impl.elem0.loc11_39.2: @C.as.Inner.impl.F.%.loc11_39.2 (%.35d) = impl_witness_access %Inner.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc11_39.2 (constants.%impl.elem0.f16)] +// CHECK:STDOUT: %specific_impl_fn.loc11_39.2: = specific_impl_function %impl.elem0.loc11_39.2, @Inner.WithSelf.F(%T, %Inner.facet) [symbolic = %specific_impl_fn.loc11_39.2 (constants.%specific_impl_fn.ddc)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%self.param: @C.as.Inner.impl.F.%C (%C.7d7)) -> out %return.param: @C.as.Inner.impl.F.%T (%T) { // CHECK:STDOUT: !entry: @@ -830,9 +995,9 @@ fn Test() -> i32 { // CHECK:STDOUT: %Inner.ref: type = name_ref Inner, %.loc11_41 [symbolic = %Inner.type (constants.%Inner.type.84b)] // CHECK:STDOUT: %.loc11_46: @C.as.Inner.impl.F.%Inner.assoc_type (%Inner.assoc_type.b6b) = specific_constant @Inner.WithSelf.%assoc0.loc6_20.1, @Inner.WithSelf(constants.%T, constants.%Self.656) [symbolic = %assoc0 (constants.%assoc0.6dc)] // CHECK:STDOUT: %F.ref: @C.as.Inner.impl.F.%Inner.assoc_type (%Inner.assoc_type.b6b) = name_ref F, %.loc11_46 [symbolic = %assoc0 (constants.%assoc0.6dc)] -// CHECK:STDOUT: %impl.elem0.loc11_39.1: @C.as.Inner.impl.F.%.loc11_39.2 (%.35d) = impl_witness_access constants.%Inner.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc11_39.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %impl.elem0.loc11_39.1: @C.as.Inner.impl.F.%.loc11_39.2 (%.35d) = impl_witness_access constants.%Inner.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc11_39.2 (constants.%impl.elem0.f16)] // CHECK:STDOUT: %bound_method.loc11_39: = bound_method %self.ref, %impl.elem0.loc11_39.1 -// CHECK:STDOUT: %specific_impl_fn.loc11_39.1: = specific_impl_function %impl.elem0.loc11_39.1, @Inner.WithSelf.F(constants.%T, constants.%Inner.facet.8ef) [symbolic = %specific_impl_fn.loc11_39.2 (constants.%specific_impl_fn)] +// CHECK:STDOUT: %specific_impl_fn.loc11_39.1: = specific_impl_function %impl.elem0.loc11_39.1, @Inner.WithSelf.F(constants.%T, constants.%Inner.facet.8ef) [symbolic = %specific_impl_fn.loc11_39.2 (constants.%specific_impl_fn.ddc)] // CHECK:STDOUT: %bound_method.loc11_50: = bound_method %self.ref, %specific_impl_fn.loc11_39.1 // CHECK:STDOUT: %.loc11_24.1: ref @C.as.Inner.impl.F.%T (%T) = splice_block %return.param {} // CHECK:STDOUT: %Inner.WithSelf.F.call: init @C.as.Inner.impl.F.%T (%T) to %.loc11_24.1 = call %bound_method.loc11_50(%self.ref) @@ -875,15 +1040,33 @@ fn Test() -> i32 { // CHECK:STDOUT: %bound_method.loc24_33: = bound_method %c.ref, %specific_fn // CHECK:STDOUT: %.loc24_10: %C.b7f = acquire_value %c.ref // CHECK:STDOUT: %C.as.Inner.impl.F.call: init %i32 = call %bound_method.loc24_33(%.loc24_10) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %c.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%c.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %c.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%c.var) // CHECK:STDOUT: return %C.as.Inner.impl.F.call // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc23_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc23_3.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc23_3.2(%self.param: ref %C.b7f) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc23_3.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc23_3.2(%self.param: ref %C.b7f) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc23_3.2(%self.param: ref %C.b7f) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc23_3.2(%self.param: ref %C.b7f) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/method_deduce.carbon b/toolchain/check/testdata/class/generic/method_deduce.carbon index 8f663c772cf3..cd4cd403e4f4 100644 --- a/toolchain/check/testdata/class/generic/method_deduce.carbon +++ b/toolchain/check/testdata/class/generic/method_deduce.carbon @@ -117,9 +117,22 @@ fn CallMethodSelfDeduce(c: Class(A)) -> A { // CHECK:STDOUT: %A.val: %A = struct_value () [concrete] // CHECK:STDOUT: %.367: ref %A = temporary invalid, %A.val [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc29_25.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc29_25.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.8fb: %pattern_type.9ef = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.e64: %pattern_type.9ef = wrapper_binding_pattern self, %self.param_patt.8fb [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc29_25.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc29_25.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.367, %Destroy.WithSelf.Op.403171.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc29_25.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.367, %Destroy.WithSelf.SelfDestruct.db3fdb.2 [concrete] // CHECK:STDOUT: %.cbf: Core.Form = init_form %A [concrete] // CHECK:STDOUT: %return.param_patt.f0c: %pattern_type.9ef = out_param_pattern [concrete] // CHECK:STDOUT: %return.patt.a6d: %pattern_type.9ef = return_slot_pattern %return.param_patt.f0c, %A [concrete] @@ -140,6 +153,37 @@ fn CallMethodSelfDeduce(c: Class(A)) -> A { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc29_25.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc29_25.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc29_25.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.9ef = ref_param_pattern [concrete = constants.%self.param_patt.8fb] +// CHECK:STDOUT: %self.patt: %pattern_type.9ef = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.e64] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %A = ref_param call_param0 +// CHECK:STDOUT: %self: ref %A = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc29_25.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.9ef = ref_param_pattern [concrete = constants.%self.param_patt.8fb] +// CHECK:STDOUT: %self.patt: %pattern_type.9ef = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.e64] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %A = ref_param call_param0 +// CHECK:STDOUT: %self: ref %A = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -452,14 +496,32 @@ fn CallMethodSelfDeduce(c: Class(A)) -> A { // CHECK:STDOUT: %.loc29_25.5: ref %A = temporary %.loc29_25.2, %.loc29_25.4 [concrete = constants.%.367] // CHECK:STDOUT: %.loc29_25.6: %A = acquire_value %.loc29_25.5 [concrete = constants.%A.val] // CHECK:STDOUT: %Class.GetNoDeduce.call: init %tuple.type.1e7 to %.loc28_62.1 = call %Class.GetNoDeduce.specific_fn(%.loc29_25.6) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.367) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.367) // CHECK:STDOUT: return %Class.GetNoDeduce.call to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc29_25.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc29_25.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc29_25.2(%self.param: ref %A) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc29_25.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc29_25.2(%self.param: ref %A) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc29_25.2(%self.param: ref %A) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc29_25.2(%self.param: ref %A) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/self.carbon b/toolchain/check/testdata/class/generic/self.carbon index b8a007c9d91a..ab1a893a4113 100644 --- a/toolchain/check/testdata/class/generic/self.carbon +++ b/toolchain/check/testdata/class/generic/self.carbon @@ -48,7 +48,7 @@ class Class(T: type) { // CHECK:STDOUT: %Class.F: %Class.F.type = struct_value () [symbolic] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] -// CHECK:STDOUT: %require_complete: = require_complete_type %Class [symbolic] +// CHECK:STDOUT: %require_complete.4d9: = require_complete_type %Class [symbolic] // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete] // CHECK:STDOUT: %Class.val: %Class = struct_value () [symbolic] // CHECK:STDOUT: %c.patt: %pattern_type.36e = ref_binding_pattern c [symbolic] @@ -58,12 +58,19 @@ class Class(T: type) { // CHECK:STDOUT: %s.var_patt: %pattern_type.36e = var_pattern %s.patt [symbolic] // CHECK:STDOUT: %Class.MakeClass.specific_fn: = specific_function %Class.MakeClass, @Class.MakeClass(%T) [symbolic] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %Class, @Destroy [symbolic] -// CHECK:STDOUT: %Destroy.facet.86d: %Destroy.type = facet_value %Class, (%Destroy.lookup_impl_witness) [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.297: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Destroy.facet.86d) [symbolic] -// CHECK:STDOUT: %.73f: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.297, %Destroy.facet.86d [symbolic] -// CHECK:STDOUT: %impl.elem0: %.73f = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn: = specific_impl_function %impl.elem0, @Destroy.WithSelf.Op.1(%Destroy.facet.86d) [symbolic] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.loc22 [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.loc22 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.lookup_impl_witness.7d7: = lookup_impl_witness %Class, @Destroy [symbolic] +// CHECK:STDOUT: %Destroy.facet.86d: %Destroy.type = facet_value %Class, (%Destroy.lookup_impl_witness.7d7) [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.6db: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.86d) [symbolic] +// CHECK:STDOUT: %.ea9: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.6db, %Destroy.facet.86d [symbolic] +// CHECK:STDOUT: %impl.elem2: %.ea9 = impl_witness_access %Destroy.lookup_impl_witness.7d7, element2 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.c7c: = specific_impl_function %impl.elem2, @Destroy.WithSelf.SelfDestruct.1(%Destroy.facet.86d) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -75,6 +82,23 @@ class Class(T: type) { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl: %Destroy.WithSelf.SubobjectDestroy.type.dfc = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc22 [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.loc22 [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: } { +// 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -149,7 +173,7 @@ class Class(T: type) { // CHECK:STDOUT: %return.patt.loc18_17.2: @Class.MakeSelf.%pattern_type (%pattern_type.36e) = return_slot_pattern %return.param_patt.loc18_20.2, %Class [symbolic = %return.patt.loc18_17.2 (constants.%return.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %Class [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type %Class [symbolic = %require_complete (constants.%require_complete.4d9)] // CHECK:STDOUT: %Class.val: @Class.MakeSelf.%Class (%Class) = struct_value () [symbolic = %Class.val (constants.%Class.val)] // CHECK:STDOUT: // CHECK:STDOUT: fn() -> out %return.param: @Class.MakeSelf.%Class (%Class) { @@ -170,7 +194,7 @@ class Class(T: type) { // CHECK:STDOUT: %return.patt.loc19_18.2: @Class.MakeClass.%pattern_type (%pattern_type.36e) = return_slot_pattern %return.param_patt.loc19_28.2, %Class.loc19_28.1 [symbolic = %return.patt.loc19_18.2 (constants.%return.patt)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %Class.loc19_28.1 [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type %Class.loc19_28.1 [symbolic = %require_complete (constants.%require_complete.4d9)] // CHECK:STDOUT: %Class.val: @Class.MakeClass.%Class.loc19_28.1 (%Class) = struct_value () [symbolic = %Class.val (constants.%Class.val)] // CHECK:STDOUT: // CHECK:STDOUT: fn() -> out %return.param: @Class.MakeClass.%Class.loc19_28.1 (%Class) { @@ -186,7 +210,7 @@ class Class(T: type) { // CHECK:STDOUT: !definition: // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T)] // CHECK:STDOUT: %Class.loc21_26.2: type = class_type @Class, @Class(%T) [symbolic = %Class.loc21_26.2 (constants.%Class)] -// CHECK:STDOUT: %require_complete: = require_complete_type %Class.loc21_26.2 [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type %Class.loc21_26.2 [symbolic = %require_complete (constants.%require_complete.4d9)] // CHECK:STDOUT: %pattern_type: type = pattern_type %Class.loc21_26.2 [symbolic = %pattern_type (constants.%pattern_type.36e)] // CHECK:STDOUT: %c.patt.loc21_17.2: @Class.F.%pattern_type (%pattern_type.36e) = ref_binding_pattern c [symbolic = %c.patt.loc21_17.2 (constants.%c.patt)] // CHECK:STDOUT: %c.var_patt.loc21_5.2: @Class.F.%pattern_type (%pattern_type.36e) = var_pattern %c.patt.loc21_17.2 [symbolic = %c.var_patt.loc21_5.2 (constants.%c.var_patt)] @@ -198,12 +222,12 @@ class Class(T: type) { // CHECK:STDOUT: %Class.MakeClass.type: type = fn_type @Class.MakeClass, @Class(%T) [symbolic = %Class.MakeClass.type (constants.%Class.MakeClass.type)] // CHECK:STDOUT: %Class.MakeClass: @Class.F.%Class.MakeClass.type (%Class.MakeClass.type) = struct_value () [symbolic = %Class.MakeClass (constants.%Class.MakeClass)] // CHECK:STDOUT: %Class.MakeClass.specific_fn.loc22_26.2: = specific_function %Class.MakeClass, @Class.MakeClass(%T) [symbolic = %Class.MakeClass.specific_fn.loc22_26.2 (constants.%Class.MakeClass.specific_fn)] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %Class.loc21_26.2, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)] +// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %Class.loc21_26.2, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.7d7)] // CHECK:STDOUT: %Destroy.facet.loc22_5.3: %Destroy.type = facet_value %Class.loc21_26.2, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.loc22_5.3 (constants.%Destroy.facet.86d)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Destroy.facet.loc22_5.3) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.297)] -// CHECK:STDOUT: %.loc22_5.4: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet.loc22_5.3 [symbolic = %.loc22_5.4 (constants.%.73f)] -// CHECK:STDOUT: %impl.elem0.loc22_5.2: @Class.F.%.loc22_5.4 (%.73f) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc22_5.2 (constants.%impl.elem0)] -// CHECK:STDOUT: %specific_impl_fn.loc22_5.2: = specific_impl_function %impl.elem0.loc22_5.2, @Destroy.WithSelf.Op.1(%Destroy.facet.loc22_5.3) [symbolic = %specific_impl_fn.loc22_5.2 (constants.%specific_impl_fn)] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.loc22_5.3) [symbolic = %Destroy.WithSelf.SelfDestruct.type (constants.%Destroy.WithSelf.SelfDestruct.type.6db)] +// CHECK:STDOUT: %.loc22_5.4: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type, %Destroy.facet.loc22_5.3 [symbolic = %.loc22_5.4 (constants.%.ea9)] +// CHECK:STDOUT: %impl.elem2.loc22_5.2: @Class.F.%.loc22_5.4 (%.ea9) = impl_witness_access %Destroy.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc22_5.2 (constants.%impl.elem2)] +// CHECK:STDOUT: %specific_impl_fn.loc22_5.2: = specific_impl_function %impl.elem2.loc22_5.2, @Destroy.WithSelf.SelfDestruct.1(%Destroy.facet.loc22_5.3) [symbolic = %specific_impl_fn.loc22_5.2 (constants.%specific_impl_fn.c7c)] // CHECK:STDOUT: // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: @@ -240,30 +264,39 @@ class Class(T: type) { // CHECK:STDOUT: %s.patt.loc22_17.1: @Class.F.%pattern_type (%pattern_type.36e) = ref_binding_pattern s [symbolic = %s.patt.loc22_17.2 (constants.%s.patt)] // CHECK:STDOUT: %s.var_patt.loc22_5.1: @Class.F.%pattern_type (%pattern_type.36e) = var_pattern %s.patt.loc22_17.1 [symbolic = %s.var_patt.loc22_5.2 (constants.%s.var_patt)] // CHECK:STDOUT: } -// CHECK:STDOUT: %impl.elem0.loc22_5.1: @Class.F.%.loc22_5.4 (%.73f) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc22_5.2 (constants.%impl.elem0)] -// CHECK:STDOUT: %bound_method.loc22_5.1: = bound_method %s.var, %impl.elem0.loc22_5.1 -// CHECK:STDOUT: %Destroy.facet.loc22_5.1: %Destroy.type = facet_value constants.%Class, (constants.%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.loc22_5.3 (constants.%Destroy.facet.86d)] +// CHECK:STDOUT: %impl.elem2.loc22_5.1: @Class.F.%.loc22_5.4 (%.ea9) = impl_witness_access constants.%Destroy.lookup_impl_witness.7d7, element2 [symbolic = %impl.elem2.loc22_5.2 (constants.%impl.elem2)] +// CHECK:STDOUT: %bound_method.loc22_5.1: = bound_method %s.var, %impl.elem2.loc22_5.1 +// CHECK:STDOUT: %Destroy.facet.loc22_5.1: %Destroy.type = facet_value constants.%Class, (constants.%Destroy.lookup_impl_witness.7d7) [symbolic = %Destroy.facet.loc22_5.3 (constants.%Destroy.facet.86d)] // CHECK:STDOUT: %.loc22_5.2: %Destroy.type = converted constants.%Class, %Destroy.facet.loc22_5.1 [symbolic = %Destroy.facet.loc22_5.3 (constants.%Destroy.facet.86d)] -// CHECK:STDOUT: %Destroy.facet.loc22_5.2: %Destroy.type = facet_value constants.%Class, (constants.%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.loc22_5.3 (constants.%Destroy.facet.86d)] +// CHECK:STDOUT: %Destroy.facet.loc22_5.2: %Destroy.type = facet_value constants.%Class, (constants.%Destroy.lookup_impl_witness.7d7) [symbolic = %Destroy.facet.loc22_5.3 (constants.%Destroy.facet.86d)] // CHECK:STDOUT: %.loc22_5.3: %Destroy.type = converted constants.%Class, %Destroy.facet.loc22_5.2 [symbolic = %Destroy.facet.loc22_5.3 (constants.%Destroy.facet.86d)] -// CHECK:STDOUT: %specific_impl_fn.loc22_5.1: = specific_impl_function %impl.elem0.loc22_5.1, @Destroy.WithSelf.Op.1(constants.%Destroy.facet.86d) [symbolic = %specific_impl_fn.loc22_5.2 (constants.%specific_impl_fn)] +// CHECK:STDOUT: %specific_impl_fn.loc22_5.1: = specific_impl_function %impl.elem2.loc22_5.1, @Destroy.WithSelf.SelfDestruct.1(constants.%Destroy.facet.86d) [symbolic = %specific_impl_fn.loc22_5.2 (constants.%specific_impl_fn.c7c)] // CHECK:STDOUT: %bound_method.loc22_5.2: = bound_method %s.var, %specific_impl_fn.loc22_5.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc22: init %empty_tuple.type = call %bound_method.loc22_5.2(%s.var) -// CHECK:STDOUT: %impl.elem0.loc21: @Class.F.%.loc22_5.4 (%.73f) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc22_5.2 (constants.%impl.elem0)] -// CHECK:STDOUT: %bound_method.loc21_5.1: = bound_method %c.var, %impl.elem0.loc21 -// CHECK:STDOUT: %Destroy.facet.loc21_5.1: %Destroy.type = facet_value constants.%Class, (constants.%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.loc22_5.3 (constants.%Destroy.facet.86d)] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc22: init %empty_tuple.type = call %bound_method.loc22_5.2(%s.var) +// CHECK:STDOUT: %impl.elem2.loc21: @Class.F.%.loc22_5.4 (%.ea9) = impl_witness_access constants.%Destroy.lookup_impl_witness.7d7, element2 [symbolic = %impl.elem2.loc22_5.2 (constants.%impl.elem2)] +// CHECK:STDOUT: %bound_method.loc21_5.1: = bound_method %c.var, %impl.elem2.loc21 +// CHECK:STDOUT: %Destroy.facet.loc21_5.1: %Destroy.type = facet_value constants.%Class, (constants.%Destroy.lookup_impl_witness.7d7) [symbolic = %Destroy.facet.loc22_5.3 (constants.%Destroy.facet.86d)] // CHECK:STDOUT: %.loc21_5.2: %Destroy.type = converted constants.%Class, %Destroy.facet.loc21_5.1 [symbolic = %Destroy.facet.loc22_5.3 (constants.%Destroy.facet.86d)] -// CHECK:STDOUT: %Destroy.facet.loc21_5.2: %Destroy.type = facet_value constants.%Class, (constants.%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.loc22_5.3 (constants.%Destroy.facet.86d)] +// CHECK:STDOUT: %Destroy.facet.loc21_5.2: %Destroy.type = facet_value constants.%Class, (constants.%Destroy.lookup_impl_witness.7d7) [symbolic = %Destroy.facet.loc22_5.3 (constants.%Destroy.facet.86d)] // CHECK:STDOUT: %.loc21_5.3: %Destroy.type = converted constants.%Class, %Destroy.facet.loc21_5.2 [symbolic = %Destroy.facet.loc22_5.3 (constants.%Destroy.facet.86d)] -// CHECK:STDOUT: %specific_impl_fn.loc21: = specific_impl_function %impl.elem0.loc21, @Destroy.WithSelf.Op.1(constants.%Destroy.facet.86d) [symbolic = %specific_impl_fn.loc22_5.2 (constants.%specific_impl_fn)] +// CHECK:STDOUT: %specific_impl_fn.loc21: = specific_impl_function %impl.elem2.loc21, @Destroy.WithSelf.SelfDestruct.1(constants.%Destroy.facet.86d) [symbolic = %specific_impl_fn.loc22_5.2 (constants.%specific_impl_fn.c7c)] // CHECK:STDOUT: %bound_method.loc21_5.2: = bound_method %c.var, %specific_impl_fn.loc21 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc21: init %empty_tuple.type = call %bound_method.loc21_5.2(%c.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc21: init %empty_tuple.type = call %bound_method.loc21_5.2(%c.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc22(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc22(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc22(%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) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: specific @Class(constants.%T) { // CHECK:STDOUT: %T.patt.loc15_14.2 => constants.%T.patt // CHECK:STDOUT: %T.loc15_14.1 => constants.%T @@ -286,7 +319,7 @@ class Class(T: type) { // CHECK:STDOUT: %return.patt.loc18_17.2 => constants.%return.patt // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%require_complete +// CHECK:STDOUT: %require_complete => constants.%require_complete.4d9 // CHECK:STDOUT: %Class.val => constants.%Class.val // CHECK:STDOUT: } // CHECK:STDOUT: @@ -299,7 +332,7 @@ class Class(T: type) { // CHECK:STDOUT: %return.patt.loc19_18.2 => constants.%return.patt // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%require_complete +// CHECK:STDOUT: %require_complete => constants.%require_complete.4d9 // CHECK:STDOUT: %Class.val => constants.%Class.val // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/import.carbon b/toolchain/check/testdata/class/import.carbon index 4ef0ad2ebcb7..b4814ba014ca 100644 --- a/toolchain/check/testdata/class/import.carbon +++ b/toolchain/check/testdata/class/import.carbon @@ -199,6 +199,7 @@ fn Run() { // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.8eb: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%i32, %ImplicitAs.facet) [concrete] // CHECK:STDOUT: %.b7a: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.8eb, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.094: = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.e39 [concrete] +// CHECK:STDOUT: %pattern_type.6b6: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.e39, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete] // CHECK:STDOUT: %bound_method.953: = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.0c6: %i32 = int_value 1 [concrete] @@ -217,6 +218,8 @@ fn Run() { // CHECK:STDOUT: %ForwardDeclared.F: %ForwardDeclared.F.type = struct_value () [concrete] // CHECK:STDOUT: %ForwardDeclared.G.type: type = fn_type @ForwardDeclared.G [concrete] // CHECK:STDOUT: %ForwardDeclared.G: %ForwardDeclared.G.type = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.a42: %pattern_type.bdf = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.d7c: %pattern_type.bdf = wrapper_binding_pattern self, %self.param_patt.a42 [concrete] // CHECK:STDOUT: %ptr.11e: type = ptr_type %ForwardDeclared.08bd4c.1 [concrete] // CHECK:STDOUT: %pattern_type.8cd: type = pattern_type %ptr.11e [concrete] // CHECK:STDOUT: %d.patt: %pattern_type.8cd = ref_binding_pattern d [concrete] @@ -246,16 +249,71 @@ fn Run() { // CHECK:STDOUT: %DefaultOrUnformed.facet: %DefaultOrUnformed.type = facet_value %ptr.06d, (%DefaultOrUnformed.impl_witness.322) [concrete] // CHECK:STDOUT: %T.as.DefaultOrUnformed.impl.Op.specific_fn: = specific_function %T.as.DefaultOrUnformed.impl.Op.9c5, @T.as.DefaultOrUnformed.impl.Op(%ptr.06d) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %self.param_patt.5cd: %pattern_type.bae = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.71b: %pattern_type.bae = wrapper_binding_pattern self, %self.param_patt.5cd [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc18 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc18 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc18 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.4bc: %pattern_type.8cd = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.872: %pattern_type.8cd = wrapper_binding_pattern self, %self.param_patt.4bc [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc16 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc16 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc16 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc12_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc12_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc12_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc12_3.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc12_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.5: type = fn_type @Destroy.WithSelf.Op.loc9_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.5: %Destroy.WithSelf.Op.type.ef016f.5 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.6: type = fn_type @Destroy.WithSelf.Op.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.6: %Destroy.WithSelf.Op.type.ef016f.6 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.946: type = pattern_type %struct_type.x.a15 [concrete] +// CHECK:STDOUT: %self.param_patt.3f5: %pattern_type.946 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.7ec: %pattern_type.946 = wrapper_binding_pattern self, %self.param_patt.3f5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.7: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.7: type = fn_type @Destroy.WithSelf.Op.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.7: %Destroy.WithSelf.Op.type.ef016f.7 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.80c: %pattern_type.f17 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.c40: %pattern_type.f17 = wrapper_binding_pattern self, %self.param_patt.80c [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.8: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.8: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.8 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.8: type = fn_type @Destroy.WithSelf.Op.loc9_3.4 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.8: %Destroy.WithSelf.Op.type.ef016f.8 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.8: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9_3.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.8: %Destroy.WithSelf.SelfDestruct.type.fbceb5.8 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.14f: %pattern_type.47a = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.97c: %pattern_type.47a = wrapper_binding_pattern self, %self.param_patt.14f [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.9: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc7 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.9: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.9 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.9: type = fn_type @Destroy.WithSelf.Op.loc7 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.9: %Destroy.WithSelf.Op.type.ef016f.9 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.9: type = fn_type @Destroy.WithSelf.SelfDestruct.loc7 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.9: %Destroy.WithSelf.SelfDestruct.type.fbceb5.9 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -298,6 +356,135 @@ fn Run() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc18 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.bae = ref_param_pattern [concrete = constants.%self.param_patt.5cd] +// CHECK:STDOUT: %self.patt: %pattern_type.bae = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.71b] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr.06d = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr.06d = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc18 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.bae = ref_param_pattern [concrete = constants.%self.param_patt.5cd] +// CHECK:STDOUT: %self.patt: %pattern_type.bae = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.71b] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr.06d = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr.06d = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc16 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.8cd = ref_param_pattern [concrete = constants.%self.param_patt.4bc] +// CHECK:STDOUT: %self.patt: %pattern_type.8cd = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.872] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr.11e = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr.11e = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc16 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.8cd = ref_param_pattern [concrete = constants.%self.param_patt.4bc] +// CHECK:STDOUT: %self.patt: %pattern_type.8cd = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.872] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr.11e = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr.11e = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc12_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// 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.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc12_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// 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.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc12_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.bdf = ref_param_pattern [concrete = constants.%self.param_patt.a42] +// CHECK:STDOUT: %self.patt: %pattern_type.bdf = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d7c] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ForwardDeclared.08bd4c.1 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ForwardDeclared.08bd4c.1 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc12_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.bdf = ref_param_pattern [concrete = constants.%self.param_patt.a42] +// CHECK:STDOUT: %self.patt: %pattern_type.bdf = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d7c] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ForwardDeclared.08bd4c.1 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ForwardDeclared.08bd4c.1 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.5: %Destroy.WithSelf.Op.type.ef016f.5 = fn_decl @Destroy.WithSelf.Op.loc9_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.6: %Destroy.WithSelf.Op.type.ef016f.6 = fn_decl @Destroy.WithSelf.Op.loc9_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.7: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.7] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.946 = ref_param_pattern [concrete = constants.%self.param_patt.3f5] +// CHECK:STDOUT: %self.patt: %pattern_type.946 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.7ec] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.x.a15 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.x.a15 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.7: %Destroy.WithSelf.Op.type.ef016f.7 = fn_decl @Destroy.WithSelf.Op.loc9_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.7] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.946 = ref_param_pattern [concrete = constants.%self.param_patt.3f5] +// CHECK:STDOUT: %self.patt: %pattern_type.946 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.7ec] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.x.a15 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.x.a15 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.8: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.8 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.4 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.8] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f17 = ref_param_pattern [concrete = constants.%self.param_patt.80c] +// CHECK:STDOUT: %self.patt: %pattern_type.f17 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.c40] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Field = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Field = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.8: %Destroy.WithSelf.Op.type.ef016f.8 = fn_decl @Destroy.WithSelf.Op.loc9_3.4 [concrete = constants.%Destroy.WithSelf.Op.403171.8] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f17 = ref_param_pattern [concrete = constants.%self.param_patt.80c] +// CHECK:STDOUT: %self.patt: %pattern_type.f17 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.c40] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Field = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Field = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.9: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.9 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc7 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.9] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.47a = ref_param_pattern [concrete = constants.%self.param_patt.14f] +// CHECK:STDOUT: %self.patt: %pattern_type.47a = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.97c] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Empty = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Empty = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.9: %Destroy.WithSelf.Op.type.ef016f.9 = fn_decl @Destroy.WithSelf.Op.loc7 [concrete = constants.%Destroy.WithSelf.Op.403171.9] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.47a = ref_param_pattern [concrete = constants.%self.param_patt.14f] +// CHECK:STDOUT: %self.patt: %pattern_type.47a = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.97c] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Empty = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Empty = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Empty = imports.%Main.Empty @@ -446,16 +633,16 @@ fn Run() { // CHECK:STDOUT: %e.patt: %pattern_type.bae = ref_binding_pattern e [concrete = constants.%e.patt] // CHECK:STDOUT: %e.var_patt: %pattern_type.bae = var_pattern %e.patt [concrete = constants.%e.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc18: = bound_method %e.var, constants.%Destroy.WithSelf.Op.403171.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc18: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc18(%e.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc16: = bound_method %d.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc16: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc16(%d.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc12: = bound_method %c.var, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc12: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc12(%c.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc9: = bound_method %b.var, constants.%Destroy.WithSelf.Op.403171.8 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc9(%b.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc7: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.9 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc7: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc7(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc18: = bound_method %e.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc18: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc18(%e.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16: = bound_method %d.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16(%d.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc12: = bound_method %c.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc12: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc12(%c.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc9: = bound_method %b.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.8 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc9(%b.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc7: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.9 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc7: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc7(%a.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -463,36 +650,117 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: fn @ForwardDeclared.G [from "a.carbon"]; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc18(%self.param: ref %ptr.06d) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18(%self.param: ref %ptr.06d) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc18(%self.param: ref %ptr.06d) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc16(%self.param: ref %ptr.11e) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16(%self.param: ref %ptr.11e) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc16(%self.param: ref %ptr.11e) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc12_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc12_3.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc12_3.2(%self.param: ref %ForwardDeclared.08bd4c.1) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc12_3.1(%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.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc12_3.2(%self.param: ref %ForwardDeclared.08bd4c.1) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc12_3.2(%self.param: ref %ForwardDeclared.08bd4c.1) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc12_3.2(%self.param: ref %ForwardDeclared.08bd4c.1) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.5(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.5(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.3(%self.param: ref %struct_type.x.a15) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.6(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.6(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.3(%self.param: ref %struct_type.x.a15) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.4(%self.param: ref %Field) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.3(%self.param: ref %struct_type.x.a15) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.3(%self.param: ref %struct_type.x.a15) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.7(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.7(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.4(%self.param: ref %Field) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7(%self.param: ref %Empty) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.4(%self.param: ref %Field) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.4(%self.param: ref %Field) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.8(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.8(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc7(%self.param: ref %Empty) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7(%self.param: ref %Empty) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc7(%self.param: ref %Empty) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.9(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.9(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/import_member_cycle.carbon b/toolchain/check/testdata/class/import_member_cycle.carbon index 6a139cec1c39..34d2eecd5f66 100644 --- a/toolchain/check/testdata/class/import_member_cycle.carbon +++ b/toolchain/check/testdata/class/import_member_cycle.carbon @@ -95,8 +95,14 @@ fn Run() { // CHECK:STDOUT: %DefaultOrUnformed.facet: %DefaultOrUnformed.type = facet_value %ptr, (%DefaultOrUnformed.impl_witness.9b1) [concrete] // CHECK:STDOUT: %T.as.DefaultOrUnformed.impl.Op.specific_fn: = specific_function %T.as.DefaultOrUnformed.impl.Op.85a, @T.as.DefaultOrUnformed.impl.Op(%ptr) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %self.param_patt.33b: %pattern_type.c3e = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.219: %pattern_type.c3e = wrapper_binding_pattern self, %self.param_patt.33b [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfc: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc7 [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.loc7 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc7 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -116,6 +122,23 @@ fn Run() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl: %Destroy.WithSelf.SubobjectDestroy.type.dfc = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc7 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.c3e = ref_param_pattern [concrete = constants.%self.param_patt.33b] +// CHECK:STDOUT: %self.patt: %pattern_type.c3e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.219] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc7 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.c3e = ref_param_pattern [concrete = constants.%self.param_patt.33b] +// CHECK:STDOUT: %self.patt: %pattern_type.c3e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.219] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Cycle = imports.%Main.Cycle @@ -154,10 +177,19 @@ fn Run() { // CHECK:STDOUT: %a.patt: %pattern_type.c3e = ref_binding_pattern a [concrete = constants.%a.patt] // CHECK:STDOUT: %a.var_patt: %pattern_type.c3e = var_pattern %a.patt [concrete = constants.%a.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%a.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc7(%self.param: ref %ptr) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7(%self.param: ref %ptr) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc7(%self.param: ref %ptr) { +// 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) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/inheritance/derived_to_base.carbon b/toolchain/check/testdata/class/inheritance/derived_to_base.carbon index ad7d6c195090..d71ab23e3e3c 100644 --- a/toolchain/check/testdata/class/inheritance/derived_to_base.carbon +++ b/toolchain/check/testdata/class/inheritance/derived_to_base.carbon @@ -130,6 +130,7 @@ fn PassPartialB(b: partial B) { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] +// CHECK:STDOUT: %pattern_type.6b6: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %struct_type.a.a92: type = struct_type {.a: %i32} [concrete] // CHECK:STDOUT: %B: type = class_type @B [concrete] // CHECK:STDOUT: %struct_type.base.b.6c4: type = struct_type {.base: %A, .b: %i32} [concrete] @@ -228,9 +229,62 @@ fn PassPartialB(b: partial B) { // CHECK:STDOUT: %.084: ref %C = temporary invalid, %C.val [concrete] // CHECK:STDOUT: %.107: ref %B = class_element_access %.084, element0 [concrete] // CHECK:STDOUT: %.5ce: ref %A = class_element_access %.107, element0 [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc32_66.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc32_66.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc32_66.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc32_66.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.506: type = pattern_type %struct_type.a.a92 [concrete] +// CHECK:STDOUT: %self.param_patt.7eb: %pattern_type.506 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.68d: %pattern_type.506 = wrapper_binding_pattern self, %self.param_patt.7eb [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc32_66.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc32_66.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.8fb: %pattern_type.9ef = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.e64: %pattern_type.9ef = wrapper_binding_pattern self, %self.param_patt.8fb [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc32_66.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc32_66.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.a6a: type = pattern_type %struct_type.base.b.6c4 [concrete] +// CHECK:STDOUT: %self.param_patt.d69: %pattern_type.a6a = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.915: %pattern_type.a6a = wrapper_binding_pattern self, %self.param_patt.d69 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc32_66.5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.5: type = fn_type @Destroy.WithSelf.Op.loc32_66.5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.5: %Destroy.WithSelf.Op.type.ef016f.5 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.e39: type = pattern_type %B [concrete] +// CHECK:STDOUT: %self.param_patt.039: %pattern_type.e39 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.535: %pattern_type.e39 = wrapper_binding_pattern self, %self.param_patt.039 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc32_66.6 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.6: type = fn_type @Destroy.WithSelf.Op.loc32_66.6 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.6: %Destroy.WithSelf.Op.type.ef016f.6 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.863: type = pattern_type %struct_type.base.c.faf [concrete] +// CHECK:STDOUT: %self.param_patt.27e: %pattern_type.863 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.67e: %pattern_type.863 = wrapper_binding_pattern self, %self.param_patt.27e [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc32_66.7 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.7: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.7: type = fn_type @Destroy.WithSelf.Op.loc32_66.7 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.7: %Destroy.WithSelf.Op.type.ef016f.7 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.99a: %pattern_type.98b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.cbd: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt.99a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.8: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc32_66.8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.8: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.8 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.8: type = fn_type @Destroy.WithSelf.Op.loc32_66.8 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.8: %Destroy.WithSelf.Op.type.ef016f.8 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.084, %Destroy.WithSelf.Op.403171.8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.8: type = fn_type @Destroy.WithSelf.SelfDestruct.loc32_66.8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.8: %Destroy.WithSelf.SelfDestruct.type.fbceb5.8 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.084, %Destroy.WithSelf.SelfDestruct.db3fdb.8 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -240,6 +294,121 @@ fn PassPartialB(b: partial B) { // CHECK:STDOUT: %ImplicitAs.impl_witness_table.1aa = impl_witness_table (%Core.import_ref.edf), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc32_66.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc32_66.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc32_66.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc32_66.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc32_66.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.506 = ref_param_pattern [concrete = constants.%self.param_patt.7eb] +// CHECK:STDOUT: %self.patt: %pattern_type.506 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.68d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.a.a92 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.a.a92 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc32_66.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.506 = ref_param_pattern [concrete = constants.%self.param_patt.7eb] +// CHECK:STDOUT: %self.patt: %pattern_type.506 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.68d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.a.a92 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.a.a92 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc32_66.4 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.9ef = ref_param_pattern [concrete = constants.%self.param_patt.8fb] +// CHECK:STDOUT: %self.patt: %pattern_type.9ef = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.e64] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %A = ref_param call_param0 +// CHECK:STDOUT: %self: ref %A = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc32_66.4 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.9ef = ref_param_pattern [concrete = constants.%self.param_patt.8fb] +// CHECK:STDOUT: %self.patt: %pattern_type.9ef = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.e64] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %A = ref_param call_param0 +// CHECK:STDOUT: %self: ref %A = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc32_66.5 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.a6a = ref_param_pattern [concrete = constants.%self.param_patt.d69] +// CHECK:STDOUT: %self.patt: %pattern_type.a6a = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.915] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.base.b.6c4 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.base.b.6c4 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.5: %Destroy.WithSelf.Op.type.ef016f.5 = fn_decl @Destroy.WithSelf.Op.loc32_66.5 [concrete = constants.%Destroy.WithSelf.Op.403171.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.a6a = ref_param_pattern [concrete = constants.%self.param_patt.d69] +// CHECK:STDOUT: %self.patt: %pattern_type.a6a = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.915] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.base.b.6c4 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.base.b.6c4 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc32_66.6 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e39 = ref_param_pattern [concrete = constants.%self.param_patt.039] +// CHECK:STDOUT: %self.patt: %pattern_type.e39 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.535] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %B = ref_param call_param0 +// CHECK:STDOUT: %self: ref %B = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.6: %Destroy.WithSelf.Op.type.ef016f.6 = fn_decl @Destroy.WithSelf.Op.loc32_66.6 [concrete = constants.%Destroy.WithSelf.Op.403171.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e39 = ref_param_pattern [concrete = constants.%self.param_patt.039] +// CHECK:STDOUT: %self.patt: %pattern_type.e39 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.535] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %B = ref_param call_param0 +// CHECK:STDOUT: %self: ref %B = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.7: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc32_66.7 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.7] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.863 = ref_param_pattern [concrete = constants.%self.param_patt.27e] +// CHECK:STDOUT: %self.patt: %pattern_type.863 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.67e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.base.c.faf = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.base.c.faf = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.7: %Destroy.WithSelf.Op.type.ef016f.7 = fn_decl @Destroy.WithSelf.Op.loc32_66.7 [concrete = constants.%Destroy.WithSelf.Op.403171.7] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.863 = ref_param_pattern [concrete = constants.%self.param_patt.27e] +// CHECK:STDOUT: %self.patt: %pattern_type.863 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.67e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.base.c.faf = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.base.c.faf = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.8: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.8 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc32_66.8 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.8] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.8: %Destroy.WithSelf.Op.type.ef016f.8 = fn_decl @Destroy.WithSelf.Op.loc32_66.8 [concrete = constants.%Destroy.WithSelf.Op.403171.8] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: %ConvertCToB.decl: %ConvertCToB.type = fn_decl @ConvertCToB [concrete = constants.%ConvertCToB] { // CHECK:STDOUT: %p.param_patt: %pattern_type.fcb = value_param_pattern [concrete = constants.%p.param_patt.9b8] @@ -456,44 +625,116 @@ fn PassPartialB(b: partial B) { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %a.patt: %pattern_type.9ef = value_binding_pattern a [concrete = constants.%a.patt.bb7b23.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.084) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.084) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc32_66.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc32_66.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc32_66.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc32_66.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc32_66.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc32_66.3(%self.param: ref %struct_type.a.a92) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc32_66.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc32_66.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc32_66.3(%self.param: ref %struct_type.a.a92) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc32_66.4(%self.param: ref %A) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc32_66.3(%self.param: ref %struct_type.a.a92) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc32_66.3(%self.param: ref %struct_type.a.a92) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc32_66.4(%self.param: ref %A) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc32_66.5(%self.param: ref %struct_type.base.b.6c4) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc32_66.4(%self.param: ref %A) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc32_66.4(%self.param: ref %A) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc32_66.5(%self.param: ref %struct_type.base.b.6c4) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc32_66.6(%self.param: ref %B) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc32_66.5(%self.param: ref %struct_type.base.b.6c4) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc32_66.5(%self.param: ref %struct_type.base.b.6c4) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.5(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.5(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc32_66.6(%self.param: ref %B) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc32_66.7(%self.param: ref %struct_type.base.c.faf) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc32_66.6(%self.param: ref %B) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc32_66.6(%self.param: ref %B) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.6(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.6(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc32_66.7(%self.param: ref %struct_type.base.c.faf) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc32_66.8(%self.param: ref %C) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc32_66.7(%self.param: ref %struct_type.base.c.faf) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc32_66.7(%self.param: ref %struct_type.base.c.faf) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.7(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.7(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc32_66.8(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc32_66.8(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc32_66.8(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.8(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.8(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/inheritance/import_base.carbon b/toolchain/check/testdata/class/inheritance/import_base.carbon index 3f8585dad40b..ef835a6cb927 100644 --- a/toolchain/check/testdata/class/inheritance/import_base.carbon +++ b/toolchain/check/testdata/class/inheritance/import_base.carbon @@ -176,6 +176,7 @@ fn Run() { // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.8eb: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%i32, %ImplicitAs.facet) [concrete] // CHECK:STDOUT: %.b7a: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.8eb, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.7b4: = bound_method %int_0.5c6, %Core.IntLiteral.as.ImplicitAs.impl.Convert.e39 [concrete] +// CHECK:STDOUT: %pattern_type.6b6: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.e39, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete] // CHECK:STDOUT: %bound_method.6e0: = bound_method %int_0.5c6, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.3c0: %i32 = int_value 0 [concrete] @@ -192,9 +193,49 @@ fn Run() { // CHECK:STDOUT: %int_2.295: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %Base.F.type: type = fn_type @Base.F [concrete] // CHECK:STDOUT: %Base.F: %Base.F.type = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.912: type = pattern_type %Base [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc7_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc7_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc7_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc7_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.a23: type = pattern_type %struct_type.x.unused_y.258 [concrete] +// CHECK:STDOUT: %self.param_patt.a53: %pattern_type.a23 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.5d3: %pattern_type.a23 = wrapper_binding_pattern self, %self.param_patt.a53 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc7_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc7_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.21c: %pattern_type.912 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.26b: %pattern_type.912 = wrapper_binding_pattern self, %self.param_patt.21c [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc7_3.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc7_3.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.cca: type = pattern_type %struct_type.base.cae [concrete] +// CHECK:STDOUT: %self.param_patt.b3a: %pattern_type.cca = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.66f: %pattern_type.cca = wrapper_binding_pattern self, %self.param_patt.b3a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc7_3.5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.5: type = fn_type @Destroy.WithSelf.Op.loc7_3.5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.5: %Destroy.WithSelf.Op.type.ef016f.5 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.ff3: %pattern_type.860 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.c08: %pattern_type.860 = wrapper_binding_pattern self, %self.param_patt.ff3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc7_3.6 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.6: type = fn_type @Destroy.WithSelf.Op.loc7_3.6 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.6: %Destroy.WithSelf.Op.type.ef016f.6 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.6: type = fn_type @Destroy.WithSelf.SelfDestruct.loc7_3.6 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.6: %Destroy.WithSelf.SelfDestruct.type.fbceb5.6 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -224,6 +265,93 @@ fn Run() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc7_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc7_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc7_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc7_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc7_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.a23 = ref_param_pattern [concrete = constants.%self.param_patt.a53] +// CHECK:STDOUT: %self.patt: %pattern_type.a23 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.5d3] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.x.unused_y.258 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.x.unused_y.258 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc7_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.a23 = ref_param_pattern [concrete = constants.%self.param_patt.a53] +// CHECK:STDOUT: %self.patt: %pattern_type.a23 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.5d3] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.x.unused_y.258 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.x.unused_y.258 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc7_3.4 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.912 = ref_param_pattern [concrete = constants.%self.param_patt.21c] +// CHECK:STDOUT: %self.patt: %pattern_type.912 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.26b] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Base = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Base = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc7_3.4 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.912 = ref_param_pattern [concrete = constants.%self.param_patt.21c] +// CHECK:STDOUT: %self.patt: %pattern_type.912 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.26b] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Base = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Base = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc7_3.5 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cca = ref_param_pattern [concrete = constants.%self.param_patt.b3a] +// CHECK:STDOUT: %self.patt: %pattern_type.cca = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.66f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.base.cae = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.base.cae = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.5: %Destroy.WithSelf.Op.type.ef016f.5 = fn_decl @Destroy.WithSelf.Op.loc7_3.5 [concrete = constants.%Destroy.WithSelf.Op.403171.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cca = ref_param_pattern [concrete = constants.%self.param_patt.b3a] +// CHECK:STDOUT: %self.patt: %pattern_type.cca = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.66f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.base.cae = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.base.cae = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc7_3.6 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.860 = ref_param_pattern [concrete = constants.%self.param_patt.ff3] +// CHECK:STDOUT: %self.patt: %pattern_type.860 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.c08] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Child = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Child = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.6: %Destroy.WithSelf.Op.type.ef016f.6 = fn_decl @Destroy.WithSelf.Op.loc7_3.6 [concrete = constants.%Destroy.WithSelf.Op.403171.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.860 = ref_param_pattern [concrete = constants.%self.param_patt.ff3] +// CHECK:STDOUT: %self.patt: %pattern_type.860 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.c08] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Child = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Child = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Base = imports.%Main.Base @@ -314,37 +442,91 @@ fn Run() { // CHECK:STDOUT: %.loc9_3.2: ref %Base = converted %a.ref.loc9, %.loc9_3.1 // CHECK:STDOUT: %.loc9_3.3: %Base = acquire_value %.loc9_3.2 // CHECK:STDOUT: %Base.F.call: init %empty_tuple.type = call %Base.F.bound(%.loc9_3.3) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.6 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.6 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%a.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Base.F [from "a.carbon"]; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc7_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_3.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc7_3.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc7_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_3.3(%self.param: ref %struct_type.x.unused_y.258) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_3.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc7_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc7_3.3(%self.param: ref %struct_type.x.unused_y.258) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_3.4(%self.param: ref %Base) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_3.3(%self.param: ref %struct_type.x.unused_y.258) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc7_3.3(%self.param: ref %struct_type.x.unused_y.258) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc7_3.4(%self.param: ref %Base) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_3.5(%self.param: ref %struct_type.base.cae) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_3.4(%self.param: ref %Base) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc7_3.4(%self.param: ref %Base) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc7_3.5(%self.param: ref %struct_type.base.cae) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_3.6(%self.param: ref %Child) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_3.5(%self.param: ref %struct_type.base.cae) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc7_3.5(%self.param: ref %struct_type.base.cae) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.5(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.5(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc7_3.6(%self.param: ref %Child) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_3.6(%self.param: ref %Child) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc7_3.6(%self.param: ref %Child) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.6(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.6(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/init_as.carbon b/toolchain/check/testdata/class/init_as.carbon index 83523c477394..cb8a0c410f92 100644 --- a/toolchain/check/testdata/class/init_as.carbon +++ b/toolchain/check/testdata/class/init_as.carbon @@ -38,6 +38,7 @@ fn G() -> i32 { // CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] +// CHECK:STDOUT: %pattern_type.6b6: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %i32 [concrete] // CHECK:STDOUT: %struct_type.a.b.b4c: type = struct_type {.a: %i32, .b: %i32} [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] @@ -74,10 +75,36 @@ fn G() -> i32 { // CHECK:STDOUT: %Copy.WithSelf.Op.type.381: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet) [concrete] // CHECK:STDOUT: %.737: type = fn_type_with_self_type %Copy.WithSelf.Op.type.381, %Copy.facet [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.4f6, @Int.as.Copy.impl.Op(%int_32) [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc20_28.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc20_28.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc20_28.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc20_28.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.20e3: type = pattern_type %struct_type.a.b.b4c [concrete] +// CHECK:STDOUT: %self.param_patt.3bf: %pattern_type.20e3 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.d0e: %pattern_type.20e3 = wrapper_binding_pattern self, %self.param_patt.3bf [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc20_28.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc20_28.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] // CHECK:STDOUT: %pattern_type.f15: type = pattern_type %Class [concrete] +// CHECK:STDOUT: %self.param_patt.b2b: %pattern_type.f15 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.f19: %pattern_type.f15 = wrapper_binding_pattern self, %self.param_patt.b2b [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc20_28.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc20_28.4 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.0e3, %Destroy.WithSelf.Op.403171.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc20_28.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.0e3, %Destroy.WithSelf.SelfDestruct.db3fdb.4 [concrete] // CHECK:STDOUT: %v.patt: %pattern_type.f15 = ref_binding_pattern v [concrete] // CHECK:STDOUT: %v.var_patt: %pattern_type.f15 = var_pattern %v.patt [concrete] // CHECK:STDOUT: } @@ -89,6 +116,65 @@ fn G() -> i32 { // CHECK:STDOUT: %Copy.impl_witness_table.8d2 = impl_witness_table (%Core.import_ref.cd6), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc20_28.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc20_28.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc20_28.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc20_28.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc20_28.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.20e3 = ref_param_pattern [concrete = constants.%self.param_patt.3bf] +// CHECK:STDOUT: %self.patt: %pattern_type.20e3 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d0e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.a.b.b4c = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.a.b.b4c = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc20_28.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.20e3 = ref_param_pattern [concrete = constants.%self.param_patt.3bf] +// CHECK:STDOUT: %self.patt: %pattern_type.20e3 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d0e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.a.b.b4c = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.a.b.b4c = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc20_28.4 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f15 = ref_param_pattern [concrete = constants.%self.param_patt.b2b] +// CHECK:STDOUT: %self.patt: %pattern_type.f15 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.f19] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Class = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Class = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc20_28.4 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f15 = ref_param_pattern [concrete = constants.%self.param_patt.b2b] +// CHECK:STDOUT: %self.patt: %pattern_type.f15 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.f19] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Class = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Class = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> out %return.param: %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] @@ -123,24 +209,60 @@ fn G() -> i32 { // CHECK:STDOUT: %specific_fn.loc20_37: = specific_function %impl.elem0.loc20_37, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] // CHECK:STDOUT: %bound_method.loc20_37.2: = bound_method %.loc20_37.2, %specific_fn.loc20_37 // CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc20_37.2(%.loc20_37.2) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.0e3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.0e3) // CHECK:STDOUT: return %Int.as.Copy.impl.Op.call // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc20_28.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc20_28.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc20_28.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc20_28.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc20_28.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc20_28.3(%self.param: ref %struct_type.a.b.b4c) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc20_28.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc20_28.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc20_28.3(%self.param: ref %struct_type.a.b.b4c) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc20_28.4(%self.param: ref %Class) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc20_28.3(%self.param: ref %struct_type.a.b.b4c) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc20_28.3(%self.param: ref %struct_type.a.b.b4c) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc20_28.4(%self.param: ref %Class) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc20_28.4(%self.param: ref %Class) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc20_28.4(%self.param: ref %Class) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -178,8 +300,8 @@ fn G() -> i32 { // CHECK:STDOUT: %v.var_patt: %pattern_type.f15 = var_pattern %v.patt [concrete = constants.%v.var_patt] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %v.var, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%v.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %v.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%v.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/local.carbon b/toolchain/check/testdata/class/local.carbon index 9998c13824ca..bbbb73dd7450 100644 --- a/toolchain/check/testdata/class/local.carbon +++ b/toolchain/check/testdata/class/local.carbon @@ -90,8 +90,34 @@ class A { // CHECK:STDOUT: %.737: type = fn_type_with_self_type %Copy.WithSelf.Op.type.381, %Copy.facet [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.4f6, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc26_19.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc26_19.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc26_19.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc26_19.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.b13: type = pattern_type %struct_type.n.9ed [concrete] +// CHECK:STDOUT: %self.param_patt.e77: %pattern_type.b13 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.b1b: %pattern_type.b13 = wrapper_binding_pattern self, %self.param_patt.e77 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc26_19.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc26_19.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.ddc: %pattern_type.6f2 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.78f: %pattern_type.6f2 = wrapper_binding_pattern self, %self.param_patt.ddc [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc26_19.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc26_19.4 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc26_19.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -113,6 +139,65 @@ class A { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc26_19.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc26_19.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc26_19.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc26_19.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc26_19.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b13 = ref_param_pattern [concrete = constants.%self.param_patt.e77] +// CHECK:STDOUT: %self.patt: %pattern_type.b13 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.b1b] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.n.9ed = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.n.9ed = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc26_19.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b13 = ref_param_pattern [concrete = constants.%self.param_patt.e77] +// CHECK:STDOUT: %self.patt: %pattern_type.b13 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.b1b] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.n.9ed = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.n.9ed = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc26_19.4 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6f2 = ref_param_pattern [concrete = constants.%self.param_patt.ddc] +// CHECK:STDOUT: %self.patt: %pattern_type.6f2 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.78f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %B = ref_param call_param0 +// CHECK:STDOUT: %self: ref %B = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc26_19.4 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6f2 = ref_param_pattern [concrete = constants.%self.param_patt.ddc] +// CHECK:STDOUT: %self.patt: %pattern_type.6f2 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.78f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %B = ref_param call_param0 +// CHECK:STDOUT: %self: ref %B = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -178,8 +263,8 @@ class A { // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] // CHECK:STDOUT: %bound_method.loc26_20.2: = bound_method %.loc26_20.2, %specific_fn // CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc26_20.2(%.loc26_20.2) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.loc26_19.2, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%.loc26_19.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc26_19.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc26_19.2) // CHECK:STDOUT: return %Int.as.Copy.impl.Op.call // CHECK:STDOUT: } // CHECK:STDOUT: @@ -208,20 +293,56 @@ class A { // CHECK:STDOUT: return %.loc19_23 to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc26_19.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc26_19.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc26_19.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc26_19.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc26_19.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc26_19.3(%self.param: ref %struct_type.n.9ed) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc26_19.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc26_19.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc26_19.3(%self.param: ref %struct_type.n.9ed) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc26_19.4(%self.param: ref %B) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc26_19.3(%self.param: ref %struct_type.n.9ed) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc26_19.3(%self.param: ref %struct_type.n.9ed) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc26_19.4(%self.param: ref %B) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc26_19.4(%self.param: ref %B) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc26_19.4(%self.param: ref %B) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/method/method.carbon b/toolchain/check/testdata/class/method/method.carbon index 5735ba92e3f1..70609bc6674b 100644 --- a/toolchain/check/testdata/class/method/method.carbon +++ b/toolchain/check/testdata/class/method/method.carbon @@ -132,9 +132,33 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %.a72: ref %Class = temporary invalid, %Class.val [concrete] // CHECK:STDOUT: %Class.F.bound: = bound_method %.a72, %Class.F [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc39_20.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc39_20.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc39_20.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc39_20.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.cec: type = pattern_type %struct_type.k.e7c [concrete] +// CHECK:STDOUT: %self.param_patt.c92: %pattern_type.cec = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.1bc: %pattern_type.cec = wrapper_binding_pattern self, %self.param_patt.c92 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc39_20.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc39_20.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc39_20.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc39_20.4 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.a72, %Destroy.WithSelf.Op.403171.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc39_20.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.a72, %Destroy.WithSelf.SelfDestruct.db3fdb.4 [concrete] // CHECK:STDOUT: %CallWithRef.type: type = fn_type @CallWithRef [concrete] // CHECK:STDOUT: %CallWithRef: %CallWithRef.type = struct_value () [concrete] // CHECK:STDOUT: %c.patt.345: %pattern_type.f15 = ref_binding_pattern c [concrete] @@ -189,6 +213,65 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %DefaultOrUnformed.impl_witness_table.856 = impl_witness_table (%Core.import_ref.cc8), @T.as.DefaultOrUnformed.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc39_20.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc39_20.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc39_20.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc39_20.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc39_20.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cec = ref_param_pattern [concrete = constants.%self.param_patt.c92] +// CHECK:STDOUT: %self.patt: %pattern_type.cec = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.1bc] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.k.e7c = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.k.e7c = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc39_20.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cec = ref_param_pattern [concrete = constants.%self.param_patt.c92] +// CHECK:STDOUT: %self.patt: %pattern_type.cec = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.1bc] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.k.e7c = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.k.e7c = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc39_20.4 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f15 = ref_param_pattern [concrete = constants.%self.param_patt.b2b] +// CHECK:STDOUT: %self.patt: %pattern_type.f15 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.f19] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Class = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Class = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc39_20.4 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f15 = ref_param_pattern [concrete = constants.%self.param_patt.b2b] +// CHECK:STDOUT: %self.patt: %pattern_type.f15 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.f19] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Class = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Class = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -428,24 +511,60 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %Class.F.bound: = bound_method %.loc39_20.2, %F.ref [concrete = constants.%Class.F.bound] // CHECK:STDOUT: %.loc39_20.3: %Class = acquire_value %.loc39_20.2 [concrete = constants.%Class.val] // CHECK:STDOUT: %Class.F.call: init %i32 = call %Class.F.bound(%.loc39_20.3) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.a72) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.a72) // CHECK:STDOUT: return %Class.F.call // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc39_20.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc39_20.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc39_20.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc39_20.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc39_20.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc39_20.3(%self.param: ref %struct_type.k.e7c) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc39_20.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc39_20.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc39_20.3(%self.param: ref %struct_type.k.e7c) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc39_20.4(%self.param: ref %Class) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc39_20.3(%self.param: ref %struct_type.k.e7c) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc39_20.3(%self.param: ref %struct_type.k.e7c) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc39_20.4(%self.param: ref %Class) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc39_20.4(%self.param: ref %Class) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc39_20.4(%self.param: ref %Class) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -470,8 +589,8 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %G.ref: %Class.G.type = name_ref G, @Class.%Class.G.decl [concrete = constants.%Class.G] // CHECK:STDOUT: %Class.G.bound: = bound_method %c.ref, %G.ref // CHECK:STDOUT: %Class.G.call: init %i32 = call %Class.G.bound(%c.ref) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %c.var, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%c.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %c.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%c.var) // CHECK:STDOUT: return %Class.G.call // CHECK:STDOUT: } // CHECK:STDOUT: @@ -508,8 +627,8 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %Class.F.bound: = bound_method %.loc58_15.2, %F.ref // CHECK:STDOUT: %.loc58_15.3: %Class = acquire_value %.loc58_15.2 // CHECK:STDOUT: %Class.F.call: init %i32 = call %Class.F.bound(%.loc58_15.3) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.loc58_15.2, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%.loc58_15.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc58_15.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc58_15.2) // CHECK:STDOUT: return %Class.F.call // CHECK:STDOUT: } // CHECK:STDOUT: @@ -522,8 +641,8 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %G.ref: %Class.G.type = name_ref G, @Class.%Class.G.decl [concrete = constants.%Class.G] // CHECK:STDOUT: %Class.G.bound: = bound_method %.loc62_15.2, %G.ref // CHECK:STDOUT: %Class.G.call: init %i32 = call %Class.G.bound(%.loc62_15.2) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.loc62_15.2, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%.loc62_15.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc62_15.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc62_15.2) // CHECK:STDOUT: return %Class.G.call // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/method/static_method.carbon b/toolchain/check/testdata/class/method/static_method.carbon index a995d620b8a1..1a359f45b0b6 100644 --- a/toolchain/check/testdata/class/method/static_method.carbon +++ b/toolchain/check/testdata/class/method/static_method.carbon @@ -54,8 +54,21 @@ fn Run() -> i32 { // CHECK:STDOUT: %DefaultOrUnformed.facet: %DefaultOrUnformed.type = facet_value %Class, (%DefaultOrUnformed.impl_witness.135) [concrete] // CHECK:STDOUT: %T.as.DefaultOrUnformed.impl.Op.specific_fn: = specific_function %T.as.DefaultOrUnformed.impl.Op.de4, @T.as.DefaultOrUnformed.impl.Op(%Class) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc20_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc20_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.b2b: %pattern_type.f15 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.f19: %pattern_type.f15 = wrapper_binding_pattern self, %self.param_patt.b2b [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc20_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc20_3.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc20_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -73,6 +86,37 @@ fn Run() -> i32 { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc20_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc20_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc20_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f15 = ref_param_pattern [concrete = constants.%self.param_patt.b2b] +// CHECK:STDOUT: %self.patt: %pattern_type.f15 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.f19] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Class = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Class = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc20_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f15 = ref_param_pattern [concrete = constants.%self.param_patt.b2b] +// CHECK:STDOUT: %self.patt: %pattern_type.f15 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.f19] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Class = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Class = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -132,15 +176,33 @@ fn Run() -> i32 { // CHECK:STDOUT: %c.ref: ref %Class = name_ref c, %c // CHECK:STDOUT: %F.ref: %Class.F.type = name_ref F, @Class.%Class.F.decl [concrete = constants.%Class.F] // CHECK:STDOUT: %Class.F.call: init %i32 = call %F.ref() -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %c.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%c.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %c.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%c.var) // CHECK:STDOUT: return %Class.F.call // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc20_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc20_3.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc20_3.2(%self.param: ref %Class) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc20_3.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc20_3.2(%self.param: ref %Class) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc20_3.2(%self.param: ref %Class) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc20_3.2(%self.param: ref %Class) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/method/virtual.carbon b/toolchain/check/testdata/class/method/virtual.carbon index 3c7b50519a4c..a9e8e5455770 100644 --- a/toolchain/check/testdata/class/method/virtual.carbon +++ b/toolchain/check/testdata/class/method/virtual.carbon @@ -651,6 +651,7 @@ class T2(G2: type) { // CHECK:STDOUT: %Derived.H.a6796b.1: %Derived.H.type.1f42d4.1 = struct_value () [concrete] // CHECK:STDOUT: %Base.H.type: type = fn_type @Base.H [concrete] // CHECK:STDOUT: %Base.H: %Base.H.type = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.b8d: type = pattern_type %Base [concrete] // CHECK:STDOUT: %Derived.H.type.1f42d4.2: type = fn_type @Derived.H.loc9_22.2 [concrete] // CHECK:STDOUT: %Derived.H.a6796b.2: %Derived.H.type.1f42d4.2 = struct_value () [concrete] // CHECK:STDOUT: %Derived.vtable_decl: ref %ptr.454 = vtable_decl @Derived.vtable [concrete] @@ -668,8 +669,41 @@ class T2(G2: type) { // CHECK:STDOUT: %Base.val: %Base = struct_value (%uninit) [concrete] // CHECK:STDOUT: %Derived.val: %Derived = struct_value (%Base.val) [concrete] // CHECK:STDOUT: %Derived.vtable_ptr: ref %ptr.454 = vtable_ptr @Derived.vtable [concrete] +// CHECK:STDOUT: %pattern_type.258: type = pattern_type %ptr.454 [concrete] +// CHECK:STDOUT: %self.param_patt.2f4: %pattern_type.258 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.cf4: %pattern_type.258 = wrapper_binding_pattern self, %self.param_patt.2f4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc15_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc15_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.f1a: type = pattern_type %struct_type.vptr [concrete] +// CHECK:STDOUT: %self.param_patt.783: %pattern_type.f1a = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.8ea: %pattern_type.f1a = wrapper_binding_pattern self, %self.param_patt.783 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc15_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc15_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.9d9: %pattern_type.b8d = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.1ac: %pattern_type.b8d = wrapper_binding_pattern self, %self.param_patt.9d9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc15_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc15_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.6ed: type = pattern_type %struct_type.base.507 [concrete] +// CHECK:STDOUT: %self.param_patt.70b: %pattern_type.6ed = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.2b0: %pattern_type.6ed = wrapper_binding_pattern self, %self.param_patt.70b [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc15_3.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc15_3.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.a2b: %pattern_type.746 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.d8a: %pattern_type.746 = wrapper_binding_pattern self, %self.param_patt.a2b [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc15_3.5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.5: type = fn_type @Destroy.WithSelf.Op.loc15_3.5 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.5: %Destroy.WithSelf.Op.type.ef016f.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5: type = fn_type @Destroy.WithSelf.SelfDestruct.loc15_3.5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.5: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -681,6 +715,79 @@ class T2(G2: type) { // CHECK:STDOUT: %Base.H.decl: %Base.H.type = fn_decl @Base.H [concrete = constants.%Base.H] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc15_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.258 = ref_param_pattern [concrete = constants.%self.param_patt.2f4] +// CHECK:STDOUT: %self.patt: %pattern_type.258 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cf4] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr.454 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr.454 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc15_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.258 = ref_param_pattern [concrete = constants.%self.param_patt.2f4] +// CHECK:STDOUT: %self.patt: %pattern_type.258 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cf4] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr.454 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr.454 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc15_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f1a = ref_param_pattern [concrete = constants.%self.param_patt.783] +// CHECK:STDOUT: %self.patt: %pattern_type.f1a = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.8ea] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.vptr = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.vptr = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc15_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f1a = ref_param_pattern [concrete = constants.%self.param_patt.783] +// CHECK:STDOUT: %self.patt: %pattern_type.f1a = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.8ea] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.vptr = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.vptr = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc15_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b8d = ref_param_pattern [concrete = constants.%self.param_patt.9d9] +// CHECK:STDOUT: %self.patt: %pattern_type.b8d = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.1ac] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Base = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Base = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc15_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b8d = ref_param_pattern [concrete = constants.%self.param_patt.9d9] +// CHECK:STDOUT: %self.patt: %pattern_type.b8d = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.1ac] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Base = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Base = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc15_3.4 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6ed = ref_param_pattern [concrete = constants.%self.param_patt.70b] +// CHECK:STDOUT: %self.patt: %pattern_type.6ed = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.2b0] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.base.507 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.base.507 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc15_3.4 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6ed = ref_param_pattern [concrete = constants.%self.param_patt.70b] +// CHECK:STDOUT: %self.patt: %pattern_type.6ed = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.2b0] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.base.507 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.base.507 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc15_3.5 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.746 = ref_param_pattern [concrete = constants.%self.param_patt.a2b] +// CHECK:STDOUT: %self.patt: %pattern_type.746 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d8a] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Derived = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Derived = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.5: %Destroy.WithSelf.Op.type.ef016f.5 = fn_decl @Destroy.WithSelf.Op.loc15_3.5 [concrete = constants.%Destroy.WithSelf.Op.403171.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.746 = ref_param_pattern [concrete = constants.%self.param_patt.a2b] +// CHECK:STDOUT: %self.patt: %pattern_type.746 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d8a] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Derived = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Derived = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: %Derived.decl: type = class_decl @Derived [concrete = constants.%Derived] {} {} // CHECK:STDOUT: } @@ -762,30 +869,75 @@ class T2(G2: type) { // CHECK:STDOUT: %d.patt: %pattern_type.746 = ref_binding_pattern d [concrete = constants.%d.patt] // CHECK:STDOUT: %d.var_patt: %pattern_type.746 = var_pattern %d.patt [concrete = constants.%d.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %d.var, constants.%Destroy.WithSelf.Op.403171.5 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%d.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %d.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%d.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc15_3.1(%self.param: ref %ptr.454) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc15_3.1(%self.param: ref %ptr.454) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc15_3.2(%self.param: ref %struct_type.vptr) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc15_3.1(%self.param: ref %ptr.454) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc15_3.2(%self.param: ref %struct_type.vptr) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc15_3.3(%self.param: ref %Base) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc15_3.2(%self.param: ref %struct_type.vptr) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc15_3.2(%self.param: ref %struct_type.vptr) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc15_3.3(%self.param: ref %Base) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc15_3.4(%self.param: ref %struct_type.base.507) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc15_3.3(%self.param: ref %Base) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc15_3.3(%self.param: ref %Base) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc15_3.4(%self.param: ref %struct_type.base.507) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc15_3.5(%self.param: ref %Derived) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc15_3.4(%self.param: ref %struct_type.base.507) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc15_3.4(%self.param: ref %struct_type.base.507) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc15_3.5(%self.param: ref %Derived) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc15_3.5(%self.param: ref %Derived) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc15_3.5(%self.param: ref %Derived) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.5(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.5(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -806,8 +958,28 @@ class T2(G2: type) { // CHECK:STDOUT: %Base.H: %Base.H.type = struct_value () [concrete] // CHECK:STDOUT: %Base.vtable_ptr: ref %ptr.454 = vtable_ptr @Base.vtable [concrete] // CHECK:STDOUT: %Base.val: %Base = struct_value (%Base.vtable_ptr) [concrete] +// CHECK:STDOUT: %pattern_type.258: type = pattern_type %ptr.454 [concrete] +// CHECK:STDOUT: %self.param_patt.2f4: %pattern_type.258 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.cf4: %pattern_type.258 = wrapper_binding_pattern self, %self.param_patt.2f4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc8_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.f1a: type = pattern_type %struct_type.vptr [concrete] +// CHECK:STDOUT: %self.param_patt.783: %pattern_type.f1a = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.8ea: %pattern_type.f1a = wrapper_binding_pattern self, %self.param_patt.783 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc8_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.9d9: %pattern_type.b8d = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.1ac: %pattern_type.b8d = wrapper_binding_pattern self, %self.param_patt.9d9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc8_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -818,6 +990,51 @@ class T2(G2: type) { // CHECK:STDOUT: %Modifiers.Base: type = import_ref Modifiers//default, Base, loaded [concrete = constants.%Base] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.258 = ref_param_pattern [concrete = constants.%self.param_patt.2f4] +// CHECK:STDOUT: %self.patt: %pattern_type.258 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cf4] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr.454 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr.454 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc8_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.258 = ref_param_pattern [concrete = constants.%self.param_patt.2f4] +// CHECK:STDOUT: %self.patt: %pattern_type.258 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cf4] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr.454 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr.454 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f1a = ref_param_pattern [concrete = constants.%self.param_patt.783] +// CHECK:STDOUT: %self.patt: %pattern_type.f1a = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.8ea] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.vptr = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.vptr = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc8_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f1a = ref_param_pattern [concrete = constants.%self.param_patt.783] +// CHECK:STDOUT: %self.patt: %pattern_type.f1a = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.8ea] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.vptr = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.vptr = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b8d = ref_param_pattern [concrete = constants.%self.param_patt.9d9] +// CHECK:STDOUT: %self.patt: %pattern_type.b8d = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.1ac] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Base = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Base = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc8_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b8d = ref_param_pattern [concrete = constants.%self.param_patt.9d9] +// CHECK:STDOUT: %self.patt: %pattern_type.b8d = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.1ac] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Base = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Base = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: vtable @Base.vtable { // CHECK:STDOUT: constants.%Base.H // CHECK:STDOUT: } @@ -841,20 +1058,47 @@ class T2(G2: type) { // CHECK:STDOUT: %v.patt: %pattern_type.b8d = ref_binding_pattern v [concrete = constants.%v.patt] // CHECK:STDOUT: %v.var_patt: %pattern_type.b8d = var_pattern %v.patt [concrete = constants.%v.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %v.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%v.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %v.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%v.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.1(%self.param: ref %ptr.454) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.1(%self.param: ref %ptr.454) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.2(%self.param: ref %struct_type.vptr) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.1(%self.param: ref %ptr.454) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.2(%self.param: ref %struct_type.vptr) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.3(%self.param: ref %Base) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.2(%self.param: ref %struct_type.vptr) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.2(%self.param: ref %struct_type.vptr) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.3(%self.param: ref %Base) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.3(%self.param: ref %Base) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.3(%self.param: ref %Base) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -868,6 +1112,7 @@ class T2(G2: type) { // CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] +// CHECK:STDOUT: %pattern_type.6b6: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %pattern_type.912: type = pattern_type %Base [concrete] // CHECK:STDOUT: %ptr.454: type = ptr_type [concrete] // CHECK:STDOUT: %struct_type.vptr.m1.m2: type = struct_type {.: %ptr.454, .m1: %i32, .m2: %i32} [concrete] @@ -909,8 +1154,41 @@ class T2(G2: type) { // CHECK:STDOUT: %bound_method.c9d: = bound_method %int_5.64b, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_5.eef: %i32 = int_value 5 [concrete] // CHECK:STDOUT: %Base.val: %Base = struct_value (%Base.vtable_ptr, %int_5.eef, %int_3.410) [concrete] +// CHECK:STDOUT: %pattern_type.258: type = pattern_type %ptr.454 [concrete] +// CHECK:STDOUT: %self.param_patt.2f4: %pattern_type.258 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.cf4: %pattern_type.258 = wrapper_binding_pattern self, %self.param_patt.2f4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc15_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc15_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc15_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc15_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc15_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc15_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.b19: type = pattern_type %struct_type.vptr.m1.m2 [concrete] +// CHECK:STDOUT: %self.param_patt.12b: %pattern_type.b19 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.e08: %pattern_type.b19 = wrapper_binding_pattern self, %self.param_patt.12b [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc15_3.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc15_3.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.21c: %pattern_type.912 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.26b: %pattern_type.912 = wrapper_binding_pattern self, %self.param_patt.21c [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc15_3.5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.5: type = fn_type @Destroy.WithSelf.Op.loc15_3.5 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.5: %Destroy.WithSelf.Op.type.ef016f.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5: type = fn_type @Destroy.WithSelf.SelfDestruct.loc15_3.5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.5: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -920,6 +1198,79 @@ class T2(G2: type) { // CHECK:STDOUT: %Copy.impl_witness_table.8d2 = impl_witness_table (%Core.import_ref.cd6), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc15_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.258 = ref_param_pattern [concrete = constants.%self.param_patt.2f4] +// CHECK:STDOUT: %self.patt: %pattern_type.258 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cf4] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr.454 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr.454 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc15_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.258 = ref_param_pattern [concrete = constants.%self.param_patt.2f4] +// CHECK:STDOUT: %self.patt: %pattern_type.258 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cf4] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr.454 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr.454 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc15_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc15_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc15_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc15_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc15_3.4 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b19 = ref_param_pattern [concrete = constants.%self.param_patt.12b] +// CHECK:STDOUT: %self.patt: %pattern_type.b19 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.e08] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.vptr.m1.m2 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.vptr.m1.m2 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc15_3.4 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b19 = ref_param_pattern [concrete = constants.%self.param_patt.12b] +// CHECK:STDOUT: %self.patt: %pattern_type.b19 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.e08] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.vptr.m1.m2 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.vptr.m1.m2 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc15_3.5 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.912 = ref_param_pattern [concrete = constants.%self.param_patt.21c] +// CHECK:STDOUT: %self.patt: %pattern_type.912 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.26b] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Base = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Base = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.5: %Destroy.WithSelf.Op.type.ef016f.5 = fn_decl @Destroy.WithSelf.Op.loc15_3.5 [concrete = constants.%Destroy.WithSelf.Op.403171.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.912 = ref_param_pattern [concrete = constants.%self.param_patt.21c] +// CHECK:STDOUT: %self.patt: %pattern_type.912 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.26b] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Base = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Base = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: vtable @Base.vtable { // CHECK:STDOUT: @Base.%Base.F.decl // CHECK:STDOUT: } @@ -992,29 +1343,74 @@ class T2(G2: type) { // CHECK:STDOUT: %b2.var_patt: %pattern_type.912 = var_pattern %b2.patt [concrete = constants.%b2.var_patt] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc15: = bound_method %b2.var, constants.%Destroy.WithSelf.Op.403171.5 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc15: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc15(%b2.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc14: = bound_method %b1.var, constants.%Destroy.WithSelf.Op.403171.5 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc14: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc14(%b1.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc15: = bound_method %b2.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc15: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc15(%b2.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14: = bound_method %b1.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14(%b1.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc15_3.1(%self.param: ref %ptr.454) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc15_3.1(%self.param: ref %ptr.454) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc15_3.1(%self.param: ref %ptr.454) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc15_3.2(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc15_3.2(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc15_3.3(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc15_3.2(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc15_3.3(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc15_3.4(%self.param: ref %struct_type.vptr.m1.m2) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc15_3.3(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc15_3.3(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc15_3.4(%self.param: ref %struct_type.vptr.m1.m2) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc15_3.5(%self.param: ref %Base) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc15_3.4(%self.param: ref %struct_type.vptr.m1.m2) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc15_3.4(%self.param: ref %struct_type.vptr.m1.m2) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc15_3.5(%self.param: ref %Base) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc15_3.5(%self.param: ref %Base) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc15_3.5(%self.param: ref %Base) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.5(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.5(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1172,6 +1568,7 @@ class T2(G2: type) { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %ImplicitAs.type.a74: type = facet_type <@ImplicitAs, @ImplicitAs(%T1)> [concrete] // CHECK:STDOUT: %ImplicitAs.impl_witness: = impl_witness @T2.as.ImplicitAs.impl.%ImplicitAs.impl_witness_table [concrete] +// CHECK:STDOUT: %pattern_type.7a3: type = pattern_type %T2 [concrete] // CHECK:STDOUT: %T2.as.ImplicitAs.impl.Convert.type: type = fn_type @T2.as.ImplicitAs.impl.Convert [concrete] // CHECK:STDOUT: %T2.as.ImplicitAs.impl.Convert: %T2.as.ImplicitAs.impl.Convert.type = struct_value () [concrete] // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.a74 = facet_value %T2, (%ImplicitAs.impl_witness) [concrete] @@ -1184,8 +1581,52 @@ class T2(G2: type) { // CHECK:STDOUT: %Derived.F.type.48cdab.2: type = fn_type @Derived.F.loc23 [concrete] // CHECK:STDOUT: %Derived.F.bd5be1.2: %Derived.F.type.48cdab.2 = struct_value () [concrete] // CHECK:STDOUT: %.8c0: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.0b2, %ImplicitAs.facet [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc23_28.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc23_28.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.995: %pattern_type.7a3 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.bbf: %pattern_type.7a3 = wrapper_binding_pattern self, %self.param_patt.995 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc23_28.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc23_28.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc23_28.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc23_28.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc23_28.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc23_28.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.7a3 = ref_param_pattern [concrete = constants.%self.param_patt.995] +// CHECK:STDOUT: %self.patt: %pattern_type.7a3 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.bbf] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %T2 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %T2 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc23_28.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.7a3 = ref_param_pattern [concrete = constants.%self.param_patt.995] +// CHECK:STDOUT: %self.patt: %pattern_type.7a3 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.bbf] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %T2 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %T2 = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Derived { @@ -1244,15 +1685,33 @@ class T2(G2: type) { // 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.Op.bound: = bound_method %.loc23_28.4, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%.loc23_28.4) +// 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: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc23_28.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc23_28.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc23_28.2(%self.param: ref %T2) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc23_28.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc23_28.2(%self.param: ref %T2) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc23_28.2(%self.param: ref %T2) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc23_28.2(%self.param: ref %T2) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/nested.carbon b/toolchain/check/testdata/class/nested.carbon index 81e9fb44546a..3226a48f5a25 100644 --- a/toolchain/check/testdata/class/nested.carbon +++ b/toolchain/check/testdata/class/nested.carbon @@ -99,10 +99,48 @@ fn F(a: Outer*) { // CHECK:STDOUT: %DefaultOrUnformed.facet.809: %DefaultOrUnformed.type = facet_value %Inner, (%DefaultOrUnformed.impl_witness.f70) [concrete] // CHECK:STDOUT: %T.as.DefaultOrUnformed.impl.Op.specific_fn.ce1: = specific_function %T.as.DefaultOrUnformed.impl.Op.0e7, @T.as.DefaultOrUnformed.impl.Op(%Inner) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %self.param_patt.4dd: %pattern_type.36a = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.52a: %pattern_type.36a = wrapper_binding_pattern self, %self.param_patt.4dd [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc19_5.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc19_5.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.a6e: %pattern_type.647 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.b68: %pattern_type.647 = wrapper_binding_pattern self, %self.param_patt.a6e [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc19_5.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc19_5.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.643: type = pattern_type %struct_type.pi.po.qi [concrete] +// CHECK:STDOUT: %self.param_patt.2c8: %pattern_type.643 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.f02: %pattern_type.643 = wrapper_binding_pattern self, %self.param_patt.2c8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc19_5.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc19_5.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.c59: %pattern_type.dc4 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.7d9: %pattern_type.dc4 = wrapper_binding_pattern self, %self.param_patt.c59 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc19_5.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc19_5.4 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc19_5.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.15c: type = pattern_type %struct_type.po.qo.pi [concrete] +// CHECK:STDOUT: %self.param_patt.d58: %pattern_type.15c = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.116: %pattern_type.15c = wrapper_binding_pattern self, %self.param_patt.d58 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc18_5.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.5: type = fn_type @Destroy.WithSelf.Op.loc18_5.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.5: %Destroy.WithSelf.Op.type.ef016f.5 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.0a9: %pattern_type.d6c = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.da1: %pattern_type.d6c = wrapper_binding_pattern self, %self.param_patt.0a9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc18_5.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.6: type = fn_type @Destroy.WithSelf.Op.loc18_5.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.6: %Destroy.WithSelf.Op.type.ef016f.6 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.6: type = fn_type @Destroy.WithSelf.SelfDestruct.loc18_5.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.6: %Destroy.WithSelf.SelfDestruct.type.fbceb5.6 = struct_value () [concrete] // CHECK:STDOUT: %o.patt.a05f50.2: %pattern_type.d6c = ref_binding_pattern o [concrete] // CHECK:STDOUT: %o.var_patt.6496fb.2: %pattern_type.d6c = var_pattern %o.patt.a05f50.2 [concrete] // CHECK:STDOUT: %i.patt.539460.2: %pattern_type.dc4 = ref_binding_pattern i [concrete] @@ -152,6 +190,93 @@ fn F(a: Outer*) { // CHECK:STDOUT: %Copy.impl_witness_table.fb0 = impl_witness_table (%Core.import_ref.e5f), @ptr.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc19_5.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.36a = ref_param_pattern [concrete = constants.%self.param_patt.4dd] +// CHECK:STDOUT: %self.patt: %pattern_type.36a = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.52a] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr.001 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr.001 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc19_5.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.36a = ref_param_pattern [concrete = constants.%self.param_patt.4dd] +// CHECK:STDOUT: %self.patt: %pattern_type.36a = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.52a] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr.001 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr.001 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc19_5.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.647 = ref_param_pattern [concrete = constants.%self.param_patt.a6e] +// CHECK:STDOUT: %self.patt: %pattern_type.647 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.b68] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr.286 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr.286 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc19_5.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.647 = ref_param_pattern [concrete = constants.%self.param_patt.a6e] +// CHECK:STDOUT: %self.patt: %pattern_type.647 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.b68] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr.286 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr.286 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc19_5.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.643 = ref_param_pattern [concrete = constants.%self.param_patt.2c8] +// CHECK:STDOUT: %self.patt: %pattern_type.643 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.f02] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.pi.po.qi = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.pi.po.qi = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc19_5.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.643 = ref_param_pattern [concrete = constants.%self.param_patt.2c8] +// CHECK:STDOUT: %self.patt: %pattern_type.643 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.f02] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.pi.po.qi = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.pi.po.qi = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc19_5.4 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.dc4 = ref_param_pattern [concrete = constants.%self.param_patt.c59] +// CHECK:STDOUT: %self.patt: %pattern_type.dc4 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.7d9] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Inner = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Inner = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc19_5.4 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.dc4 = ref_param_pattern [concrete = constants.%self.param_patt.c59] +// CHECK:STDOUT: %self.patt: %pattern_type.dc4 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.7d9] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Inner = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Inner = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc18_5.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.15c = ref_param_pattern [concrete = constants.%self.param_patt.d58] +// CHECK:STDOUT: %self.patt: %pattern_type.15c = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.116] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.po.qo.pi = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.po.qo.pi = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.5: %Destroy.WithSelf.Op.type.ef016f.5 = fn_decl @Destroy.WithSelf.Op.loc18_5.1 [concrete = constants.%Destroy.WithSelf.Op.403171.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.15c = ref_param_pattern [concrete = constants.%self.param_patt.d58] +// CHECK:STDOUT: %self.patt: %pattern_type.15c = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.116] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.po.qo.pi = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.po.qo.pi = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc18_5.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.d6c = ref_param_pattern [concrete = constants.%self.param_patt.0a9] +// CHECK:STDOUT: %self.patt: %pattern_type.d6c = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.da1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Outer = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Outer = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.6: %Destroy.WithSelf.Op.type.ef016f.6 = fn_decl @Destroy.WithSelf.Op.loc18_5.2 [concrete = constants.%Destroy.WithSelf.Op.403171.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.d6c = ref_param_pattern [concrete = constants.%self.param_patt.0a9] +// CHECK:STDOUT: %self.patt: %pattern_type.d6c = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.da1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Outer = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Outer = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -262,10 +387,10 @@ fn F(a: Outer*) { // CHECK:STDOUT: %i.patt: %pattern_type.dc4 = ref_binding_pattern i [concrete = constants.%i.patt.539460.1] // CHECK:STDOUT: %i.var_patt: %pattern_type.dc4 = var_pattern %i.patt [concrete = constants.%i.var_patt.15311d.1] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc19: = bound_method %i.var, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc19: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc19(%i.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc18: = bound_method %o.var, constants.%Destroy.WithSelf.Op.403171.6 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc18: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc18(%o.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc19: = bound_method %i.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc19: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc19(%i.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc18: = bound_method %o.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.6 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc18: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc18(%o.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -301,10 +426,10 @@ fn F(a: Outer*) { // CHECK:STDOUT: %i.patt: %pattern_type.dc4 = ref_binding_pattern i [concrete = constants.%i.patt.539460.2] // CHECK:STDOUT: %i.var_patt: %pattern_type.dc4 = var_pattern %i.patt [concrete = constants.%i.var_patt.15311d.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc30: = bound_method %i.var, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc30: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc30(%i.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc29: = bound_method %o.var, constants.%Destroy.WithSelf.Op.403171.6 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc29: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc29(%o.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc30: = bound_method %i.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc30: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc30(%i.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc29: = bound_method %o.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.6 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc29: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc29(%o.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -340,34 +465,88 @@ fn F(a: Outer*) { // CHECK:STDOUT: %i.patt: %pattern_type.dc4 = ref_binding_pattern i [concrete = constants.%i.patt.539460.3] // CHECK:STDOUT: %i.var_patt: %pattern_type.dc4 = var_pattern %i.patt [concrete = constants.%i.var_patt.15311d.3] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc37: = bound_method %i.var, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc37: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc37(%i.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc36: = bound_method %o.var, constants.%Destroy.WithSelf.Op.403171.6 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc36: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc36(%o.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc37: = bound_method %i.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc37: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc37(%i.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc36: = bound_method %o.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.6 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc36: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc36(%o.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc19_5.1(%self.param: ref %ptr.001) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc19_5.1(%self.param: ref %ptr.001) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc19_5.1(%self.param: ref %ptr.001) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc19_5.2(%self.param: ref %ptr.286) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc19_5.2(%self.param: ref %ptr.286) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc19_5.3(%self.param: ref %struct_type.pi.po.qi) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc19_5.2(%self.param: ref %ptr.286) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc19_5.3(%self.param: ref %struct_type.pi.po.qi) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc19_5.4(%self.param: ref %Inner) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc19_5.3(%self.param: ref %struct_type.pi.po.qi) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc19_5.3(%self.param: ref %struct_type.pi.po.qi) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc19_5.4(%self.param: ref %Inner) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18_5.1(%self.param: ref %struct_type.po.qo.pi) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc19_5.4(%self.param: ref %Inner) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc19_5.4(%self.param: ref %Inner) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc18_5.1(%self.param: ref %struct_type.po.qo.pi) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18_5.2(%self.param: ref %Outer) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18_5.1(%self.param: ref %struct_type.po.qo.pi) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc18_5.1(%self.param: ref %struct_type.po.qo.pi) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.5(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.5(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc18_5.2(%self.param: ref %Outer) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18_5.2(%self.param: ref %Outer) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc18_5.2(%self.param: ref %Outer) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.6(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.6(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/nested_name.carbon b/toolchain/check/testdata/class/nested_name.carbon index 1023a00c86b2..855e255b8475 100644 --- a/toolchain/check/testdata/class/nested_name.carbon +++ b/toolchain/check/testdata/class/nested_name.carbon @@ -80,8 +80,34 @@ fn G(o: Outer) { // CHECK:STDOUT: %DefaultOrUnformed.facet: %DefaultOrUnformed.type = facet_value %Inner, (%DefaultOrUnformed.impl_witness.f70) [concrete] // CHECK:STDOUT: %T.as.DefaultOrUnformed.impl.Op.specific_fn: = specific_function %T.as.DefaultOrUnformed.impl.Op.0e7, @T.as.DefaultOrUnformed.impl.Op(%Inner) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc26_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc26_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc26_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc26_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.b13: type = pattern_type %struct_type.n [concrete] +// CHECK:STDOUT: %self.param_patt.e77: %pattern_type.b13 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.b1b: %pattern_type.b13 = wrapper_binding_pattern self, %self.param_patt.e77 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc26_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc26_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.c59: %pattern_type.dc4 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.7d9: %pattern_type.dc4 = wrapper_binding_pattern self, %self.param_patt.c59 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc26_3.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc26_3.4 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc26_3.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -103,6 +129,65 @@ fn G(o: Outer) { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc26_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc26_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc26_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc26_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc26_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b13 = ref_param_pattern [concrete = constants.%self.param_patt.e77] +// CHECK:STDOUT: %self.patt: %pattern_type.b13 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.b1b] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.n = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.n = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc26_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b13 = ref_param_pattern [concrete = constants.%self.param_patt.e77] +// CHECK:STDOUT: %self.patt: %pattern_type.b13 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.b1b] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.n = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.n = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc26_3.4 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.dc4 = ref_param_pattern [concrete = constants.%self.param_patt.c59] +// CHECK:STDOUT: %self.patt: %pattern_type.dc4 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.7d9] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Inner = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Inner = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc26_3.4 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.dc4 = ref_param_pattern [concrete = constants.%self.param_patt.c59] +// CHECK:STDOUT: %self.patt: %pattern_type.dc4 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.7d9] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Inner = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Inner = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -195,25 +280,61 @@ fn G(o: Outer) { // CHECK:STDOUT: %i.patt: %pattern_type.dc4 = ref_binding_pattern i [concrete = constants.%i.patt] // CHECK:STDOUT: %i.var_patt: %pattern_type.dc4 = var_pattern %i.patt [concrete = constants.%i.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %i.var, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%i.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %i.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%i.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc26_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc26_3.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc26_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc26_3.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc26_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc26_3.3(%self.param: ref %struct_type.n) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc26_3.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc26_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc26_3.3(%self.param: ref %struct_type.n) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc26_3.4(%self.param: ref %Inner) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc26_3.3(%self.param: ref %struct_type.n) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc26_3.3(%self.param: ref %struct_type.n) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc26_3.4(%self.param: ref %Inner) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc26_3.4(%self.param: ref %Inner) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc26_3.4(%self.param: ref %Inner) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/reorder_qualified.carbon b/toolchain/check/testdata/class/reorder_qualified.carbon index 4c957ef3f13d..5f962b826116 100644 --- a/toolchain/check/testdata/class/reorder_qualified.carbon +++ b/toolchain/check/testdata/class/reorder_qualified.carbon @@ -65,6 +65,7 @@ class A { // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] +// CHECK:STDOUT: %pattern_type.6b6: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %B.elem: type = unbound_element_type %B, %i32 [concrete] // CHECK:STDOUT: %struct_type.b.0bf: type = struct_type {.b: %i32} [concrete] // CHECK:STDOUT: %complete_type.330: = complete_type_witness %struct_type.b.0bf [concrete] @@ -140,14 +141,79 @@ class A { // CHECK:STDOUT: %int_4.4eb: %i32 = int_value 4 [concrete] // CHECK:STDOUT: %D.val: %D = struct_value (%int_4.4eb) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc36_7.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc36_7.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc36_7.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc36_7.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.6ce: type = pattern_type %struct_type.d.bde [concrete] +// CHECK:STDOUT: %self.param_patt.e0c: %pattern_type.6ce = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.ab8: %pattern_type.6ce = wrapper_binding_pattern self, %self.param_patt.e0c [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc36_7.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc36_7.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.fa6: %pattern_type.a0b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.078: %pattern_type.a0b = wrapper_binding_pattern self, %self.param_patt.fa6 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc36_7.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc36_7.4 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc36_7.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.e1a: type = pattern_type %struct_type.c.73d [concrete] +// CHECK:STDOUT: %self.param_patt.c02: %pattern_type.e1a = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.e19: %pattern_type.e1a = wrapper_binding_pattern self, %self.param_patt.c02 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc35_7.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.5: type = fn_type @Destroy.WithSelf.Op.loc35_7.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.5: %Destroy.WithSelf.Op.type.ef016f.5 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.648: %pattern_type.ca8 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.f03: %pattern_type.ca8 = wrapper_binding_pattern self, %self.param_patt.648 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc35_7.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.6: type = fn_type @Destroy.WithSelf.Op.loc35_7.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.6: %Destroy.WithSelf.Op.type.ef016f.6 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.6: type = fn_type @Destroy.WithSelf.SelfDestruct.loc35_7.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.6: %Destroy.WithSelf.SelfDestruct.type.fbceb5.6 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.b29: type = pattern_type %struct_type.b.0bf [concrete] +// CHECK:STDOUT: %self.param_patt.11f: %pattern_type.b29 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.8a4: %pattern_type.b29 = wrapper_binding_pattern self, %self.param_patt.11f [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc34_7.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.7: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.7: type = fn_type @Destroy.WithSelf.Op.loc34_7.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.7: %Destroy.WithSelf.Op.type.ef016f.7 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.1a8: %pattern_type.e78 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.5fa: %pattern_type.e78 = wrapper_binding_pattern self, %self.param_patt.1a8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.8: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc34_7.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.8: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.8 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.8: type = fn_type @Destroy.WithSelf.Op.loc34_7.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.8: %Destroy.WithSelf.Op.type.ef016f.8 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.8: type = fn_type @Destroy.WithSelf.SelfDestruct.loc34_7.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.8: %Destroy.WithSelf.SelfDestruct.type.fbceb5.8 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.506: type = pattern_type %struct_type.a.a92 [concrete] +// CHECK:STDOUT: %self.param_patt.7eb: %pattern_type.506 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.68d: %pattern_type.506 = wrapper_binding_pattern self, %self.param_patt.7eb [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.9: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc33_7.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.9: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.9 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.9: type = fn_type @Destroy.WithSelf.Op.loc33_7.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.9: %Destroy.WithSelf.Op.type.ef016f.9 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.8fb: %pattern_type.9ef = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.e64: %pattern_type.9ef = wrapper_binding_pattern self, %self.param_patt.8fb [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.10: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc33_7.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.10: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.10 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.10: type = fn_type @Destroy.WithSelf.Op.loc33_7.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.10: %Destroy.WithSelf.Op.type.ef016f.10 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.10: type = fn_type @Destroy.WithSelf.SelfDestruct.loc33_7.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.10: %Destroy.WithSelf.SelfDestruct.type.fbceb5.10 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -165,6 +231,149 @@ class A { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc36_7.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc36_7.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc36_7.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc36_7.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc36_7.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6ce = ref_param_pattern [concrete = constants.%self.param_patt.e0c] +// CHECK:STDOUT: %self.patt: %pattern_type.6ce = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ab8] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.d.bde = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.d.bde = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc36_7.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6ce = ref_param_pattern [concrete = constants.%self.param_patt.e0c] +// CHECK:STDOUT: %self.patt: %pattern_type.6ce = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ab8] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.d.bde = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.d.bde = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc36_7.4 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.a0b = ref_param_pattern [concrete = constants.%self.param_patt.fa6] +// CHECK:STDOUT: %self.patt: %pattern_type.a0b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.078] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %D = ref_param call_param0 +// CHECK:STDOUT: %self: ref %D = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc36_7.4 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.a0b = ref_param_pattern [concrete = constants.%self.param_patt.fa6] +// CHECK:STDOUT: %self.patt: %pattern_type.a0b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.078] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %D = ref_param call_param0 +// CHECK:STDOUT: %self: ref %D = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc35_7.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e1a = ref_param_pattern [concrete = constants.%self.param_patt.c02] +// CHECK:STDOUT: %self.patt: %pattern_type.e1a = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.e19] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.c.73d = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.c.73d = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.5: %Destroy.WithSelf.Op.type.ef016f.5 = fn_decl @Destroy.WithSelf.Op.loc35_7.1 [concrete = constants.%Destroy.WithSelf.Op.403171.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e1a = ref_param_pattern [concrete = constants.%self.param_patt.c02] +// CHECK:STDOUT: %self.patt: %pattern_type.e1a = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.e19] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.c.73d = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.c.73d = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc35_7.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.ca8 = ref_param_pattern [concrete = constants.%self.param_patt.648] +// CHECK:STDOUT: %self.patt: %pattern_type.ca8 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.f03] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.6: %Destroy.WithSelf.Op.type.ef016f.6 = fn_decl @Destroy.WithSelf.Op.loc35_7.2 [concrete = constants.%Destroy.WithSelf.Op.403171.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.ca8 = ref_param_pattern [concrete = constants.%self.param_patt.648] +// CHECK:STDOUT: %self.patt: %pattern_type.ca8 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.f03] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.7: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc34_7.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.7] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b29 = ref_param_pattern [concrete = constants.%self.param_patt.11f] +// CHECK:STDOUT: %self.patt: %pattern_type.b29 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.8a4] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.b.0bf = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.b.0bf = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.7: %Destroy.WithSelf.Op.type.ef016f.7 = fn_decl @Destroy.WithSelf.Op.loc34_7.1 [concrete = constants.%Destroy.WithSelf.Op.403171.7] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b29 = ref_param_pattern [concrete = constants.%self.param_patt.11f] +// CHECK:STDOUT: %self.patt: %pattern_type.b29 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.8a4] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.b.0bf = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.b.0bf = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.8: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.8 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc34_7.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.8] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e78 = ref_param_pattern [concrete = constants.%self.param_patt.1a8] +// CHECK:STDOUT: %self.patt: %pattern_type.e78 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.5fa] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %B = ref_param call_param0 +// CHECK:STDOUT: %self: ref %B = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.8: %Destroy.WithSelf.Op.type.ef016f.8 = fn_decl @Destroy.WithSelf.Op.loc34_7.2 [concrete = constants.%Destroy.WithSelf.Op.403171.8] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e78 = ref_param_pattern [concrete = constants.%self.param_patt.1a8] +// CHECK:STDOUT: %self.patt: %pattern_type.e78 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.5fa] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %B = ref_param call_param0 +// CHECK:STDOUT: %self: ref %B = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.9: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.9 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc33_7.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.9] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.506 = ref_param_pattern [concrete = constants.%self.param_patt.7eb] +// CHECK:STDOUT: %self.patt: %pattern_type.506 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.68d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.a.a92 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.a.a92 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.9: %Destroy.WithSelf.Op.type.ef016f.9 = fn_decl @Destroy.WithSelf.Op.loc33_7.1 [concrete = constants.%Destroy.WithSelf.Op.403171.9] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.506 = ref_param_pattern [concrete = constants.%self.param_patt.7eb] +// CHECK:STDOUT: %self.patt: %pattern_type.506 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.68d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.a.a92 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.a.a92 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.10: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.10 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc33_7.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.10] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.9ef = ref_param_pattern [concrete = constants.%self.param_patt.8fb] +// CHECK:STDOUT: %self.patt: %pattern_type.9ef = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.e64] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %A = ref_param call_param0 +// CHECK:STDOUT: %self: ref %A = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.10: %Destroy.WithSelf.Op.type.ef016f.10 = fn_decl @Destroy.WithSelf.Op.loc33_7.2 [concrete = constants.%Destroy.WithSelf.Op.403171.10] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.9ef = ref_param_pattern [concrete = constants.%self.param_patt.8fb] +// CHECK:STDOUT: %self.patt: %pattern_type.9ef = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.e64] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %A = ref_param call_param0 +// CHECK:STDOUT: %self: ref %A = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -350,14 +559,14 @@ class A { // CHECK:STDOUT: %C.CF.call: init %empty_tuple.type = call %CF.ref() // CHECK:STDOUT: %DF.ref: %D.DF.type = name_ref DF, @D.%D.DF.decl [concrete = constants.%D.DF] // CHECK:STDOUT: %D.DF.call: init %empty_tuple.type = call %DF.ref() -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc36: = bound_method %d.var, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc36: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc36(%d.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc35: = bound_method %c.var, constants.%Destroy.WithSelf.Op.403171.6 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc35: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc35(%c.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc34: = bound_method %b.var, constants.%Destroy.WithSelf.Op.403171.8 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc34: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc34(%b.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc33: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.10 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc33: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc33(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc36: = bound_method %d.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc36: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc36(%d.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc35: = bound_method %c.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.6 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc35: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc35(%c.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc34: = bound_method %b.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.8 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc34: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc34(%b.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc33: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.10 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc33: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc33(%a.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -365,50 +574,140 @@ class A { // CHECK:STDOUT: // CHECK:STDOUT: fn @A.AF(); // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc36_7.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc36_7.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc36_7.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc36_7.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc36_7.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc36_7.3(%self.param: ref %struct_type.d.bde) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc36_7.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc36_7.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc36_7.3(%self.param: ref %struct_type.d.bde) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc36_7.4(%self.param: ref %D) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc36_7.3(%self.param: ref %struct_type.d.bde) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc36_7.3(%self.param: ref %struct_type.d.bde) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc36_7.4(%self.param: ref %D) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc35_7.1(%self.param: ref %struct_type.c.73d) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc36_7.4(%self.param: ref %D) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc36_7.4(%self.param: ref %D) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc35_7.1(%self.param: ref %struct_type.c.73d) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc35_7.2(%self.param: ref %C) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc35_7.1(%self.param: ref %struct_type.c.73d) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc35_7.1(%self.param: ref %struct_type.c.73d) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.5(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.5(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc35_7.2(%self.param: ref %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc34_7.1(%self.param: ref %struct_type.b.0bf) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc35_7.2(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc35_7.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.6(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.6(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc34_7.1(%self.param: ref %struct_type.b.0bf) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc34_7.2(%self.param: ref %B) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc34_7.1(%self.param: ref %struct_type.b.0bf) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc34_7.1(%self.param: ref %struct_type.b.0bf) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.7(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.7(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc34_7.2(%self.param: ref %B) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc33_7.1(%self.param: ref %struct_type.a.a92) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc34_7.2(%self.param: ref %B) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc34_7.2(%self.param: ref %B) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.8(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.8(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc33_7.1(%self.param: ref %struct_type.a.a92) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc33_7.2(%self.param: ref %A) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc33_7.1(%self.param: ref %struct_type.a.a92) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc33_7.1(%self.param: ref %struct_type.a.a92) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.9(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.9(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc33_7.2(%self.param: ref %A) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc33_7.2(%self.param: ref %A) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc33_7.2(%self.param: ref %A) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.10(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.10(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/scope.carbon b/toolchain/check/testdata/class/scope.carbon index e35cc885e341..d45438d96c6d 100644 --- a/toolchain/check/testdata/class/scope.carbon +++ b/toolchain/check/testdata/class/scope.carbon @@ -82,8 +82,21 @@ fn Run() { // CHECK:STDOUT: %b.patt: %pattern_type.6b6 = ref_binding_pattern b [concrete] // CHECK:STDOUT: %b.var_patt: %pattern_type.6b6 = var_pattern %b.patt [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc31_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc31_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc31_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc31_3.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc31_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -101,6 +114,37 @@ fn Run() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc31_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc31_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc31_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc31_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -204,17 +248,35 @@ fn Run() { // CHECK:STDOUT: %b.patt: %pattern_type.6b6 = ref_binding_pattern b [concrete = constants.%b.patt] // CHECK:STDOUT: %b.var_patt: %pattern_type.6b6 = var_pattern %b.patt [concrete = constants.%b.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc31: = bound_method %b.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc31: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc31(%b.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc30: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc30: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc30(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc31: = bound_method %b.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc31: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc31(%b.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc30: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc30: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc30(%a.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc31_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc31_3.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc31_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc31_3.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc31_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc31_3.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc31_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/self/fail_ref_self.carbon b/toolchain/check/testdata/class/self/fail_ref_self.carbon index 47a3d09e5ac8..4a9964358dae 100644 --- a/toolchain/check/testdata/class/self/fail_ref_self.carbon +++ b/toolchain/check/testdata/class/self/fail_ref_self.carbon @@ -62,8 +62,19 @@ fn F(c: Class, p: Class*) { // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc35_8.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc35_8.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc35_8.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc35_8.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc35_8.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -75,6 +86,37 @@ fn F(c: Class, p: Class*) { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc35_8.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc35_8.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc35_8.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f15 = ref_param_pattern [concrete = constants.%self.param_patt.b2b] +// CHECK:STDOUT: %self.patt: %pattern_type.f15 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.f19] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Class = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Class = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc35_8.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f15 = ref_param_pattern [concrete = constants.%self.param_patt.b2b] +// CHECK:STDOUT: %self.patt: %pattern_type.f15 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.f19] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Class = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Class = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -150,15 +192,33 @@ fn F(c: Class, p: Class*) { // CHECK:STDOUT: %F.ref.loc35: %Class.F.type = name_ref F, @Class.%Class.F.decl [concrete = constants.%Class.F] // CHECK:STDOUT: %Class.F.bound.loc35: = bound_method %.loc35_8.2, %F.ref.loc35 // CHECK:STDOUT: %Class.F.call.loc35: init %empty_tuple.type = call %Class.F.bound.loc35(%.loc35_8.2) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.loc35_8.2, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%.loc35_8.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc35_8.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc35_8.2) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc35_8.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc35_8.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc35_8.2(%self.param: ref %Class) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc35_8.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc35_8.2(%self.param: ref %Class) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc35_8.2(%self.param: ref %Class) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc35_8.2(%self.param: ref %Class) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/self/raw_self_type.carbon b/toolchain/check/testdata/class/self/raw_self_type.carbon index 5cd44393098f..aac721ca3449 100644 --- a/toolchain/check/testdata/class/self/raw_self_type.carbon +++ b/toolchain/check/testdata/class/self/raw_self_type.carbon @@ -63,8 +63,14 @@ fn MemberNamedSelf.F(unused x: Self, unused y: r#Self) {} // CHECK:STDOUT: %.8ed: type = fn_type_with_self_type %Copy.WithSelf.Op.type.707, %Copy.facet [concrete] // CHECK:STDOUT: %ptr.as.Copy.impl.Op.specific_fn: = specific_function %ptr.as.Copy.impl.Op.8fa, @ptr.as.Copy.impl.Op(%Class) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %self.param_patt.fb6: %pattern_type.8c5 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.0e3: %pattern_type.8c5 = wrapper_binding_pattern self, %self.param_patt.fb6 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfc: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc18 [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.loc18 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc18 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: %MemberNamedSelf: type = class_type @MemberNamedSelf [concrete] // CHECK:STDOUT: %Self.7fc: type = class_type @Self [concrete] // CHECK:STDOUT: %pattern_type.bb1: type = pattern_type %MemberNamedSelf [concrete] @@ -94,6 +100,23 @@ fn MemberNamedSelf.F(unused x: Self, unused y: r#Self) {} // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl: %Destroy.WithSelf.SubobjectDestroy.type.dfc = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc18 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.8c5 = ref_param_pattern [concrete = constants.%self.param_patt.fb6] +// CHECK:STDOUT: %self.patt: %pattern_type.8c5 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.0e3] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr.7ee = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr.7ee = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc18 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.8c5 = ref_param_pattern [concrete = constants.%self.param_patt.fb6] +// CHECK:STDOUT: %self.patt: %pattern_type.8c5 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.0e3] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr.7ee = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr.7ee = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -197,15 +220,24 @@ fn MemberNamedSelf.F(unused x: Self, unused y: r#Self) {} // CHECK:STDOUT: %p.patt: %pattern_type.8c5 = ref_binding_pattern p [concrete = constants.%p.patt] // CHECK:STDOUT: %p.var_patt: %pattern_type.8c5 = var_pattern %p.patt [concrete = constants.%p.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc18: = bound_method %p.var, constants.%Destroy.WithSelf.Op.403 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc18: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc18(%p.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc17: = bound_method %Self.var, constants.%Destroy.WithSelf.Op.403 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc17: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc17(%Self.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc18: = bound_method %p.var, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc18: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc18(%p.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc17: = bound_method %Self.var, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc17: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc17(%Self.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc18(%self.param: ref %ptr.7ee) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18(%self.param: ref %ptr.7ee) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc18(%self.param: ref %ptr.7ee) { +// 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) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @MemberNamedSelf.F(%x.param.loc28: %MemberNamedSelf, %y.param.loc28: %Self.7fc) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/deduce/array.carbon b/toolchain/check/testdata/deduce/array.carbon index a6c4a0656427..17b7052a8af6 100644 --- a/toolchain/check/testdata/deduce/array.carbon +++ b/toolchain/check/testdata/deduce/array.carbon @@ -168,7 +168,7 @@ fn G() { // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] -// CHECK:STDOUT: %require_complete: = require_complete_type %array_type.3ec [symbolic] +// CHECK:STDOUT: %require_complete.ff3: = require_complete_type %array_type.3ec [symbolic] // CHECK:STDOUT: %F.specific_fn.eab: = specific_function %F, @F(%T) [symbolic] // CHECK:STDOUT: %.a44: Core.Form = init_form %C [concrete] // CHECK:STDOUT: %pattern_type.98b: type = pattern_type %C [concrete] @@ -192,8 +192,27 @@ fn G() { // CHECK:STDOUT: %a.patt.40c: %pattern_type.3f5 = wrapper_binding_pattern a, %a.param_patt.79a [concrete] // CHECK:STDOUT: %F.specific_fn.e0d: = specific_function %F, @F(%C) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc9_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.99a: %pattern_type.98b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.cbd: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt.99a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.2ae: %pattern_type.3f5 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.277: %pattern_type.3f5 = wrapper_binding_pattern self, %self.param_patt.2ae [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc9_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] // CHECK:STDOUT: %complete_type.1a4: = complete_type_witness %array_type.9a3 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -206,6 +225,51 @@ fn G() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc9_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc9_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.3f5 = ref_param_pattern [concrete = constants.%self.param_patt.2ae] +// CHECK:STDOUT: %self.patt: %pattern_type.3f5 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.277] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type.9a3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type.9a3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc9_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.3f5 = ref_param_pattern [concrete = constants.%self.param_patt.2ae] +// CHECK:STDOUT: %self.patt: %pattern_type.3f5 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.277] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type.9a3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type.9a3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -271,7 +335,7 @@ fn G() { // CHECK:STDOUT: %return.patt.loc6_31.2: @F.%pattern_type.loc6_34 (%pattern_type.51d) = return_slot_pattern %return.param_patt.loc6_34.2, %T.loc6_7.1 [symbolic = %return.patt.loc6_31.2 (constants.%return.patt.b39)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %array_type.loc6_28.1 [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type %array_type.loc6_28.1 [symbolic = %require_complete (constants.%require_complete.ff3)] // CHECK:STDOUT: %F.specific_fn.loc6_45.2: = specific_function constants.%F, @F(%T.loc6_7.1) [symbolic = %F.specific_fn.loc6_45.2 (constants.%F.specific_fn.eab)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%a.param: @F.%array_type.loc6_28.1 (%array_type.3ec)) -> out %return.param: @F.%T.loc6_7.1 (%T) { @@ -323,20 +387,47 @@ fn G() { // CHECK:STDOUT: %.loc8_11.1: ref %C = splice_block %return.param {} // CHECK:STDOUT: %.loc10: %array_type.9a3 = acquire_value %a.ref // CHECK:STDOUT: %F.call: init %C to %.loc8_11.1 = call %F.specific_fn(%.loc10) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%a.var) // CHECK:STDOUT: return %F.call to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.2(%self.param: ref %C) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.2(%self.param: ref %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.3(%self.param: ref %array_type.9a3) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.2(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.2(%self.param: ref %C) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.3(%self.param: ref %array_type.9a3) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.3(%self.param: ref %array_type.9a3) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.3(%self.param: ref %array_type.9a3) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -353,7 +444,7 @@ fn G() { // CHECK:STDOUT: %return.patt.loc6_31.2 => constants.%return.patt.b39 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%require_complete +// CHECK:STDOUT: %require_complete => constants.%require_complete.ff3 // CHECK:STDOUT: %F.specific_fn.loc6_45.2 => constants.%F.specific_fn.eab // CHECK:STDOUT: } // CHECK:STDOUT: @@ -436,8 +527,28 @@ fn G() { // CHECK:STDOUT: %a.patt.40c: %pattern_type.3f5 = wrapper_binding_pattern a, %a.param_patt.79a [concrete] // CHECK:STDOUT: %F.specific_fn: = specific_function %F, @F(%int_3.1ba) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc9_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.98b: type = pattern_type %C [concrete] +// CHECK:STDOUT: %self.param_patt.99a: %pattern_type.98b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.cbd: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt.99a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.2ae: %pattern_type.3f5 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.277: %pattern_type.3f5 = wrapper_binding_pattern self, %self.param_patt.2ae [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc9_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] // CHECK:STDOUT: %complete_type.1a4: = complete_type_witness %array_type.9a3 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.485: = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert.e39 [concrete] // CHECK:STDOUT: %bound_method.763: = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] @@ -461,6 +572,51 @@ fn G() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc9_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc9_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.3f5 = ref_param_pattern [concrete = constants.%self.param_patt.2ae] +// CHECK:STDOUT: %self.patt: %pattern_type.3f5 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.277] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type.9a3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type.9a3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc9_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.3f5 = ref_param_pattern [concrete = constants.%self.param_patt.2ae] +// CHECK:STDOUT: %self.patt: %pattern_type.3f5 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.277] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type.9a3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type.9a3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -578,20 +734,47 @@ fn G() { // CHECK:STDOUT: %F.specific_fn: = specific_function %F.ref, @F(constants.%int_3.1ba) [concrete = constants.%F.specific_fn] // CHECK:STDOUT: %.loc10: %array_type.9a3 = acquire_value %a.ref // CHECK:STDOUT: %F.call: init %i32 = call %F.specific_fn(%.loc10) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%a.var) // CHECK:STDOUT: return %F.call // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.2(%self.param: ref %C) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.2(%self.param: ref %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.3(%self.param: ref %array_type.9a3) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.2(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.2(%self.param: ref %C) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.3(%self.param: ref %array_type.9a3) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.3(%self.param: ref %array_type.9a3) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.3(%self.param: ref %array_type.9a3) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -640,7 +823,7 @@ fn G() { // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] -// CHECK:STDOUT: %require_complete: = require_complete_type %array_type.6d2 [symbolic] +// CHECK:STDOUT: %require_complete.f53: = require_complete_type %array_type.6d2 [symbolic] // CHECK:STDOUT: %G.type: type = fn_type @G [concrete] // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete] @@ -660,8 +843,28 @@ fn G() { // CHECK:STDOUT: %a.patt.40c: %pattern_type.3f5 = wrapper_binding_pattern a, %a.param_patt.79a [concrete] // CHECK:STDOUT: %F.specific_fn: = specific_function %F, @F(%C, %int_3) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc9_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.98b: type = pattern_type %C [concrete] +// CHECK:STDOUT: %self.param_patt.99a: %pattern_type.98b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.cbd: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt.99a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.2ae: %pattern_type.3f5 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.277: %pattern_type.3f5 = wrapper_binding_pattern self, %self.param_patt.2ae [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc9_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] // CHECK:STDOUT: %complete_type.1a4: = complete_type_witness %array_type.9a3 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -676,6 +879,51 @@ fn G() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc9_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc9_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.3f5 = ref_param_pattern [concrete = constants.%self.param_patt.2ae] +// CHECK:STDOUT: %self.patt: %pattern_type.3f5 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.277] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type.9a3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type.9a3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc9_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.3f5 = ref_param_pattern [concrete = constants.%self.param_patt.2ae] +// CHECK:STDOUT: %self.patt: %pattern_type.3f5 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.277] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type.9a3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type.9a3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -732,7 +980,7 @@ fn G() { // CHECK:STDOUT: %a.patt.loc6_43.2: @F.%pattern_type (%pattern_type.4d8) = wrapper_binding_pattern a, %a.param_patt.loc6_43.2 [symbolic = %a.patt.loc6_43.2 (constants.%a.patt.f10)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %array_type.loc6_55.1 [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type %array_type.loc6_55.1 [symbolic = %require_complete (constants.%require_complete.f53)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%a.param: @F.%array_type.loc6_55.1 (%array_type.6d2)) { // CHECK:STDOUT: !entry: @@ -777,20 +1025,47 @@ fn G() { // CHECK:STDOUT: %F.specific_fn: = specific_function %F.ref, @F(constants.%C, constants.%int_3) [concrete = constants.%F.specific_fn] // CHECK:STDOUT: %.loc10: %array_type.9a3 = acquire_value %a.ref // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn(%.loc10) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%a.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.2(%self.param: ref %C) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.2(%self.param: ref %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.3(%self.param: ref %array_type.9a3) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.2(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.2(%self.param: ref %C) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.3(%self.param: ref %array_type.9a3) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.3(%self.param: ref %array_type.9a3) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.3(%self.param: ref %array_type.9a3) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -842,7 +1117,7 @@ fn G() { // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] -// CHECK:STDOUT: %require_complete: = require_complete_type %array_type.a0b [symbolic] +// CHECK:STDOUT: %require_complete.fc9: = require_complete_type %array_type.a0b [symbolic] // CHECK:STDOUT: %F.specific_fn.eab: = specific_function %F, @F(%T) [symbolic] // CHECK:STDOUT: %.a44: Core.Form = init_form %C [concrete] // CHECK:STDOUT: %pattern_type.98b: type = pattern_type %C [concrete] @@ -870,8 +1145,27 @@ fn G() { // CHECK:STDOUT: %ImplicitAs.type.0ff: type = generic_interface_type @ImplicitAs [concrete] // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.0ff = struct_value () [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc10_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.99a: %pattern_type.98b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.cbd: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt.99a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc10_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.2ae: %pattern_type.3f5 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.277: %pattern_type.3f5 = wrapper_binding_pattern self, %self.param_patt.2ae [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc10_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] // CHECK:STDOUT: %complete_type.d6a: = complete_type_witness %array_type.cc9 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -886,6 +1180,51 @@ fn G() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc10_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc10_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.3f5 = ref_param_pattern [concrete = constants.%self.param_patt.2ae] +// CHECK:STDOUT: %self.patt: %pattern_type.3f5 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.277] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type.9a3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type.9a3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc10_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.3f5 = ref_param_pattern [concrete = constants.%self.param_patt.2ae] +// CHECK:STDOUT: %self.patt: %pattern_type.3f5 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.277] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type.9a3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type.9a3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -951,7 +1290,7 @@ fn G() { // CHECK:STDOUT: %return.patt.loc6_31.2: @F.%pattern_type.loc6_34 (%pattern_type.51d1c4.1) = return_slot_pattern %return.param_patt.loc6_34.2, %T.loc6_7.1 [symbolic = %return.patt.loc6_31.2 (constants.%return.patt.b39)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %array_type.loc6_28.1 [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type %array_type.loc6_28.1 [symbolic = %require_complete (constants.%require_complete.fc9)] // CHECK:STDOUT: %F.specific_fn.loc6_45.2: = specific_function constants.%F, @F(%T.loc6_7.1) [symbolic = %F.specific_fn.loc6_45.2 (constants.%F.specific_fn.eab)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%a.param: @F.%array_type.loc6_28.1 (%array_type.a0b)) -> out %return.param: @F.%T.loc6_7.1 (%T) { @@ -1003,20 +1342,47 @@ fn G() { // CHECK:STDOUT: %.loc8_11.1: ref %C = splice_block %return.param {} // CHECK:STDOUT: %.loc21: %array_type.cc9 = converted %a.ref, [concrete = ] // CHECK:STDOUT: %F.call: init %C to %.loc8_11.1 = call %F.specific_fn() -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%a.var) // CHECK:STDOUT: return %F.call to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_3.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_3.2(%self.param: ref %C) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_3.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_3.2(%self.param: ref %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_3.3(%self.param: ref %array_type.9a3) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_3.2(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_3.2(%self.param: ref %C) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_3.3(%self.param: ref %array_type.9a3) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_3.3(%self.param: ref %array_type.9a3) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_3.3(%self.param: ref %array_type.9a3) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1033,7 +1399,7 @@ fn G() { // CHECK:STDOUT: %return.patt.loc6_31.2 => constants.%return.patt.b39 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%require_complete +// CHECK:STDOUT: %require_complete => constants.%require_complete.fc9 // CHECK:STDOUT: %F.specific_fn.loc6_45.2 => constants.%F.specific_fn.eab // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1119,8 +1485,28 @@ fn G() { // CHECK:STDOUT: %a.patt.40c: %pattern_type.3f5 = wrapper_binding_pattern a, %a.param_patt.79a [concrete] // CHECK:STDOUT: %F.specific_fn: = specific_function %F, @F(%int_3.1ba) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc11_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.d8d: type = pattern_type %D [concrete] +// CHECK:STDOUT: %self.param_patt.b8e: %pattern_type.d8d = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.86b: %pattern_type.d8d = wrapper_binding_pattern self, %self.param_patt.b8e [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc11_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.7ca: %pattern_type.0ed = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.5cc: %pattern_type.0ed = wrapper_binding_pattern self, %self.param_patt.7ca [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc11_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc11_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] // CHECK:STDOUT: %complete_type.1a4: = complete_type_witness %array_type.9a3 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.485: = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert.e39 [concrete] // CHECK:STDOUT: %bound_method.763: = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] @@ -1144,6 +1530,51 @@ fn G() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc11_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.d8d = ref_param_pattern [concrete = constants.%self.param_patt.b8e] +// CHECK:STDOUT: %self.patt: %pattern_type.d8d = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.86b] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %D = ref_param call_param0 +// CHECK:STDOUT: %self: ref %D = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc11_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.d8d = ref_param_pattern [concrete = constants.%self.param_patt.b8e] +// CHECK:STDOUT: %self.patt: %pattern_type.d8d = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.86b] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %D = ref_param call_param0 +// CHECK:STDOUT: %self: ref %D = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.0ed = ref_param_pattern [concrete = constants.%self.param_patt.7ca] +// CHECK:STDOUT: %self.patt: %pattern_type.0ed = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.5cc] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type.cec = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type.cec = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc11_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.0ed = ref_param_pattern [concrete = constants.%self.param_patt.7ca] +// CHECK:STDOUT: %self.patt: %pattern_type.0ed = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.5cc] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type.cec = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type.cec = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -1271,20 +1702,47 @@ fn G() { // CHECK:STDOUT: %F.specific_fn: = specific_function %F.ref, @F(constants.%int_3.1ba) [concrete = constants.%F.specific_fn] // CHECK:STDOUT: %.loc22: %array_type.9a3 = converted %a.ref, [concrete = ] // CHECK:STDOUT: %F.call: init %i32 = call %F.specific_fn() -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%a.var) // CHECK:STDOUT: return %F.call // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_3.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_3.2(%self.param: ref %D) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_3.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_3.2(%self.param: ref %D) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_3.3(%self.param: ref %array_type.cec) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_3.2(%self.param: ref %D) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_3.2(%self.param: ref %D) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_3.3(%self.param: ref %array_type.cec) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_3.3(%self.param: ref %array_type.cec) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_3.3(%self.param: ref %array_type.cec) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1383,8 +1841,28 @@ fn G() { // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete] // CHECK:STDOUT: %array: %array_type.9a3 = tuple_value (%C.val, %C.val, %C.val) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc9_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.98b: type = pattern_type %C [concrete] +// CHECK:STDOUT: %self.param_patt.99a: %pattern_type.98b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.cbd: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt.99a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.2ae: %pattern_type.3f5 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.277: %pattern_type.3f5 = wrapper_binding_pattern self, %self.param_patt.2ae [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc9_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1406,6 +1884,51 @@ fn G() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc9_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc9_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.3f5 = ref_param_pattern [concrete = constants.%self.param_patt.2ae] +// CHECK:STDOUT: %self.patt: %pattern_type.3f5 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.277] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type.9a3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type.9a3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc9_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.3f5 = ref_param_pattern [concrete = constants.%self.param_patt.2ae] +// CHECK:STDOUT: %self.patt: %pattern_type.3f5 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.277] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type.9a3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type.9a3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -1527,20 +2050,47 @@ fn G() { // CHECK:STDOUT: } // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F] // CHECK:STDOUT: %a.ref: ref %array_type.9a3 = name_ref a, %a -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%a.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.2(%self.param: ref %C) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.2(%self.param: ref %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.3(%self.param: ref %array_type.9a3) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.2(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.2(%self.param: ref %C) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.3(%self.param: ref %array_type.9a3) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.3(%self.param: ref %array_type.9a3) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.3(%self.param: ref %array_type.9a3) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/deduce/conversion.carbon b/toolchain/check/testdata/deduce/conversion.carbon index 236ad5912986..735b0f17a067 100644 --- a/toolchain/check/testdata/deduce/conversion.carbon +++ b/toolchain/check/testdata/deduce/conversion.carbon @@ -104,6 +104,7 @@ fn G(a: A) { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %ImplicitAs.type.a5e: type = facet_type <@ImplicitAs, @ImplicitAs(type)> [concrete] // CHECK:STDOUT: %ImplicitAs.impl_witness: = impl_witness @A.as.ImplicitAs.impl.%ImplicitAs.impl_witness_table [concrete] +// CHECK:STDOUT: %pattern_type.9ef: type = pattern_type %A [concrete] // CHECK:STDOUT: %A.as.ImplicitAs.impl.Convert.type.572c06.1: type = fn_type @A.as.ImplicitAs.impl.Convert.loc7_40.1 [concrete] // CHECK:STDOUT: %A.as.ImplicitAs.impl.Convert.dbe75c.1: %A.as.ImplicitAs.impl.Convert.type.572c06.1 = struct_value () [concrete] // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.a5e = facet_value %A, (%ImplicitAs.impl_witness) [concrete] @@ -119,9 +120,53 @@ fn G(a: A) { // CHECK:STDOUT: %.367: ref %A = temporary invalid, %A.val [concrete] // CHECK:STDOUT: %A.as.ImplicitAs.impl.Convert.bound.5ecf75.2: = bound_method %A.val, %A.as.ImplicitAs.impl.Convert.dbe75c.1 [concrete] // CHECK:STDOUT: %F.specific_fn: = specific_function %F, @F(%B) [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc16_8.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc16_8.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.8fb: %pattern_type.9ef = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.e64: %pattern_type.9ef = wrapper_binding_pattern self, %self.param_patt.8fb [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc16_8.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc16_8.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.367, %Destroy.WithSelf.Op.403171.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc16_8.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.367, %Destroy.WithSelf.SelfDestruct.db3fdb.2 [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc16_8.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc16_8.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc16_8.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.9ef = ref_param_pattern [concrete = constants.%self.param_patt.8fb] +// CHECK:STDOUT: %self.patt: %pattern_type.9ef = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.e64] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %A = ref_param call_param0 +// CHECK:STDOUT: %self: ref %A = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc16_8.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.9ef = ref_param_pattern [concrete = constants.%self.param_patt.8fb] +// CHECK:STDOUT: %self.patt: %pattern_type.9ef = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.e64] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %A = ref_param call_param0 +// CHECK:STDOUT: %self: ref %A = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @G() { @@ -143,14 +188,32 @@ fn G(a: A) { // CHECK:STDOUT: %.loc16_12.2: type = converted %.loc16_8.1, %.loc16_12.1 [concrete = constants.%B] // CHECK:STDOUT: %F.specific_fn: = specific_function %F.ref, @F(constants.%B) [concrete = constants.%F.specific_fn] // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn() -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.367) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.367) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc16_8.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16_8.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16_8.2(%self.param: ref %A) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc16_8.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc16_8.2(%self.param: ref %A) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16_8.2(%self.param: ref %A) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc16_8.2(%self.param: ref %A) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -164,6 +227,7 @@ fn G(a: A) { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %ImplicitAs.type.1bc: type = facet_type <@ImplicitAs, @ImplicitAs(%B)> [concrete] // CHECK:STDOUT: %ImplicitAs.impl_witness: = impl_witness @A.as.ImplicitAs.impl.%ImplicitAs.impl_witness_table [concrete] +// CHECK:STDOUT: %pattern_type.e39: type = pattern_type %B [concrete] // CHECK:STDOUT: %A.as.ImplicitAs.impl.Convert.type: type = fn_type @A.as.ImplicitAs.impl.Convert [concrete] // CHECK:STDOUT: %A.as.ImplicitAs.impl.Convert: %A.as.ImplicitAs.impl.Convert.type = struct_value () [concrete] // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.1bc = facet_value %A, (%ImplicitAs.impl_witness) [concrete] @@ -173,8 +237,52 @@ fn G(a: A) { // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] // CHECK:STDOUT: %F.specific_fn: = specific_function %F, @F(%empty_tuple.type) [concrete] // CHECK:STDOUT: %.3de: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.554, %ImplicitAs.facet [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc16_9.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc16_9.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.039: %pattern_type.e39 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.535: %pattern_type.e39 = wrapper_binding_pattern self, %self.param_patt.039 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc16_9.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc16_9.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc16_9.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc16_9.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc16_9.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc16_9.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e39 = ref_param_pattern [concrete = constants.%self.param_patt.039] +// CHECK:STDOUT: %self.patt: %pattern_type.e39 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.535] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %B = ref_param call_param0 +// CHECK:STDOUT: %self: ref %B = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc16_9.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e39 = ref_param_pattern [concrete = constants.%self.param_patt.039] +// CHECK:STDOUT: %self.patt: %pattern_type.e39 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.535] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %B = ref_param call_param0 +// CHECK:STDOUT: %self: ref %B = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @G(%a.param: %A) { @@ -192,15 +300,33 @@ fn G(a: A) { // CHECK:STDOUT: %.loc16_9.3: ref %B = temporary %.loc16_9.1, %.loc16_9.2 // CHECK:STDOUT: %.loc16_9.4: %B = acquire_value %.loc16_9.3 // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn(%.loc16_9.4) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.loc16_9.3, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%.loc16_9.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc16_9.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc16_9.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc16_9.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16_9.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16_9.2(%self.param: ref %B) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc16_9.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc16_9.2(%self.param: ref %B) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16_9.2(%self.param: ref %B) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc16_9.2(%self.param: ref %B) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/deduce/generic_type.carbon b/toolchain/check/testdata/deduce/generic_type.carbon index b0ba4884c6f6..4bbbd4ef23ba 100644 --- a/toolchain/check/testdata/deduce/generic_type.carbon +++ b/toolchain/check/testdata/deduce/generic_type.carbon @@ -892,9 +892,22 @@ fn G() -> i32 { // CHECK:STDOUT: %F.specific_fn: = specific_function %F, @F(%int_0.3c0) [concrete] // CHECK:STDOUT: %.0e2: ref %WithNontype.888 = temporary invalid, %WithNontype.val [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_15.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc9_15.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.830: %pattern_type.d30 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.fa7: %pattern_type.d30 = wrapper_binding_pattern self, %self.param_patt.830 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_15.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc9_15.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.0e2, %Destroy.WithSelf.Op.403171.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9_15.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.0e2, %Destroy.WithSelf.SelfDestruct.db3fdb.2 [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.bound.678: = bound_method %int_0.3c0, %Int.as.Copy.impl.Op.4f6 [concrete] // CHECK:STDOUT: %bound_method.28e: = bound_method %int_0.3c0, %Int.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: } @@ -918,6 +931,37 @@ fn G() -> i32 { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_15.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc9_15.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_15.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.d30 = ref_param_pattern [concrete = constants.%self.param_patt.830] +// CHECK:STDOUT: %self.patt: %pattern_type.d30 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.fa7] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %WithNontype.888 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %WithNontype.888 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc9_15.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.d30 = ref_param_pattern [concrete = constants.%self.param_patt.830] +// CHECK:STDOUT: %self.patt: %pattern_type.d30 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.fa7] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %WithNontype.888 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %WithNontype.888 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -1031,14 +1075,32 @@ fn G() -> i32 { // CHECK:STDOUT: %.loc9_15.2: ref %WithNontype.888 = temporary %.loc9_13.2, %.loc9_15.1 [concrete = constants.%.0e2] // CHECK:STDOUT: %.loc9_15.3: %WithNontype.888 = acquire_value %.loc9_15.2 [concrete = constants.%WithNontype.val] // CHECK:STDOUT: %F.call: init %i32 = call %F.specific_fn(%.loc9_15.3) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.0e2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.0e2) // CHECK:STDOUT: return %F.call // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_15.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_15.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_15.2(%self.param: ref %WithNontype.888) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_15.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_15.2(%self.param: ref %WithNontype.888) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_15.2(%self.param: ref %WithNontype.888) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_15.2(%self.param: ref %WithNontype.888) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/deduce/value_with_type_through_access.carbon b/toolchain/check/testdata/deduce/value_with_type_through_access.carbon index 981ef9abd29e..ac0e9cccaa43 100644 --- a/toolchain/check/testdata/deduce/value_with_type_through_access.carbon +++ b/toolchain/check/testdata/deduce/value_with_type_through_access.carbon @@ -145,12 +145,31 @@ fn G() { // CHECK:STDOUT: %C.val: %C = struct_value () [concrete] // CHECK:STDOUT: %.115: ref %C = temporary invalid, %C.val [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc13_30.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc13_30.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.99a: %pattern_type.98b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.cbd: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt.99a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc13_30.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc13_30.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.1a9: = bound_method %.115, %Destroy.WithSelf.Op.403171.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc13_30.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.e45: = bound_method %.115, %Destroy.WithSelf.SelfDestruct.db3fdb.2 [concrete] +// CHECK:STDOUT: %self.param_patt.d34: %pattern_type.2e7 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.f54: %pattern_type.2e7 = wrapper_binding_pattern self, %self.param_patt.d34 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc13_8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc13_8 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.eeb: = bound_method %.533, %Destroy.WithSelf.Op.403171.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc13_8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.8b3: = bound_method %.533, %Destroy.WithSelf.SelfDestruct.db3fdb.3 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -162,6 +181,51 @@ fn G() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc13_30.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc13_30.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc13_30.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc13_30.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc13_8 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.2e7 = ref_param_pattern [concrete = constants.%self.param_patt.d34] +// CHECK:STDOUT: %self.patt: %pattern_type.2e7 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.f54] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %HoldsType.210 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %HoldsType.210 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc13_8 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.2e7 = ref_param_pattern [concrete = constants.%self.param_patt.d34] +// CHECK:STDOUT: %self.patt: %pattern_type.2e7 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.f54] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %HoldsType.210 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %HoldsType.210 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -283,20 +347,47 @@ fn G() { // CHECK:STDOUT: %.loc13_30.5: ref %C = temporary %.loc13_30.2, %.loc13_30.4 [concrete = constants.%.115] // CHECK:STDOUT: %.loc13_30.6: %C = acquire_value %.loc13_30.5 [concrete = constants.%C.val] // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn(%.loc13_8.3, %.loc13_30.6) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc13_30: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound.1a9(constants.%.115) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc13_8: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound.eeb(constants.%.533) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc13_30: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound.e45(constants.%.115) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc13_8: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound.8b3(constants.%.533) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc13_30.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc13_30.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc13_30.2(%self.param: ref %C) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc13_30.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc13_30.2(%self.param: ref %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc13_8(%self.param: ref %HoldsType.210) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc13_30.2(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc13_30.2(%self.param: ref %C) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc13_8(%self.param: ref %HoldsType.210) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc13_8(%self.param: ref %HoldsType.210) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc13_8(%self.param: ref %HoldsType.210) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -388,12 +479,31 @@ fn G() { // CHECK:STDOUT: %C.val: %C = struct_value () [concrete] // CHECK:STDOUT: %.115: ref %C = temporary invalid, %C.val [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc13_33.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc13_33.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.99a: %pattern_type.98b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.cbd: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt.99a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc13_33.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc13_33.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.1a9: = bound_method %.115, %Destroy.WithSelf.Op.403171.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc13_33.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.e45: = bound_method %.115, %Destroy.WithSelf.SelfDestruct.db3fdb.2 [concrete] +// CHECK:STDOUT: %self.param_patt.ebd: %pattern_type.79a = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.ad7: %pattern_type.79a = wrapper_binding_pattern self, %self.param_patt.ebd [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc13_8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc13_8 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.191: = bound_method %.3e2, %Destroy.WithSelf.Op.403171.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc13_8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.324: = bound_method %.3e2, %Destroy.WithSelf.SelfDestruct.db3fdb.3 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -405,6 +515,51 @@ fn G() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc13_33.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc13_33.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc13_33.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc13_33.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc13_8 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.79a = ref_param_pattern [concrete = constants.%self.param_patt.ebd] +// CHECK:STDOUT: %self.patt: %pattern_type.79a = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ad7] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %HoldsType.512 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %HoldsType.512 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc13_8 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.79a = ref_param_pattern [concrete = constants.%self.param_patt.ebd] +// CHECK:STDOUT: %self.patt: %pattern_type.79a = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ad7] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %HoldsType.512 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %HoldsType.512 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -523,20 +678,47 @@ fn G() { // CHECK:STDOUT: %.loc13_33.5: ref %C = temporary %.loc13_33.2, %.loc13_33.4 [concrete = constants.%.115] // CHECK:STDOUT: %.loc13_33.6: %C = acquire_value %.loc13_33.5 [concrete = constants.%C.val] // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn(%.loc13_8.3, %.loc13_33.6) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc13_33: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound.1a9(constants.%.115) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc13_8: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound.191(constants.%.3e2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc13_33: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound.e45(constants.%.115) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc13_8: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound.324(constants.%.3e2) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc13_33.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc13_33.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc13_33.2(%self.param: ref %C) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc13_33.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc13_33.2(%self.param: ref %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc13_8(%self.param: ref %HoldsType.512) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc13_33.2(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc13_33.2(%self.param: ref %C) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc13_8(%self.param: ref %HoldsType.512) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc13_8(%self.param: ref %HoldsType.512) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc13_8(%self.param: ref %HoldsType.512) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -589,6 +771,7 @@ fn G() { // CHECK:STDOUT: constants { // CHECK:STDOUT: type: type = facet_type [concrete] // CHECK:STDOUT: %Class: type = class_type @Class [concrete] +// CHECK:STDOUT: %pattern_type.9a5: type = pattern_type type [concrete] // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, type [concrete] // CHECK:STDOUT: %struct_type.t: type = struct_type {.t: type} [concrete] // CHECK:STDOUT: %complete_type.738: = complete_type_witness %struct_type.t [concrete] @@ -633,9 +816,28 @@ fn G() { // CHECK:STDOUT: %.0de: ref %Class = temporary invalid, %Class.val [concrete] // CHECK:STDOUT: %G.specific_fn: = specific_function %G, @G(%Class.val) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %self.param_patt.11c: %pattern_type.9a5 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.11d: %pattern_type.9a5 = wrapper_binding_pattern self, %self.param_patt.11c [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc30_13.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc30_13.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.136: type = pattern_type %struct_type.t [concrete] +// CHECK:STDOUT: %self.param_patt.0c8: %pattern_type.136 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.a0c: %pattern_type.136 = wrapper_binding_pattern self, %self.param_patt.0c8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc30_13.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc30_13.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.b2b: %pattern_type.f15 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.f19: %pattern_type.f15 = wrapper_binding_pattern self, %self.param_patt.b2b [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc30_13.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc30_13.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.0de, %Destroy.WithSelf.Op.403171.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc30_13.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.0de, %Destroy.WithSelf.SelfDestruct.db3fdb.3 [concrete] // CHECK:STDOUT: %HoldsType.af5: type = class_type @HoldsType, @HoldsType(%Class.val) [concrete] // CHECK:STDOUT: %HoldsType.val.8bc: %HoldsType.af5 = struct_value () [concrete] // CHECK:STDOUT: } @@ -653,6 +855,51 @@ fn G() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc30_13.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.9a5 = ref_param_pattern [concrete = constants.%self.param_patt.11c] +// CHECK:STDOUT: %self.patt: %pattern_type.9a5 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.11d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref type = ref_param call_param0 +// CHECK:STDOUT: %self: ref type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc30_13.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.9a5 = ref_param_pattern [concrete = constants.%self.param_patt.11c] +// CHECK:STDOUT: %self.patt: %pattern_type.9a5 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.11d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref type = ref_param call_param0 +// CHECK:STDOUT: %self: ref type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc30_13.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.136 = ref_param_pattern [concrete = constants.%self.param_patt.0c8] +// CHECK:STDOUT: %self.patt: %pattern_type.136 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a0c] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.t = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.t = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc30_13.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.136 = ref_param_pattern [concrete = constants.%self.param_patt.0c8] +// CHECK:STDOUT: %self.patt: %pattern_type.136 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a0c] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.t = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.t = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc30_13.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f15 = ref_param_pattern [concrete = constants.%self.param_patt.b2b] +// CHECK:STDOUT: %self.patt: %pattern_type.f15 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.f19] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Class = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Class = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc30_13.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f15 = ref_param_pattern [concrete = constants.%self.param_patt.b2b] +// CHECK:STDOUT: %self.patt: %pattern_type.f15 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.f19] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Class = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Class = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -809,19 +1056,46 @@ fn G() { // CHECK:STDOUT: %.loc30_13.3: %Class = acquire_value %.loc30_13.2 [concrete = constants.%Class.val] // CHECK:STDOUT: %G.specific_fn: = specific_function %G.ref, @G(constants.%Class.val) [concrete = constants.%G.specific_fn] // CHECK:STDOUT: %G.call: init %empty_tuple.type = call %G.specific_fn() -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.0de) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.0de) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc30_13.1(%self.param: ref type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc30_13.1(%self.param: ref type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc30_13.2(%self.param: ref %struct_type.t) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc30_13.1(%self.param: ref type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc30_13.2(%self.param: ref %struct_type.t) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc30_13.3(%self.param: ref %Class) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc30_13.2(%self.param: ref %struct_type.t) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc30_13.2(%self.param: ref %struct_type.t) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc30_13.3(%self.param: ref %Class) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc30_13.3(%self.param: ref %Class) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc30_13.3(%self.param: ref %Class) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -897,6 +1171,7 @@ fn G() { // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %ImplicitAs.type.0ff: type = generic_interface_type @ImplicitAs [concrete] // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.0ff = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.9a5: type = pattern_type type [concrete] // CHECK:STDOUT: %ImplicitAs.type.914: 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.e74: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic] @@ -933,9 +1208,21 @@ fn G() { // CHECK:STDOUT: %HoldsType.d9e: type = class_type @HoldsType, @HoldsType(%array) [concrete] // CHECK:STDOUT: %HoldsType.val: %HoldsType.d9e = struct_value () [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %self.param_patt.11c: %pattern_type.9a5 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.11d: %pattern_type.9a5 = wrapper_binding_pattern self, %self.param_patt.11c [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc17_27.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc17_27.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.308: %pattern_type.4fd = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.a71: %pattern_type.4fd = wrapper_binding_pattern self, %self.param_patt.308 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc17_27.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc17_27.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.f9a, %Destroy.WithSelf.Op.403171.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc17_27.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.f9a, %Destroy.WithSelf.SelfDestruct.db3fdb.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -957,6 +1244,37 @@ fn G() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc17_27.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.9a5 = ref_param_pattern [concrete = constants.%self.param_patt.11c] +// CHECK:STDOUT: %self.patt: %pattern_type.9a5 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.11d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref type = ref_param call_param0 +// CHECK:STDOUT: %self: ref type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc17_27.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.9a5 = ref_param_pattern [concrete = constants.%self.param_patt.11c] +// CHECK:STDOUT: %self.patt: %pattern_type.9a5 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.11d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref type = ref_param call_param0 +// CHECK:STDOUT: %self: ref type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc17_27.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.4fd = ref_param_pattern [concrete = constants.%self.param_patt.308] +// CHECK:STDOUT: %self.patt: %pattern_type.4fd = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a71] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc17_27.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.4fd = ref_param_pattern [concrete = constants.%self.param_patt.308] +// CHECK:STDOUT: %self.patt: %pattern_type.4fd = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a71] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -1085,14 +1403,32 @@ fn G() { // CHECK:STDOUT: %.loc17_6.3: init %HoldsType.d9e to %.loc17_6.2 = class_init () [concrete = constants.%HoldsType.val] // CHECK:STDOUT: %.loc17_8: init %HoldsType.d9e = converted %.loc17_6.1, %.loc17_6.3 [concrete = constants.%HoldsType.val] // CHECK:STDOUT: %.loc17_48: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.f9a) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.f9a) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc17_27.1(%self.param: ref type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc17_27.1(%self.param: ref type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc17_27.2(%self.param: ref %array_type) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc17_27.1(%self.param: ref type) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc17_27.2(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc17_27.2(%self.param: ref %array_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc17_27.2(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/eval/aggregates.carbon b/toolchain/check/testdata/eval/aggregates.carbon index da3edfeaf50d..e9a181ba2a09 100644 --- a/toolchain/check/testdata/eval/aggregates.carbon +++ b/toolchain/check/testdata/eval/aggregates.carbon @@ -548,22 +548,22 @@ fn G(generic N: i32) { // CHECK:STDOUT: %specific_impl_fn.6bf: = specific_impl_function %impl.elem0.276, @DefaultOrUnformed.WithSelf.Op(%DefaultOrUnformed.facet.d60) [symbolic] // CHECK:STDOUT: %Destroy.lookup_impl_witness.1f5: = lookup_impl_witness %array_type.50f, @Destroy [symbolic] // CHECK:STDOUT: %Destroy.facet.664: %Destroy.type = facet_value %array_type.50f, (%Destroy.lookup_impl_witness.1f5) [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.373: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.664) [symbolic] -// CHECK:STDOUT: %.260: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.373, %Destroy.facet.664 [symbolic] -// CHECK:STDOUT: %impl.elem0.375: %.260 = impl_witness_access %Destroy.lookup_impl_witness.1f5, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.f05: = specific_impl_function %impl.elem0.375, @Destroy.WithSelf.Op(%Destroy.facet.664) [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.2db: type = fn_type @Destroy.WithSelf.SelfDestruct, @Destroy.WithSelf(%Destroy.facet.664) [symbolic] +// CHECK:STDOUT: %.fc5: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.2db, %Destroy.facet.664 [symbolic] +// CHECK:STDOUT: %impl.elem2.3eb: %.fc5 = impl_witness_access %Destroy.lookup_impl_witness.1f5, element2 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.c96: = specific_impl_function %impl.elem2.3eb, @Destroy.WithSelf.SelfDestruct(%Destroy.facet.664) [symbolic] // CHECK:STDOUT: %Destroy.lookup_impl_witness.7f9: = lookup_impl_witness %struct_type.a, @Destroy [symbolic] // CHECK:STDOUT: %Destroy.facet.aa3: %Destroy.type = facet_value %struct_type.a, (%Destroy.lookup_impl_witness.7f9) [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ae9: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.aa3) [symbolic] -// CHECK:STDOUT: %.3c7: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.ae9, %Destroy.facet.aa3 [symbolic] -// CHECK:STDOUT: %impl.elem0.bb8: %.3c7 = impl_witness_access %Destroy.lookup_impl_witness.7f9, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.799: = specific_impl_function %impl.elem0.bb8, @Destroy.WithSelf.Op(%Destroy.facet.aa3) [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.3c2: type = fn_type @Destroy.WithSelf.SelfDestruct, @Destroy.WithSelf(%Destroy.facet.aa3) [symbolic] +// CHECK:STDOUT: %.88b: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.3c2, %Destroy.facet.aa3 [symbolic] +// CHECK:STDOUT: %impl.elem2.7c6: %.88b = impl_witness_access %Destroy.lookup_impl_witness.7f9, element2 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.640: = specific_impl_function %impl.elem2.7c6, @Destroy.WithSelf.SelfDestruct(%Destroy.facet.aa3) [symbolic] // CHECK:STDOUT: %Destroy.lookup_impl_witness.d26: = lookup_impl_witness %tuple.type.cd5, @Destroy [symbolic] // CHECK:STDOUT: %Destroy.facet.7ba: %Destroy.type = facet_value %tuple.type.cd5, (%Destroy.lookup_impl_witness.d26) [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.a30: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.7ba) [symbolic] -// CHECK:STDOUT: %.a0a: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.a30, %Destroy.facet.7ba [symbolic] -// CHECK:STDOUT: %impl.elem0.667: %.a0a = impl_witness_access %Destroy.lookup_impl_witness.d26, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.96b: = specific_impl_function %impl.elem0.667, @Destroy.WithSelf.Op(%Destroy.facet.7ba) [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.8d3: type = fn_type @Destroy.WithSelf.SelfDestruct, @Destroy.WithSelf(%Destroy.facet.7ba) [symbolic] +// CHECK:STDOUT: %.84a: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.8d3, %Destroy.facet.7ba [symbolic] +// CHECK:STDOUT: %impl.elem2.9fc: %.84a = impl_witness_access %Destroy.lookup_impl_witness.d26, element2 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.be0: = specific_impl_function %impl.elem2.9fc, @Destroy.WithSelf.SelfDestruct(%Destroy.facet.7ba) [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %pattern_type.6b6: type = pattern_type %i32 [concrete] @@ -597,10 +597,10 @@ fn G(generic N: i32) { // CHECK:STDOUT: %specific_impl_fn.b63: = specific_impl_function %impl.elem0.37d, @DefaultOrUnformed.WithSelf.Op(%DefaultOrUnformed.facet.b1c) [symbolic] // CHECK:STDOUT: %Destroy.lookup_impl_witness.822: = lookup_impl_witness %array_type.359, @Destroy [symbolic] // CHECK:STDOUT: %Destroy.facet.a58: %Destroy.type = facet_value %array_type.359, (%Destroy.lookup_impl_witness.822) [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.6c9: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.a58) [symbolic] -// CHECK:STDOUT: %.a73: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.6c9, %Destroy.facet.a58 [symbolic] -// CHECK:STDOUT: %impl.elem0.fa7: %.a73 = impl_witness_access %Destroy.lookup_impl_witness.822, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.075: = specific_impl_function %impl.elem0.fa7, @Destroy.WithSelf.Op(%Destroy.facet.a58) [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.d3f: type = fn_type @Destroy.WithSelf.SelfDestruct, @Destroy.WithSelf(%Destroy.facet.a58) [symbolic] +// CHECK:STDOUT: %.f42: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.d3f, %Destroy.facet.a58 [symbolic] +// CHECK:STDOUT: %impl.elem2.f96: %.f42 = impl_witness_access %Destroy.lookup_impl_witness.822, element2 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.262: = specific_impl_function %impl.elem2.f96, @Destroy.WithSelf.SelfDestruct(%Destroy.facet.a58) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -654,22 +654,22 @@ fn G(generic N: i32) { // CHECK:STDOUT: %specific_impl_fn.loc8_28.2: = specific_impl_function %impl.elem0.loc8_28.2, @DefaultOrUnformed.WithSelf.Op(%DefaultOrUnformed.facet.loc8_28.2) [symbolic = %specific_impl_fn.loc8_28.2 (constants.%specific_impl_fn.6bf)] // CHECK:STDOUT: %Destroy.lookup_impl_witness.loc8: = lookup_impl_witness %array_type.loc8_27.2, @Destroy [symbolic = %Destroy.lookup_impl_witness.loc8 (constants.%Destroy.lookup_impl_witness.1f5)] // CHECK:STDOUT: %Destroy.facet.loc8_3.3: %Destroy.type = facet_value %array_type.loc8_27.2, (%Destroy.lookup_impl_witness.loc8) [symbolic = %Destroy.facet.loc8_3.3 (constants.%Destroy.facet.664)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.loc8: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.loc8_3.3) [symbolic = %Destroy.WithSelf.Op.type.loc8 (constants.%Destroy.WithSelf.Op.type.373)] -// CHECK:STDOUT: %.loc8_3.4: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.loc8, %Destroy.facet.loc8_3.3 [symbolic = %.loc8_3.4 (constants.%.260)] -// CHECK:STDOUT: %impl.elem0.loc8_3.2: @F.%.loc8_3.4 (%.260) = impl_witness_access %Destroy.lookup_impl_witness.loc8, element0 [symbolic = %impl.elem0.loc8_3.2 (constants.%impl.elem0.375)] -// CHECK:STDOUT: %specific_impl_fn.loc8_3.2: = specific_impl_function %impl.elem0.loc8_3.2, @Destroy.WithSelf.Op(%Destroy.facet.loc8_3.3) [symbolic = %specific_impl_fn.loc8_3.2 (constants.%specific_impl_fn.f05)] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.loc8: type = fn_type @Destroy.WithSelf.SelfDestruct, @Destroy.WithSelf(%Destroy.facet.loc8_3.3) [symbolic = %Destroy.WithSelf.SelfDestruct.type.loc8 (constants.%Destroy.WithSelf.SelfDestruct.type.2db)] +// CHECK:STDOUT: %.loc8_3.4: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.loc8, %Destroy.facet.loc8_3.3 [symbolic = %.loc8_3.4 (constants.%.fc5)] +// CHECK:STDOUT: %impl.elem2.loc8_3.2: @F.%.loc8_3.4 (%.fc5) = impl_witness_access %Destroy.lookup_impl_witness.loc8, element2 [symbolic = %impl.elem2.loc8_3.2 (constants.%impl.elem2.3eb)] +// CHECK:STDOUT: %specific_impl_fn.loc8_3.2: = specific_impl_function %impl.elem2.loc8_3.2, @Destroy.WithSelf.SelfDestruct(%Destroy.facet.loc8_3.3) [symbolic = %specific_impl_fn.loc8_3.2 (constants.%specific_impl_fn.c96)] // CHECK:STDOUT: %Destroy.lookup_impl_witness.loc7: = lookup_impl_witness %struct_type.a.loc7_23.2, @Destroy [symbolic = %Destroy.lookup_impl_witness.loc7 (constants.%Destroy.lookup_impl_witness.7f9)] // CHECK:STDOUT: %Destroy.facet.loc7_3.3: %Destroy.type = facet_value %struct_type.a.loc7_23.2, (%Destroy.lookup_impl_witness.loc7) [symbolic = %Destroy.facet.loc7_3.3 (constants.%Destroy.facet.aa3)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.loc7: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.loc7_3.3) [symbolic = %Destroy.WithSelf.Op.type.loc7 (constants.%Destroy.WithSelf.Op.type.ae9)] -// CHECK:STDOUT: %.loc7_3.3: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.loc7, %Destroy.facet.loc7_3.3 [symbolic = %.loc7_3.3 (constants.%.3c7)] -// CHECK:STDOUT: %impl.elem0.loc7_3.2: @F.%.loc7_3.3 (%.3c7) = impl_witness_access %Destroy.lookup_impl_witness.loc7, element0 [symbolic = %impl.elem0.loc7_3.2 (constants.%impl.elem0.bb8)] -// CHECK:STDOUT: %specific_impl_fn.loc7_3.2: = specific_impl_function %impl.elem0.loc7_3.2, @Destroy.WithSelf.Op(%Destroy.facet.loc7_3.3) [symbolic = %specific_impl_fn.loc7_3.2 (constants.%specific_impl_fn.799)] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.loc7: type = fn_type @Destroy.WithSelf.SelfDestruct, @Destroy.WithSelf(%Destroy.facet.loc7_3.3) [symbolic = %Destroy.WithSelf.SelfDestruct.type.loc7 (constants.%Destroy.WithSelf.SelfDestruct.type.3c2)] +// CHECK:STDOUT: %.loc7_3.3: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.loc7, %Destroy.facet.loc7_3.3 [symbolic = %.loc7_3.3 (constants.%.88b)] +// CHECK:STDOUT: %impl.elem2.loc7_3.2: @F.%.loc7_3.3 (%.88b) = impl_witness_access %Destroy.lookup_impl_witness.loc7, element2 [symbolic = %impl.elem2.loc7_3.2 (constants.%impl.elem2.7c6)] +// CHECK:STDOUT: %specific_impl_fn.loc7_3.2: = specific_impl_function %impl.elem2.loc7_3.2, @Destroy.WithSelf.SelfDestruct(%Destroy.facet.loc7_3.3) [symbolic = %specific_impl_fn.loc7_3.2 (constants.%specific_impl_fn.640)] // CHECK:STDOUT: %Destroy.lookup_impl_witness.loc6: = lookup_impl_witness %tuple.type, @Destroy [symbolic = %Destroy.lookup_impl_witness.loc6 (constants.%Destroy.lookup_impl_witness.d26)] // CHECK:STDOUT: %Destroy.facet.loc6_3.3: %Destroy.type = facet_value %tuple.type, (%Destroy.lookup_impl_witness.loc6) [symbolic = %Destroy.facet.loc6_3.3 (constants.%Destroy.facet.7ba)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.loc6: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.loc6_3.3) [symbolic = %Destroy.WithSelf.Op.type.loc6 (constants.%Destroy.WithSelf.Op.type.a30)] -// CHECK:STDOUT: %.loc6_3.4: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.loc6, %Destroy.facet.loc6_3.3 [symbolic = %.loc6_3.4 (constants.%.a0a)] -// CHECK:STDOUT: %impl.elem0.loc6_3.2: @F.%.loc6_3.4 (%.a0a) = impl_witness_access %Destroy.lookup_impl_witness.loc6, element0 [symbolic = %impl.elem0.loc6_3.2 (constants.%impl.elem0.667)] -// CHECK:STDOUT: %specific_impl_fn.loc6_3.2: = specific_impl_function %impl.elem0.loc6_3.2, @Destroy.WithSelf.Op(%Destroy.facet.loc6_3.3) [symbolic = %specific_impl_fn.loc6_3.2 (constants.%specific_impl_fn.96b)] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.loc6: type = fn_type @Destroy.WithSelf.SelfDestruct, @Destroy.WithSelf(%Destroy.facet.loc6_3.3) [symbolic = %Destroy.WithSelf.SelfDestruct.type.loc6 (constants.%Destroy.WithSelf.SelfDestruct.type.8d3)] +// CHECK:STDOUT: %.loc6_3.4: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.loc6, %Destroy.facet.loc6_3.3 [symbolic = %.loc6_3.4 (constants.%.84a)] +// CHECK:STDOUT: %impl.elem2.loc6_3.2: @F.%.loc6_3.4 (%.84a) = impl_witness_access %Destroy.lookup_impl_witness.loc6, element2 [symbolic = %impl.elem2.loc6_3.2 (constants.%impl.elem2.9fc)] +// CHECK:STDOUT: %specific_impl_fn.loc6_3.2: = specific_impl_function %impl.elem2.loc6_3.2, @Destroy.WithSelf.SelfDestruct(%Destroy.facet.loc6_3.3) [symbolic = %specific_impl_fn.loc6_3.2 (constants.%specific_impl_fn.be0)] // CHECK:STDOUT: // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: @@ -742,33 +742,33 @@ fn G(generic N: i32) { // CHECK:STDOUT: %w.patt.loc8_15.1: @F.%pattern_type.loc8 (%pattern_type.78a) = ref_binding_pattern w [symbolic = %w.patt.loc8_15.2 (constants.%w.patt)] // CHECK:STDOUT: %w.var_patt.loc8_3.1: @F.%pattern_type.loc8 (%pattern_type.78a) = var_pattern %w.patt.loc8_15.1 [symbolic = %w.var_patt.loc8_3.2 (constants.%w.var_patt)] // CHECK:STDOUT: } -// CHECK:STDOUT: %impl.elem0.loc8_3.1: @F.%.loc8_3.4 (%.260) = impl_witness_access constants.%Destroy.lookup_impl_witness.1f5, element0 [symbolic = %impl.elem0.loc8_3.2 (constants.%impl.elem0.375)] -// CHECK:STDOUT: %bound_method.loc8_3.1: = bound_method %w.var, %impl.elem0.loc8_3.1 +// CHECK:STDOUT: %impl.elem2.loc8_3.1: @F.%.loc8_3.4 (%.fc5) = impl_witness_access constants.%Destroy.lookup_impl_witness.1f5, element2 [symbolic = %impl.elem2.loc8_3.2 (constants.%impl.elem2.3eb)] +// CHECK:STDOUT: %bound_method.loc8_3.1: = bound_method %w.var, %impl.elem2.loc8_3.1 // CHECK:STDOUT: %Destroy.facet.loc8_3.1: %Destroy.type = facet_value constants.%array_type.50f, (constants.%Destroy.lookup_impl_witness.1f5) [symbolic = %Destroy.facet.loc8_3.3 (constants.%Destroy.facet.664)] // CHECK:STDOUT: %.loc8_3.2: %Destroy.type = converted constants.%array_type.50f, %Destroy.facet.loc8_3.1 [symbolic = %Destroy.facet.loc8_3.3 (constants.%Destroy.facet.664)] // CHECK:STDOUT: %Destroy.facet.loc8_3.2: %Destroy.type = facet_value constants.%array_type.50f, (constants.%Destroy.lookup_impl_witness.1f5) [symbolic = %Destroy.facet.loc8_3.3 (constants.%Destroy.facet.664)] // CHECK:STDOUT: %.loc8_3.3: %Destroy.type = converted constants.%array_type.50f, %Destroy.facet.loc8_3.2 [symbolic = %Destroy.facet.loc8_3.3 (constants.%Destroy.facet.664)] -// CHECK:STDOUT: %specific_impl_fn.loc8_3.1: = specific_impl_function %impl.elem0.loc8_3.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.664) [symbolic = %specific_impl_fn.loc8_3.2 (constants.%specific_impl_fn.f05)] +// CHECK:STDOUT: %specific_impl_fn.loc8_3.1: = specific_impl_function %impl.elem2.loc8_3.1, @Destroy.WithSelf.SelfDestruct(constants.%Destroy.facet.664) [symbolic = %specific_impl_fn.loc8_3.2 (constants.%specific_impl_fn.c96)] // CHECK:STDOUT: %bound_method.loc8_3.2: = bound_method %w.var, %specific_impl_fn.loc8_3.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc8: init %empty_tuple.type = call %bound_method.loc8_3.2(%w.var) -// CHECK:STDOUT: %impl.elem0.loc7_3.1: @F.%.loc7_3.3 (%.3c7) = impl_witness_access constants.%Destroy.lookup_impl_witness.7f9, element0 [symbolic = %impl.elem0.loc7_3.2 (constants.%impl.elem0.bb8)] -// CHECK:STDOUT: %bound_method.loc7_3.1: = bound_method %v.var, %impl.elem0.loc7_3.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %bound_method.loc8_3.2(%w.var) +// CHECK:STDOUT: %impl.elem2.loc7_3.1: @F.%.loc7_3.3 (%.88b) = impl_witness_access constants.%Destroy.lookup_impl_witness.7f9, element2 [symbolic = %impl.elem2.loc7_3.2 (constants.%impl.elem2.7c6)] +// CHECK:STDOUT: %bound_method.loc7_3.1: = bound_method %v.var, %impl.elem2.loc7_3.1 // CHECK:STDOUT: %Destroy.facet.loc7_3.1: %Destroy.type = facet_value constants.%struct_type.a, (constants.%Destroy.lookup_impl_witness.7f9) [symbolic = %Destroy.facet.loc7_3.3 (constants.%Destroy.facet.aa3)] // CHECK:STDOUT: %.loc7_3.1: %Destroy.type = converted constants.%struct_type.a, %Destroy.facet.loc7_3.1 [symbolic = %Destroy.facet.loc7_3.3 (constants.%Destroy.facet.aa3)] // CHECK:STDOUT: %Destroy.facet.loc7_3.2: %Destroy.type = facet_value constants.%struct_type.a, (constants.%Destroy.lookup_impl_witness.7f9) [symbolic = %Destroy.facet.loc7_3.3 (constants.%Destroy.facet.aa3)] // CHECK:STDOUT: %.loc7_3.2: %Destroy.type = converted constants.%struct_type.a, %Destroy.facet.loc7_3.2 [symbolic = %Destroy.facet.loc7_3.3 (constants.%Destroy.facet.aa3)] -// CHECK:STDOUT: %specific_impl_fn.loc7_3.1: = specific_impl_function %impl.elem0.loc7_3.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.aa3) [symbolic = %specific_impl_fn.loc7_3.2 (constants.%specific_impl_fn.799)] +// CHECK:STDOUT: %specific_impl_fn.loc7_3.1: = specific_impl_function %impl.elem2.loc7_3.1, @Destroy.WithSelf.SelfDestruct(constants.%Destroy.facet.aa3) [symbolic = %specific_impl_fn.loc7_3.2 (constants.%specific_impl_fn.640)] // CHECK:STDOUT: %bound_method.loc7_3.2: = bound_method %v.var, %specific_impl_fn.loc7_3.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc7: init %empty_tuple.type = call %bound_method.loc7_3.2(%v.var) -// CHECK:STDOUT: %impl.elem0.loc6_3.1: @F.%.loc6_3.4 (%.a0a) = impl_witness_access constants.%Destroy.lookup_impl_witness.d26, element0 [symbolic = %impl.elem0.loc6_3.2 (constants.%impl.elem0.667)] -// CHECK:STDOUT: %bound_method.loc6_3.1: = bound_method %u.var, %impl.elem0.loc6_3.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc7: init %empty_tuple.type = call %bound_method.loc7_3.2(%v.var) +// CHECK:STDOUT: %impl.elem2.loc6_3.1: @F.%.loc6_3.4 (%.84a) = impl_witness_access constants.%Destroy.lookup_impl_witness.d26, element2 [symbolic = %impl.elem2.loc6_3.2 (constants.%impl.elem2.9fc)] +// CHECK:STDOUT: %bound_method.loc6_3.1: = bound_method %u.var, %impl.elem2.loc6_3.1 // CHECK:STDOUT: %Destroy.facet.loc6_3.1: %Destroy.type = facet_value constants.%tuple.type.cd5, (constants.%Destroy.lookup_impl_witness.d26) [symbolic = %Destroy.facet.loc6_3.3 (constants.%Destroy.facet.7ba)] // CHECK:STDOUT: %.loc6_3.2: %Destroy.type = converted constants.%tuple.type.cd5, %Destroy.facet.loc6_3.1 [symbolic = %Destroy.facet.loc6_3.3 (constants.%Destroy.facet.7ba)] // CHECK:STDOUT: %Destroy.facet.loc6_3.2: %Destroy.type = facet_value constants.%tuple.type.cd5, (constants.%Destroy.lookup_impl_witness.d26) [symbolic = %Destroy.facet.loc6_3.3 (constants.%Destroy.facet.7ba)] // CHECK:STDOUT: %.loc6_3.3: %Destroy.type = converted constants.%tuple.type.cd5, %Destroy.facet.loc6_3.2 [symbolic = %Destroy.facet.loc6_3.3 (constants.%Destroy.facet.7ba)] -// CHECK:STDOUT: %specific_impl_fn.loc6_3.1: = specific_impl_function %impl.elem0.loc6_3.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.7ba) [symbolic = %specific_impl_fn.loc6_3.2 (constants.%specific_impl_fn.96b)] +// CHECK:STDOUT: %specific_impl_fn.loc6_3.1: = specific_impl_function %impl.elem2.loc6_3.1, @Destroy.WithSelf.SelfDestruct(constants.%Destroy.facet.7ba) [symbolic = %specific_impl_fn.loc6_3.2 (constants.%specific_impl_fn.be0)] // CHECK:STDOUT: %bound_method.loc6_3.2: = bound_method %u.var, %specific_impl_fn.loc6_3.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc6: init %empty_tuple.type = call %bound_method.loc6_3.2(%u.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc6: init %empty_tuple.type = call %bound_method.loc6_3.2(%u.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -794,10 +794,10 @@ fn G(generic N: i32) { // CHECK:STDOUT: %specific_impl_fn.loc14_30.2: = specific_impl_function %impl.elem0.loc14_30.2, @DefaultOrUnformed.WithSelf.Op(%DefaultOrUnformed.facet.loc14_30.2) [symbolic = %specific_impl_fn.loc14_30.2 (constants.%specific_impl_fn.b63)] // CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %array_type.loc14_29.2, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.822)] // CHECK:STDOUT: %Destroy.facet.loc14_3.3: %Destroy.type = facet_value %array_type.loc14_29.2, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.loc14_3.3 (constants.%Destroy.facet.a58)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.loc14_3.3) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.6c9)] -// CHECK:STDOUT: %.loc14_3.4: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet.loc14_3.3 [symbolic = %.loc14_3.4 (constants.%.a73)] -// CHECK:STDOUT: %impl.elem0.loc14_3.2: @G.%.loc14_3.4 (%.a73) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc14_3.2 (constants.%impl.elem0.fa7)] -// CHECK:STDOUT: %specific_impl_fn.loc14_3.2: = specific_impl_function %impl.elem0.loc14_3.2, @Destroy.WithSelf.Op(%Destroy.facet.loc14_3.3) [symbolic = %specific_impl_fn.loc14_3.2 (constants.%specific_impl_fn.075)] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type: type = fn_type @Destroy.WithSelf.SelfDestruct, @Destroy.WithSelf(%Destroy.facet.loc14_3.3) [symbolic = %Destroy.WithSelf.SelfDestruct.type (constants.%Destroy.WithSelf.SelfDestruct.type.d3f)] +// CHECK:STDOUT: %.loc14_3.4: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type, %Destroy.facet.loc14_3.3 [symbolic = %.loc14_3.4 (constants.%.f42)] +// CHECK:STDOUT: %impl.elem2.loc14_3.2: @G.%.loc14_3.4 (%.f42) = impl_witness_access %Destroy.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc14_3.2 (constants.%impl.elem2.f96)] +// CHECK:STDOUT: %specific_impl_fn.loc14_3.2: = specific_impl_function %impl.elem2.loc14_3.2, @Destroy.WithSelf.SelfDestruct(%Destroy.facet.loc14_3.3) [symbolic = %specific_impl_fn.loc14_3.2 (constants.%specific_impl_fn.262)] // CHECK:STDOUT: // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: @@ -828,15 +828,15 @@ fn G(generic N: i32) { // CHECK:STDOUT: %k.patt.loc14_15.1: @G.%pattern_type (%pattern_type.486) = ref_binding_pattern k [symbolic = %k.patt.loc14_15.2 (constants.%k.patt)] // CHECK:STDOUT: %k.var_patt.loc14_3.1: @G.%pattern_type (%pattern_type.486) = var_pattern %k.patt.loc14_15.1 [symbolic = %k.var_patt.loc14_3.2 (constants.%k.var_patt)] // CHECK:STDOUT: } -// CHECK:STDOUT: %impl.elem0.loc14_3.1: @G.%.loc14_3.4 (%.a73) = impl_witness_access constants.%Destroy.lookup_impl_witness.822, element0 [symbolic = %impl.elem0.loc14_3.2 (constants.%impl.elem0.fa7)] -// CHECK:STDOUT: %bound_method.loc14_3.1: = bound_method %k.var, %impl.elem0.loc14_3.1 +// CHECK:STDOUT: %impl.elem2.loc14_3.1: @G.%.loc14_3.4 (%.f42) = impl_witness_access constants.%Destroy.lookup_impl_witness.822, element2 [symbolic = %impl.elem2.loc14_3.2 (constants.%impl.elem2.f96)] +// CHECK:STDOUT: %bound_method.loc14_3.1: = bound_method %k.var, %impl.elem2.loc14_3.1 // CHECK:STDOUT: %Destroy.facet.loc14_3.1: %Destroy.type = facet_value constants.%array_type.359, (constants.%Destroy.lookup_impl_witness.822) [symbolic = %Destroy.facet.loc14_3.3 (constants.%Destroy.facet.a58)] // CHECK:STDOUT: %.loc14_3.2: %Destroy.type = converted constants.%array_type.359, %Destroy.facet.loc14_3.1 [symbolic = %Destroy.facet.loc14_3.3 (constants.%Destroy.facet.a58)] // CHECK:STDOUT: %Destroy.facet.loc14_3.2: %Destroy.type = facet_value constants.%array_type.359, (constants.%Destroy.lookup_impl_witness.822) [symbolic = %Destroy.facet.loc14_3.3 (constants.%Destroy.facet.a58)] // CHECK:STDOUT: %.loc14_3.3: %Destroy.type = converted constants.%array_type.359, %Destroy.facet.loc14_3.2 [symbolic = %Destroy.facet.loc14_3.3 (constants.%Destroy.facet.a58)] -// CHECK:STDOUT: %specific_impl_fn.loc14_3.1: = specific_impl_function %impl.elem0.loc14_3.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.a58) [symbolic = %specific_impl_fn.loc14_3.2 (constants.%specific_impl_fn.075)] +// CHECK:STDOUT: %specific_impl_fn.loc14_3.1: = specific_impl_function %impl.elem2.loc14_3.1, @Destroy.WithSelf.SelfDestruct(constants.%Destroy.facet.a58) [symbolic = %specific_impl_fn.loc14_3.2 (constants.%specific_impl_fn.262)] // CHECK:STDOUT: %bound_method.loc14_3.2: = bound_method %k.var, %specific_impl_fn.loc14_3.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc14_3.2(%k.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %bound_method.loc14_3.2(%k.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/eval/call.carbon b/toolchain/check/testdata/eval/call.carbon index 1ad352914e28..19462476ab7a 100644 --- a/toolchain/check/testdata/eval/call.carbon +++ b/toolchain/check/testdata/eval/call.carbon @@ -201,8 +201,8 @@ fn H() { // CHECK:STDOUT: %ImplicitAs.assoc_type.fcc: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic] // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.97e: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%Dest, %Self.294) [symbolic] // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.945: %ImplicitAs.WithSelf.Convert.type.97e = struct_value () [symbolic] -// CHECK:STDOUT: %.53a: type = type_of_inst @UseFGenerically.%.loc11_3.15 [template] -// CHECK:STDOUT: %.4e4: %.53a = splice_inst @UseFGenerically.%.loc11_3.15 [template] +// CHECK:STDOUT: %.53a63: type = type_of_inst @UseFGenerically.%.loc11_3.15 [template] +// CHECK:STDOUT: %.4e4: %.53a63 = splice_inst @UseFGenerically.%.loc11_3.15 [template] // CHECK:STDOUT: %.7df: type = type_of_inst @UseFGenerically.%.loc11_3.18 [template] // CHECK:STDOUT: %.6c2: %.7df = splice_inst @UseFGenerically.%.loc11_3.18 [template] // CHECK:STDOUT: %.abc: type = type_of_inst @UseFGenerically.%.loc11_3.21 [template] @@ -212,14 +212,14 @@ fn H() { // CHECK:STDOUT: %.e0f: %F.call = splice_inst @UseFGenerically.%.loc11_3.27 [template] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %Self.0e7: %Destroy.type = symbolic_binding Self, 0 [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.d3e: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Self.0e7) [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.42b: %Destroy.WithSelf.Op.type.d3e = struct_value () [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.4e5: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Self.0e7) [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.4a0: %Destroy.WithSelf.SelfDestruct.type.4e5 = struct_value () [symbolic] // CHECK:STDOUT: %Destroy.assoc_type: type = assoc_entity_type @Destroy [concrete] -// CHECK:STDOUT: %assoc0.ae8: %Destroy.assoc_type = assoc_entity element0, imports.%Core.import_ref.918 [concrete] -// CHECK:STDOUT: %.d34: type = type_of_inst @UseFGenerically.%.loc11_3.29 [template] -// CHECK:STDOUT: %.811: %.d34 = splice_inst @UseFGenerically.%.loc11_3.29 [template] -// CHECK:STDOUT: %.7d3: type = type_of_inst @UseFGenerically.%.loc11_3.32 [template] -// CHECK:STDOUT: %.3eb: %.7d3 = splice_inst @UseFGenerically.%.loc11_3.32 [template] +// CHECK:STDOUT: %assoc2: %Destroy.assoc_type = assoc_entity element2, imports.%Core.import_ref.71d [concrete] +// CHECK:STDOUT: %.ddf: type = type_of_inst @UseFGenerically.%.loc11_3.29 [template] +// CHECK:STDOUT: %.7d7: %.ddf = splice_inst @UseFGenerically.%.loc11_3.29 [template] +// CHECK:STDOUT: %.e9b: type = type_of_inst @UseFGenerically.%.loc11_3.32 [template] +// CHECK:STDOUT: %.1f2: %.e9b = splice_inst @UseFGenerically.%.loc11_3.32 [template] // CHECK:STDOUT: %assoc0.0ac: %ImplicitAs.assoc_type.fcc = assoc_entity element0, imports.%Core.import_ref.f9d [symbolic] // CHECK:STDOUT: %int_3.410: %i32 = int_value 3 [concrete] // CHECK:STDOUT: %pattern_type.98b: type = pattern_type %C [concrete] @@ -240,31 +240,75 @@ fn H() { // CHECK:STDOUT: %inst.splice_block.edd: = inst_value [concrete] { // CHECK:STDOUT: %.432: = splice_block [concrete = ] {} // CHECK:STDOUT: } +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc11_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.99a: %pattern_type.98b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.cbd: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt.99a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc11_3.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.6c4ec3.2: = custom_witness (%Destroy.WithSelf.Op.403171.2), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.b0f: %Destroy.type = facet_value %C, (%custom_witness.6c4ec3.2) [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.cb4: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Destroy.facet.b0f) [concrete] -// CHECK:STDOUT: %.c3c: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.cb4, %Destroy.facet.b0f [concrete] -// CHECK:STDOUT: %inst.splice_block.79d: = inst_value [concrete] { -// CHECK:STDOUT: %.eae: = splice_block %bound_method.b4b { +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc11_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f8f19d.2: = custom_witness (%Destroy.WithSelf.Op.403171.2, %Destroy.WithSelf.SubobjectDestroy.d01daf.2, %Destroy.WithSelf.SelfDestruct.db3fdb.2), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.601: %Destroy.type = facet_value %C, (%custom_witness.f8f19d.2) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.c6a: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.601) [concrete] +// CHECK:STDOUT: %.977: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.c6a, %Destroy.facet.601 [concrete] +// CHECK:STDOUT: %inst.splice_block.ae2: = inst_value [concrete] { +// CHECK:STDOUT: %.db6: = splice_block %bound_method.db6 { // CHECK:STDOUT: %.6ba: ref %C = specific_inst @UseFGenerically.%v.var, @UseFGenerically(%int_3.410) -// CHECK:STDOUT: %impl.elem0.bf4: %.c3c = impl_witness_access %custom_witness.6c4ec3.2, element0 [concrete = %Destroy.WithSelf.Op.403171.2] -// CHECK:STDOUT: %bound_method.b4b: = bound_method %.6ba, %impl.elem0.bf4 +// CHECK:STDOUT: %impl.elem2: %.977 = impl_witness_access %custom_witness.f8f19d.2, element2 [concrete = %Destroy.WithSelf.SelfDestruct.db3fdb.2] +// CHECK:STDOUT: %bound_method.db6: = bound_method %.6ba, %impl.elem2 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: %inst.call: = inst_value [concrete] { -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %.eae(%.6ba) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %.db6(%.6ba) // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core.import_ref.484: @ImplicitAs.WithSelf.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.fcc) = import_ref Core//prelude/parts/as, loc{{\d+_\d+}}, loaded [symbolic = @ImplicitAs.WithSelf.%assoc0 (constants.%assoc0.0ac)] // CHECK:STDOUT: %Core.import_ref.cb2: @ImplicitAs.WithSelf.%ImplicitAs.WithSelf.Convert.type (%ImplicitAs.WithSelf.Convert.type.97e) = import_ref Core//prelude/parts/as, loc{{\d+_\d+}}, loaded [symbolic = @ImplicitAs.WithSelf.%ImplicitAs.WithSelf.Convert (constants.%ImplicitAs.WithSelf.Convert.945)] -// CHECK:STDOUT: %Core.import_ref.918: @Destroy.WithSelf.%Destroy.WithSelf.Op.type (%Destroy.WithSelf.Op.type.d3e) = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [symbolic = @Destroy.WithSelf.%Destroy.WithSelf.Op (constants.%Destroy.WithSelf.Op.42b)] +// CHECK:STDOUT: %Core.import_ref.71d: @Destroy.WithSelf.%Destroy.WithSelf.SelfDestruct.type (%Destroy.WithSelf.SelfDestruct.type.4e5) = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [symbolic = @Destroy.WithSelf.%Destroy.WithSelf.SelfDestruct (constants.%Destroy.WithSelf.SelfDestruct.4a0)] // CHECK:STDOUT: %Core.import_ref.f9d = import_ref Core//prelude/parts/as, loc{{\d+_\d+}}, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc11_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc11_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: %UseFGenerically.decl: %UseFGenerically.type = fn_decl @UseFGenerically [concrete = constants.%UseFGenerically] { // CHECK:STDOUT: %X.patt.loc10_29.1: %pattern_type.6b6 = symbolic_binding_pattern X, 0 [symbolic = %X.patt.loc10_29.2 (constants.%X.patt)] @@ -288,8 +332,8 @@ fn H() { // CHECK:STDOUT: %v.patt.loc11_15.2: @UseFGenerically.%pattern_type (%pattern_type.231) = ref_binding_pattern v [template = %v.patt.loc11_15.2 (constants.%v.patt.bcc)] // CHECK:STDOUT: %v.var_patt.loc11_3.2: @UseFGenerically.%pattern_type (%pattern_type.231) = var_pattern %v.patt.loc11_15.2 [template = %v.var_patt.loc11_3.2 (constants.%v.var_patt.53d)] // CHECK:STDOUT: %.loc11_3.15: = call_action (constants.%ImplicitAs.generic, %F.call.loc11_20.2), false [template] -// CHECK:STDOUT: %.loc11_3.16: type = type_of_inst %.loc11_3.15 [template = %.loc11_3.16 (constants.%.53a)] -// CHECK:STDOUT: %.loc11_3.17: @UseFGenerically.%.loc11_3.16 (%.53a) = splice_inst %.loc11_3.15 [template = %.loc11_3.17 (constants.%.4e4)] +// CHECK:STDOUT: %.loc11_3.16: type = type_of_inst %.loc11_3.15 [template = %.loc11_3.16 (constants.%.53a63)] +// CHECK:STDOUT: %.loc11_3.17: @UseFGenerically.%.loc11_3.16 (%.53a63) = splice_inst %.loc11_3.15 [template = %.loc11_3.17 (constants.%.4e4)] // CHECK:STDOUT: %.loc11_3.18: = access_member_action %.loc11_3.2, Convert [template] // CHECK:STDOUT: %.loc11_3.19: type = type_of_inst %.loc11_3.18 [template = %.loc11_3.19 (constants.%.7df)] // CHECK:STDOUT: %.loc11_3.20: @UseFGenerically.%.loc11_3.19 (%.7df) = splice_inst %.loc11_3.18 [template = %.loc11_3.20 (constants.%.6c2)] @@ -301,19 +345,19 @@ fn H() { // CHECK:STDOUT: %.loc11_3.26: @UseFGenerically.%.loc11_3.25 (%.649) = splice_inst %.loc11_3.24 [template = %.loc11_3.26 (constants.%.88d)] // CHECK:STDOUT: %.loc11_3.27: = convert_to_category_action %.loc11_3.9, element10 [template] // CHECK:STDOUT: %.loc11_3.28: @UseFGenerically.%F.call.loc11_20.2 (%F.call) = splice_inst %.loc11_3.27 [template = %.loc11_3.28 (constants.%.e0f)] -// CHECK:STDOUT: %.loc11_3.29: = compound_member_access_action %v.var, constants.%assoc0.ae8 [template] -// CHECK:STDOUT: %.loc11_3.30: type = type_of_inst %.loc11_3.29 [template = %.loc11_3.30 (constants.%.d34)] -// CHECK:STDOUT: %.loc11_3.31: @UseFGenerically.%.loc11_3.30 (%.d34) = splice_inst %.loc11_3.29 [template = %.loc11_3.31 (constants.%.811)] +// CHECK:STDOUT: %.loc11_3.29: = compound_member_access_action %v.var, constants.%assoc2 [template] +// CHECK:STDOUT: %.loc11_3.30: type = type_of_inst %.loc11_3.29 [template = %.loc11_3.30 (constants.%.ddf)] +// CHECK:STDOUT: %.loc11_3.31: @UseFGenerically.%.loc11_3.30 (%.ddf) = splice_inst %.loc11_3.29 [template = %.loc11_3.31 (constants.%.7d7)] // CHECK:STDOUT: %.loc11_3.32: = call_action (%.loc11_3.12), true [template] -// CHECK:STDOUT: %.loc11_3.33: type = type_of_inst %.loc11_3.32 [template = %.loc11_3.33 (constants.%.7d3)] -// CHECK:STDOUT: %.loc11_3.34: @UseFGenerically.%.loc11_3.33 (%.7d3) = splice_inst %.loc11_3.32 [template = %.loc11_3.34 (constants.%.3eb)] +// CHECK:STDOUT: %.loc11_3.33: type = type_of_inst %.loc11_3.32 [template = %.loc11_3.33 (constants.%.e9b)] +// CHECK:STDOUT: %.loc11_3.34: @UseFGenerically.%.loc11_3.33 (%.e9b) = splice_inst %.loc11_3.32 [template = %.loc11_3.34 (constants.%.1f2)] // CHECK:STDOUT: // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %v.var: ref @UseFGenerically.%F.call.loc11_20.2 (%F.call) = var_storage %v.var_patt.loc11_3.1 // CHECK:STDOUT: %.loc11_25: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc11_3.1: type = type_of_inst %.loc11_3.15 [template = %.loc11_3.16 (constants.%.53a)] -// CHECK:STDOUT: %.loc11_3.2: @UseFGenerically.%.loc11_3.16 (%.53a) = splice_inst %.loc11_3.15 [template = %.loc11_3.17 (constants.%.4e4)] +// CHECK:STDOUT: %.loc11_3.1: type = type_of_inst %.loc11_3.15 [template = %.loc11_3.16 (constants.%.53a63)] +// CHECK:STDOUT: %.loc11_3.2: @UseFGenerically.%.loc11_3.16 (%.53a63) = splice_inst %.loc11_3.15 [template = %.loc11_3.17 (constants.%.4e4)] // CHECK:STDOUT: %.loc11_3.3: type = type_of_inst %.loc11_3.18 [template = %.loc11_3.19 (constants.%.7df)] // CHECK:STDOUT: %.loc11_3.4: @UseFGenerically.%.loc11_3.19 (%.7df) = splice_inst %.loc11_3.18 [template = %.loc11_3.20 (constants.%.6c2)] // CHECK:STDOUT: %.loc11_3.5: type = type_of_inst %.loc11_3.21 [template = %.loc11_3.22 (constants.%.abc)] @@ -335,18 +379,36 @@ fn H() { // CHECK:STDOUT: %v.patt.loc11_15.1: @UseFGenerically.%pattern_type (%pattern_type.231) = ref_binding_pattern v [template = %v.patt.loc11_15.2 (constants.%v.patt.bcc)] // CHECK:STDOUT: %v.var_patt.loc11_3.1: @UseFGenerically.%pattern_type (%pattern_type.231) = var_pattern %v.patt.loc11_15.1 [template = %v.var_patt.loc11_3.2 (constants.%v.var_patt.53d)] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc11_3.11: type = type_of_inst %.loc11_3.29 [template = %.loc11_3.30 (constants.%.d34)] -// CHECK:STDOUT: %.loc11_3.12: @UseFGenerically.%.loc11_3.30 (%.d34) = splice_inst %.loc11_3.29 [template = %.loc11_3.31 (constants.%.811)] -// CHECK:STDOUT: %.loc11_3.13: type = type_of_inst %.loc11_3.32 [template = %.loc11_3.33 (constants.%.7d3)] -// CHECK:STDOUT: %.loc11_3.14: @UseFGenerically.%.loc11_3.33 (%.7d3) = splice_inst %.loc11_3.32 [template = %.loc11_3.34 (constants.%.3eb)] +// CHECK:STDOUT: %.loc11_3.11: type = type_of_inst %.loc11_3.29 [template = %.loc11_3.30 (constants.%.ddf)] +// CHECK:STDOUT: %.loc11_3.12: @UseFGenerically.%.loc11_3.30 (%.ddf) = splice_inst %.loc11_3.29 [template = %.loc11_3.31 (constants.%.7d7)] +// CHECK:STDOUT: %.loc11_3.13: type = type_of_inst %.loc11_3.32 [template = %.loc11_3.33 (constants.%.e9b)] +// CHECK:STDOUT: %.loc11_3.14: @UseFGenerically.%.loc11_3.33 (%.e9b) = splice_inst %.loc11_3.32 [template = %.loc11_3.34 (constants.%.1f2)] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_3.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_3.2(%self.param: ref %C) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_3.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_3.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_3.2(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_3.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -379,7 +441,7 @@ fn H() { // CHECK:STDOUT: %.loc11_3.26 => // CHECK:STDOUT: %.loc11_3.27 => // CHECK:STDOUT: %.loc11_3.28 => -// CHECK:STDOUT: %.loc11_3.29 => constants.%inst.splice_block.79d +// CHECK:STDOUT: %.loc11_3.29 => constants.%inst.splice_block.ae2 // CHECK:STDOUT: %.loc11_3.30 => // CHECK:STDOUT: %.loc11_3.31 => invalid // CHECK:STDOUT: %.loc11_3.32 => constants.%inst.call @@ -395,17 +457,83 @@ fn H() { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %tuple.type.555: type = tuple_type (%i32, %i32, %i32) [concrete] +// CHECK:STDOUT: %pattern_type.777: type = pattern_type %tuple.type.555 [concrete] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] +// CHECK:STDOUT: %pattern_type.6b6: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %int_1.0c6: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %int_2.295: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %int_3.410: %i32 = int_value 3 [concrete] // CHECK:STDOUT: %tuple.479: %tuple.type.555 = tuple_value (%int_1.0c6, %int_2.295, %int_3.410) [concrete] // CHECK:STDOUT: %.e1e: ref %tuple.type.555 = temporary invalid, %tuple.479 [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_5.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc8_5.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_5.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc8_5.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.bd8: %pattern_type.777 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.891: %pattern_type.777 = wrapper_binding_pattern self, %self.param_patt.bd8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_5.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc8_5.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.e1e, %Destroy.WithSelf.Op.403171.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8_5.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.e1e, %Destroy.WithSelf.SelfDestruct.db3fdb.3 [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_5.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc8_5.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_5.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc8_5.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_5.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.777 = ref_param_pattern [concrete = constants.%self.param_patt.bd8] +// CHECK:STDOUT: %self.patt: %pattern_type.777 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.891] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.555 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.555 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc8_5.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.777 = ref_param_pattern [concrete = constants.%self.param_patt.bd8] +// CHECK:STDOUT: %self.patt: %pattern_type.777 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.891] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.555 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.555 = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @G() { @@ -414,19 +542,46 @@ fn H() { // CHECK:STDOUT: %.loc8_5.1: ref %tuple.type.555 = temporary_storage // CHECK:STDOUT: %F.call: init %tuple.type.555 to %.loc8_5.1 = call %F.ref() [concrete = constants.%tuple.479] // CHECK:STDOUT: %.loc8_5.2: ref %tuple.type.555 = temporary %.loc8_5.1, %F.call [concrete = constants.%.e1e] -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.e1e) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.e1e) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_5.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_5.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_5.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_5.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_5.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_5.3(%self.param: ref %tuple.type.555) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_5.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_5.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_5.3(%self.param: ref %tuple.type.555) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_5.3(%self.param: ref %tuple.type.555) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_5.3(%self.param: ref %tuple.type.555) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -444,14 +599,79 @@ fn H() { // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] +// CHECK:STDOUT: %pattern_type.6b6: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %int_1.0c6: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %int_2.295: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %int_3.410: %i32 = int_value 3 [concrete] // CHECK:STDOUT: %tuple.479: %tuple.type.555 = tuple_value (%int_1.0c6, %int_2.295, %int_3.410) [concrete] // CHECK:STDOUT: %a.patt: %pattern_type.777 = ref_binding_pattern a [concrete] // CHECK:STDOUT: %a.var_patt: %pattern_type.777 = var_pattern %a.patt [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc8_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc8_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.bd8: %pattern_type.777 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.891: %pattern_type.777 = wrapper_binding_pattern self, %self.param_patt.bd8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc8_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc8_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc8_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.777 = ref_param_pattern [concrete = constants.%self.param_patt.bd8] +// CHECK:STDOUT: %self.patt: %pattern_type.777 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.891] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.555 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.555 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc8_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.777 = ref_param_pattern [concrete = constants.%self.param_patt.bd8] +// CHECK:STDOUT: %self.patt: %pattern_type.777 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.891] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.555 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.555 = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @G() { @@ -473,20 +693,47 @@ fn H() { // CHECK:STDOUT: %a.patt: %pattern_type.777 = ref_binding_pattern a [concrete = constants.%a.patt] // CHECK:STDOUT: %a.var_patt: %pattern_type.777 = var_pattern %a.patt [concrete = constants.%a.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.3(%self.param: ref %tuple.type.555) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.3(%self.param: ref %tuple.type.555) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.3(%self.param: ref %tuple.type.555) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.3(%self.param: ref %tuple.type.555) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -523,6 +770,7 @@ fn H() { // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.8eb: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%i32, %ImplicitAs.facet) [concrete] // CHECK:STDOUT: %.b7a: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.8eb, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.094: = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.e39 [concrete] +// CHECK:STDOUT: %pattern_type.6b6: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.e39, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete] // CHECK:STDOUT: %bound_method.953: = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.0c6: %i32 = int_value 1 [concrete] @@ -536,9 +784,28 @@ fn H() { // CHECK:STDOUT: %.e1e: ref %tuple.type.555 = temporary invalid, %tuple.479 [concrete] // CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [concrete] // CHECK:STDOUT: %tuple.ad8: %tuple.type.f94 = tuple_value (%int_1.5b8, %int_2.ecc) [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc17_32.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc17_32.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc17_32.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc17_32.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.bd8: %pattern_type.777 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.891: %pattern_type.777 = wrapper_binding_pattern self, %self.param_patt.bd8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc17_32.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc17_32.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.e1e, %Destroy.WithSelf.Op.403171.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc17_32.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.e1e, %Destroy.WithSelf.SelfDestruct.db3fdb.3 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -546,6 +813,51 @@ fn H() { // CHECK:STDOUT: %ImplicitAs.impl_witness_table.1aa = impl_witness_table (%Core.import_ref.edf), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc17_32.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc17_32.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc17_32.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc17_32.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc17_32.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.777 = ref_param_pattern [concrete = constants.%self.param_patt.bd8] +// CHECK:STDOUT: %self.patt: %pattern_type.777 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.891] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.555 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.555 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc17_32.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.777 = ref_param_pattern [concrete = constants.%self.param_patt.bd8] +// CHECK:STDOUT: %self.patt: %pattern_type.777 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.891] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.555 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.555 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] { // CHECK:STDOUT: %return.param_patt: %pattern_type.777 = out_param_pattern [concrete = constants.%return.param_patt.789] @@ -610,19 +922,46 @@ fn H() { // CHECK:STDOUT: %a.patt: = ref_binding_pattern a [concrete = ] // CHECK:STDOUT: %a.var_patt: = var_pattern %a.patt [concrete = ] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.e1e) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.e1e) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc17_32.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc17_32.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc17_32.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc17_32.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc17_32.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc17_32.3(%self.param: ref %tuple.type.555) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc17_32.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc17_32.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc17_32.3(%self.param: ref %tuple.type.555) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc17_32.3(%self.param: ref %tuple.type.555) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc17_32.3(%self.param: ref %tuple.type.555) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -645,9 +984,53 @@ fn H() { // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] // CHECK:STDOUT: %.115: ref %C = temporary invalid, %C.val [concrete] // CHECK:STDOUT: %G.specific_fn: = specific_function %G, @G(%C.val) [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc13_7.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc13_7.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.99a: %pattern_type.98b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.cbd: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt.99a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc13_7.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc13_7.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.115, %Destroy.WithSelf.Op.403171.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc13_7.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.115, %Destroy.WithSelf.SelfDestruct.db3fdb.2 [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc13_7.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc13_7.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc13_7.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc13_7.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -680,14 +1063,32 @@ fn H() { // CHECK:STDOUT: %.loc13_7.3: %C = acquire_value %.loc13_7.2 [concrete = constants.%C.val] // CHECK:STDOUT: %G.specific_fn: = specific_function %G.ref, @G(constants.%C.val) [concrete = constants.%G.specific_fn] // CHECK:STDOUT: %G.call: init %empty_tuple.type = call %G.specific_fn() -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.115) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.115) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc13_7.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc13_7.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc13_7.2(%self.param: ref %C) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc13_7.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc13_7.2(%self.param: ref %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc13_7.2(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc13_7.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/facet/call_combined_impl_witness.carbon b/toolchain/check/testdata/facet/call_combined_impl_witness.carbon index d7366b42e776..73ae89c29fbb 100644 --- a/toolchain/check/testdata/facet/call_combined_impl_witness.carbon +++ b/toolchain/check/testdata/facet/call_combined_impl_witness.carbon @@ -107,7 +107,7 @@ fn F() { // CHECK:STDOUT: %t.patt.00d: %pattern_type.653 = wrapper_binding_pattern t, %t.param_patt.4f9 [symbolic] // CHECK:STDOUT: %G.type: type = fn_type @G [concrete] // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] -// CHECK:STDOUT: %require_complete: = require_complete_type %T.as_type [symbolic] +// CHECK:STDOUT: %require_complete.632: = require_complete_type %T.as_type [symbolic] // CHECK:STDOUT: %A.WithSelf.AA.type.5d9: type = fn_type @A.WithSelf.AA, @A.WithSelf(%T) [symbolic] // CHECK:STDOUT: %A.WithSelf.AA.bcc: %A.WithSelf.AA.type.5d9 = struct_value () [symbolic] // CHECK:STDOUT: %B.WithSelf.BB.type.596: type = fn_type @B.WithSelf.BB, @B.WithSelf(%T) [symbolic] @@ -137,9 +137,22 @@ fn F() { // CHECK:STDOUT: %G.specific_fn: = specific_function %G, @G(%facet_value) [concrete] // CHECK:STDOUT: %.115: ref %C = temporary invalid, %C.val [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc45_8.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc45_8.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.99a: %pattern_type.98b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.cbd: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt.99a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc45_8.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc45_8.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.115, %Destroy.WithSelf.Op.403171.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc45_8.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.115, %Destroy.WithSelf.SelfDestruct.db3fdb.2 [concrete] // CHECK:STDOUT: %.833: type = fn_type_with_self_type %A.WithSelf.AA.type.e6d, %A.facet.7ce [concrete] // CHECK:STDOUT: %.02b: type = fn_type_with_self_type %B.WithSelf.BB.type.77e, %B.facet.a13 [concrete] // CHECK:STDOUT: } @@ -157,6 +170,37 @@ fn F() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc45_8.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc45_8.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc45_8.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc45_8.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -333,7 +377,7 @@ fn F() { // CHECK:STDOUT: %t.patt.loc33_25.2: @G.%pattern_type (%pattern_type.653) = wrapper_binding_pattern t, %t.param_patt.loc33_25.2 [symbolic = %t.patt.loc33_25.2 (constants.%t.patt.00d)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %T.as_type.loc33_27.1 [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type %T.as_type.loc33_27.1 [symbolic = %require_complete (constants.%require_complete.632)] // CHECK:STDOUT: %A.lookup_impl_witness: = lookup_impl_witness %T.loc33_7.1, @A [symbolic = %A.lookup_impl_witness (constants.%A.lookup_impl_witness)] // CHECK:STDOUT: %A.facet.loc34: %A.type = facet_value %T.as_type.loc33_27.1, (%A.lookup_impl_witness) [symbolic = %A.facet.loc34 (constants.%A.facet.7b4)] // CHECK:STDOUT: %A.WithSelf.AA.type: type = fn_type @A.WithSelf.AA, @A.WithSelf(%A.facet.loc34) [symbolic = %A.WithSelf.AA.type (constants.%A.WithSelf.AA.type.c6d)] @@ -411,14 +455,32 @@ fn F() { // CHECK:STDOUT: %.loc45_8.2: ref %C = temporary %.loc45_6.2, %.loc45_8.1 [concrete = constants.%.115] // CHECK:STDOUT: %.loc45_8.3: %C = acquire_value %.loc45_8.2 [concrete = constants.%C.val] // CHECK:STDOUT: %G.call: init %empty_tuple.type = call %G.specific_fn(%.loc45_8.3) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.115) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.115) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc45_8.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc45_8.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc45_8.2(%self.param: ref %C) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc45_8.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc45_8.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc45_8.2(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc45_8.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/facet/convert_class_type_to_generic_facet_value.carbon b/toolchain/check/testdata/facet/convert_class_type_to_generic_facet_value.carbon index 0834602e1f46..b49aae2f4ea5 100644 --- a/toolchain/check/testdata/facet/convert_class_type_to_generic_facet_value.carbon +++ b/toolchain/check/testdata/facet/convert_class_type_to_generic_facet_value.carbon @@ -462,7 +462,7 @@ fn G() { // CHECK:STDOUT: %t.patt.c64: %pattern_type.51d = wrapper_binding_pattern t, %t.param_patt.513 [symbolic] // CHECK:STDOUT: %CallGenericMethod.type: type = fn_type @CallGenericMethod [concrete] // CHECK:STDOUT: %CallGenericMethod: %CallGenericMethod.type = struct_value () [concrete] -// CHECK:STDOUT: %require_complete: = require_complete_type %T [symbolic] +// CHECK:STDOUT: %require_complete.944: = require_complete_type %T [symbolic] // CHECK:STDOUT: %G.type: type = fn_type @G [concrete] // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete] @@ -475,9 +475,22 @@ fn G() { // CHECK:STDOUT: %CallGenericMethod.specific_fn: = specific_function %CallGenericMethod, @CallGenericMethod(%GenericParam, %Generic.facet) [concrete] // CHECK:STDOUT: %.b65: ref %GenericParam = temporary invalid, %GenericParam.val [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc18_38.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc18_38.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.320: %pattern_type.485 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.c61: %pattern_type.485 = wrapper_binding_pattern self, %self.param_patt.320 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc18_38.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc18_38.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.b65, %Destroy.WithSelf.Op.403171.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc18_38.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.b65, %Destroy.WithSelf.SelfDestruct.db3fdb.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -489,6 +502,37 @@ fn G() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc18_38.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc18_38.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc18_38.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.485 = ref_param_pattern [concrete = constants.%self.param_patt.320] +// CHECK:STDOUT: %self.patt: %pattern_type.485 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.c61] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %GenericParam = ref_param call_param0 +// CHECK:STDOUT: %self: ref %GenericParam = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc18_38.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.485 = ref_param_pattern [concrete = constants.%self.param_patt.320] +// CHECK:STDOUT: %self.patt: %pattern_type.485 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.c61] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %GenericParam = ref_param call_param0 +// CHECK:STDOUT: %self: ref %GenericParam = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -615,7 +659,7 @@ fn G() { // CHECK:STDOUT: %t.patt.loc15_69.2: @CallGenericMethod.%pattern_type.loc15_69 (%pattern_type.51d) = wrapper_binding_pattern t, %t.param_patt.loc15_69.2 [symbolic = %t.patt.loc15_69.2 (constants.%t.patt.c64)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %T.loc15_23.1 [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type %T.loc15_23.1 [symbolic = %require_complete (constants.%require_complete.944)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%t.param: @CallGenericMethod.%T.loc15_23.1 (%T)) { // CHECK:STDOUT: !entry: @@ -638,14 +682,32 @@ fn G() { // CHECK:STDOUT: %.loc18_38.2: ref %GenericParam = temporary %.loc18_36.2, %.loc18_38.1 [concrete = constants.%.b65] // CHECK:STDOUT: %.loc18_38.3: %GenericParam = acquire_value %.loc18_38.2 [concrete = constants.%GenericParam.val] // CHECK:STDOUT: %CallGenericMethod.call: init %empty_tuple.type = call %CallGenericMethod.specific_fn(%.loc18_38.3) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.b65) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.b65) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc18_38.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18_38.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18_38.2(%self.param: ref %GenericParam) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc18_38.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc18_38.2(%self.param: ref %GenericParam) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18_38.2(%self.param: ref %GenericParam) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc18_38.2(%self.param: ref %GenericParam) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/facet/convert_class_value_to_facet_value_value.carbon b/toolchain/check/testdata/facet/convert_class_value_to_facet_value_value.carbon index 9ee81b7f4660..ab2f580a858f 100644 --- a/toolchain/check/testdata/facet/convert_class_value_to_facet_value_value.carbon +++ b/toolchain/check/testdata/facet/convert_class_value_to_facet_value_value.carbon @@ -40,7 +40,7 @@ fn F() { // CHECK:STDOUT: %WalkAnimal.type: type = fn_type @WalkAnimal [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %WalkAnimal: %WalkAnimal.type = struct_value () [concrete] -// CHECK:STDOUT: %require_complete: = require_complete_type %T.as_type [symbolic] +// CHECK:STDOUT: %require_complete.db4: = require_complete_type %T.as_type [symbolic] // CHECK:STDOUT: %Goat: type = class_type @Goat [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] @@ -57,9 +57,22 @@ fn F() { // CHECK:STDOUT: %WalkAnimal.specific_fn: = specific_function %WalkAnimal, @WalkAnimal(%Animal.facet) [concrete] // CHECK:STDOUT: %.4ea: ref %Goat = temporary invalid, %Goat.val [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc23_17.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc23_17.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.41a: %pattern_type.283 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.ad2: %pattern_type.283 = wrapper_binding_pattern self, %self.param_patt.41a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc23_17.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc23_17.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.4ea, %Destroy.WithSelf.Op.403171.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc23_17.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.4ea, %Destroy.WithSelf.SelfDestruct.db3fdb.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -71,6 +84,37 @@ fn F() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc23_17.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc23_17.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc23_17.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.283 = ref_param_pattern [concrete = constants.%self.param_patt.41a] +// CHECK:STDOUT: %self.patt: %pattern_type.283 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ad2] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Goat = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Goat = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc23_17.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.283 = ref_param_pattern [concrete = constants.%self.param_patt.41a] +// CHECK:STDOUT: %self.patt: %pattern_type.283 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ad2] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Goat = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Goat = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -145,7 +189,7 @@ fn F() { // CHECK:STDOUT: %a.patt.loc17_34.2: @WalkAnimal.%pattern_type (%pattern_type.e90) = wrapper_binding_pattern a, %a.param_patt.loc17_34.2 [symbolic = %a.patt.loc17_34.2 (constants.%a.patt.feb)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %T.as_type.loc17_36.1 [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type %T.as_type.loc17_36.1 [symbolic = %require_complete (constants.%require_complete.db4)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%a.param: @WalkAnimal.%T.as_type.loc17_36.1 (%T.as_type)) { // CHECK:STDOUT: !entry: @@ -169,14 +213,32 @@ fn F() { // CHECK:STDOUT: %.loc23_17.2: ref %Goat = temporary %.loc23_15.2, %.loc23_17.1 [concrete = constants.%.4ea] // CHECK:STDOUT: %.loc23_17.3: %Goat = acquire_value %.loc23_17.2 [concrete = constants.%Goat.val] // CHECK:STDOUT: %WalkAnimal.call: init %empty_tuple.type = call %WalkAnimal.specific_fn(%.loc23_17.3) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.4ea) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.4ea) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc23_17.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc23_17.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc23_17.2(%self.param: ref %Goat) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc23_17.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc23_17.2(%self.param: ref %Goat) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc23_17.2(%self.param: ref %Goat) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc23_17.2(%self.param: ref %Goat) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/facet/convert_class_value_to_generic_facet_value_value.carbon b/toolchain/check/testdata/facet/convert_class_value_to_generic_facet_value_value.carbon index e9b303bbd88a..226b9cd684a8 100644 --- a/toolchain/check/testdata/facet/convert_class_value_to_generic_facet_value_value.carbon +++ b/toolchain/check/testdata/facet/convert_class_value_to_generic_facet_value_value.carbon @@ -155,8 +155,8 @@ fn B() { // CHECK:STDOUT: %Generic.WithSelf.F.5e8: %Generic.WithSelf.F.type.a70 = struct_value () [symbolic] // CHECK:STDOUT: %Generic.lookup_impl_witness: = lookup_impl_witness %U, @Generic, @Generic(%T) [symbolic] // CHECK:STDOUT: %.aca: type = fn_type_with_self_type %Generic.WithSelf.F.type.a70, %U [symbolic] -// CHECK:STDOUT: %impl.elem0: %.aca = impl_witness_access %Generic.lookup_impl_witness, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn: = specific_impl_function %impl.elem0, @Generic.WithSelf.F(%T, %U) [symbolic] +// CHECK:STDOUT: %impl.elem0.e53: %.aca = impl_witness_access %Generic.lookup_impl_witness, element0 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.5eb: = specific_impl_function %impl.elem0.e53, @Generic.WithSelf.F(%T, %U) [symbolic] // CHECK:STDOUT: %G.type: type = fn_type @G [concrete] // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete] @@ -174,12 +174,31 @@ fn B() { // CHECK:STDOUT: %.cd4: ref %ImplsGeneric = temporary invalid, %ImplsGeneric.val [concrete] // CHECK:STDOUT: %.b65: ref %GenericParam = temporary invalid, %GenericParam.val [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc20_44.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc20_44.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.320: %pattern_type.485 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.c61: %pattern_type.485 = wrapper_binding_pattern self, %self.param_patt.320 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc20_44.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc20_44.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.d4a: = bound_method %.b65, %Destroy.WithSelf.Op.403171.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc20_44.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.f89: = bound_method %.b65, %Destroy.WithSelf.SelfDestruct.db3fdb.2 [concrete] +// CHECK:STDOUT: %self.param_patt.a2d: %pattern_type.488 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.dca: %pattern_type.488 = wrapper_binding_pattern self, %self.param_patt.a2d [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc20_24 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc20_24 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.03b: = bound_method %.cd4, %Destroy.WithSelf.Op.403171.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc20_24 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.fc0: = bound_method %.cd4, %Destroy.WithSelf.SelfDestruct.db3fdb.3 [concrete] // CHECK:STDOUT: %complete_type.35b: = complete_type_witness %Generic.type.b40 [concrete] // CHECK:STDOUT: %.636: type = fn_type_with_self_type %Generic.WithSelf.F.type.7ef, %Generic.facet [concrete] // CHECK:STDOUT: } @@ -193,6 +212,51 @@ fn B() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc20_44.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc20_44.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc20_44.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.485 = ref_param_pattern [concrete = constants.%self.param_patt.320] +// CHECK:STDOUT: %self.patt: %pattern_type.485 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.c61] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %GenericParam = ref_param call_param0 +// CHECK:STDOUT: %self: ref %GenericParam = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc20_44.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.485 = ref_param_pattern [concrete = constants.%self.param_patt.320] +// CHECK:STDOUT: %self.patt: %pattern_type.485 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.c61] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %GenericParam = ref_param call_param0 +// CHECK:STDOUT: %self: ref %GenericParam = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc20_24 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.488 = ref_param_pattern [concrete = constants.%self.param_patt.a2d] +// CHECK:STDOUT: %self.patt: %pattern_type.488 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.dca] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ImplsGeneric = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ImplsGeneric = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc20_24 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.488 = ref_param_pattern [concrete = constants.%self.param_patt.a2d] +// CHECK:STDOUT: %self.patt: %pattern_type.488 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.dca] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ImplsGeneric = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ImplsGeneric = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -340,8 +404,8 @@ fn B() { // CHECK:STDOUT: %Generic.WithSelf.F.type: type = fn_type @Generic.WithSelf.F, @Generic.WithSelf(%T.loc15_23.1, %U.loc15_32.1) [symbolic = %Generic.WithSelf.F.type (constants.%Generic.WithSelf.F.type.a70)] // CHECK:STDOUT: %.loc16_4.3: type = fn_type_with_self_type %Generic.WithSelf.F.type, %U.loc15_32.1 [symbolic = %.loc16_4.3 (constants.%.aca)] // CHECK:STDOUT: %Generic.lookup_impl_witness: = lookup_impl_witness %U.loc15_32.1, @Generic, @Generic(%T.loc15_23.1) [symbolic = %Generic.lookup_impl_witness (constants.%Generic.lookup_impl_witness)] -// CHECK:STDOUT: %impl.elem0.loc16_4.2: @CallGenericMethod.%.loc16_4.3 (%.aca) = impl_witness_access %Generic.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc16_4.2 (constants.%impl.elem0)] -// CHECK:STDOUT: %specific_impl_fn.loc16_4.2: = specific_impl_function %impl.elem0.loc16_4.2, @Generic.WithSelf.F(%T.loc15_23.1, %U.loc15_32.1) [symbolic = %specific_impl_fn.loc16_4.2 (constants.%specific_impl_fn)] +// CHECK:STDOUT: %impl.elem0.loc16_4.2: @CallGenericMethod.%.loc16_4.3 (%.aca) = impl_witness_access %Generic.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc16_4.2 (constants.%impl.elem0.e53)] +// CHECK:STDOUT: %specific_impl_fn.loc16_4.2: = specific_impl_function %impl.elem0.loc16_4.2, @Generic.WithSelf.F(%T.loc15_23.1, %U.loc15_32.1) [symbolic = %specific_impl_fn.loc16_4.2 (constants.%specific_impl_fn.5eb)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%a.param: @CallGenericMethod.%U.as_type.loc15_56.1 (%U.as_type), %s.param: @CallGenericMethod.%T.loc15_23.1 (%T)) { // CHECK:STDOUT: !entry: @@ -350,8 +414,8 @@ fn B() { // CHECK:STDOUT: %.loc16_4.1: type = converted %U.ref.loc16, %U.as_type.loc16 [symbolic = %U.as_type.loc15_56.1 (constants.%U.as_type)] // CHECK:STDOUT: %.loc16_4.2: @CallGenericMethod.%Generic.assoc_type (%Generic.assoc_type.d7021d.2) = specific_constant @Generic.WithSelf.%assoc0.loc5_9.1, @Generic.WithSelf(constants.%T, constants.%U) [symbolic = %assoc0 (constants.%assoc0.31052a.2)] // CHECK:STDOUT: %F.ref: @CallGenericMethod.%Generic.assoc_type (%Generic.assoc_type.d7021d.2) = name_ref F, %.loc16_4.2 [symbolic = %assoc0 (constants.%assoc0.31052a.2)] -// CHECK:STDOUT: %impl.elem0.loc16_4.1: @CallGenericMethod.%.loc16_4.3 (%.aca) = impl_witness_access constants.%Generic.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc16_4.2 (constants.%impl.elem0)] -// CHECK:STDOUT: %specific_impl_fn.loc16_4.1: = specific_impl_function %impl.elem0.loc16_4.1, @Generic.WithSelf.F(constants.%T, constants.%U) [symbolic = %specific_impl_fn.loc16_4.2 (constants.%specific_impl_fn)] +// CHECK:STDOUT: %impl.elem0.loc16_4.1: @CallGenericMethod.%.loc16_4.3 (%.aca) = impl_witness_access constants.%Generic.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc16_4.2 (constants.%impl.elem0.e53)] +// CHECK:STDOUT: %specific_impl_fn.loc16_4.1: = specific_impl_function %impl.elem0.loc16_4.1, @Generic.WithSelf.F(constants.%T, constants.%U) [symbolic = %specific_impl_fn.loc16_4.2 (constants.%specific_impl_fn.5eb)] // CHECK:STDOUT: %Generic.WithSelf.F.call: init %empty_tuple.type = call %specific_impl_fn.loc16_4.1() // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -378,20 +442,47 @@ fn B() { // CHECK:STDOUT: %.loc20_44.2: ref %GenericParam = temporary %.loc20_42.2, %.loc20_44.1 [concrete = constants.%.b65] // CHECK:STDOUT: %.loc20_44.3: %GenericParam = acquire_value %.loc20_44.2 [concrete = constants.%GenericParam.val] // CHECK:STDOUT: %CallGenericMethod.call: init %empty_tuple.type = call %CallGenericMethod.specific_fn(%.loc20_24.3, %.loc20_44.3) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc20_44: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound.d4a(constants.%.b65) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc20_24: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound.03b(constants.%.cd4) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc20_44: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound.f89(constants.%.b65) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc20_24: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound.fc0(constants.%.cd4) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc20_44.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc20_44.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc20_44.2(%self.param: ref %GenericParam) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc20_44.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc20_44.2(%self.param: ref %GenericParam) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc20_24(%self.param: ref %ImplsGeneric) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc20_44.2(%self.param: ref %GenericParam) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc20_44.2(%self.param: ref %GenericParam) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc20_24(%self.param: ref %ImplsGeneric) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc20_24(%self.param: ref %ImplsGeneric) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc20_24(%self.param: ref %ImplsGeneric) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -567,9 +658,22 @@ fn B() { // CHECK:STDOUT: %A.specific_fn: = specific_function %A, @A(%I.facet.dfc) [concrete] // CHECK:STDOUT: %.115: ref %C = temporary invalid, %C.val [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc12_8.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc12_8.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.99a: %pattern_type.98b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.cbd: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt.99a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc12_8.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc12_8.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.115, %Destroy.WithSelf.Op.403171.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc12_8.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.115, %Destroy.WithSelf.SelfDestruct.db3fdb.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -581,6 +685,37 @@ fn B() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc12_8.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc12_8.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc12_8.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc12_8.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -731,14 +866,32 @@ fn B() { // CHECK:STDOUT: %.loc12_8.2: ref %C = temporary %.loc12_6.2, %.loc12_8.1 [concrete = constants.%.115] // CHECK:STDOUT: %.loc12_8.3: %C = acquire_value %.loc12_8.2 [concrete = constants.%C.val] // CHECK:STDOUT: %A.call: init %empty_tuple.type = call %A.specific_fn(%.loc12_8.3) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.115) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.115) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc12_8.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc12_8.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc12_8.2(%self.param: ref %C) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc12_8.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc12_8.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc12_8.2(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc12_8.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/facet/convert_facet_value_as_type_knows_original_type.carbon b/toolchain/check/testdata/facet/convert_facet_value_as_type_knows_original_type.carbon index 158bcc6fc415..d1b14cdc8998 100644 --- a/toolchain/check/testdata/facet/convert_facet_value_as_type_knows_original_type.carbon +++ b/toolchain/check/testdata/facet/convert_facet_value_as_type_knows_original_type.carbon @@ -132,7 +132,7 @@ fn F[A: J, B: A](x: C(A, B)) { // CHECK:STDOUT: %Eats.type: type = facet_type <@Eats> [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Eats.assoc_type: type = assoc_entity_type @Eats [concrete] -// CHECK:STDOUT: %assoc0.12f: %Eats.assoc_type = assoc_entity element0, @Eats.WithSelf.%Eats.WithSelf.Eat.decl [concrete] +// CHECK:STDOUT: %assoc0: %Eats.assoc_type = assoc_entity element0, @Eats.WithSelf.%Eats.WithSelf.Eat.decl [concrete] // CHECK:STDOUT: %Animal.type: type = facet_type <@Animal> [concrete] // CHECK:STDOUT: %Goat: type = class_type @Goat [concrete] // CHECK:STDOUT: %Goat.Bleet.type: type = fn_type @Goat.Bleet [concrete] @@ -151,9 +151,53 @@ fn F[A: J, B: A](x: C(A, B)) { // CHECK:STDOUT: %Goat.val: %Goat = struct_value () [concrete] // CHECK:STDOUT: %.4ea: ref %Goat = temporary invalid, %Goat.val [concrete] // CHECK:STDOUT: %.544: type = fn_type_with_self_type %Eats.WithSelf.Eat.type.067, %Eats.facet [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc26_8.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc26_8.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.41a: %pattern_type.283 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.ad2: %pattern_type.283 = wrapper_binding_pattern self, %self.param_patt.41a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc26_8.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc26_8.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.4ea, %Destroy.WithSelf.Op.403171.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc26_8.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.4ea, %Destroy.WithSelf.SelfDestruct.db3fdb.2 [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc26_8.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc26_8.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc26_8.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.283 = ref_param_pattern [concrete = constants.%self.param_patt.41a] +// CHECK:STDOUT: %self.patt: %pattern_type.283 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ad2] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Goat = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Goat = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc26_8.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.283 = ref_param_pattern [concrete = constants.%self.param_patt.41a] +// CHECK:STDOUT: %self.patt: %pattern_type.283 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ad2] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Goat = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Goat = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -181,7 +225,7 @@ fn F[A: J, B: A](x: C(A, B)) { // CHECK:STDOUT: %Bleet.ref.loc23: %Goat.Bleet.type = name_ref Bleet, @Goat.%Goat.Bleet.decl [concrete = constants.%Goat.Bleet] // CHECK:STDOUT: %Goat.Bleet.call.loc23: init %empty_tuple.type = call %Bleet.ref.loc23() // CHECK:STDOUT: %x.ref.loc24: %Goat = name_ref x, %x -// CHECK:STDOUT: %Eat.ref.loc24: %Eats.assoc_type = name_ref Eat, @Eats.WithSelf.%assoc0 [concrete = constants.%assoc0.12f] +// CHECK:STDOUT: %Eat.ref.loc24: %Eats.assoc_type = name_ref Eat, @Eats.WithSelf.%assoc0 [concrete = constants.%assoc0] // CHECK:STDOUT: %impl.elem0.loc24: %.544 = impl_witness_access constants.%Eats.impl_witness, element0 [concrete = constants.%Goat.as.Eats.impl.Eat] // CHECK:STDOUT: %Goat.as.Eats.impl.Eat.call.loc24: init %empty_tuple.type = call %impl.elem0.loc24() // CHECK:STDOUT: %.loc26_6.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] @@ -198,7 +242,7 @@ fn F[A: J, B: A](x: C(A, B)) { // CHECK:STDOUT: %.loc26_8.2: ref %Goat = temporary %.loc26_6.2, %.loc26_8.1 [concrete = constants.%.4ea] // CHECK:STDOUT: %Bleet.ref.loc26: %Goat.Bleet.type = name_ref Bleet, @Goat.%Goat.Bleet.decl [concrete = constants.%Goat.Bleet] // CHECK:STDOUT: %Goat.Bleet.call.loc26: init %empty_tuple.type = call %Bleet.ref.loc26() -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc26: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.4ea) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc26: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.4ea) // CHECK:STDOUT: %.loc27_6.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] // CHECK:STDOUT: %Goat.ref.loc27_11: type = name_ref Goat, file.%Goat.decl [concrete = constants.%Goat] // CHECK:STDOUT: %.loc27_6.2: ref %Goat = temporary_storage @@ -211,18 +255,36 @@ fn F[A: J, B: A](x: C(A, B)) { // CHECK:STDOUT: %as_type.loc27: type = facet_access_type %.loc27_26 [concrete = constants.%Goat] // CHECK:STDOUT: %.loc27_35: type = converted %.loc27_26, %as_type.loc27 [concrete = constants.%Goat] // CHECK:STDOUT: %.loc27_8.2: ref %Goat = temporary %.loc27_6.2, %.loc27_8.1 [concrete = constants.%.4ea] -// CHECK:STDOUT: %Eat.ref.loc27: %Eats.assoc_type = name_ref Eat, @Eats.WithSelf.%assoc0 [concrete = constants.%assoc0.12f] +// CHECK:STDOUT: %Eat.ref.loc27: %Eats.assoc_type = name_ref Eat, @Eats.WithSelf.%assoc0 [concrete = constants.%assoc0] // CHECK:STDOUT: %impl.elem0.loc27: %.544 = impl_witness_access constants.%Eats.impl_witness, element0 [concrete = constants.%Goat.as.Eats.impl.Eat] // CHECK:STDOUT: %Goat.as.Eats.impl.Eat.call.loc27: init %empty_tuple.type = call %impl.elem0.loc27() -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc27: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.4ea) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc22: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.4ea) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc27: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.4ea) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc22: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.4ea) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc26_8.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc26_8.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc26_8.2(%self.param: ref %Goat) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc26_8.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc26_8.2(%self.param: ref %Goat) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc26_8.2(%self.param: ref %Goat) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc26_8.2(%self.param: ref %Goat) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/facet/convert_facet_value_value_to_generic_facet_value_value.carbon b/toolchain/check/testdata/facet/convert_facet_value_value_to_generic_facet_value_value.carbon index 30d86626f450..139629e20321 100644 --- a/toolchain/check/testdata/facet/convert_facet_value_value_to_generic_facet_value_value.carbon +++ b/toolchain/check/testdata/facet/convert_facet_value_value_to_generic_facet_value_value.carbon @@ -138,12 +138,31 @@ fn F() { // CHECK:STDOUT: %.4ea: ref %Goat = temporary invalid, %Goat.val [concrete] // CHECK:STDOUT: %.202: ref %Grass = temporary invalid, %Grass.val [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc35_31.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc35_31.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.330: %pattern_type.92e = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.414: %pattern_type.92e = wrapper_binding_pattern self, %self.param_patt.330 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc35_31.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc35_31.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.af9: = bound_method %.202, %Destroy.WithSelf.Op.403171.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc35_31.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.d5e: = bound_method %.202, %Destroy.WithSelf.SelfDestruct.db3fdb.2 [concrete] +// CHECK:STDOUT: %self.param_patt.41a: %pattern_type.283 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.ad2: %pattern_type.283 = wrapper_binding_pattern self, %self.param_patt.41a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc35_19 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc35_19 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.c34: = bound_method %.4ea, %Destroy.WithSelf.Op.403171.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc35_19 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.d8f: = bound_method %.4ea, %Destroy.WithSelf.SelfDestruct.db3fdb.3 [concrete] // CHECK:STDOUT: %Eats.type.682: type = facet_type <@Eats, @Eats(%Grass)> [concrete] // CHECK:STDOUT: %.6da: = impl_self_witness %Goat, @Eats, @Eats(%Grass) [concrete] // CHECK:STDOUT: %Eats.impl_witness.86c: = impl_witness @T.as_type.as.Eats.impl.%Eats.impl_witness_table, @T.as_type.as.Eats.impl(%Animal.facet, %Edible.facet) [concrete] @@ -168,6 +187,51 @@ fn F() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc35_31.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc35_31.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc35_31.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.92e = ref_param_pattern [concrete = constants.%self.param_patt.330] +// CHECK:STDOUT: %self.patt: %pattern_type.92e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.414] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Grass = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Grass = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc35_31.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.92e = ref_param_pattern [concrete = constants.%self.param_patt.330] +// CHECK:STDOUT: %self.patt: %pattern_type.92e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.414] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Grass = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Grass = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc35_19 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.283 = ref_param_pattern [concrete = constants.%self.param_patt.41a] +// CHECK:STDOUT: %self.patt: %pattern_type.283 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ad2] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Goat = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Goat = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc35_19 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.283 = ref_param_pattern [concrete = constants.%self.param_patt.41a] +// CHECK:STDOUT: %self.patt: %pattern_type.283 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ad2] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Goat = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Goat = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -492,20 +556,47 @@ fn F() { // CHECK:STDOUT: %.loc35_31.2: ref %Grass = temporary %.loc35_29.2, %.loc35_31.1 [concrete = constants.%.202] // CHECK:STDOUT: %.loc35_31.3: %Grass = acquire_value %.loc35_31.2 [concrete = constants.%Grass.val] // CHECK:STDOUT: %HandleAnimal.call: init %empty_tuple.type = call %HandleAnimal.specific_fn(%.loc35_19.3, %.loc35_31.3) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc35_31: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound.af9(constants.%.202) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc35_19: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound.c34(constants.%.4ea) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc35_31: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound.d5e(constants.%.202) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc35_19: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound.d8f(constants.%.4ea) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc35_31.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc35_31.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc35_31.2(%self.param: ref %Grass) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc35_31.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc35_31.2(%self.param: ref %Grass) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc35_19(%self.param: ref %Goat) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc35_31.2(%self.param: ref %Grass) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc35_31.2(%self.param: ref %Grass) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc35_19(%self.param: ref %Goat) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc35_19(%self.param: ref %Goat) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc35_19(%self.param: ref %Goat) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/facet/convert_facet_value_value_to_itself.carbon b/toolchain/check/testdata/facet/convert_facet_value_value_to_itself.carbon index c932139a291b..3eab5f95dd43 100644 --- a/toolchain/check/testdata/facet/convert_facet_value_value_to_itself.carbon +++ b/toolchain/check/testdata/facet/convert_facet_value_value_to_itself.carbon @@ -42,7 +42,7 @@ fn F() { // CHECK:STDOUT: %FeedAnimal.type: type = fn_type @FeedAnimal [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %FeedAnimal: %FeedAnimal.type = struct_value () [concrete] -// CHECK:STDOUT: %require_complete: = require_complete_type %T.as_type [symbolic] +// CHECK:STDOUT: %require_complete.db4: = require_complete_type %T.as_type [symbolic] // CHECK:STDOUT: %a.patt.febc60.2: %pattern_type.e90 = wrapper_binding_pattern a, %a.param_patt.84e [symbolic] // CHECK:STDOUT: %HandleAnimal.type: type = fn_type @HandleAnimal [concrete] // CHECK:STDOUT: %HandleAnimal: %HandleAnimal.type = struct_value () [concrete] @@ -63,9 +63,22 @@ fn F() { // CHECK:STDOUT: %HandleAnimal.specific_fn: = specific_function %HandleAnimal, @HandleAnimal(%Animal.facet) [concrete] // CHECK:STDOUT: %.4ea: ref %Goat = temporary invalid, %Goat.val [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc25_19.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc25_19.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.41a: %pattern_type.283 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.ad2: %pattern_type.283 = wrapper_binding_pattern self, %self.param_patt.41a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc25_19.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc25_19.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.4ea, %Destroy.WithSelf.Op.403171.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc25_19.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.4ea, %Destroy.WithSelf.SelfDestruct.db3fdb.2 [concrete] // CHECK:STDOUT: %a.patt.fd6628.2: %pattern_type.283 = wrapper_binding_pattern a, %a.param_patt.8f5 [concrete] // CHECK:STDOUT: %FeedAnimal.specific_fn.99a: = specific_function %FeedAnimal, @FeedAnimal(%Animal.facet) [concrete] // CHECK:STDOUT: } @@ -79,6 +92,37 @@ fn F() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc25_19.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc25_19.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc25_19.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.283 = ref_param_pattern [concrete = constants.%self.param_patt.41a] +// CHECK:STDOUT: %self.patt: %pattern_type.283 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ad2] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Goat = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Goat = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc25_19.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.283 = ref_param_pattern [concrete = constants.%self.param_patt.41a] +// CHECK:STDOUT: %self.patt: %pattern_type.283 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ad2] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Goat = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Goat = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -172,7 +216,7 @@ fn F() { // CHECK:STDOUT: %a.patt.loc17_34.2: @FeedAnimal.%pattern_type (%pattern_type.e90) = wrapper_binding_pattern a, %a.param_patt.loc17_34.2 [symbolic = %a.patt.loc17_34.2 (constants.%a.patt.febc60.1)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %T.as_type.loc17_36.1 [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type %T.as_type.loc17_36.1 [symbolic = %require_complete (constants.%require_complete.db4)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%a.param: @FeedAnimal.%T.as_type.loc17_36.1 (%T.as_type)) { // CHECK:STDOUT: !entry: @@ -189,7 +233,7 @@ fn F() { // CHECK:STDOUT: %a.patt.loc19_29.2: @HandleAnimal.%pattern_type (%pattern_type.e90) = wrapper_binding_pattern a, %a.param_patt.loc19_29.2 [symbolic = %a.patt.loc19_29.2 (constants.%a.patt.febc60.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %T.as_type.loc19_31.1 [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type %T.as_type.loc19_31.1 [symbolic = %require_complete (constants.%require_complete.db4)] // CHECK:STDOUT: %FeedAnimal.specific_fn.loc19_36.2: = specific_function constants.%FeedAnimal, @FeedAnimal(%T.loc19_18.1) [symbolic = %FeedAnimal.specific_fn.loc19_36.2 (constants.%FeedAnimal.specific_fn.5bd)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%a.param: @HandleAnimal.%T.as_type.loc19_31.1 (%T.as_type)) { @@ -220,14 +264,32 @@ fn F() { // CHECK:STDOUT: %.loc25_19.2: ref %Goat = temporary %.loc25_17.2, %.loc25_19.1 [concrete = constants.%.4ea] // CHECK:STDOUT: %.loc25_19.3: %Goat = acquire_value %.loc25_19.2 [concrete = constants.%Goat.val] // CHECK:STDOUT: %HandleAnimal.call: init %empty_tuple.type = call %HandleAnimal.specific_fn(%.loc25_19.3) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.4ea) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.4ea) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc25_19.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc25_19.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc25_19.2(%self.param: ref %Goat) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc25_19.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc25_19.2(%self.param: ref %Goat) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc25_19.2(%self.param: ref %Goat) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc25_19.2(%self.param: ref %Goat) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -244,7 +306,7 @@ fn F() { // CHECK:STDOUT: %a.patt.loc17_34.2 => constants.%a.patt.febc60.1 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%require_complete +// CHECK:STDOUT: %require_complete => constants.%require_complete.db4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @HandleAnimal(constants.%T) { diff --git a/toolchain/check/testdata/facet/fail_deduction_uses_runtime_type_conversion.carbon b/toolchain/check/testdata/facet/fail_deduction_uses_runtime_type_conversion.carbon index 44e6cc5e6b6f..6fe4a7194414 100644 --- a/toolchain/check/testdata/facet/fail_deduction_uses_runtime_type_conversion.carbon +++ b/toolchain/check/testdata/facet/fail_deduction_uses_runtime_type_conversion.carbon @@ -87,7 +87,7 @@ fn G(holds_to: HoldsType((RuntimeConvertTo, )), generic from: RuntimeConvertFrom // CHECK:STDOUT: %x.patt.991: %pattern_type.ec9 = wrapper_binding_pattern x, %x.param_patt.741 [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] -// CHECK:STDOUT: %require_complete: = require_complete_type %HoldsType.4fb [symbolic] +// CHECK:STDOUT: %require_complete.4d4: = require_complete_type %HoldsType.4fb [symbolic] // CHECK:STDOUT: %tuple.eb2: %tuple.type = tuple_value (%RuntimeConvertTo) [concrete] // CHECK:STDOUT: %HoldsType.5cb: type = class_type @HoldsType, @HoldsType(%tuple.eb2) [concrete] // CHECK:STDOUT: %pattern_type.a09: type = pattern_type %HoldsType.5cb [concrete] @@ -104,8 +104,21 @@ fn G(holds_to: HoldsType((RuntimeConvertTo, )), generic from: RuntimeConvertFrom // CHECK:STDOUT: %x.patt.b9c: %pattern_type.a09 = wrapper_binding_pattern x, %x.param_patt.726 [concrete] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc40_19.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc40_19.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.afb: %pattern_type.c10 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.a97: %pattern_type.c10 = wrapper_binding_pattern self, %self.param_patt.afb [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc40_19.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc40_19.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc40_19.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -119,6 +132,37 @@ fn G(holds_to: HoldsType((RuntimeConvertTo, )), generic from: RuntimeConvertFrom // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc40_19.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc40_19.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc40_19.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.c10 = ref_param_pattern [concrete = constants.%self.param_patt.afb] +// CHECK:STDOUT: %self.patt: %pattern_type.c10 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a97] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %RuntimeConvertTo = ref_param call_param0 +// CHECK:STDOUT: %self: ref %RuntimeConvertTo = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc40_19.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.c10 = ref_param_pattern [concrete = constants.%self.param_patt.afb] +// CHECK:STDOUT: %self.patt: %pattern_type.c10 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a97] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %RuntimeConvertTo = ref_param call_param0 +// CHECK:STDOUT: %self: ref %RuntimeConvertTo = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -278,7 +322,7 @@ fn G(holds_to: HoldsType((RuntimeConvertTo, )), generic from: RuntimeConvertFrom // CHECK:STDOUT: %x.patt.loc27_50.2: @F.%pattern_type.loc27_50 (%pattern_type.ec9) = wrapper_binding_pattern x, %x.param_patt.loc27_50.2 [symbolic = %x.patt.loc27_50.2 (constants.%x.patt.991)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %HoldsType.loc27_63.1 [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type %HoldsType.loc27_63.1 [symbolic = %require_complete (constants.%require_complete.4d4)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%x.param: @F.%HoldsType.loc27_63.1 (%HoldsType.4fb)) { // CHECK:STDOUT: !entry: @@ -309,16 +353,34 @@ fn G(holds_to: HoldsType((RuntimeConvertTo, )), generic from: RuntimeConvertFrom // CHECK:STDOUT: %.loc40_19.5: %empty_tuple.type = call %F.specific_fn(%holds_to.ref) // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc40_19.6: %empty_tuple.type = converted %.loc40_19.5, %empty_tuple [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.loc40_19.3, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%.loc40_19.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc40_19.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc40_19.3) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc40_19.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc40_19.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc40_19.2(%self.param: ref %RuntimeConvertTo) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc40_19.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc40_19.2(%self.param: ref %RuntimeConvertTo) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc40_19.2(%self.param: ref %RuntimeConvertTo) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc40_19.2(%self.param: ref %RuntimeConvertTo) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/for/actual.carbon b/toolchain/check/testdata/for/actual.carbon index 00931f9e572a..95effd6e3cc5 100644 --- a/toolchain/check/testdata/for/actual.carbon +++ b/toolchain/check/testdata/for/actual.carbon @@ -184,10 +184,10 @@ fn Read(generic y: Core.IntLiteral) { // CHECK:STDOUT: %impl.elem0.7b5: %.952 = impl_witness_access %Inc.lookup_impl_witness, element0 [symbolic] // CHECK:STDOUT: %specific_impl_fn.ed1: = specific_impl_function %impl.elem0.7b5, @Inc.WithSelf.Op(%Inc.facet) [symbolic] // CHECK:STDOUT: %Optional.Some.specific_fn: = specific_function %Optional.Some.bcf, @Optional.Some(%OptionalStorage.facet.b99) [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.8f1: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.7bb) [symbolic] -// CHECK:STDOUT: %.2c6: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.8f1, %Destroy.facet.7bb [symbolic] -// CHECK:STDOUT: %impl.elem0.604: %.2c6 = impl_witness_access %Destroy.lookup_impl_witness.173, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.693: = specific_impl_function %impl.elem0.604, @Destroy.WithSelf.Op(%Destroy.facet.7bb) [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.6fa: type = fn_type @Destroy.WithSelf.SelfDestruct, @Destroy.WithSelf(%Destroy.facet.7bb) [symbolic] +// CHECK:STDOUT: %.b53: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.6fa, %Destroy.facet.7bb [symbolic] +// CHECK:STDOUT: %impl.elem2.9bd: %.b53 = impl_witness_access %Destroy.lookup_impl_witness.173, element2 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.1ce: = specific_impl_function %impl.elem2.9bd, @Destroy.WithSelf.SelfDestruct(%Destroy.facet.7bb) [symbolic] // CHECK:STDOUT: %Optional.None.specific_fn: = specific_function %Optional.None.fb7, @Optional.None(%OptionalStorage.facet.b99) [symbolic] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] @@ -679,10 +679,10 @@ fn Read(generic y: Core.IntLiteral) { // CHECK:STDOUT: %Optional.Some: @IntRange.as.Iterate.impl.Next.%Optional.Some.type (%Optional.Some.type.422) = struct_value () [symbolic = %Optional.Some (constants.%Optional.Some.bcf)] // CHECK:STDOUT: %Optional.Some.specific_fn.loc15_42.2: = specific_function %Optional.Some, @Optional.Some(%OptionalStorage.facet.loc11_69.1) [symbolic = %Optional.Some.specific_fn.loc15_42.2 (constants.%Optional.Some.specific_fn)] // CHECK:STDOUT: %Destroy.facet.loc12_7.5: %Destroy.type = facet_value %Int.loc11_37.1, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.loc12_7.5 (constants.%Destroy.facet.7bb)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.loc12_7.5) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.8f1)] -// CHECK:STDOUT: %.loc12_7.5: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet.loc12_7.5 [symbolic = %.loc12_7.5 (constants.%.2c6)] -// CHECK:STDOUT: %impl.elem0.loc12_7.3: @IntRange.as.Iterate.impl.Next.%.loc12_7.5 (%.2c6) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc12_7.3 (constants.%impl.elem0.604)] -// CHECK:STDOUT: %specific_impl_fn.loc12_7.3: = specific_impl_function %impl.elem0.loc12_7.3, @Destroy.WithSelf.Op(%Destroy.facet.loc12_7.5) [symbolic = %specific_impl_fn.loc12_7.3 (constants.%specific_impl_fn.693)] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type: type = fn_type @Destroy.WithSelf.SelfDestruct, @Destroy.WithSelf(%Destroy.facet.loc12_7.5) [symbolic = %Destroy.WithSelf.SelfDestruct.type (constants.%Destroy.WithSelf.SelfDestruct.type.6fa)] +// CHECK:STDOUT: %.loc12_7.5: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type, %Destroy.facet.loc12_7.5 [symbolic = %.loc12_7.5 (constants.%.b53)] +// CHECK:STDOUT: %impl.elem2.loc12_7.3: @IntRange.as.Iterate.impl.Next.%.loc12_7.5 (%.b53) = impl_witness_access %Destroy.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc12_7.3 (constants.%impl.elem2.9bd)] +// CHECK:STDOUT: %specific_impl_fn.loc12_7.3: = specific_impl_function %impl.elem2.loc12_7.3, @Destroy.WithSelf.SelfDestruct(%Destroy.facet.loc12_7.5) [symbolic = %specific_impl_fn.loc12_7.3 (constants.%specific_impl_fn.1ce)] // CHECK:STDOUT: %Optional.None.type: type = fn_type @Optional.None, @Optional(%OptionalStorage.facet.loc11_69.1) [symbolic = %Optional.None.type (constants.%Optional.None.type.2aa)] // CHECK:STDOUT: %Optional.None: @IntRange.as.Iterate.impl.Next.%Optional.None.type (%Optional.None.type.2aa) = struct_value () [symbolic = %Optional.None (constants.%Optional.None.fb7)] // CHECK:STDOUT: %Optional.None.specific_fn.loc17_42.2: = specific_function %Optional.None, @Optional.None(%OptionalStorage.facet.loc11_69.1) [symbolic = %Optional.None.specific_fn.loc17_42.2 (constants.%Optional.None.specific_fn)] @@ -764,15 +764,15 @@ fn Read(generic y: Core.IntLiteral) { // CHECK:STDOUT: %.loc11_69.1: ref @IntRange.as.Iterate.impl.Next.%Optional.loc11_69.1 (%Optional.5ec) = splice_block %return.param {} // CHECK:STDOUT: %.loc15_48: @IntRange.as.Iterate.impl.Next.%Int.loc11_37.1 (%Int.67af24.1) = acquire_value %value.ref.loc15 // CHECK:STDOUT: %Optional.Some.call: init @IntRange.as.Iterate.impl.Next.%Optional.loc11_69.1 (%Optional.5ec) to %.loc11_69.1 = call %Optional.Some.specific_fn.loc15_42.1(%.loc15_48) -// CHECK:STDOUT: %impl.elem0.loc12_7.1: @IntRange.as.Iterate.impl.Next.%.loc12_7.5 (%.2c6) = impl_witness_access constants.%Destroy.lookup_impl_witness.173, element0 [symbolic = %impl.elem0.loc12_7.3 (constants.%impl.elem0.604)] -// CHECK:STDOUT: %bound_method.loc12_7.1: = bound_method %value.var, %impl.elem0.loc12_7.1 +// CHECK:STDOUT: %impl.elem2.loc12_7.1: @IntRange.as.Iterate.impl.Next.%.loc12_7.5 (%.b53) = impl_witness_access constants.%Destroy.lookup_impl_witness.173, element2 [symbolic = %impl.elem2.loc12_7.3 (constants.%impl.elem2.9bd)] +// CHECK:STDOUT: %bound_method.loc12_7.1: = bound_method %value.var, %impl.elem2.loc12_7.1 // CHECK:STDOUT: %Destroy.facet.loc12_7.1: %Destroy.type = facet_value constants.%Int.67af24.1, (constants.%Destroy.lookup_impl_witness.173) [symbolic = %Destroy.facet.loc12_7.5 (constants.%Destroy.facet.7bb)] // CHECK:STDOUT: %.loc12_7.1: %Destroy.type = converted constants.%Int.67af24.1, %Destroy.facet.loc12_7.1 [symbolic = %Destroy.facet.loc12_7.5 (constants.%Destroy.facet.7bb)] // CHECK:STDOUT: %Destroy.facet.loc12_7.2: %Destroy.type = facet_value constants.%Int.67af24.1, (constants.%Destroy.lookup_impl_witness.173) [symbolic = %Destroy.facet.loc12_7.5 (constants.%Destroy.facet.7bb)] // CHECK:STDOUT: %.loc12_7.2: %Destroy.type = converted constants.%Int.67af24.1, %Destroy.facet.loc12_7.2 [symbolic = %Destroy.facet.loc12_7.5 (constants.%Destroy.facet.7bb)] -// CHECK:STDOUT: %specific_impl_fn.loc12_7.1: = specific_impl_function %impl.elem0.loc12_7.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.7bb) [symbolic = %specific_impl_fn.loc12_7.3 (constants.%specific_impl_fn.693)] +// CHECK:STDOUT: %specific_impl_fn.loc12_7.1: = specific_impl_function %impl.elem2.loc12_7.1, @Destroy.WithSelf.SelfDestruct(constants.%Destroy.facet.7bb) [symbolic = %specific_impl_fn.loc12_7.3 (constants.%specific_impl_fn.1ce)] // CHECK:STDOUT: %bound_method.loc12_7.2: = bound_method %value.var, %specific_impl_fn.loc12_7.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc12_7.1: init %empty_tuple.type = call %bound_method.loc12_7.2(%value.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc12_7.1: init %empty_tuple.type = call %bound_method.loc12_7.2(%value.var) // CHECK:STDOUT: return %Optional.Some.call to %return.param // CHECK:STDOUT: // CHECK:STDOUT: !if.else: @@ -790,15 +790,15 @@ fn Read(generic y: Core.IntLiteral) { // CHECK:STDOUT: %Optional.None.specific_fn.loc17_42.1: = specific_function %None.ref, @Optional.None(constants.%OptionalStorage.facet.b99) [symbolic = %Optional.None.specific_fn.loc17_42.2 (constants.%Optional.None.specific_fn)] // CHECK:STDOUT: %.loc11_69.2: ref @IntRange.as.Iterate.impl.Next.%Optional.loc11_69.1 (%Optional.5ec) = splice_block %return.param {} // CHECK:STDOUT: %Optional.None.call: init @IntRange.as.Iterate.impl.Next.%Optional.loc11_69.1 (%Optional.5ec) to %.loc11_69.2 = call %Optional.None.specific_fn.loc17_42.1() -// CHECK:STDOUT: %impl.elem0.loc12_7.2: @IntRange.as.Iterate.impl.Next.%.loc12_7.5 (%.2c6) = impl_witness_access constants.%Destroy.lookup_impl_witness.173, element0 [symbolic = %impl.elem0.loc12_7.3 (constants.%impl.elem0.604)] -// CHECK:STDOUT: %bound_method.loc12_7.3: = bound_method %value.var, %impl.elem0.loc12_7.2 +// CHECK:STDOUT: %impl.elem2.loc12_7.2: @IntRange.as.Iterate.impl.Next.%.loc12_7.5 (%.b53) = impl_witness_access constants.%Destroy.lookup_impl_witness.173, element2 [symbolic = %impl.elem2.loc12_7.3 (constants.%impl.elem2.9bd)] +// CHECK:STDOUT: %bound_method.loc12_7.3: = bound_method %value.var, %impl.elem2.loc12_7.2 // CHECK:STDOUT: %Destroy.facet.loc12_7.3: %Destroy.type = facet_value constants.%Int.67af24.1, (constants.%Destroy.lookup_impl_witness.173) [symbolic = %Destroy.facet.loc12_7.5 (constants.%Destroy.facet.7bb)] // CHECK:STDOUT: %.loc12_7.3: %Destroy.type = converted constants.%Int.67af24.1, %Destroy.facet.loc12_7.3 [symbolic = %Destroy.facet.loc12_7.5 (constants.%Destroy.facet.7bb)] // CHECK:STDOUT: %Destroy.facet.loc12_7.4: %Destroy.type = facet_value constants.%Int.67af24.1, (constants.%Destroy.lookup_impl_witness.173) [symbolic = %Destroy.facet.loc12_7.5 (constants.%Destroy.facet.7bb)] // CHECK:STDOUT: %.loc12_7.4: %Destroy.type = converted constants.%Int.67af24.1, %Destroy.facet.loc12_7.4 [symbolic = %Destroy.facet.loc12_7.5 (constants.%Destroy.facet.7bb)] -// CHECK:STDOUT: %specific_impl_fn.loc12_7.2: = specific_impl_function %impl.elem0.loc12_7.2, @Destroy.WithSelf.Op(constants.%Destroy.facet.7bb) [symbolic = %specific_impl_fn.loc12_7.3 (constants.%specific_impl_fn.693)] +// CHECK:STDOUT: %specific_impl_fn.loc12_7.2: = specific_impl_function %impl.elem2.loc12_7.2, @Destroy.WithSelf.SelfDestruct(constants.%Destroy.facet.7bb) [symbolic = %specific_impl_fn.loc12_7.3 (constants.%specific_impl_fn.1ce)] // CHECK:STDOUT: %bound_method.loc12_7.4: = bound_method %value.var, %specific_impl_fn.loc12_7.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc12_7.2: init %empty_tuple.type = call %bound_method.loc12_7.4(%value.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc12_7.2: init %empty_tuple.type = call %bound_method.loc12_7.4(%value.var) // CHECK:STDOUT: return %Optional.None.call to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -1010,6 +1010,7 @@ fn Read(generic y: Core.IntLiteral) { // CHECK:STDOUT: %x.var_patt: %pattern_type.0f3 = var_pattern %x.patt [concrete] // CHECK:STDOUT: %Range.type: type = fn_type @Range [concrete] // CHECK:STDOUT: %Range: %Range.type = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.6b6: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %ImplicitAs.type.0ff: type = generic_interface_type @ImplicitAs [concrete] // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.0ff = struct_value () [concrete] // CHECK:STDOUT: %ImplicitAs.type.914: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete] @@ -1027,8 +1028,34 @@ fn Read(generic y: Core.IntLiteral) { // CHECK:STDOUT: %bound_method: = bound_method %y, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [symbolic] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method(%y) [symbolic] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc5_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc5_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc5_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc5_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.b1e: type = pattern_type %struct_type.start.end.e93 [concrete] +// CHECK:STDOUT: %self.param_patt.b48: %pattern_type.b1e = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.593: %pattern_type.b1e = wrapper_binding_pattern self, %self.param_patt.b48 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc5_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc5_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.9d8: %pattern_type.0f3 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.126: %pattern_type.0f3 = wrapper_binding_pattern self, %self.param_patt.9d8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc5_3.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc5_3.4 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc5_3.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1055,6 +1082,65 @@ fn Read(generic y: Core.IntLiteral) { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc5_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc5_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc5_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc5_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc5_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b1e = ref_param_pattern [concrete = constants.%self.param_patt.b48] +// CHECK:STDOUT: %self.patt: %pattern_type.b1e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.593] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.start.end.e93 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.start.end.e93 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc5_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b1e = ref_param_pattern [concrete = constants.%self.param_patt.b48] +// CHECK:STDOUT: %self.patt: %pattern_type.b1e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.593] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.start.end.e93 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.start.end.e93 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc5_3.4 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.0f3 = ref_param_pattern [concrete = constants.%self.param_patt.9d8] +// CHECK:STDOUT: %self.patt: %pattern_type.0f3 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.126] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %IntRange.bbd = ref_param call_param0 +// CHECK:STDOUT: %self: ref %IntRange.bbd = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc5_3.4 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.0f3 = ref_param_pattern [concrete = constants.%self.param_patt.9d8] +// CHECK:STDOUT: %self.patt: %pattern_type.0f3 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.126] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %IntRange.bbd = ref_param call_param0 +// CHECK:STDOUT: %self: ref %IntRange.bbd = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .IntRange = imports.%Main.IntRange @@ -1135,8 +1221,8 @@ fn Read(generic y: Core.IntLiteral) { // CHECK:STDOUT: %x.patt: %pattern_type.0f3 = ref_binding_pattern x [concrete = constants.%x.patt] // CHECK:STDOUT: %x.var_patt: %pattern_type.0f3 = var_pattern %x.patt [concrete = constants.%x.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %x.var, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%x.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %x.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%x.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -1172,20 +1258,56 @@ fn Read(generic y: Core.IntLiteral) { // CHECK:STDOUT: // CHECK:STDOUT: fn @Range [from "lib.carbon"]; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc5_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc5_3.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc5_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc5_3.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc5_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc5_3.3(%self.param: ref %struct_type.start.end.e93) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc5_3.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc5_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc5_3.3(%self.param: ref %struct_type.start.end.e93) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc5_3.4(%self.param: ref %IntRange.bbd) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc5_3.3(%self.param: ref %struct_type.start.end.e93) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc5_3.3(%self.param: ref %struct_type.start.end.e93) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc5_3.4(%self.param: ref %IntRange.bbd) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc5_3.4(%self.param: ref %IntRange.bbd) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc5_3.4(%self.param: ref %IntRange.bbd) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/for/basic.carbon b/toolchain/check/testdata/for/basic.carbon index 3836b07857c0..f6521da9a414 100644 --- a/toolchain/check/testdata/for/basic.carbon +++ b/toolchain/check/testdata/for/basic.carbon @@ -63,14 +63,17 @@ fn Run() { // CHECK:STDOUT: %Optional.Get.20c: %Optional.Get.type.e1b = struct_value () [symbolic] // CHECK:STDOUT: %Optional.HasValue.type.224: type = fn_type @Optional.HasValue, @Optional(%T.f84) [symbolic] // CHECK:STDOUT: %Optional.HasValue.c4f: %Optional.HasValue.type.224 = struct_value () [symbolic] +// CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete] // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] // CHECK:STDOUT: %Copy.impl_witness.37a: = impl_witness imports.%Copy.impl_witness_table.229 [concrete] // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %empty_tuple.type, (%Copy.impl_witness.37a) [concrete] // CHECK:STDOUT: %Iterate.impl_witness: = impl_witness @TrivialRange.as.Iterate.impl.%Iterate.impl_witness_table [concrete] +// CHECK:STDOUT: %pattern_type.d81: type = pattern_type %TrivialRange [concrete] // CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.type.de32c1.1: type = fn_type @TrivialRange.as.Iterate.impl.NewCursor.loc6_31.1 [concrete] // CHECK:STDOUT: %TrivialRange.as.Iterate.impl.NewCursor.93de00.1: %TrivialRange.as.Iterate.impl.NewCursor.type.de32c1.1 = struct_value () [concrete] // CHECK:STDOUT: %ptr.843: type = ptr_type %empty_tuple.type [concrete] // CHECK:STDOUT: %Optional.0cb: type = class_type @Optional, @Optional(%Copy.facet) [concrete] +// CHECK:STDOUT: %pattern_type.236: type = pattern_type %Optional.0cb [concrete] // CHECK:STDOUT: %TrivialRange.as.Iterate.impl.Next.type: type = fn_type @TrivialRange.as.Iterate.impl.Next [concrete] // CHECK:STDOUT: %TrivialRange.as.Iterate.impl.Next: %TrivialRange.as.Iterate.impl.Next.type = struct_value () [concrete] // CHECK:STDOUT: %Iterate.facet: %Iterate.type = facet_value %TrivialRange, (%Iterate.impl_witness) [concrete] @@ -100,13 +103,51 @@ fn Run() { // CHECK:STDOUT: %TrivialRange.as.Iterate.impl.Next.bound: = bound_method %.50e, %TrivialRange.as.Iterate.impl.Next [concrete] // CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %Optional.HasValue.3ad, @Optional.HasValue(%Copy.facet) [concrete] // CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Optional.Get.20b, @Optional.Get(%Copy.facet) [concrete] +// CHECK:STDOUT: %self.param_patt.65a: %pattern_type.cb1 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.df1: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt.65a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc18_35.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc18_35.1 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc18_35.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.40d: %pattern_type.831 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.560: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt.40d [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc18_35.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc18_35.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.5ad: type = pattern_type %struct_type.has_value.value.da2 [concrete] +// CHECK:STDOUT: %self.param_patt.69f: %pattern_type.5ad = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.a66: %pattern_type.5ad = wrapper_binding_pattern self, %self.param_patt.69f [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc18_35.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc18_35.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.0df: %pattern_type.236 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.6b9: %pattern_type.236 = wrapper_binding_pattern self, %self.param_patt.0df [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc18_35.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc18_35.4 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc18_35.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.5: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc18_20.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.5: type = fn_type @Destroy.WithSelf.Op.loc18_20.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.5: %Destroy.WithSelf.Op.type.ef016f.5 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.f48: %pattern_type.d81 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.3ed: %pattern_type.d81 = wrapper_binding_pattern self, %self.param_patt.f48 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc18_20.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.6: type = fn_type @Destroy.WithSelf.Op.loc18_20.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.6: %Destroy.WithSelf.Op.type.ef016f.6 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.50e, %Destroy.WithSelf.Op.403171.6 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.6: type = fn_type @Destroy.WithSelf.SelfDestruct.loc18_20.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.6: %Destroy.WithSelf.SelfDestruct.type.fbceb5.6 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.50e, %Destroy.WithSelf.SelfDestruct.db3fdb.6 [concrete] // CHECK:STDOUT: %empty_tuple.type.as.Copy.impl.Op.type: type = fn_type @empty_tuple.type.as.Copy.impl.Op [concrete] // CHECK:STDOUT: %empty_tuple.type.as.Copy.impl.Op: %empty_tuple.type.as.Copy.impl.Op.type = struct_value () [concrete] // CHECK:STDOUT: } @@ -118,6 +159,93 @@ fn Run() { // CHECK:STDOUT: %Copy.impl_witness_table.229 = impl_witness_table (%Core.import_ref.9c3), @empty_tuple.type.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc18_35.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc18_35.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc18_35.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d] +// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0 +// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc18_35.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d] +// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0 +// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc18_35.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.5ad = ref_param_pattern [concrete = constants.%self.param_patt.69f] +// CHECK:STDOUT: %self.patt: %pattern_type.5ad = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a66] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.has_value.value.da2 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.has_value.value.da2 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc18_35.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.5ad = ref_param_pattern [concrete = constants.%self.param_patt.69f] +// CHECK:STDOUT: %self.patt: %pattern_type.5ad = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a66] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.has_value.value.da2 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.has_value.value.da2 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc18_35.4 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.236 = ref_param_pattern [concrete = constants.%self.param_patt.0df] +// CHECK:STDOUT: %self.patt: %pattern_type.236 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.6b9] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Optional.0cb = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Optional.0cb = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc18_35.4 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.236 = ref_param_pattern [concrete = constants.%self.param_patt.0df] +// CHECK:STDOUT: %self.patt: %pattern_type.236 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.6b9] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Optional.0cb = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Optional.0cb = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc18_20.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.5] { +// 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.5f94cf.5: %Destroy.WithSelf.Op.type.ef016f.5 = fn_decl @Destroy.WithSelf.Op.loc18_20.1 [concrete = constants.%Destroy.WithSelf.Op.403171.5] { +// 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.SubobjectDestroy.decl.763c71.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc18_20.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.d81 = ref_param_pattern [concrete = constants.%self.param_patt.f48] +// CHECK:STDOUT: %self.patt: %pattern_type.d81 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.3ed] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %TrivialRange = ref_param call_param0 +// CHECK:STDOUT: %self: ref %TrivialRange = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.6: %Destroy.WithSelf.Op.type.ef016f.6 = fn_decl @Destroy.WithSelf.Op.loc18_20.2 [concrete = constants.%Destroy.WithSelf.Op.403171.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.d81 = ref_param_pattern [concrete = constants.%self.param_patt.f48] +// CHECK:STDOUT: %self.patt: %pattern_type.d81 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.3ed] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %TrivialRange = ref_param call_param0 +// CHECK:STDOUT: %self: ref %TrivialRange = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: name_binding_decl { @@ -177,41 +305,95 @@ fn Run() { // CHECK:STDOUT: %_: %empty_tuple.type = wrapper_binding _, %.loc18_35.11 // CHECK:STDOUT: %Body.ref: %Body.type = name_ref Body, file.%Body.decl [concrete = constants.%Body] // CHECK:STDOUT: %Body.call: init %empty_tuple.type = call %Body.ref() -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc18_35.1: = bound_method %.loc18_35.10, constants.%Destroy.WithSelf.Op.403171.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc18_35.1: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc18_35.1(%.loc18_35.10) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc18_35.2: = bound_method %.loc18_35.2, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc18_35.2: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc18_35.2(%.loc18_35.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc18_35.1: = bound_method %.loc18_35.10, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc18_35.1: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc18_35.1(%.loc18_35.10) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc18_35.2: = bound_method %.loc18_35.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc18_35.2: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc18_35.2(%.loc18_35.2) // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.done: -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc18_35.3: = bound_method %.loc18_35.2, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc18_35.3: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc18_35.3(%.loc18_35.2) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc18_35.4: = bound_method %var, constants.%Destroy.WithSelf.Op.403171.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc18_35.4: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc18_35.4(%var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc18_20: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.50e) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc18_35.3: = bound_method %.loc18_35.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc18_35.3: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc18_35.3(%.loc18_35.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc18_35.4: = bound_method %var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc18_35.4: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc18_35.4(%var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc18_20: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.50e) // CHECK:STDOUT: %AfterLoop.ref: %AfterLoop.type = name_ref AfterLoop, file.%AfterLoop.decl [concrete = constants.%AfterLoop] // CHECK:STDOUT: %AfterLoop.call: init %empty_tuple.type = call %AfterLoop.ref() // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc18_35.1(%self.param: ref %empty_tuple.type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18_35.1(%self.param: ref %empty_tuple.type) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc18_35.1(%self.param: ref %empty_tuple.type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc18_35.2(%self.param: ref bool) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18_35.2(%self.param: ref bool) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18_35.3(%self.param: ref %struct_type.has_value.value.da2) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc18_35.2(%self.param: ref bool) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc18_35.3(%self.param: ref %struct_type.has_value.value.da2) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18_35.4(%self.param: ref %Optional.0cb) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18_35.3(%self.param: ref %struct_type.has_value.value.da2) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc18_35.3(%self.param: ref %struct_type.has_value.value.da2) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc18_35.4(%self.param: ref %Optional.0cb) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18_35.4(%self.param: ref %Optional.0cb) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc18_35.4(%self.param: ref %Optional.0cb) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc18_20.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18_20.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18_20.2(%self.param: ref %TrivialRange) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc18_20.1(%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.5f94cf.5(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.5(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc18_20.2(%self.param: ref %TrivialRange) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18_20.2(%self.param: ref %TrivialRange) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc18_20.2(%self.param: ref %TrivialRange) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.6(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.6(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/for/pattern.carbon b/toolchain/check/testdata/for/pattern.carbon index 2e0731902b97..8b287e89c037 100644 --- a/toolchain/check/testdata/for/pattern.carbon +++ b/toolchain/check/testdata/for/pattern.carbon @@ -141,16 +141,19 @@ fn Run() { // CHECK:STDOUT: %EmptyRange.b10: type = class_type @EmptyRange, @EmptyRange(%Copy.facet) [concrete] // CHECK:STDOUT: %EmptyRange.Make.type.a90: type = fn_type @EmptyRange.Make, @EmptyRange(%Copy.facet) [concrete] // CHECK:STDOUT: %EmptyRange.Make.72e: %EmptyRange.Make.type.a90 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.74f: type = pattern_type %EmptyRange.b10 [concrete] // CHECK:STDOUT: %EmptyRange.Make.specific_fn: = specific_function %EmptyRange.Make.72e, @EmptyRange.Make(%Copy.facet) [concrete] // CHECK:STDOUT: %Iterate.type: type = facet_type <@Iterate> [concrete] // CHECK:STDOUT: %Optional.Get.type.e1b: type = fn_type @Optional.Get, @Optional(%T.f84) [symbolic] // CHECK:STDOUT: %Optional.Get.20c: %Optional.Get.type.e1b = struct_value () [symbolic] // CHECK:STDOUT: %Optional.HasValue.type.224: type = fn_type @Optional.HasValue, @Optional(%T.f84) [symbolic] // CHECK:STDOUT: %Optional.HasValue.c4f: %Optional.HasValue.type.224 = struct_value () [symbolic] +// CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete] // CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.type.c04: type = fn_type @EmptyRange.as.Iterate.impl.Next, @EmptyRange.as.Iterate.impl(%T.f84) [symbolic] // CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.cdc: %EmptyRange.as.Iterate.impl.Next.type.c04 = struct_value () [symbolic] // CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.type.561: type = fn_type @EmptyRange.as.Iterate.impl.NewCursor, @EmptyRange.as.Iterate.impl(%T.f84) [symbolic] // CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.31b: %EmptyRange.as.Iterate.impl.NewCursor.type.561 = struct_value () [symbolic] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [concrete] // CHECK:STDOUT: %Iterate.impl_witness.3a0: = impl_witness imports.%Iterate.impl_witness_table, @EmptyRange.as.Iterate.impl(%Copy.facet) [concrete] // CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.type.fdf: type = fn_type @EmptyRange.as.Iterate.impl.NewCursor, @EmptyRange.as.Iterate.impl(%Copy.facet) [concrete] // CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.120: %EmptyRange.as.Iterate.impl.NewCursor.type.fdf = struct_value () [concrete] @@ -163,6 +166,7 @@ fn Run() { // CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.specific_fn: = specific_function %EmptyRange.as.Iterate.impl.NewCursor.120, @EmptyRange.as.Iterate.impl.NewCursor(%Copy.facet) [concrete] // CHECK:STDOUT: %.1d5: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.645, %Iterate.facet [concrete] // CHECK:STDOUT: %Optional.0e3: type = class_type @Optional, @Optional(%Copy.facet) [concrete] +// CHECK:STDOUT: %pattern_type.e1d: type = pattern_type %Optional.0e3 [concrete] // CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.specific_fn: = specific_function %EmptyRange.as.Iterate.impl.Next.795, @EmptyRange.as.Iterate.impl.Next(%Copy.facet) [concrete] // CHECK:STDOUT: %Optional.HasValue.type.383: type = fn_type @Optional.HasValue, @Optional(%Copy.facet) [concrete] // CHECK:STDOUT: %Optional.HasValue.45e: %Optional.HasValue.type.383 = struct_value () [concrete] @@ -171,14 +175,51 @@ fn Run() { // CHECK:STDOUT: %struct_type.has_value.value.9e7: type = struct_type {.has_value: bool, .value: %C} [concrete] // CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %Optional.HasValue.45e, @Optional.HasValue(%Copy.facet) [concrete] // CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Optional.Get.dc7, @Optional.Get(%Copy.facet) [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_36.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc10_36.1 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10_36.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.99a: %pattern_type.98b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.cbd: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt.99a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_36.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc10_36.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10_36.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.40d: %pattern_type.831 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.560: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt.40d [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_36.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc10_36.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.1a1: type = pattern_type %struct_type.has_value.value.9e7 [concrete] +// CHECK:STDOUT: %self.param_patt.c09: %pattern_type.1a1 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.343: %pattern_type.1a1 = wrapper_binding_pattern self, %self.param_patt.c09 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_36.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc10_36.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.d1b: %pattern_type.e1d = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.78d: %pattern_type.e1d = wrapper_binding_pattern self, %self.param_patt.d1b [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_36.5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.5: type = fn_type @Destroy.WithSelf.Op.loc10_36.5 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.5: %Destroy.WithSelf.Op.type.ef016f.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10_36.5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.5: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.0da: %pattern_type.74f = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.26d: %pattern_type.74f = wrapper_binding_pattern self, %self.param_patt.0da [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_35 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.6: type = fn_type @Destroy.WithSelf.Op.loc10_35 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.6: %Destroy.WithSelf.Op.type.ef016f.6 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.6: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10_35 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.6: %Destroy.WithSelf.SelfDestruct.type.fbceb5.6 = struct_value () [concrete] // CHECK:STDOUT: %C.as.Copy.impl.Op.type: type = fn_type @C.as.Copy.impl.Op [concrete] // CHECK:STDOUT: %C.as.Copy.impl.Op: %C.as.Copy.impl.Op.type = struct_value () [concrete] // CHECK:STDOUT: } @@ -198,6 +239,93 @@ fn Run() { // CHECK:STDOUT: %Iterate.impl_witness_table = impl_witness_table (%Main.import_ref.71a, %Main.import_ref.999, %Main.import_ref.b6b, %Main.import_ref.b499), @EmptyRange.as.Iterate.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_36.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc10_36.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_36.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc10_36.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_36.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d] +// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0 +// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc10_36.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d] +// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0 +// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_36.4 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.1a1 = ref_param_pattern [concrete = constants.%self.param_patt.c09] +// CHECK:STDOUT: %self.patt: %pattern_type.1a1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.343] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.has_value.value.9e7 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.has_value.value.9e7 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc10_36.4 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.1a1 = ref_param_pattern [concrete = constants.%self.param_patt.c09] +// CHECK:STDOUT: %self.patt: %pattern_type.1a1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.343] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.has_value.value.9e7 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.has_value.value.9e7 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_36.5 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e1d = ref_param_pattern [concrete = constants.%self.param_patt.d1b] +// CHECK:STDOUT: %self.patt: %pattern_type.e1d = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.78d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Optional.0e3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Optional.0e3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.5: %Destroy.WithSelf.Op.type.ef016f.5 = fn_decl @Destroy.WithSelf.Op.loc10_36.5 [concrete = constants.%Destroy.WithSelf.Op.403171.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e1d = ref_param_pattern [concrete = constants.%self.param_patt.d1b] +// CHECK:STDOUT: %self.patt: %pattern_type.e1d = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.78d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Optional.0e3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Optional.0e3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_35 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.74f = ref_param_pattern [concrete = constants.%self.param_patt.0da] +// CHECK:STDOUT: %self.patt: %pattern_type.74f = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.26d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %EmptyRange.b10 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %EmptyRange.b10 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.6: %Destroy.WithSelf.Op.type.ef016f.6 = fn_decl @Destroy.WithSelf.Op.loc10_35 [concrete = constants.%Destroy.WithSelf.Op.403171.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.74f = ref_param_pattern [concrete = constants.%self.param_patt.0da] +// CHECK:STDOUT: %self.patt: %pattern_type.74f = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.26d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %EmptyRange.b10 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %EmptyRange.b10 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: name_binding_decl { @@ -261,43 +389,97 @@ fn Run() { // CHECK:STDOUT: %Body.ref: %Body.type = name_ref Body, file.%Body.decl [concrete = constants.%Body] // CHECK:STDOUT: %c.ref: %C = name_ref c, %c // CHECK:STDOUT: %Body.call: init %empty_tuple.type = call %Body.ref(%c.ref) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc10_36.1: = bound_method %.loc10_36.10, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc10_36.1: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc10_36.1(%.loc10_36.10) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc10_36.2: = bound_method %.loc10_36.2, constants.%Destroy.WithSelf.Op.403171.5 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc10_36.2: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc10_36.2(%.loc10_36.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10_36.1: = bound_method %.loc10_36.10, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10_36.1: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10_36.1(%.loc10_36.10) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10_36.2: = bound_method %.loc10_36.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10_36.2: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10_36.2(%.loc10_36.2) // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.done: -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc10_36.3: = bound_method %.loc10_36.2, constants.%Destroy.WithSelf.Op.403171.5 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc10_36.3: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc10_36.3(%.loc10_36.2) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc10_36.4: = bound_method %var, constants.%Destroy.WithSelf.Op.403171.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc10_36.4: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc10_36.4(%var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc10_35: = bound_method %.loc10_35.2, constants.%Destroy.WithSelf.Op.403171.6 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc10_35: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc10_35(%.loc10_35.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10_36.3: = bound_method %.loc10_36.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10_36.3: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10_36.3(%.loc10_36.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10_36.4: = bound_method %var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10_36.4: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10_36.4(%var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10_35: = bound_method %.loc10_35.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.6 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10_35: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10_35(%.loc10_35.2) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_36.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_36.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_36.2(%self.param: ref %C) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_36.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_36.2(%self.param: ref %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_36.2(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_36.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_36.3(%self.param: ref bool) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_36.3(%self.param: ref bool) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_36.4(%self.param: ref %struct_type.has_value.value.9e7) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_36.3(%self.param: ref bool) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_36.4(%self.param: ref %struct_type.has_value.value.9e7) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_36.5(%self.param: ref %Optional.0e3) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_36.4(%self.param: ref %struct_type.has_value.value.9e7) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_36.4(%self.param: ref %struct_type.has_value.value.9e7) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_36.5(%self.param: ref %Optional.0e3) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_35(%self.param: ref %EmptyRange.b10) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_36.5(%self.param: ref %Optional.0e3) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_36.5(%self.param: ref %Optional.0e3) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.5(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.5(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_35(%self.param: ref %EmptyRange.b10) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_35(%self.param: ref %EmptyRange.b10) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_35(%self.param: ref %EmptyRange.b10) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.6(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.6(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -326,16 +508,19 @@ fn Run() { // CHECK:STDOUT: %EmptyRange.b10: type = class_type @EmptyRange, @EmptyRange(%Copy.facet) [concrete] // CHECK:STDOUT: %EmptyRange.Make.type.a90: type = fn_type @EmptyRange.Make, @EmptyRange(%Copy.facet) [concrete] // CHECK:STDOUT: %EmptyRange.Make.72e: %EmptyRange.Make.type.a90 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.74f: type = pattern_type %EmptyRange.b10 [concrete] // CHECK:STDOUT: %EmptyRange.Make.specific_fn: = specific_function %EmptyRange.Make.72e, @EmptyRange.Make(%Copy.facet) [concrete] // CHECK:STDOUT: %Iterate.type: type = facet_type <@Iterate> [concrete] // CHECK:STDOUT: %Optional.Get.type.e1b: type = fn_type @Optional.Get, @Optional(%T.f84) [symbolic] // CHECK:STDOUT: %Optional.Get.20c: %Optional.Get.type.e1b = struct_value () [symbolic] // CHECK:STDOUT: %Optional.HasValue.type.224: type = fn_type @Optional.HasValue, @Optional(%T.f84) [symbolic] // CHECK:STDOUT: %Optional.HasValue.c4f: %Optional.HasValue.type.224 = struct_value () [symbolic] +// CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete] // CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.type.c04: type = fn_type @EmptyRange.as.Iterate.impl.Next, @EmptyRange.as.Iterate.impl(%T.f84) [symbolic] // CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.cdc: %EmptyRange.as.Iterate.impl.Next.type.c04 = struct_value () [symbolic] // CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.type.561: type = fn_type @EmptyRange.as.Iterate.impl.NewCursor, @EmptyRange.as.Iterate.impl(%T.f84) [symbolic] // CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.31b: %EmptyRange.as.Iterate.impl.NewCursor.type.561 = struct_value () [symbolic] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [concrete] // CHECK:STDOUT: %Iterate.impl_witness.3a0: = impl_witness imports.%Iterate.impl_witness_table, @EmptyRange.as.Iterate.impl(%Copy.facet) [concrete] // CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.type.fdf: type = fn_type @EmptyRange.as.Iterate.impl.NewCursor, @EmptyRange.as.Iterate.impl(%Copy.facet) [concrete] // CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.120: %EmptyRange.as.Iterate.impl.NewCursor.type.fdf = struct_value () [concrete] @@ -348,6 +533,7 @@ fn Run() { // CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.specific_fn: = specific_function %EmptyRange.as.Iterate.impl.NewCursor.120, @EmptyRange.as.Iterate.impl.NewCursor(%Copy.facet) [concrete] // CHECK:STDOUT: %.1d5: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.645, %Iterate.facet [concrete] // CHECK:STDOUT: %Optional.0e3: type = class_type @Optional, @Optional(%Copy.facet) [concrete] +// CHECK:STDOUT: %pattern_type.e1d: type = pattern_type %Optional.0e3 [concrete] // CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.specific_fn: = specific_function %EmptyRange.as.Iterate.impl.Next.795, @EmptyRange.as.Iterate.impl.Next(%Copy.facet) [concrete] // CHECK:STDOUT: %Optional.HasValue.type.383: type = fn_type @Optional.HasValue, @Optional(%Copy.facet) [concrete] // CHECK:STDOUT: %Optional.HasValue.45e: %Optional.HasValue.type.383 = struct_value () [concrete] @@ -356,14 +542,51 @@ fn Run() { // CHECK:STDOUT: %struct_type.has_value.value.9e7: type = struct_type {.has_value: bool, .value: %C} [concrete] // CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %Optional.HasValue.45e, @Optional.HasValue(%Copy.facet) [concrete] // CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Optional.Get.dc7, @Optional.Get(%Copy.facet) [concrete] +// CHECK:STDOUT: %self.param_patt.40d: %pattern_type.831 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.560: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt.40d [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_40.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc10_40.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [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.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_40.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc10_40.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10_40.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.99a: %pattern_type.98b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.cbd: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt.99a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_40.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc10_40.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10_40.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.1a1: type = pattern_type %struct_type.has_value.value.9e7 [concrete] +// CHECK:STDOUT: %self.param_patt.c09: %pattern_type.1a1 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.343: %pattern_type.1a1 = wrapper_binding_pattern self, %self.param_patt.c09 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_40.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc10_40.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.d1b: %pattern_type.e1d = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.78d: %pattern_type.e1d = wrapper_binding_pattern self, %self.param_patt.d1b [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_40.5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.5: type = fn_type @Destroy.WithSelf.Op.loc10_40.5 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.5: %Destroy.WithSelf.Op.type.ef016f.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10_40.5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.5: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.0da: %pattern_type.74f = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.26d: %pattern_type.74f = wrapper_binding_pattern self, %self.param_patt.0da [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_39 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.6: type = fn_type @Destroy.WithSelf.Op.loc10_39 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.6: %Destroy.WithSelf.Op.type.ef016f.6 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.6: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10_39 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.6: %Destroy.WithSelf.SelfDestruct.type.fbceb5.6 = struct_value () [concrete] // CHECK:STDOUT: %C.as.Copy.impl.Op.type: type = fn_type @C.as.Copy.impl.Op [concrete] // CHECK:STDOUT: %C.as.Copy.impl.Op: %C.as.Copy.impl.Op.type = struct_value () [concrete] // CHECK:STDOUT: } @@ -383,6 +606,93 @@ fn Run() { // CHECK:STDOUT: %Iterate.impl_witness_table = impl_witness_table (%Main.import_ref.71a, %Main.import_ref.999, %Main.import_ref.b6b, %Main.import_ref.b499), @EmptyRange.as.Iterate.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_40.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d] +// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0 +// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc10_40.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d] +// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0 +// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_40.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// 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.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc10_40.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// 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.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_40.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc10_40.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_40.4 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.1a1 = ref_param_pattern [concrete = constants.%self.param_patt.c09] +// CHECK:STDOUT: %self.patt: %pattern_type.1a1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.343] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.has_value.value.9e7 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.has_value.value.9e7 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc10_40.4 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.1a1 = ref_param_pattern [concrete = constants.%self.param_patt.c09] +// CHECK:STDOUT: %self.patt: %pattern_type.1a1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.343] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.has_value.value.9e7 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.has_value.value.9e7 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_40.5 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e1d = ref_param_pattern [concrete = constants.%self.param_patt.d1b] +// CHECK:STDOUT: %self.patt: %pattern_type.e1d = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.78d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Optional.0e3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Optional.0e3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.5: %Destroy.WithSelf.Op.type.ef016f.5 = fn_decl @Destroy.WithSelf.Op.loc10_40.5 [concrete = constants.%Destroy.WithSelf.Op.403171.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e1d = ref_param_pattern [concrete = constants.%self.param_patt.d1b] +// CHECK:STDOUT: %self.patt: %pattern_type.e1d = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.78d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Optional.0e3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Optional.0e3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_39 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.74f = ref_param_pattern [concrete = constants.%self.param_patt.0da] +// CHECK:STDOUT: %self.patt: %pattern_type.74f = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.26d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %EmptyRange.b10 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %EmptyRange.b10 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.6: %Destroy.WithSelf.Op.type.ef016f.6 = fn_decl @Destroy.WithSelf.Op.loc10_39 [concrete = constants.%Destroy.WithSelf.Op.403171.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.74f = ref_param_pattern [concrete = constants.%self.param_patt.0da] +// CHECK:STDOUT: %self.patt: %pattern_type.74f = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.26d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %EmptyRange.b10 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %EmptyRange.b10 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c.var: ref %C = var_storage %c.var_patt @@ -448,45 +758,99 @@ fn Run() { // CHECK:STDOUT: %c.ref: ref %C = name_ref c, %c // CHECK:STDOUT: %addr.loc11: %ptr.6b6 = addr_of %c.ref // CHECK:STDOUT: %Body.call: init %empty_tuple.type = call %Body.ref(%addr.loc11) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc10_40.1: = bound_method %.loc10_40.2, constants.%Destroy.WithSelf.Op.403171.5 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc10_40.1: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc10_40.1(%.loc10_40.2) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc10_8.1: = bound_method %c.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc10_8.1: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc10_8.1(%c.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10_40.1: = bound_method %.loc10_40.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10_40.1: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10_40.1(%.loc10_40.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10_8.1: = bound_method %c.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10_8.1: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10_8.1(%c.var) // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.done: -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc10_40.2: = bound_method %.loc10_40.2, constants.%Destroy.WithSelf.Op.403171.5 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc10_40.2: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc10_40.2(%.loc10_40.2) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc10_8.2: = bound_method %c.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc10_8.2: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc10_8.2(%c.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc10_40.3: = bound_method %var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc10_40.3: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc10_40.3(%var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc10_39: = bound_method %.loc10_39.2, constants.%Destroy.WithSelf.Op.403171.6 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc10_39: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc10_39(%.loc10_39.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10_40.2: = bound_method %.loc10_40.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10_40.2: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10_40.2(%.loc10_40.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10_8.2: = bound_method %c.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10_8.2: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10_8.2(%c.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10_40.3: = bound_method %var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10_40.3: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10_40.3(%var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10_39: = bound_method %.loc10_39.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.6 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10_39: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10_39(%.loc10_39.2) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_40.1(%self.param: ref bool) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_40.1(%self.param: ref bool) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_40.1(%self.param: ref bool) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_40.2(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_40.2(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_40.3(%self.param: ref %C) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_40.2(%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.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_40.3(%self.param: ref %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_40.4(%self.param: ref %struct_type.has_value.value.9e7) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_40.3(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_40.3(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_40.4(%self.param: ref %struct_type.has_value.value.9e7) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_40.5(%self.param: ref %Optional.0e3) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_40.4(%self.param: ref %struct_type.has_value.value.9e7) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_40.4(%self.param: ref %struct_type.has_value.value.9e7) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_40.5(%self.param: ref %Optional.0e3) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_39(%self.param: ref %EmptyRange.b10) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_40.5(%self.param: ref %Optional.0e3) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_40.5(%self.param: ref %Optional.0e3) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.5(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.5(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_39(%self.param: ref %EmptyRange.b10) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_39(%self.param: ref %EmptyRange.b10) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_39(%self.param: ref %EmptyRange.b10) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.6(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.6(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -523,6 +887,7 @@ fn Run() { // CHECK:STDOUT: %EmptyRange.Make.type.059: type = fn_type @EmptyRange.Make, @EmptyRange(%Copy.facet.701) [concrete] // CHECK:STDOUT: %EmptyRange.Make.787: %EmptyRange.Make.type.059 = struct_value () [concrete] // CHECK:STDOUT: %ptr.c28: type = ptr_type %empty_struct_type [concrete] +// CHECK:STDOUT: %pattern_type.886: type = pattern_type %EmptyRange.d81 [concrete] // CHECK:STDOUT: %EmptyRange.Make.specific_fn: = specific_function %EmptyRange.Make.787, @EmptyRange.Make(%Copy.facet.701) [concrete] // CHECK:STDOUT: %Iterate.type: type = facet_type <@Iterate> [concrete] // CHECK:STDOUT: %Optional.Get.type.e1b: type = fn_type @Optional.Get, @Optional(%T.f84) [symbolic] @@ -533,6 +898,7 @@ fn Run() { // CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.cdc: %EmptyRange.as.Iterate.impl.Next.type.c04 = struct_value () [symbolic] // CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.type.561: type = fn_type @EmptyRange.as.Iterate.impl.NewCursor, @EmptyRange.as.Iterate.impl(%T.f84) [symbolic] // CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.31b: %EmptyRange.as.Iterate.impl.NewCursor.type.561 = struct_value () [symbolic] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [concrete] // CHECK:STDOUT: %Iterate.impl_witness.65f: = impl_witness imports.%Iterate.impl_witness_table, @EmptyRange.as.Iterate.impl(%Copy.facet.701) [concrete] // CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.type.351: type = fn_type @EmptyRange.as.Iterate.impl.NewCursor, @EmptyRange.as.Iterate.impl(%Copy.facet.701) [concrete] // CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.49c: %EmptyRange.as.Iterate.impl.NewCursor.type.351 = struct_value () [concrete] @@ -545,6 +911,7 @@ fn Run() { // CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.specific_fn: = specific_function %EmptyRange.as.Iterate.impl.NewCursor.49c, @EmptyRange.as.Iterate.impl.NewCursor(%Copy.facet.701) [concrete] // CHECK:STDOUT: %.a85: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.2e8, %Iterate.facet [concrete] // CHECK:STDOUT: %Optional.4d1: type = class_type @Optional, @Optional(%Copy.facet.701) [concrete] +// CHECK:STDOUT: %pattern_type.7db: type = pattern_type %Optional.4d1 [concrete] // CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.specific_fn: = specific_function %EmptyRange.as.Iterate.impl.Next.3fd, @EmptyRange.as.Iterate.impl.Next(%Copy.facet.701) [concrete] // CHECK:STDOUT: %Optional.HasValue.type.34e: type = fn_type @Optional.HasValue, @Optional(%Copy.facet.701) [concrete] // CHECK:STDOUT: %Optional.HasValue.55e: %Optional.HasValue.type.34e = struct_value () [concrete] @@ -553,14 +920,51 @@ fn Run() { // CHECK:STDOUT: %struct_type.has_value.value.6f9: type = struct_type {.has_value: bool, .value: %tuple.type.784} [concrete] // CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %Optional.HasValue.55e, @Optional.HasValue(%Copy.facet.701) [concrete] // CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Optional.Get.018, @Optional.Get(%Copy.facet.701) [concrete] +// CHECK:STDOUT: %self.param_patt.40d: %pattern_type.831 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.560: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt.40d [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_61.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc10_61.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.fa3: %pattern_type.860 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.3e4: %pattern_type.860 = wrapper_binding_pattern self, %self.param_patt.fa3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_61.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc10_61.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10_61.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.095: type = pattern_type %struct_type.has_value.value.6f9 [concrete] +// CHECK:STDOUT: %self.param_patt.e70: %pattern_type.095 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.cce: %pattern_type.095 = wrapper_binding_pattern self, %self.param_patt.e70 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_61.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc10_61.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.1e1: %pattern_type.7db = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.0a8: %pattern_type.7db = wrapper_binding_pattern self, %self.param_patt.1e1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_61.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc10_61.4 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10_61.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [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.dfcbdb.5: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_61.5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.5: type = fn_type @Destroy.WithSelf.Op.loc10_61.5 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.5: %Destroy.WithSelf.Op.type.ef016f.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10_61.5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.5: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.48e: %pattern_type.886 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.827: %pattern_type.886 = wrapper_binding_pattern self, %self.param_patt.48e [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_60 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.6: type = fn_type @Destroy.WithSelf.Op.loc10_60 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.6: %Destroy.WithSelf.Op.type.ef016f.6 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.6: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10_60 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.6: %Destroy.WithSelf.SelfDestruct.type.fbceb5.6 = struct_value () [concrete] // CHECK:STDOUT: %bool.as.Copy.impl.Op.type: type = fn_type @bool.as.Copy.impl.Op [concrete] // CHECK:STDOUT: %bool.as.Copy.impl.Op: %bool.as.Copy.impl.Op.type = struct_value () [concrete] // CHECK:STDOUT: } @@ -581,6 +985,93 @@ fn Run() { // CHECK:STDOUT: %Iterate.impl_witness_table = impl_witness_table (%Main.import_ref.71a, %Main.import_ref.999, %Main.import_ref.b6b, %Main.import_ref.b499), @EmptyRange.as.Iterate.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_61.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d] +// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0 +// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc10_61.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d] +// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0 +// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_61.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.860 = ref_param_pattern [concrete = constants.%self.param_patt.fa3] +// CHECK:STDOUT: %self.patt: %pattern_type.860 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.3e4] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.784 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.784 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc10_61.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.860 = ref_param_pattern [concrete = constants.%self.param_patt.fa3] +// CHECK:STDOUT: %self.patt: %pattern_type.860 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.3e4] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.784 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.784 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_61.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.095 = ref_param_pattern [concrete = constants.%self.param_patt.e70] +// CHECK:STDOUT: %self.patt: %pattern_type.095 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cce] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.has_value.value.6f9 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.has_value.value.6f9 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc10_61.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.095 = ref_param_pattern [concrete = constants.%self.param_patt.e70] +// CHECK:STDOUT: %self.patt: %pattern_type.095 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cce] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.has_value.value.6f9 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.has_value.value.6f9 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_61.4 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.7db = ref_param_pattern [concrete = constants.%self.param_patt.1e1] +// CHECK:STDOUT: %self.patt: %pattern_type.7db = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.0a8] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Optional.4d1 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Optional.4d1 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc10_61.4 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.7db = ref_param_pattern [concrete = constants.%self.param_patt.1e1] +// CHECK:STDOUT: %self.patt: %pattern_type.7db = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.0a8] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Optional.4d1 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Optional.4d1 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_61.5 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.5] { +// 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.5f94cf.5: %Destroy.WithSelf.Op.type.ef016f.5 = fn_decl @Destroy.WithSelf.Op.loc10_61.5 [concrete = constants.%Destroy.WithSelf.Op.403171.5] { +// 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.SubobjectDestroy.decl.763c71.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_60 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.886 = ref_param_pattern [concrete = constants.%self.param_patt.48e] +// CHECK:STDOUT: %self.patt: %pattern_type.886 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.827] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %EmptyRange.d81 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %EmptyRange.d81 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.6: %Destroy.WithSelf.Op.type.ef016f.6 = fn_decl @Destroy.WithSelf.Op.loc10_60 [concrete = constants.%Destroy.WithSelf.Op.403171.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.886 = ref_param_pattern [concrete = constants.%self.param_patt.48e] +// CHECK:STDOUT: %self.patt: %pattern_type.886 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.827] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %EmptyRange.d81 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %EmptyRange.d81 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: name_binding_decl { @@ -654,43 +1145,97 @@ fn Run() { // CHECK:STDOUT: %a.ref: bool = name_ref a, %a // CHECK:STDOUT: %b.ref: bool = name_ref b, %b // CHECK:STDOUT: %Body.call: init %empty_tuple.type = call %Body.ref(%a.ref, %b.ref) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc10_61.1: = bound_method %.loc10_61.10, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc10_61.1: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc10_61.1(%.loc10_61.10) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc10_61.2: = bound_method %.loc10_61.2, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc10_61.2: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc10_61.2(%.loc10_61.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10_61.1: = bound_method %.loc10_61.10, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10_61.1: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10_61.1(%.loc10_61.10) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10_61.2: = bound_method %.loc10_61.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10_61.2: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10_61.2(%.loc10_61.2) // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.done: -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc10_61.3: = bound_method %.loc10_61.2, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc10_61.3: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc10_61.3(%.loc10_61.2) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc10_61.4: = bound_method %var, constants.%Destroy.WithSelf.Op.403171.5 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc10_61.4: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc10_61.4(%var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc10_60: = bound_method %.loc10_60.2, constants.%Destroy.WithSelf.Op.403171.6 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc10_60: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc10_60(%.loc10_60.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10_61.3: = bound_method %.loc10_61.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10_61.3: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10_61.3(%.loc10_61.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10_61.4: = bound_method %var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10_61.4: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10_61.4(%var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10_60: = bound_method %.loc10_60.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.6 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10_60: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10_60(%.loc10_60.2) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_61.1(%self.param: ref bool) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_61.1(%self.param: ref bool) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_61.2(%self.param: ref %tuple.type.784) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_61.1(%self.param: ref bool) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_61.2(%self.param: ref %tuple.type.784) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_61.3(%self.param: ref %struct_type.has_value.value.6f9) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_61.2(%self.param: ref %tuple.type.784) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_61.2(%self.param: ref %tuple.type.784) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_61.3(%self.param: ref %struct_type.has_value.value.6f9) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_61.4(%self.param: ref %Optional.4d1) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_61.3(%self.param: ref %struct_type.has_value.value.6f9) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_61.3(%self.param: ref %struct_type.has_value.value.6f9) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_61.4(%self.param: ref %Optional.4d1) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_61.4(%self.param: ref %Optional.4d1) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_61.4(%self.param: ref %Optional.4d1) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_61.5(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_61.5(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_60(%self.param: ref %EmptyRange.d81) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_61.5(%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.5f94cf.5(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.5(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_60(%self.param: ref %EmptyRange.d81) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_60(%self.param: ref %EmptyRange.d81) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_60(%self.param: ref %EmptyRange.d81) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.6(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.6(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -728,16 +1273,19 @@ fn Run() { // CHECK:STDOUT: %EmptyRange.8d3: type = class_type @EmptyRange, @EmptyRange(%Copy.facet.38c) [concrete] // CHECK:STDOUT: %EmptyRange.Make.type.96a: type = fn_type @EmptyRange.Make, @EmptyRange(%Copy.facet.38c) [concrete] // CHECK:STDOUT: %EmptyRange.Make.24e: %EmptyRange.Make.type.96a = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.2a0: type = pattern_type %EmptyRange.8d3 [concrete] // CHECK:STDOUT: %EmptyRange.Make.specific_fn: = specific_function %EmptyRange.Make.24e, @EmptyRange.Make(%Copy.facet.38c) [concrete] // CHECK:STDOUT: %Iterate.type: type = facet_type <@Iterate> [concrete] // CHECK:STDOUT: %Optional.Get.type.e1b: type = fn_type @Optional.Get, @Optional(%T.f84) [symbolic] // CHECK:STDOUT: %Optional.Get.20c: %Optional.Get.type.e1b = struct_value () [symbolic] // CHECK:STDOUT: %Optional.HasValue.type.224: type = fn_type @Optional.HasValue, @Optional(%T.f84) [symbolic] // CHECK:STDOUT: %Optional.HasValue.c4f: %Optional.HasValue.type.224 = struct_value () [symbolic] +// CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete] // CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.type.c04: type = fn_type @EmptyRange.as.Iterate.impl.Next, @EmptyRange.as.Iterate.impl(%T.f84) [symbolic] // CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.cdc: %EmptyRange.as.Iterate.impl.Next.type.c04 = struct_value () [symbolic] // CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.type.561: type = fn_type @EmptyRange.as.Iterate.impl.NewCursor, @EmptyRange.as.Iterate.impl(%T.f84) [symbolic] // CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.31b: %EmptyRange.as.Iterate.impl.NewCursor.type.561 = struct_value () [symbolic] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [concrete] // CHECK:STDOUT: %Iterate.impl_witness.28e: = impl_witness imports.%Iterate.impl_witness_table, @EmptyRange.as.Iterate.impl(%Copy.facet.38c) [concrete] // CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.type.b49: type = fn_type @EmptyRange.as.Iterate.impl.NewCursor, @EmptyRange.as.Iterate.impl(%Copy.facet.38c) [concrete] // CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.b24: %EmptyRange.as.Iterate.impl.NewCursor.type.b49 = struct_value () [concrete] @@ -750,6 +1298,7 @@ fn Run() { // CHECK:STDOUT: %EmptyRange.as.Iterate.impl.NewCursor.specific_fn: = specific_function %EmptyRange.as.Iterate.impl.NewCursor.b24, @EmptyRange.as.Iterate.impl.NewCursor(%Copy.facet.38c) [concrete] // CHECK:STDOUT: %.f09: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.bd6, %Iterate.facet [concrete] // CHECK:STDOUT: %Optional.992: type = class_type @Optional, @Optional(%Copy.facet.38c) [concrete] +// CHECK:STDOUT: %pattern_type.b54: type = pattern_type %Optional.992 [concrete] // CHECK:STDOUT: %EmptyRange.as.Iterate.impl.Next.specific_fn: = specific_function %EmptyRange.as.Iterate.impl.Next.e7f, @EmptyRange.as.Iterate.impl.Next(%Copy.facet.38c) [concrete] // CHECK:STDOUT: %Optional.HasValue.type.e1b: type = fn_type @Optional.HasValue, @Optional(%Copy.facet.38c) [concrete] // CHECK:STDOUT: %Optional.HasValue.b06: %Optional.HasValue.type.e1b = struct_value () [concrete] @@ -758,14 +1307,57 @@ fn Run() { // CHECK:STDOUT: %struct_type.has_value.value.9b1: type = struct_type {.has_value: bool, .value: %tuple.type.748} [concrete] // CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %Optional.HasValue.b06, @Optional.HasValue(%Copy.facet.38c) [concrete] // CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Optional.Get.091, @Optional.Get(%Copy.facet.38c) [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_49.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc10_49.1 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10_49.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.99a: %pattern_type.98b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.cbd: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt.99a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_49.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc10_49.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.a49: %pattern_type.8b4 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.d80: %pattern_type.8b4 = wrapper_binding_pattern self, %self.param_patt.a49 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_49.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc10_49.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10_49.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.40d: %pattern_type.831 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.560: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt.40d [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_49.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc10_49.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.ebb: type = pattern_type %struct_type.has_value.value.9b1 [concrete] +// CHECK:STDOUT: %self.param_patt.c1b: %pattern_type.ebb = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.4fb: %pattern_type.ebb = wrapper_binding_pattern self, %self.param_patt.c1b [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_49.5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.5: type = fn_type @Destroy.WithSelf.Op.loc10_49.5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.5: %Destroy.WithSelf.Op.type.ef016f.5 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.beb: %pattern_type.b54 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.fab: %pattern_type.b54 = wrapper_binding_pattern self, %self.param_patt.beb [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_49.6 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.6: type = fn_type @Destroy.WithSelf.Op.loc10_49.6 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.6: %Destroy.WithSelf.Op.type.ef016f.6 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.6: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10_49.6 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.6: %Destroy.WithSelf.SelfDestruct.type.fbceb5.6 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.c36: %pattern_type.2a0 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.022: %pattern_type.2a0 = wrapper_binding_pattern self, %self.param_patt.c36 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_48 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.7: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.7: type = fn_type @Destroy.WithSelf.Op.loc10_48 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.7: %Destroy.WithSelf.Op.type.ef016f.7 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.7: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10_48 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.7: %Destroy.WithSelf.SelfDestruct.type.fbceb5.7 = struct_value () [concrete] // CHECK:STDOUT: %C.as.Copy.impl.Op.type: type = fn_type @C.as.Copy.impl.Op [concrete] // CHECK:STDOUT: %C.as.Copy.impl.Op: %C.as.Copy.impl.Op.type = struct_value () [concrete] // CHECK:STDOUT: } @@ -787,6 +1379,107 @@ fn Run() { // CHECK:STDOUT: %Iterate.impl_witness_table = impl_witness_table (%Main.import_ref.71a, %Main.import_ref.999, %Main.import_ref.b6b, %Main.import_ref.b499), @EmptyRange.as.Iterate.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_49.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc10_49.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_49.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc10_49.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_49.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.8b4 = ref_param_pattern [concrete = constants.%self.param_patt.a49] +// CHECK:STDOUT: %self.patt: %pattern_type.8b4 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d80] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.748 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.748 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc10_49.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.8b4 = ref_param_pattern [concrete = constants.%self.param_patt.a49] +// CHECK:STDOUT: %self.patt: %pattern_type.8b4 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d80] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.748 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.748 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_49.4 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d] +// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0 +// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc10_49.4 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d] +// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0 +// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_49.5 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.ebb = ref_param_pattern [concrete = constants.%self.param_patt.c1b] +// CHECK:STDOUT: %self.patt: %pattern_type.ebb = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.4fb] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.has_value.value.9b1 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.has_value.value.9b1 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.5: %Destroy.WithSelf.Op.type.ef016f.5 = fn_decl @Destroy.WithSelf.Op.loc10_49.5 [concrete = constants.%Destroy.WithSelf.Op.403171.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.ebb = ref_param_pattern [concrete = constants.%self.param_patt.c1b] +// CHECK:STDOUT: %self.patt: %pattern_type.ebb = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.4fb] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.has_value.value.9b1 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.has_value.value.9b1 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_49.6 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b54 = ref_param_pattern [concrete = constants.%self.param_patt.beb] +// CHECK:STDOUT: %self.patt: %pattern_type.b54 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.fab] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Optional.992 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Optional.992 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.6: %Destroy.WithSelf.Op.type.ef016f.6 = fn_decl @Destroy.WithSelf.Op.loc10_49.6 [concrete = constants.%Destroy.WithSelf.Op.403171.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b54 = ref_param_pattern [concrete = constants.%self.param_patt.beb] +// CHECK:STDOUT: %self.patt: %pattern_type.b54 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.fab] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Optional.992 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Optional.992 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.7: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_48 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.7] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.2a0 = ref_param_pattern [concrete = constants.%self.param_patt.c36] +// CHECK:STDOUT: %self.patt: %pattern_type.2a0 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.022] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %EmptyRange.8d3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %EmptyRange.8d3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.7: %Destroy.WithSelf.Op.type.ef016f.7 = fn_decl @Destroy.WithSelf.Op.loc10_48 [concrete = constants.%Destroy.WithSelf.Op.403171.7] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.2a0 = ref_param_pattern [concrete = constants.%self.param_patt.c36] +// CHECK:STDOUT: %self.patt: %pattern_type.2a0 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.022] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %EmptyRange.8d3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %EmptyRange.8d3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: name_binding_decl { @@ -860,48 +1553,111 @@ fn Run() { // CHECK:STDOUT: %a.ref: %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b // CHECK:STDOUT: %Body.call: init %empty_tuple.type = call %Body.ref(%a.ref, %b.ref) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc10_49.1: = bound_method %.loc10_49.10, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc10_49.1: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc10_49.1(%.loc10_49.10) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc10_49.2: = bound_method %.loc10_49.2, constants.%Destroy.WithSelf.Op.403171.6 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc10_49.2: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc10_49.2(%.loc10_49.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10_49.1: = bound_method %.loc10_49.10, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10_49.1: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10_49.1(%.loc10_49.10) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10_49.2: = bound_method %.loc10_49.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.6 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10_49.2: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10_49.2(%.loc10_49.2) // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.done: -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc10_49.3: = bound_method %.loc10_49.2, constants.%Destroy.WithSelf.Op.403171.6 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc10_49.3: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc10_49.3(%.loc10_49.2) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc10_49.4: = bound_method %var, constants.%Destroy.WithSelf.Op.403171.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc10_49.4: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc10_49.4(%var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc10_48: = bound_method %.loc10_48.2, constants.%Destroy.WithSelf.Op.403171.7 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc10_48: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc10_48(%.loc10_48.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10_49.3: = bound_method %.loc10_49.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.6 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10_49.3: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10_49.3(%.loc10_49.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10_49.4: = bound_method %var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10_49.4: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10_49.4(%var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10_48: = bound_method %.loc10_48.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.7 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10_48: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10_48(%.loc10_48.2) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_49.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_49.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_49.2(%self.param: ref %C) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_49.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_49.2(%self.param: ref %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_49.3(%self.param: ref %tuple.type.748) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_49.2(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_49.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_49.3(%self.param: ref %tuple.type.748) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_49.3(%self.param: ref %tuple.type.748) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_49.3(%self.param: ref %tuple.type.748) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_49.4(%self.param: ref bool) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_49.4(%self.param: ref bool) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_49.5(%self.param: ref %struct_type.has_value.value.9b1) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_49.4(%self.param: ref bool) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_49.5(%self.param: ref %struct_type.has_value.value.9b1) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_49.6(%self.param: ref %Optional.992) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_49.5(%self.param: ref %struct_type.has_value.value.9b1) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_49.5(%self.param: ref %struct_type.has_value.value.9b1) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.5(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.5(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_49.6(%self.param: ref %Optional.992) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_48(%self.param: ref %EmptyRange.8d3) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_49.6(%self.param: ref %Optional.992) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_49.6(%self.param: ref %Optional.992) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.6(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.6(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_48(%self.param: ref %EmptyRange.8d3) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_48(%self.param: ref %EmptyRange.8d3) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_48(%self.param: ref %EmptyRange.8d3) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.7(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.7(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/call/alias.carbon b/toolchain/check/testdata/function/call/alias.carbon index 7cdda8df7778..4a4ad370d948 100644 --- a/toolchain/check/testdata/function/call/alias.carbon +++ b/toolchain/check/testdata/function/call/alias.carbon @@ -37,8 +37,14 @@ fn Main() { // CHECK:STDOUT: %b.patt: %pattern_type.cb1 = ref_binding_pattern b [concrete] // CHECK:STDOUT: %b.var_patt: %pattern_type.cb1 = var_pattern %b.patt [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %self.param_patt.65a: %pattern_type.cb1 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.df1: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt.65a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfc: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc20 [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.loc20 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc20 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -50,6 +56,23 @@ fn Main() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl: %Destroy.WithSelf.SubobjectDestroy.type.dfc = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc20 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc20 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -96,10 +119,19 @@ fn Main() { // CHECK:STDOUT: %b.patt: %pattern_type.cb1 = ref_binding_pattern b [concrete = constants.%b.patt] // CHECK:STDOUT: %b.var_patt: %pattern_type.cb1 = var_pattern %b.patt [concrete = constants.%b.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %b.var, constants.%Destroy.WithSelf.Op.403 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%b.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %b.var, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%b.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc20(%self.param: ref %empty_tuple.type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc20(%self.param: ref %empty_tuple.type) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc20(%self.param: ref %empty_tuple.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) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/call/default_values.carbon b/toolchain/check/testdata/function/call/default_values.carbon index 3d526593fc50..102b38c099bb 100644 --- a/toolchain/check/testdata/function/call/default_values.carbon +++ b/toolchain/check/testdata/function/call/default_values.carbon @@ -102,6 +102,7 @@ fn G() { // CHECK:STDOUT: type: type = facet_type [concrete] // CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] +// CHECK:STDOUT: %pattern_type.98b: type = pattern_type %C [concrete] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] // CHECK:STDOUT: %C.val: %C = struct_value () [concrete] @@ -110,15 +111,59 @@ fn G() { // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete] // CHECK:STDOUT: %.115: ref %C = temporary invalid, %C.val [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc7_6.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc7_6.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.99a: %pattern_type.98b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.cbd: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt.99a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc7_6.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc7_6.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.115, %Destroy.WithSelf.Op.403171.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc7_6.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.115, %Destroy.WithSelf.SelfDestruct.db3fdb.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Main.import_ref.d96: %C = import_ref Main//imported_callee, loc4_20, loaded [concrete = constants.%C.val] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc7_6.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc7_6.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc7_6.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc7_6.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {} {} // CHECK:STDOUT: } @@ -133,14 +178,32 @@ fn G() { // CHECK:STDOUT: %.loc7_6.5: ref %C = temporary %.loc7_6.2, %.loc7_6.4 [concrete = constants.%.115] // CHECK:STDOUT: %.loc7_6.6: %C = acquire_value %.loc7_6.5 [concrete = constants.%C.val] // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.ref(%.loc7_6.6, imports.%Main.import_ref.d96) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.115) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.115) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc7_6.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_6.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_6.2(%self.param: ref %C) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc7_6.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc7_6.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_6.2(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc7_6.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -175,9 +238,53 @@ fn G() { // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] // CHECK:STDOUT: %G.type: type = fn_type @G [concrete] // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_6.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc8_6.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.99a: %pattern_type.98b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.cbd: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt.99a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_6.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc8_6.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.115, %Destroy.WithSelf.Op.403171.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8_6.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.115, %Destroy.WithSelf.SelfDestruct.db3fdb.2 [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_6.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc8_6.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_6.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc8_6.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -249,14 +356,32 @@ fn G() { // CHECK:STDOUT: %tuple.elem0: %C = tuple_access @F.%.loc5_55.8, element0 [concrete = constants.%C.val] // CHECK:STDOUT: %tuple.elem1: %C = tuple_access @F.%.loc5_55.8, element1 [concrete = constants.%C.val] // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.ref(%.loc8_6.6, %tuple.elem0, %tuple.elem1, @F.%.loc5_73.6) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.115) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.115) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_6.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_6.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_6.2(%self.param: ref %C) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_6.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_6.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_6.2(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_6.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon b/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon index b13174e528f0..eafd3023d438 100644 --- a/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon +++ b/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon @@ -68,8 +68,21 @@ fn Run() { // CHECK:STDOUT: %x.patt: %pattern_type.6b6 = ref_binding_pattern x [concrete] // CHECK:STDOUT: %x.var_patt: %pattern_type.6b6 = var_pattern %x.patt [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc25_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc25_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc25_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc25_3.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc25_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -89,6 +102,37 @@ fn Run() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc25_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc25_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc25_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc25_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -133,15 +177,33 @@ fn Run() { // CHECK:STDOUT: %x.patt: %pattern_type.6b6 = ref_binding_pattern x [concrete = constants.%x.patt] // CHECK:STDOUT: %x.var_patt: %pattern_type.6b6 = var_pattern %x.patt [concrete = constants.%x.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %x.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%x.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %x.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%x.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc25_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc25_3.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc25_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc25_3.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc25_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc25_3.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc25_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/call/form.carbon b/toolchain/check/testdata/function/call/form.carbon index 1b88f02e0a08..9b7343857939 100644 --- a/toolchain/check/testdata/function/call/form.carbon +++ b/toolchain/check/testdata/function/call/form.carbon @@ -360,8 +360,21 @@ fn G() { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.e39, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete] // CHECK:STDOUT: %bound_method: = bound_method %int_0.5c6, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.3c0: %i32 = int_value 0 [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc4_7.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc4_7.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc4_7.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc4_7.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc4_7.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -369,6 +382,37 @@ fn G() { // CHECK:STDOUT: %ImplicitAs.impl_witness_table.1aa = impl_witness_table (%Core.import_ref.edf), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc4_7.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc4_7.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc4_7.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc4_7.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] { // CHECK:STDOUT: %x.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%x.param_patt] @@ -400,15 +444,33 @@ fn G() { // CHECK:STDOUT: %x.var: ref %i32 = var_storage @F.%x.var_patt // CHECK:STDOUT: assign %x.var, %.loc4 // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.ref(%x.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %x.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%x.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %x.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%x.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc4_7.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc4_7.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc4_7.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc4_7.1(%self.param: ref %i32.builtin) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc4_7.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc4_7.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc4_7.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -569,8 +631,52 @@ fn G() { // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %_.patt: %pattern_type.6b6 = ref_binding_pattern _ [concrete] // CHECK:STDOUT: %_.var_patt: %pattern_type.6b6 = var_pattern %_.patt [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_7.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc9_7.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_7.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc9_7.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9_7.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_7.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc9_7.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_7.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc9_7.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -600,15 +706,33 @@ fn G() { // CHECK:STDOUT: %_.patt: %pattern_type.6b6 = ref_binding_pattern _ [concrete = constants.%_.patt] // CHECK:STDOUT: %_.var_patt: %pattern_type.6b6 = var_pattern %_.patt [concrete = constants.%_.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %_.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%_.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %_.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%_.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_7.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_7.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_7.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_7.1(%self.param: ref %i32.builtin) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_7.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_7.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_7.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -770,16 +894,29 @@ fn G() { // CHECK:STDOUT: %F.specific_fn.2f1: = specific_function %F, @F(%.c2a) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %Self.0e7: %Destroy.type = symbolic_binding Self, 0 [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.d3e: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Self.0e7) [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.42b: %Destroy.WithSelf.Op.type.d3e = struct_value () [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.4e5: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Self.0e7) [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.4a0: %Destroy.WithSelf.SelfDestruct.type.4e5 = struct_value () [symbolic] // CHECK:STDOUT: %Destroy.assoc_type: type = assoc_entity_type @Destroy [concrete] -// CHECK:STDOUT: %assoc0.ae8: %Destroy.assoc_type = assoc_entity element0, imports.%Core.import_ref.918 [concrete] +// CHECK:STDOUT: %assoc2: %Destroy.assoc_type = assoc_entity element2, imports.%Core.import_ref.71d [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.6c4ec3.2: = custom_witness (%Destroy.WithSelf.Op.403171.2), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.6de: %Destroy.type = facet_value %i32, (%custom_witness.6c4ec3.2) [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.170: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Destroy.facet.6de) [concrete] -// CHECK:STDOUT: %.d91: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.170, %Destroy.facet.6de [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f8f19d.2: = custom_witness (%Destroy.WithSelf.Op.403171.2, %Destroy.WithSelf.SubobjectDestroy.d01daf.2, %Destroy.WithSelf.SelfDestruct.db3fdb.2), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.b41: %Destroy.type = facet_value %i32, (%custom_witness.f8f19d.2) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.11b: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.b41) [concrete] +// CHECK:STDOUT: %.bbc: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.11b, %Destroy.facet.b41 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -801,8 +938,39 @@ fn G() { // CHECK:STDOUT: %Core.import_ref.cd6: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.ac8) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.5e0)] // CHECK:STDOUT: %Copy.impl_witness_table.8d2 = impl_witness_table (%Core.import_ref.cd6), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] -// CHECK:STDOUT: %Core.import_ref.c64: %Destroy.assoc_type = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [concrete = constants.%assoc0.ae8] -// CHECK:STDOUT: %Core.import_ref.918: @Destroy.WithSelf.%Destroy.WithSelf.Op.type (%Destroy.WithSelf.Op.type.d3e) = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [symbolic = @Destroy.WithSelf.%Destroy.WithSelf.Op (constants.%Destroy.WithSelf.Op.42b)] +// CHECK:STDOUT: %Core.import_ref.e39: %Destroy.assoc_type = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [concrete = constants.%assoc2] +// CHECK:STDOUT: %Core.import_ref.71d: @Destroy.WithSelf.%Destroy.WithSelf.SelfDestruct.type (%Destroy.WithSelf.SelfDestruct.type.4e5) = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [symbolic = @Destroy.WithSelf.%Destroy.WithSelf.SelfDestruct (constants.%Destroy.WithSelf.SelfDestruct.4a0)] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.2 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.3 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -928,21 +1096,39 @@ fn G() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %z.patt: %pattern_type.6b6 = value_binding_pattern z [concrete = constants.%z.patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Op.ref: %Destroy.assoc_type = name_ref Op, imports.%Core.import_ref.c64 [concrete = constants.%assoc0.ae8] -// CHECK:STDOUT: %impl.elem0.1: %.d91 = impl_witness_access constants.%custom_witness.6c4ec3.2, element0 [concrete = constants.%Destroy.WithSelf.Op.403171.2] -// CHECK:STDOUT: %bound_method.1: = bound_method %v.var.1, %impl.elem0.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.1: init %empty_tuple.type = call %bound_method.1(%v.var.1) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc13: = bound_method %x.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc13: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc13(%x.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc11: = bound_method %v.var.loc11, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc11: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc11(%v.var.loc11) +// CHECK:STDOUT: %SelfDestruct.ref: %Destroy.assoc_type = name_ref SelfDestruct, imports.%Core.import_ref.e39 [concrete = constants.%assoc2] +// CHECK:STDOUT: %impl.elem2: %.bbc = impl_witness_access constants.%custom_witness.f8f19d.2, element2 [concrete = constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2] +// CHECK:STDOUT: %bound_method.1: = bound_method %v.var.1, %impl.elem2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.1: init %empty_tuple.type = call %bound_method.1(%v.var.1) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc13: = bound_method %x.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc13: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc13(%x.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc11: = bound_method %v.var.loc11, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc11: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc11(%v.var.loc11) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.2(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.2(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.3(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.2(%self.param: ref %i32.builtin) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.3(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.3(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.3(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/call/i32.carbon b/toolchain/check/testdata/function/call/i32.carbon index 29b8a2f626c6..ddf1cb43e059 100644 --- a/toolchain/check/testdata/function/call/i32.carbon +++ b/toolchain/check/testdata/function/call/i32.carbon @@ -71,8 +71,21 @@ fn Main() { // CHECK:STDOUT: %bound_method: = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.0c6: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc20_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc20_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc20_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc20_3.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc20_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -94,6 +107,37 @@ fn Main() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc20_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc20_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc20_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc20_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -149,15 +193,33 @@ fn Main() { // CHECK:STDOUT: %b.patt: %pattern_type.6b6 = ref_binding_pattern b [concrete = constants.%b.patt] // CHECK:STDOUT: %b.var_patt: %pattern_type.6b6 = var_pattern %b.patt [concrete = constants.%b.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %b.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%b.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %b.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%b.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc20_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc20_3.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc20_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc20_3.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc20_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc20_3.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc20_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/call/more_param_ir.carbon b/toolchain/check/testdata/function/call/more_param_ir.carbon index 78c5dcf64b61..c261229dbb67 100644 --- a/toolchain/check/testdata/function/call/more_param_ir.carbon +++ b/toolchain/check/testdata/function/call/more_param_ir.carbon @@ -71,8 +71,27 @@ fn Main() { // CHECK:STDOUT: %bound_method.be9: = bound_method %int_6.462, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_6.439: %i32 = int_value 6 [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc18_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc18_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc18_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc18_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.bad: %pattern_type.e71 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.216: %pattern_type.e71 = wrapper_binding_pattern self, %self.param_patt.bad [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc18_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc18_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc18_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -90,6 +109,51 @@ fn Main() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc18_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc18_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc18_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc18_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc18_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e71 = ref_param_pattern [concrete = constants.%self.param_patt.bad] +// CHECK:STDOUT: %self.patt: %pattern_type.e71 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.216] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.a8a = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.a8a = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc18_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e71 = ref_param_pattern [concrete = constants.%self.param_patt.bad] +// CHECK:STDOUT: %self.patt: %pattern_type.e71 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.216] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.a8a = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.a8a = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -156,20 +220,47 @@ fn Main() { // CHECK:STDOUT: %.loc20_12.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc20 [concrete = constants.%int_6.439] // CHECK:STDOUT: %.loc20_12.2: %i32 = converted %int_6, %.loc20_12.1 [concrete = constants.%int_6.439] // CHECK:STDOUT: %Foo.call: init %empty_tuple.type = call %Foo.ref(%.loc20_8, %.loc20_12.2) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %x.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%x.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %x.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%x.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc18_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18_3.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc18_3.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc18_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18_3.3(%self.param: ref %tuple.type.a8a) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18_3.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc18_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc18_3.3(%self.param: ref %tuple.type.a8a) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18_3.3(%self.param: ref %tuple.type.a8a) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc18_3.3(%self.param: ref %tuple.type.a8a) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/call/ref.carbon b/toolchain/check/testdata/function/call/ref.carbon index eeb9d43dba49..b9b73046b555 100644 --- a/toolchain/check/testdata/function/call/ref.carbon +++ b/toolchain/check/testdata/function/call/ref.carbon @@ -143,8 +143,21 @@ fn G(ref d: D) { F(ref d); } // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.e39, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete] // CHECK:STDOUT: %bound_method: = bound_method %int_0.5c6, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.3c0: %i32 = int_value 0 [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc8_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc8_3.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -152,6 +165,37 @@ fn G(ref d: D) { F(ref d); } // CHECK:STDOUT: %ImplicitAs.impl_witness_table.1aa = impl_witness_table (%Core.import_ref.edf), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc8_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc8_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] { // CHECK:STDOUT: %x.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%x.param_patt] @@ -187,15 +231,33 @@ fn G(ref d: D) { F(ref d); } // CHECK:STDOUT: %y.ref: ref %i32 = name_ref y, %y // CHECK:STDOUT: %.loc10: %i32 = ref_tag %y.ref // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.ref(%y.ref) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %y.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%y.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %y.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%y.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.1(%self.param: ref %i32.builtin) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -222,8 +284,19 @@ fn G(ref d: D) { F(ref d); } // CHECK:STDOUT: %T.as.DefaultOrUnformed.impl.Op.53a: %T.as.DefaultOrUnformed.impl.Op.type.150 = struct_value () [symbolic] // CHECK:STDOUT: %DefaultOrUnformed.impl_witness.38f: = impl_witness imports.%DefaultOrUnformed.impl_witness_table.856, @T.as.DefaultOrUnformed.impl(%C) [concrete] // CHECK:STDOUT: %DefaultOrUnformed.facet: %DefaultOrUnformed.type = facet_value %C, (%DefaultOrUnformed.impl_witness.38f) [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc10_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc10_3.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -231,6 +304,37 @@ fn G(ref d: D) { F(ref d); } // CHECK:STDOUT: %DefaultOrUnformed.impl_witness_table.856 = impl_witness_table (%Core.import_ref.cc8), @T.as.DefaultOrUnformed.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc10_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc10_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {} // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {} {} @@ -276,15 +380,33 @@ fn G(ref d: D) { F(ref d); } // CHECK:STDOUT: %F.ref: %C.F.type = name_ref F, @C.%C.F.decl [concrete = constants.%C.F] // CHECK:STDOUT: %C.F.bound: = bound_method %c.ref, %F.ref // CHECK:STDOUT: %C.F.call: init %empty_tuple.type = call %C.F.bound(%c.ref) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %c.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%c.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %c.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%c.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_3.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_3.2(%self.param: ref %C) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_3.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_3.2(%self.param: ref %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_3.2(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_3.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/call/return_implicit.carbon b/toolchain/check/testdata/function/call/return_implicit.carbon index 86a6de271724..925ba592a299 100644 --- a/toolchain/check/testdata/function/call/return_implicit.carbon +++ b/toolchain/check/testdata/function/call/return_implicit.carbon @@ -33,8 +33,14 @@ fn Main() { // CHECK:STDOUT: %b.patt: %pattern_type.cb1 = ref_binding_pattern b [concrete] // CHECK:STDOUT: %b.var_patt: %pattern_type.cb1 = var_pattern %b.patt [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %self.param_patt.65a: %pattern_type.cb1 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.df1: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt.65a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfc: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc19 [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.loc19 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc19 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -46,6 +52,23 @@ fn Main() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl: %Destroy.WithSelf.SubobjectDestroy.type.dfc = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc19 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc19 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -77,10 +100,19 @@ fn Main() { // CHECK:STDOUT: %b.patt: %pattern_type.cb1 = ref_binding_pattern b [concrete = constants.%b.patt] // CHECK:STDOUT: %b.var_patt: %pattern_type.cb1 = var_pattern %b.patt [concrete = constants.%b.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %b.var, constants.%Destroy.WithSelf.Op.403 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%b.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %b.var, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%b.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc19(%self.param: ref %empty_tuple.type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc19(%self.param: ref %empty_tuple.type) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc19(%self.param: ref %empty_tuple.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) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/declaration/fail_import_incomplete_return.carbon b/toolchain/check/testdata/function/declaration/fail_import_incomplete_return.carbon index d047d7e322c6..ef36b6951ccf 100644 --- a/toolchain/check/testdata/function/declaration/fail_import_incomplete_return.carbon +++ b/toolchain/check/testdata/function/declaration/fail_import_incomplete_return.carbon @@ -220,9 +220,23 @@ fn CallFAndGIncomplete() { // CHECK:STDOUT: %D: type = class_type @D [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] +// CHECK:STDOUT: %pattern_type.d8d: type = pattern_type %D [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc33_17.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc33_17.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.b8e: %pattern_type.d8d = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.86b: %pattern_type.d8d = wrapper_binding_pattern self, %self.param_patt.b8e [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc33_17.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc33_17.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc33_17.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: %ReturnDUsed.type: type = fn_type @ReturnDUsed [concrete] // CHECK:STDOUT: %ReturnDUsed: %ReturnDUsed.type = struct_value () [concrete] // CHECK:STDOUT: } @@ -245,6 +259,37 @@ fn CallFAndGIncomplete() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc33_17.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc33_17.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc33_17.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.d8d = ref_param_pattern [concrete = constants.%self.param_patt.b8e] +// CHECK:STDOUT: %self.patt: %pattern_type.d8d = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.86b] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %D = ref_param call_param0 +// CHECK:STDOUT: %self: ref %D = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc33_17.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.d8d = ref_param_pattern [concrete = constants.%self.param_patt.b8e] +// CHECK:STDOUT: %self.patt: %pattern_type.d8d = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.86b] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %D = ref_param call_param0 +// CHECK:STDOUT: %self: ref %D = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .C = imports.%Main.C @@ -281,14 +326,14 @@ fn CallFAndGIncomplete() { // CHECK:STDOUT: %.loc33_17.1: ref %D = temporary_storage // CHECK:STDOUT: %ReturnDUnused.call: init %D to %.loc33_17.1 = call %ReturnDUnused.ref() // CHECK:STDOUT: %.loc33_17.2: ref %D = temporary %.loc33_17.1, %ReturnDUnused.call -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc33: = bound_method %.loc33_17.2, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc33: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc33(%.loc33_17.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc33: = bound_method %.loc33_17.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc33: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc33(%.loc33_17.2) // CHECK:STDOUT: %ReturnDUsed.ref: %ReturnDUsed.type = name_ref ReturnDUsed, imports.%Main.ReturnDUsed [concrete = constants.%ReturnDUsed] // CHECK:STDOUT: %.loc34_15.1: ref %D = temporary_storage // CHECK:STDOUT: %ReturnDUsed.call: init %D to %.loc34_15.1 = call %ReturnDUsed.ref() // CHECK:STDOUT: %.loc34_15.2: ref %D = temporary %.loc34_15.1, %ReturnDUsed.call -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc34: = bound_method %.loc34_15.2, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc34: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc34(%.loc34_15.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc34: = bound_method %.loc34_15.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc34: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc34(%.loc34_15.2) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -298,10 +343,28 @@ fn CallFAndGIncomplete() { // CHECK:STDOUT: // CHECK:STDOUT: fn @ReturnDUnused [from "fail_incomplete_return.carbon"]; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc33_17.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc33_17.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc33_17.2(%self.param: ref %D) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc33_17.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc33_17.2(%self.param: ref %D) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc33_17.2(%self.param: ref %D) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc33_17.2(%self.param: ref %D) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/generic/deduce.carbon b/toolchain/check/testdata/function/generic/deduce.carbon index 4be90a431988..690e38ab0736 100644 --- a/toolchain/check/testdata/function/generic/deduce.carbon +++ b/toolchain/check/testdata/function/generic/deduce.carbon @@ -609,9 +609,22 @@ fn F() { // CHECK:STDOUT: %A.val: %A = struct_value () [concrete] // CHECK:STDOUT: %.367: ref %A = temporary invalid, %A.val [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_37.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc11_37.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.8fb: %pattern_type.9ef = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.e64: %pattern_type.9ef = wrapper_binding_pattern self, %self.param_patt.8fb [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_37.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc11_37.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.367, %Destroy.WithSelf.Op.403171.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc11_37.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.367, %Destroy.WithSelf.SelfDestruct.db3fdb.2 [concrete] // CHECK:STDOUT: %complete_type.a75: = complete_type_witness %ptr.d43 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -624,6 +637,37 @@ fn F() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_37.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc11_37.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_37.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.9ef = ref_param_pattern [concrete = constants.%self.param_patt.8fb] +// CHECK:STDOUT: %self.patt: %pattern_type.9ef = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.e64] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %A = ref_param call_param0 +// CHECK:STDOUT: %self: ref %A = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc11_37.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.9ef = ref_param_pattern [concrete = constants.%self.param_patt.8fb] +// CHECK:STDOUT: %self.patt: %pattern_type.9ef = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.e64] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %A = ref_param call_param0 +// CHECK:STDOUT: %self: ref %A = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -714,14 +758,32 @@ fn F() { // CHECK:STDOUT: %.loc11_37.5: ref %A = temporary %.loc11_37.2, %.loc11_37.4 [concrete = constants.%.367] // CHECK:STDOUT: %.loc11_37.6: %A = acquire_value %.loc11_37.5 [concrete = constants.%A.val] // CHECK:STDOUT: %ExplicitAndAlsoDeduced.call: init %ptr.d43 = call %ExplicitAndAlsoDeduced.specific_fn(%.loc11_37.6) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.367) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.367) // CHECK:STDOUT: return %ExplicitAndAlsoDeduced.call // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_37.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_37.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_37.2(%self.param: ref %A) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_37.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_37.2(%self.param: ref %A) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_37.2(%self.param: ref %A) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_37.2(%self.param: ref %A) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/generic/resolve_used.carbon b/toolchain/check/testdata/function/generic/resolve_used.carbon index 5595d9c2b73b..be13f08aa504 100644 --- a/toolchain/check/testdata/function/generic/resolve_used.carbon +++ b/toolchain/check/testdata/function/generic/resolve_used.carbon @@ -71,10 +71,10 @@ fn CallNegative() { // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %Destroy.lookup_impl_witness.173: = lookup_impl_witness %Int, @Destroy [symbolic] // CHECK:STDOUT: %Destroy.facet.7bb: %Destroy.type = facet_value %Int, (%Destroy.lookup_impl_witness.173) [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.8f1: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Destroy.facet.7bb) [symbolic] -// CHECK:STDOUT: %.2c6: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.8f1, %Destroy.facet.7bb [symbolic] -// CHECK:STDOUT: %impl.elem0.604: %.2c6 = impl_witness_access %Destroy.lookup_impl_witness.173, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.693: = specific_impl_function %impl.elem0.604, @Destroy.WithSelf.Op.1(%Destroy.facet.7bb) [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.6fa: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.7bb) [symbolic] +// CHECK:STDOUT: %.b53: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.6fa, %Destroy.facet.7bb [symbolic] +// CHECK:STDOUT: %impl.elem2: %.b53 = impl_witness_access %Destroy.lookup_impl_witness.173, element2 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.1ce: = specific_impl_function %impl.elem2, @Destroy.WithSelf.SelfDestruct.1(%Destroy.facet.7bb) [symbolic] // CHECK:STDOUT: %CallNegative.type: type = fn_type @CallNegative [concrete] // CHECK:STDOUT: %CallNegative: %CallNegative.type = struct_value () [concrete] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete] @@ -91,12 +91,18 @@ fn CallNegative() { // CHECK:STDOUT: %DefaultOrUnformed.WithSelf.Op.type.2b9: type = fn_type @DefaultOrUnformed.WithSelf.Op, @DefaultOrUnformed.WithSelf(%DefaultOrUnformed.facet.6c8) [concrete] // CHECK:STDOUT: %.b06: type = fn_type_with_self_type %DefaultOrUnformed.WithSelf.Op.type.2b9, %DefaultOrUnformed.facet.6c8 [concrete] // CHECK:STDOUT: %T.as.DefaultOrUnformed.impl.Op.specific_fn: = specific_function %T.as.DefaultOrUnformed.impl.Op.38a, @T.as.DefaultOrUnformed.impl.Op(%i0) [concrete] +// CHECK:STDOUT: %self.param_patt.5aa: %pattern_type.d0e = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.caf: %pattern_type.d0e = wrapper_binding_pattern self, %self.param_patt.5aa [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfc: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9 [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.loc9 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.6c4: = custom_witness (%Destroy.WithSelf.Op.403), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.7b8: %Destroy.type = facet_value %i0, (%custom_witness.6c4) [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.fbf: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Destroy.facet.7b8) [concrete] -// CHECK:STDOUT: %.c2e: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.fbf, %Destroy.facet.7b8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f8f: = custom_witness (%Destroy.WithSelf.Op.403, %Destroy.WithSelf.SubobjectDestroy.d01, %Destroy.WithSelf.SelfDestruct.db3), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.f85: %Destroy.type = facet_value %i0, (%custom_witness.f8f) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.c2b: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.f85) [concrete] +// CHECK:STDOUT: %.cd9: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.c2b, %Destroy.facet.f85 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -116,6 +122,23 @@ fn CallNegative() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl: %Destroy.WithSelf.SubobjectDestroy.type.dfc = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.d0e = ref_param_pattern [concrete = constants.%self.param_patt.5aa] +// CHECK:STDOUT: %self.patt: %pattern_type.d0e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.caf] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i0 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i0 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc9 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.d0e = ref_param_pattern [concrete = constants.%self.param_patt.5aa] +// CHECK:STDOUT: %self.patt: %pattern_type.d0e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.caf] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i0 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i0 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -155,10 +178,10 @@ fn CallNegative() { // CHECK:STDOUT: %specific_impl_fn.loc9_28.2: = specific_impl_function %impl.elem0.loc9_28.2, @DefaultOrUnformed.WithSelf.Op(%DefaultOrUnformed.facet.loc9_28.2) [symbolic = %specific_impl_fn.loc9_28.2 (constants.%specific_impl_fn.cf5)] // CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %Int.loc9_27.2, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.173)] // CHECK:STDOUT: %Destroy.facet.loc9_3.3: %Destroy.type = facet_value %Int.loc9_27.2, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.loc9_3.3 (constants.%Destroy.facet.7bb)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Destroy.facet.loc9_3.3) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.8f1)] -// CHECK:STDOUT: %.loc9_3.3: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet.loc9_3.3 [symbolic = %.loc9_3.3 (constants.%.2c6)] -// CHECK:STDOUT: %impl.elem0.loc9_3.2: @ErrorIfNIsZero.%.loc9_3.3 (%.2c6) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc9_3.2 (constants.%impl.elem0.604)] -// CHECK:STDOUT: %specific_impl_fn.loc9_3.2: = specific_impl_function %impl.elem0.loc9_3.2, @Destroy.WithSelf.Op.1(%Destroy.facet.loc9_3.3) [symbolic = %specific_impl_fn.loc9_3.2 (constants.%specific_impl_fn.693)] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.loc9_3.3) [symbolic = %Destroy.WithSelf.SelfDestruct.type (constants.%Destroy.WithSelf.SelfDestruct.type.6fa)] +// CHECK:STDOUT: %.loc9_3.3: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type, %Destroy.facet.loc9_3.3 [symbolic = %.loc9_3.3 (constants.%.b53)] +// CHECK:STDOUT: %impl.elem2.loc9_3.2: @ErrorIfNIsZero.%.loc9_3.3 (%.b53) = impl_witness_access %Destroy.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc9_3.2 (constants.%impl.elem2)] +// CHECK:STDOUT: %specific_impl_fn.loc9_3.2: = specific_impl_function %impl.elem2.loc9_3.2, @Destroy.WithSelf.SelfDestruct.1(%Destroy.facet.loc9_3.3) [symbolic = %specific_impl_fn.loc9_3.2 (constants.%specific_impl_fn.1ce)] // CHECK:STDOUT: // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: @@ -182,15 +205,15 @@ fn CallNegative() { // CHECK:STDOUT: %v.patt.loc9_15.1: @ErrorIfNIsZero.%pattern_type (%pattern_type.142) = ref_binding_pattern v [symbolic = %v.patt.loc9_15.2 (constants.%v.patt.834)] // CHECK:STDOUT: %v.var_patt.loc9_3.1: @ErrorIfNIsZero.%pattern_type (%pattern_type.142) = var_pattern %v.patt.loc9_15.1 [symbolic = %v.var_patt.loc9_3.2 (constants.%v.var_patt.cd4)] // CHECK:STDOUT: } -// CHECK:STDOUT: %impl.elem0.loc9_3.1: @ErrorIfNIsZero.%.loc9_3.3 (%.2c6) = impl_witness_access constants.%Destroy.lookup_impl_witness.173, element0 [symbolic = %impl.elem0.loc9_3.2 (constants.%impl.elem0.604)] -// CHECK:STDOUT: %bound_method.loc9_3.1: = bound_method %v.var, %impl.elem0.loc9_3.1 +// CHECK:STDOUT: %impl.elem2.loc9_3.1: @ErrorIfNIsZero.%.loc9_3.3 (%.b53) = impl_witness_access constants.%Destroy.lookup_impl_witness.173, element2 [symbolic = %impl.elem2.loc9_3.2 (constants.%impl.elem2)] +// CHECK:STDOUT: %bound_method.loc9_3.1: = bound_method %v.var, %impl.elem2.loc9_3.1 // CHECK:STDOUT: %Destroy.facet.loc9_3.1: %Destroy.type = facet_value constants.%Int, (constants.%Destroy.lookup_impl_witness.173) [symbolic = %Destroy.facet.loc9_3.3 (constants.%Destroy.facet.7bb)] // CHECK:STDOUT: %.loc9_3.1: %Destroy.type = converted constants.%Int, %Destroy.facet.loc9_3.1 [symbolic = %Destroy.facet.loc9_3.3 (constants.%Destroy.facet.7bb)] // CHECK:STDOUT: %Destroy.facet.loc9_3.2: %Destroy.type = facet_value constants.%Int, (constants.%Destroy.lookup_impl_witness.173) [symbolic = %Destroy.facet.loc9_3.3 (constants.%Destroy.facet.7bb)] // CHECK:STDOUT: %.loc9_3.2: %Destroy.type = converted constants.%Int, %Destroy.facet.loc9_3.2 [symbolic = %Destroy.facet.loc9_3.3 (constants.%Destroy.facet.7bb)] -// CHECK:STDOUT: %specific_impl_fn.loc9_3.1: = specific_impl_function %impl.elem0.loc9_3.1, @Destroy.WithSelf.Op.1(constants.%Destroy.facet.7bb) [symbolic = %specific_impl_fn.loc9_3.2 (constants.%specific_impl_fn.693)] +// CHECK:STDOUT: %specific_impl_fn.loc9_3.1: = specific_impl_function %impl.elem2.loc9_3.1, @Destroy.WithSelf.SelfDestruct.1(constants.%Destroy.facet.7bb) [symbolic = %specific_impl_fn.loc9_3.2 (constants.%specific_impl_fn.1ce)] // CHECK:STDOUT: %bound_method.loc9_3.2: = bound_method %v.var, %specific_impl_fn.loc9_3.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc9_3.2(%v.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %bound_method.loc9_3.2(%v.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -204,11 +227,20 @@ fn CallNegative() { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9(%self.param: ref %i0) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9(%self.param: ref %i0) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9(%self.param: ref %i0) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9(%self.param: ref %i0) { +// 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) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: specific @ErrorIfNIsZero(constants.%N) { // CHECK:STDOUT: %N.patt.loc4_28.2 => constants.%N.patt // CHECK:STDOUT: %N.loc4_28.1 => constants.%N @@ -231,11 +263,11 @@ fn CallNegative() { // CHECK:STDOUT: %.loc9_28.4 => constants.%.b06 // CHECK:STDOUT: %impl.elem0.loc9_28.2 => constants.%T.as.DefaultOrUnformed.impl.Op.38a // CHECK:STDOUT: %specific_impl_fn.loc9_28.2 => constants.%T.as.DefaultOrUnformed.impl.Op.specific_fn -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.6c4 -// CHECK:STDOUT: %Destroy.facet.loc9_3.3 => constants.%Destroy.facet.7b8 -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.fbf -// CHECK:STDOUT: %.loc9_3.3 => constants.%.c2e -// CHECK:STDOUT: %impl.elem0.loc9_3.2 => constants.%Destroy.WithSelf.Op.403 -// CHECK:STDOUT: %specific_impl_fn.loc9_3.2 => constants.%Destroy.WithSelf.Op.403 +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.f8f +// CHECK:STDOUT: %Destroy.facet.loc9_3.3 => constants.%Destroy.facet.f85 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.c2b +// CHECK:STDOUT: %.loc9_3.3 => constants.%.cd9 +// CHECK:STDOUT: %impl.elem2.loc9_3.2 => constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %specific_impl_fn.loc9_3.2 => constants.%Destroy.WithSelf.SelfDestruct.db3 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/generic/return_slot.carbon b/toolchain/check/testdata/function/generic/return_slot.carbon index 5916f4cfa529..befac8bc3276 100644 --- a/toolchain/check/testdata/function/generic/return_slot.carbon +++ b/toolchain/check/testdata/function/generic/return_slot.carbon @@ -55,6 +55,7 @@ fn G() { // CHECK:STDOUT: %array_type: type = array_type %int_100, %i32 [concrete] // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %complete_type.f8a: = complete_type_witness %i32.builtin [concrete] +// CHECK:STDOUT: %pattern_type.3eb: type = pattern_type %array_type [concrete] // CHECK:STDOUT: %C.elem: type = unbound_element_type %C, %array_type [concrete] // CHECK:STDOUT: %struct_type.arr.fdc: type = struct_type {.arr: %array_type} [concrete] // CHECK:STDOUT: %complete_type.18e: = complete_type_witness %struct_type.arr.fdc [concrete] @@ -92,12 +93,50 @@ fn G() { // CHECK:STDOUT: %return.patt.e4a: %pattern_type.98b = return_slot_pattern %return.param_patt.89a, %C [concrete] // CHECK:STDOUT: %Wrap.Make.specific_fn.c96: = specific_function %Wrap.Make.83f, @Wrap.Make(%C) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc24_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc24_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc24_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc24_3.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc24_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.cc7: %pattern_type.3eb = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.0e5: %pattern_type.3eb = wrapper_binding_pattern self, %self.param_patt.cc7 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc24_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc24_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.38e: type = pattern_type %struct_type.arr.fdc [concrete] +// CHECK:STDOUT: %self.param_patt.96e: %pattern_type.38e = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.401: %pattern_type.38e = wrapper_binding_pattern self, %self.param_patt.96e [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc24_3.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc24_3.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.99a: %pattern_type.98b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.cbd: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt.99a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc24_3.5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.5: type = fn_type @Destroy.WithSelf.Op.loc24_3.5 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.5: %Destroy.WithSelf.Op.type.ef016f.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5: type = fn_type @Destroy.WithSelf.SelfDestruct.loc24_3.5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.5: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.65a: %pattern_type.cb1 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.df1: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt.65a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc23 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.6: type = fn_type @Destroy.WithSelf.Op.loc23 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.6: %Destroy.WithSelf.Op.type.ef016f.6 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.6: type = fn_type @Destroy.WithSelf.SelfDestruct.loc23 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.6: %Destroy.WithSelf.SelfDestruct.type.fbceb5.6 = struct_value () [concrete] // CHECK:STDOUT: %complete_type.782: = complete_type_witness %empty_tuple.type [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -112,6 +151,93 @@ fn G() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc24_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc24_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc24_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc24_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc24_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.3eb = ref_param_pattern [concrete = constants.%self.param_patt.cc7] +// CHECK:STDOUT: %self.patt: %pattern_type.3eb = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.0e5] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc24_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.3eb = ref_param_pattern [concrete = constants.%self.param_patt.cc7] +// CHECK:STDOUT: %self.patt: %pattern_type.3eb = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.0e5] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc24_3.4 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.38e = ref_param_pattern [concrete = constants.%self.param_patt.96e] +// CHECK:STDOUT: %self.patt: %pattern_type.38e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.401] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.arr.fdc = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.arr.fdc = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc24_3.4 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.38e = ref_param_pattern [concrete = constants.%self.param_patt.96e] +// CHECK:STDOUT: %self.patt: %pattern_type.38e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.401] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.arr.fdc = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.arr.fdc = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc24_3.5 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.5: %Destroy.WithSelf.Op.type.ef016f.5 = fn_decl @Destroy.WithSelf.Op.loc24_3.5 [concrete = constants.%Destroy.WithSelf.Op.403171.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc23 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.6: %Destroy.WithSelf.Op.type.ef016f.6 = fn_decl @Destroy.WithSelf.Op.loc23 [concrete = constants.%Destroy.WithSelf.Op.403171.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -251,39 +377,93 @@ fn G() { // CHECK:STDOUT: %c.patt: %pattern_type.98b = ref_binding_pattern c [concrete = constants.%c.patt] // CHECK:STDOUT: %c.var_patt: %pattern_type.98b = var_pattern %c.patt [concrete = constants.%c.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc24: = bound_method %c.var, constants.%Destroy.WithSelf.Op.403171.5 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc24: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc24(%c.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc23: = bound_method %b.var, constants.%Destroy.WithSelf.Op.403171.6 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc23: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc23(%b.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc22: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc22: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc22(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc24: = bound_method %c.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc24: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc24(%c.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc23: = bound_method %b.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.6 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc23: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc23(%b.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc22: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc22: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc22(%a.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc24_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_3.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc24_3.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc24_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_3.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc24_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc24_3.3(%self.param: ref %array_type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_3.4(%self.param: ref %struct_type.arr.fdc) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_3.3(%self.param: ref %array_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc24_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc24_3.4(%self.param: ref %struct_type.arr.fdc) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_3.5(%self.param: ref %C) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_3.4(%self.param: ref %struct_type.arr.fdc) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc24_3.4(%self.param: ref %struct_type.arr.fdc) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc24_3.5(%self.param: ref %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_3.5(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc24_3.5(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.5(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.5(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc23(%self.param: ref %empty_tuple.type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc23(%self.param: ref %empty_tuple.type) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc23(%self.param: ref %empty_tuple.type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.6(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.6(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: specific @Wrap(constants.%T) { // CHECK:STDOUT: %T.patt.loc15_13.2 => constants.%T.patt // CHECK:STDOUT: %T.loc15_13.1 => constants.%T diff --git a/toolchain/check/testdata/function/generic/type_param.carbon b/toolchain/check/testdata/function/generic/type_param.carbon index 412af6122f23..9c5ba2253a0f 100644 --- a/toolchain/check/testdata/function/generic/type_param.carbon +++ b/toolchain/check/testdata/function/generic/type_param.carbon @@ -46,12 +46,12 @@ fn F(generic T: type) { // CHECK:STDOUT: %specific_impl_fn.53b: = specific_impl_function %impl.elem0.66d, @DefaultOrUnformed.WithSelf.Op(%DefaultOrUnformed.facet) [symbolic] // CHECK:STDOUT: %n.patt: %pattern_type.51d = value_binding_pattern n [symbolic] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %ptr, @Destroy [symbolic] -// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %ptr, (%Destroy.lookup_impl_witness) [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.8a4: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet) [symbolic] -// CHECK:STDOUT: %.9f8: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.8a4, %Destroy.facet [symbolic] -// CHECK:STDOUT: %impl.elem0.258: %.9f8 = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.192: = specific_impl_function %impl.elem0.258, @Destroy.WithSelf.Op(%Destroy.facet) [symbolic] +// CHECK:STDOUT: %Destroy.lookup_impl_witness.781: = lookup_impl_witness %ptr, @Destroy [symbolic] +// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %ptr, (%Destroy.lookup_impl_witness.781) [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.119: type = fn_type @Destroy.WithSelf.SelfDestruct, @Destroy.WithSelf(%Destroy.facet) [symbolic] +// CHECK:STDOUT: %.0e0: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.119, %Destroy.facet [symbolic] +// CHECK:STDOUT: %impl.elem2: %.0e0 = impl_witness_access %Destroy.lookup_impl_witness.781, element2 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.928: = specific_impl_function %impl.elem2, @Destroy.WithSelf.SelfDestruct(%Destroy.facet) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -102,12 +102,12 @@ fn F(generic T: type) { // CHECK:STDOUT: %require_complete.loc17: = require_complete_type %T.loc15_15.1 [symbolic = %require_complete.loc17 (constants.%require_complete.944)] // CHECK:STDOUT: %pattern_type.loc17: type = pattern_type %T.loc15_15.1 [symbolic = %pattern_type.loc17 (constants.%pattern_type.51d)] // CHECK:STDOUT: %n.patt.loc17_15.2: @F.%pattern_type.loc17 (%pattern_type.51d) = value_binding_pattern n [symbolic = %n.patt.loc17_15.2 (constants.%n.patt)] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %ptr.loc16_11.2, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)] +// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %ptr.loc16_11.2, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.781)] // CHECK:STDOUT: %Destroy.facet.loc16_3.3: %Destroy.type = facet_value %ptr.loc16_11.2, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.loc16_3.3 (constants.%Destroy.facet)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.loc16_3.3) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.8a4)] -// CHECK:STDOUT: %.loc16_3.3: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet.loc16_3.3 [symbolic = %.loc16_3.3 (constants.%.9f8)] -// CHECK:STDOUT: %impl.elem0.loc16_3.2: @F.%.loc16_3.3 (%.9f8) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc16_3.2 (constants.%impl.elem0.258)] -// CHECK:STDOUT: %specific_impl_fn.loc16_3.2: = specific_impl_function %impl.elem0.loc16_3.2, @Destroy.WithSelf.Op(%Destroy.facet.loc16_3.3) [symbolic = %specific_impl_fn.loc16_3.2 (constants.%specific_impl_fn.192)] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type: type = fn_type @Destroy.WithSelf.SelfDestruct, @Destroy.WithSelf(%Destroy.facet.loc16_3.3) [symbolic = %Destroy.WithSelf.SelfDestruct.type (constants.%Destroy.WithSelf.SelfDestruct.type.119)] +// CHECK:STDOUT: %.loc16_3.3: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type, %Destroy.facet.loc16_3.3 [symbolic = %.loc16_3.3 (constants.%.0e0)] +// CHECK:STDOUT: %impl.elem2.loc16_3.2: @F.%.loc16_3.3 (%.0e0) = impl_witness_access %Destroy.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc16_3.2 (constants.%impl.elem2)] +// CHECK:STDOUT: %specific_impl_fn.loc16_3.2: = specific_impl_function %impl.elem2.loc16_3.2, @Destroy.WithSelf.SelfDestruct(%Destroy.facet.loc16_3.3) [symbolic = %specific_impl_fn.loc16_3.2 (constants.%specific_impl_fn.928)] // CHECK:STDOUT: // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: @@ -138,15 +138,15 @@ fn F(generic T: type) { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %n.patt.loc17_15.1: @F.%pattern_type.loc17 (%pattern_type.51d) = value_binding_pattern n [symbolic = %n.patt.loc17_15.2 (constants.%n.patt)] // CHECK:STDOUT: } -// CHECK:STDOUT: %impl.elem0.loc16_3.1: @F.%.loc16_3.3 (%.9f8) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc16_3.2 (constants.%impl.elem0.258)] -// CHECK:STDOUT: %bound_method.loc16_3.1: = bound_method %p.var, %impl.elem0.loc16_3.1 -// CHECK:STDOUT: %Destroy.facet.loc16_3.1: %Destroy.type = facet_value constants.%ptr, (constants.%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.loc16_3.3 (constants.%Destroy.facet)] +// CHECK:STDOUT: %impl.elem2.loc16_3.1: @F.%.loc16_3.3 (%.0e0) = impl_witness_access constants.%Destroy.lookup_impl_witness.781, element2 [symbolic = %impl.elem2.loc16_3.2 (constants.%impl.elem2)] +// CHECK:STDOUT: %bound_method.loc16_3.1: = bound_method %p.var, %impl.elem2.loc16_3.1 +// CHECK:STDOUT: %Destroy.facet.loc16_3.1: %Destroy.type = facet_value constants.%ptr, (constants.%Destroy.lookup_impl_witness.781) [symbolic = %Destroy.facet.loc16_3.3 (constants.%Destroy.facet)] // CHECK:STDOUT: %.loc16_3.1: %Destroy.type = converted constants.%ptr, %Destroy.facet.loc16_3.1 [symbolic = %Destroy.facet.loc16_3.3 (constants.%Destroy.facet)] -// CHECK:STDOUT: %Destroy.facet.loc16_3.2: %Destroy.type = facet_value constants.%ptr, (constants.%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.loc16_3.3 (constants.%Destroy.facet)] +// CHECK:STDOUT: %Destroy.facet.loc16_3.2: %Destroy.type = facet_value constants.%ptr, (constants.%Destroy.lookup_impl_witness.781) [symbolic = %Destroy.facet.loc16_3.3 (constants.%Destroy.facet)] // CHECK:STDOUT: %.loc16_3.2: %Destroy.type = converted constants.%ptr, %Destroy.facet.loc16_3.2 [symbolic = %Destroy.facet.loc16_3.3 (constants.%Destroy.facet)] -// CHECK:STDOUT: %specific_impl_fn.loc16_3.1: = specific_impl_function %impl.elem0.loc16_3.1, @Destroy.WithSelf.Op(constants.%Destroy.facet) [symbolic = %specific_impl_fn.loc16_3.2 (constants.%specific_impl_fn.192)] +// CHECK:STDOUT: %specific_impl_fn.loc16_3.1: = specific_impl_function %impl.elem2.loc16_3.1, @Destroy.WithSelf.SelfDestruct(constants.%Destroy.facet) [symbolic = %specific_impl_fn.loc16_3.2 (constants.%specific_impl_fn.928)] // CHECK:STDOUT: %bound_method.loc16_3.2: = bound_method %p.var, %specific_impl_fn.loc16_3.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc16_3.2(%p.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %bound_method.loc16_3.2(%p.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/generic/call_basic_depth.carbon b/toolchain/check/testdata/generic/call_basic_depth.carbon index 3ff125471d3d..54da95c6fef9 100644 --- a/toolchain/check/testdata/generic/call_basic_depth.carbon +++ b/toolchain/check/testdata/generic/call_basic_depth.carbon @@ -64,7 +64,7 @@ fn M() { // CHECK:STDOUT: %C.Cfn: %C.Cfn.type = struct_value () [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] -// CHECK:STDOUT: %require_complete: = require_complete_type %T [symbolic] +// CHECK:STDOUT: %require_complete.944: = require_complete_type %T [symbolic] // CHECK:STDOUT: %x.patt.26065e.2: %pattern_type.51d = wrapper_binding_pattern x, %x.param_patt.91d [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] @@ -109,7 +109,7 @@ fn M() { // CHECK:STDOUT: %x.patt.loc19_23.2: @F.%pattern_type (%pattern_type.51d) = wrapper_binding_pattern x, %x.param_patt.loc19_23.2 [symbolic = %x.patt.loc19_23.2 (constants.%x.patt.26065e.2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %T.loc19_7.1 [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type %T.loc19_7.1 [symbolic = %require_complete (constants.%require_complete.944)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%x.param: @F.%T.loc19_7.1 (%T)) { // CHECK:STDOUT: !entry: @@ -181,7 +181,7 @@ fn M() { // CHECK:STDOUT: %x.patt.loc19_23.2 => constants.%x.patt.26065e.1 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%require_complete +// CHECK:STDOUT: %require_complete => constants.%require_complete.944 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @H(constants.%T) { @@ -192,7 +192,7 @@ fn M() { // CHECK:STDOUT: %x.patt.loc23_16.2 => constants.%x.patt.26065e.3 // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%require_complete +// CHECK:STDOUT: %require_complete => constants.%require_complete.944 // CHECK:STDOUT: %F.specific_fn.loc25_3.2 => constants.%F.specific_fn.eab // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/generic/local.carbon b/toolchain/check/testdata/generic/local.carbon index e33aa1142915..274529b9cfbe 100644 --- a/toolchain/check/testdata/generic/local.carbon +++ b/toolchain/check/testdata/generic/local.carbon @@ -94,13 +94,40 @@ class C(C: type) { // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.8eb: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%i32, %ImplicitAs.facet) [concrete] // CHECK:STDOUT: %.b7a: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.8eb, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound: = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.e39 [concrete] +// CHECK:STDOUT: %pattern_type.6b6: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.e39, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete] // CHECK:STDOUT: %bound_method: = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.0c6: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %C.val: %C.8eb = struct_value (%int_1.0c6) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc8_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc8_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.946: type = pattern_type %struct_type.x.a15 [concrete] +// CHECK:STDOUT: %self.param_patt.3f5: %pattern_type.946 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.7ec: %pattern_type.946 = wrapper_binding_pattern self, %self.param_patt.3f5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc8_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.b9c: %pattern_type.1f3 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.a62: %pattern_type.1f3 = wrapper_binding_pattern self, %self.param_patt.b9c [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc8_3.4 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8_3.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -118,6 +145,65 @@ class C(C: type) { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc8_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc8_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.946 = ref_param_pattern [concrete = constants.%self.param_patt.3f5] +// CHECK:STDOUT: %self.patt: %pattern_type.946 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.7ec] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.x.a15 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.x.a15 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc8_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.946 = ref_param_pattern [concrete = constants.%self.param_patt.3f5] +// CHECK:STDOUT: %self.patt: %pattern_type.946 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.7ec] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.x.a15 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.x.a15 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.4 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.1f3 = ref_param_pattern [concrete = constants.%self.param_patt.b9c] +// CHECK:STDOUT: %self.patt: %pattern_type.1f3 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a62] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C.8eb = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C.8eb = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc8_3.4 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.1f3 = ref_param_pattern [concrete = constants.%self.param_patt.b9c] +// CHECK:STDOUT: %self.patt: %pattern_type.1f3 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a62] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C.8eb = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C.8eb = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -187,25 +273,61 @@ class C(C: type) { // CHECK:STDOUT: %v.patt: %pattern_type.1f3 = ref_binding_pattern v [concrete = constants.%v.patt] // CHECK:STDOUT: %v.var_patt: %pattern_type.1f3 = var_pattern %v.patt [concrete = constants.%v.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %v.var, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%v.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %v.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%v.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.3(%self.param: ref %struct_type.x.a15) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.3(%self.param: ref %struct_type.x.a15) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.4(%self.param: ref %C.8eb) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.3(%self.param: ref %struct_type.x.a15) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.3(%self.param: ref %struct_type.x.a15) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.4(%self.param: ref %C.8eb) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.4(%self.param: ref %C.8eb) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.4(%self.param: ref %C.8eb) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/generic/var_param.carbon b/toolchain/check/testdata/generic/var_param.carbon index 132a52826a41..f87a71174c10 100644 --- a/toolchain/check/testdata/generic/var_param.carbon +++ b/toolchain/check/testdata/generic/var_param.carbon @@ -66,8 +66,21 @@ fn Test(x: i32) { // CHECK:STDOUT: %Copy.WithSelf.Op.type.381: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet) [concrete] // CHECK:STDOUT: %.737: type = fn_type_with_self_type %Copy.WithSelf.Op.type.381, %Copy.facet [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.4f6, @Int.as.Copy.impl.Op(%int_32) [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc22_24.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc22_24.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc22_24.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc22_24.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc22_24.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -75,6 +88,37 @@ fn Test(x: i32) { // CHECK:STDOUT: %Copy.impl_witness_table.8d2 = impl_witness_table (%Core.import_ref.cd6), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc22_24.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc22_24.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc22_24.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc22_24.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [concrete = constants.%TestOp] { // CHECK:STDOUT: %T.patt.loc22_12.1: %pattern_type.6cb = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc22_12.2 (constants.%T.patt.1df)] @@ -130,15 +174,33 @@ fn Test(x: i32) { // CHECK:STDOUT: %x.var: ref %i32 = var_storage @TestOp.%x.param_patt.loc22_24.1 // CHECK:STDOUT: assign %x.var, %Int.as.Copy.impl.Op.call // CHECK:STDOUT: %TestOp.call: init %empty_tuple.type = call %TestOp.specific_fn(%x.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %x.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%x.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %x.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%x.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc22_24.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc22_24.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc22_24.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc22_24.1(%self.param: ref %i32.builtin) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc22_24.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc22_24.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc22_24.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/if/lifetime.carbon b/toolchain/check/testdata/if/lifetime.carbon index 0f6cffcba76d..79003cf9c00d 100644 --- a/toolchain/check/testdata/if/lifetime.carbon +++ b/toolchain/check/testdata/if/lifetime.carbon @@ -39,12 +39,57 @@ fn F() { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %A.F: %A.F.type = struct_value () [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] +// CHECK:STDOUT: %pattern_type.9ef: type = pattern_type %A [concrete] // CHECK:STDOUT: %Make.type: type = fn_type @Make [concrete] // CHECK:STDOUT: %Make: %Make.type = struct_value () [concrete] // CHECK:STDOUT: %G.type: type = fn_type @G [concrete] // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc14_12.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc14_12.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.8fb: %pattern_type.9ef = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.e64: %pattern_type.9ef = wrapper_binding_pattern self, %self.param_patt.8fb [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc14_12.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc14_12.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc14_12.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc14_12.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc14_12.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc14_12.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.9ef = ref_param_pattern [concrete = constants.%self.param_patt.8fb] +// CHECK:STDOUT: %self.patt: %pattern_type.9ef = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.e64] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %A = ref_param call_param0 +// CHECK:STDOUT: %self: ref %A = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc14_12.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.9ef = ref_param_pattern [concrete = constants.%self.param_patt.8fb] +// CHECK:STDOUT: %self.patt: %pattern_type.9ef = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.e64] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %A = ref_param call_param0 +// CHECK:STDOUT: %self: ref %A = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -57,8 +102,8 @@ fn F() { // CHECK:STDOUT: %A.F.call: init bool = call %F.ref() // CHECK:STDOUT: %.loc14_17.1: bool = value_of_initializer %A.F.call // CHECK:STDOUT: %.loc14_17.2: bool = converted %A.F.call, %.loc14_17.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.loc14_12.2, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%.loc14_12.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc14_12.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc14_12.2) // CHECK:STDOUT: if %.loc14_17.2 br !if.then else br !if.else // CHECK:STDOUT: // CHECK:STDOUT: !if.then: @@ -70,10 +115,28 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc14_12.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc14_12.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc14_12.2(%self.param: ref %A) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc14_12.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc14_12.2(%self.param: ref %A) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc14_12.2(%self.param: ref %A) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc14_12.2(%self.param: ref %A) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/if_expr/basic.carbon b/toolchain/check/testdata/if_expr/basic.carbon index c34175642b44..0d533ca64592 100644 --- a/toolchain/check/testdata/if_expr/basic.carbon +++ b/toolchain/check/testdata/if_expr/basic.carbon @@ -77,8 +77,27 @@ fn F(b: bool, n: i32, m: i32) -> i32 { // CHECK:STDOUT: %.737: type = fn_type_with_self_type %Copy.WithSelf.Op.type.381, %Copy.facet [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.4f6, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc16_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc16_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc16_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc16_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.dc5: %pattern_type.97e = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.7f9: %pattern_type.97e = wrapper_binding_pattern self, %self.param_patt.dc5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc16_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc16_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc16_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -102,6 +121,51 @@ fn F(b: bool, n: i32, m: i32) -> i32 { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc16_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc16_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc16_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc16_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc16_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.97e = ref_param_pattern [concrete = constants.%self.param_patt.dc5] +// CHECK:STDOUT: %self.patt: %pattern_type.97e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.7f9] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc16_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.97e = ref_param_pattern [concrete = constants.%self.param_patt.dc5] +// CHECK:STDOUT: %self.patt: %pattern_type.97e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.7f9] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -185,20 +249,47 @@ fn F(b: bool, n: i32, m: i32) -> i32 { // CHECK:STDOUT: %specific_fn.loc17: = specific_function %impl.elem0.loc17, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] // CHECK:STDOUT: %bound_method.loc17_10.2: = bound_method %.loc17_10, %specific_fn.loc17 // CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc17_10.2(%.loc17_10) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %x.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%x.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %x.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%x.var) // CHECK:STDOUT: return %Int.as.Copy.impl.Op.call // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc16_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16_3.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc16_3.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc16_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16_3.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc16_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc16_3.3(%self.param: ref %array_type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16_3.3(%self.param: ref %array_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc16_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/if_expr/constant_condition.carbon b/toolchain/check/testdata/if_expr/constant_condition.carbon index d2fbc0808050..f1976d37c457 100644 --- a/toolchain/check/testdata/if_expr/constant_condition.carbon +++ b/toolchain/check/testdata/if_expr/constant_condition.carbon @@ -111,10 +111,29 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: %.6d0: type = fn_type_with_self_type %Copy.WithSelf.Op.type.36e, %Copy.facet.09a [concrete] // CHECK:STDOUT: %ptr.as.Copy.impl.Op.specific_fn: = specific_function %ptr.as.Copy.impl.Op.d1c, @ptr.as.Copy.impl.Op(%i32) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %self.param_patt.af0: %pattern_type.f00 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.954: %pattern_type.f00 = wrapper_binding_pattern self, %self.param_patt.af0 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc28 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc28 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc28 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc27_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc27_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc27_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc27_3.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc27_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] // CHECK:STDOUT: %t.param_patt: %pattern_type.9a5 = value_param_pattern [concrete] // CHECK:STDOUT: %t.patt: %pattern_type.9a5 = wrapper_binding_pattern t, %t.param_patt [concrete] // CHECK:STDOUT: %PartiallyConstant.type: type = fn_type @PartiallyConstant [concrete] @@ -142,6 +161,51 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc28 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f00 = ref_param_pattern [concrete = constants.%self.param_patt.af0] +// CHECK:STDOUT: %self.patt: %pattern_type.f00 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.954] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr.d08 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr.d08 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc28 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f00 = ref_param_pattern [concrete = constants.%self.param_patt.af0] +// CHECK:STDOUT: %self.patt: %pattern_type.f00 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.954] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr.d08 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr.d08 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc27_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc27_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc27_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc27_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -375,19 +439,46 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: %specific_fn.loc29: = specific_function %impl.elem0.loc29, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] // CHECK:STDOUT: %bound_method.loc29_10.2: = bound_method %.loc29_10.2, %specific_fn.loc29 // CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc29_10.2(%.loc29_10.2) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc28: = bound_method %w.var, constants.%Destroy.WithSelf.Op.403171.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc28: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc28(%w.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc27: = bound_method %v.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc27: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc27(%v.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc28: = bound_method %w.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc28: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc28(%w.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc27: = bound_method %v.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc27: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc27(%v.var) // CHECK:STDOUT: return %Int.as.Copy.impl.Op.call // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc28(%self.param: ref %ptr.d08) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc28(%self.param: ref %ptr.d08) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc28(%self.param: ref %ptr.d08) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc27_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc27_3.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc27_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc27_3.1(%self.param: ref %i32.builtin) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc27_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc27_3.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc27_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -469,10 +560,10 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: %specific_fn.loc35: = specific_function %impl.elem0.loc35, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] // CHECK:STDOUT: %bound_method.loc35_10.2: = bound_method %.loc35_10.2, %specific_fn.loc35 // CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc35_10.2(%.loc35_10.2) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc34: = bound_method %w.var, constants.%Destroy.WithSelf.Op.403171.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc34: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc34(%w.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc33: = bound_method %v.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc33: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc33(%v.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc34: = bound_method %w.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc34: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc34(%w.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc33: = bound_method %v.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc33: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc33(%v.var) // CHECK:STDOUT: return %Int.as.Copy.impl.Op.call // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/if_expr/struct.carbon b/toolchain/check/testdata/if_expr/struct.carbon index 5ddb2db1d75d..ef102113edd5 100644 --- a/toolchain/check/testdata/if_expr/struct.carbon +++ b/toolchain/check/testdata/if_expr/struct.carbon @@ -59,6 +59,7 @@ fn F(cond: bool) { // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.8eb: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%i32, %ImplicitAs.facet) [concrete] // CHECK:STDOUT: %.b7a: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.8eb, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.094: = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.e39 [concrete] +// CHECK:STDOUT: %pattern_type.6b6: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.e39, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete] // CHECK:STDOUT: %bound_method.953: = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.0c6: %i32 = int_value 1 [concrete] @@ -67,8 +68,27 @@ fn F(cond: bool) { // CHECK:STDOUT: %int_2.295: %i32 = int_value 2 [concrete] // CHECK:STDOUT: %struct.631: %struct_type.a.b.b4c = struct_value (%int_1.0c6, %int_2.295) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc18_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc18_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc18_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc18_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.3bf: %pattern_type.20e3 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.d0e: %pattern_type.20e3 = wrapper_binding_pattern self, %self.param_patt.3bf [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc18_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc18_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc18_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -88,6 +108,51 @@ fn F(cond: bool) { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc18_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc18_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc18_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc18_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc18_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.20e3 = ref_param_pattern [concrete = constants.%self.param_patt.3bf] +// CHECK:STDOUT: %self.patt: %pattern_type.20e3 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d0e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.a.b.b4c = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.a.b.b4c = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc18_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.20e3 = ref_param_pattern [concrete = constants.%self.param_patt.3bf] +// CHECK:STDOUT: %self.patt: %pattern_type.20e3 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d0e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.a.b.b4c = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.a.b.b4c = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -181,20 +246,47 @@ fn F(cond: bool) { // CHECK:STDOUT: !if.expr.result: // CHECK:STDOUT: %.loc19_5: %struct_type.a.b.b4c = block_arg !if.expr.result // CHECK:STDOUT: %G.call: init %empty_tuple.type = call %G.ref(%.loc19_5) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%a.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc18_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18_3.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc18_3.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc18_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18_3.3(%self.param: ref %struct_type.a.b.b4c) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18_3.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc18_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc18_3.3(%self.param: ref %struct_type.a.b.b4c) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18_3.3(%self.param: ref %struct_type.a.b.b4c) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc18_3.3(%self.param: ref %struct_type.a.b.b4c) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/extend_impl_generic.carbon b/toolchain/check/testdata/impl/extend_impl_generic.carbon index 6e1588e312c5..80a929ca1c1d 100644 --- a/toolchain/check/testdata/impl/extend_impl_generic.carbon +++ b/toolchain/check/testdata/impl/extend_impl_generic.carbon @@ -146,10 +146,36 @@ class X(U: type) { // CHECK:STDOUT: %.737: type = fn_type_with_self_type %Copy.WithSelf.Op.type.381, %Copy.facet [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.4f6, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc22_27.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc22_27.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc22_27.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc22_27.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc22_27.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.946: type = pattern_type %struct_type.x.a15 [concrete] +// CHECK:STDOUT: %self.param_patt.3f5: %pattern_type.946 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.7ec: %pattern_type.946 = wrapper_binding_pattern self, %self.param_patt.3f5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc22_27.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc22_27.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.4da: %pattern_type.116 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.335: %pattern_type.116 = wrapper_binding_pattern self, %self.param_patt.4da [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc22_27.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc22_27.4 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc22_27.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -171,6 +197,65 @@ class X(U: type) { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc22_27.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc22_27.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc22_27.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc22_27.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc22_27.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.946 = ref_param_pattern [concrete = constants.%self.param_patt.3f5] +// CHECK:STDOUT: %self.patt: %pattern_type.946 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.7ec] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.x.a15 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.x.a15 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc22_27.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.946 = ref_param_pattern [concrete = constants.%self.param_patt.3f5] +// CHECK:STDOUT: %self.patt: %pattern_type.946 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.7ec] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.x.a15 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.x.a15 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc22_27.4 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.116 = ref_param_pattern [concrete = constants.%self.param_patt.4da] +// CHECK:STDOUT: %self.patt: %pattern_type.116 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.335] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Param = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Param = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc22_27.4 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.116 = ref_param_pattern [concrete = constants.%self.param_patt.4da] +// CHECK:STDOUT: %self.patt: %pattern_type.116 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.335] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Param = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Param = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -355,29 +440,65 @@ class X(U: type) { // CHECK:STDOUT: %b.patt: %pattern_type.6b6 = ref_binding_pattern b [concrete = constants.%b.patt] // CHECK:STDOUT: %b.var_patt: %pattern_type.6b6 = var_pattern %b.patt [concrete = constants.%b.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc22_27: = bound_method %.loc22_27.2, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc22_27: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc22_27(%.loc22_27.2) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc22_3: = bound_method %b.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc22_3: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc22_3(%b.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc21: = bound_method %.loc21_27.2, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc21: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc21(%.loc21_27.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc22_27: = bound_method %.loc22_27.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc22_27: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc22_27(%.loc22_27.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc22_3: = bound_method %b.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc22_3: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc22_3(%b.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc21: = bound_method %.loc21_27.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc21: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc21(%.loc21_27.2) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc22_27.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc22_27.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc22_27.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc22_27.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc22_27.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc22_27.3(%self.param: ref %struct_type.x.a15) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc22_27.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc22_27.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc22_27.3(%self.param: ref %struct_type.x.a15) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc22_27.4(%self.param: ref %Param) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc22_27.3(%self.param: ref %struct_type.x.a15) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc22_27.3(%self.param: ref %struct_type.x.a15) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc22_27.4(%self.param: ref %Param) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc22_27.4(%self.param: ref %Param) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc22_27.4(%self.param: ref %Param) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon b/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon index 70b8966b150b..cb46845cb639 100644 --- a/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon +++ b/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon @@ -195,7 +195,7 @@ fn F() { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Z.WithSelf.Zero.087: %Z.WithSelf.Zero.type.68b = struct_value () [symbolic] // CHECK:STDOUT: %Z.assoc_type: type = assoc_entity_type @Z [concrete] -// CHECK:STDOUT: %assoc0.627: %Z.assoc_type = assoc_entity element0, @Z.WithSelf.%Z.WithSelf.Zero.decl [concrete] +// CHECK:STDOUT: %assoc0: %Z.assoc_type = assoc_entity element0, @Z.WithSelf.%Z.WithSelf.Zero.decl [concrete] // CHECK:STDOUT: %.as.Z.impl.Zero.type: type = fn_type @.as.Z.impl.Zero, @.as.Z.impl(%Self.cb6) [symbolic] // CHECK:STDOUT: %.as.Z.impl.Zero: %.as.Z.impl.Zero.type = struct_value () [symbolic] // CHECK:STDOUT: %Point: type = class_type @Point [concrete] @@ -217,9 +217,23 @@ fn F() { // CHECK:STDOUT: %Z.WithSelf.Zero.3cb: %Z.WithSelf.Zero.type.7b8 = struct_value () [concrete] // CHECK:STDOUT: %.dfa: type = fn_type_with_self_type %Z.WithSelf.Zero.type.896, %Z.facet [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc25_7.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc25_7.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.9d8: type = pattern_type %Point [concrete] +// CHECK:STDOUT: %self.param_patt.e02: %pattern_type.9d8 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.8c1: %pattern_type.9d8 = wrapper_binding_pattern self, %self.param_patt.e02 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc25_7.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc25_7.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.e6b, %Destroy.WithSelf.Op.403171.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc25_7.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.e6b, %Destroy.WithSelf.SelfDestruct.db3fdb.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -231,6 +245,37 @@ fn F() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc25_7.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc25_7.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc25_7.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.9d8 = ref_param_pattern [concrete = constants.%self.param_patt.e02] +// CHECK:STDOUT: %self.patt: %pattern_type.9d8 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.8c1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Point = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Point = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc25_7.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.9d8 = ref_param_pattern [concrete = constants.%self.param_patt.e02] +// CHECK:STDOUT: %self.patt: %pattern_type.9d8 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.8c1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Point = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Point = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -250,7 +295,7 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: !with Self: // CHECK:STDOUT: %Z.WithSelf.Zero.decl: @Z.WithSelf.%Z.WithSelf.Zero.type (%Z.WithSelf.Zero.type.68b) = fn_decl @Z.WithSelf.Zero [symbolic = @Z.WithSelf.%Z.WithSelf.Zero (constants.%Z.WithSelf.Zero.087)] {} {} -// CHECK:STDOUT: %assoc0: %Z.assoc_type = assoc_entity element0, %Z.WithSelf.Zero.decl [concrete = constants.%assoc0.627] +// CHECK:STDOUT: %assoc0: %Z.assoc_type = assoc_entity element0, %Z.WithSelf.Zero.decl [concrete = constants.%assoc0] // CHECK:STDOUT: impl_decl @.as.Z.impl [concrete] {} { // CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z.type] // CHECK:STDOUT: } @@ -335,17 +380,35 @@ fn F() { // CHECK:STDOUT: %.loc25_5.3: init %Point to %.loc25_5.2 = class_init () [concrete = constants.%Point.val] // CHECK:STDOUT: %.loc25_7.1: init %Point = converted %.loc25_5.1, %.loc25_5.3 [concrete = constants.%Point.val] // CHECK:STDOUT: %.loc25_7.2: ref %Point = temporary %.loc25_5.2, %.loc25_7.1 [concrete = constants.%.e6b] -// CHECK:STDOUT: %Zero.ref: %Z.assoc_type = name_ref Zero, @Z.WithSelf.%assoc0 [concrete = constants.%assoc0.627] +// CHECK:STDOUT: %Zero.ref: %Z.assoc_type = name_ref Zero, @Z.WithSelf.%assoc0 [concrete = constants.%assoc0] // CHECK:STDOUT: %impl.elem0: %.dfa = impl_witness_access constants.%Z.impl_witness, element0 [concrete = constants.%Point.as.Z.impl.Zero] // CHECK:STDOUT: %Point.as.Z.impl.Zero.call: init %empty_tuple.type = call %impl.elem0() -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.e6b) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.e6b) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc25_7.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc25_7.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc25_7.2(%self.param: ref %Point) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc25_7.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc25_7.2(%self.param: ref %Point) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc25_7.2(%self.param: ref %Point) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc25_7.2(%self.param: ref %Point) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/fail_impl_as_scope.carbon b/toolchain/check/testdata/impl/fail_impl_as_scope.carbon index 884a3f00cd8b..e87d81bb183a 100644 --- a/toolchain/check/testdata/impl/fail_impl_as_scope.carbon +++ b/toolchain/check/testdata/impl/fail_impl_as_scope.carbon @@ -246,7 +246,7 @@ class X { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Z.WithSelf.Zero.087: %Z.WithSelf.Zero.type.68b = struct_value () [symbolic] // CHECK:STDOUT: %Z.assoc_type: type = assoc_entity_type @Z [concrete] -// CHECK:STDOUT: %assoc0.627: %Z.assoc_type = assoc_entity element0, @Z.WithSelf.%Z.WithSelf.Zero.decl [concrete] +// CHECK:STDOUT: %assoc0: %Z.assoc_type = assoc_entity element0, @Z.WithSelf.%Z.WithSelf.Zero.decl [concrete] // CHECK:STDOUT: %Self.as_type.0cf: type = facet_access_type %Self.cb6 [symbolic] // CHECK:STDOUT: %pattern_type.52a: type = pattern_type %Self.as_type.0cf [symbolic] // CHECK:STDOUT: %self.param_patt.241: %pattern_type.52a = value_param_pattern [symbolic] @@ -258,7 +258,7 @@ class X { // CHECK:STDOUT: %.as.Z.impl.Zero: %.as.Z.impl.Zero.type = struct_value () [symbolic] // CHECK:STDOUT: %.as.Z.impl.Method.type: type = fn_type @.as.Z.impl.Method, @.as.Z.impl(%Self.cb6) [symbolic] // CHECK:STDOUT: %.as.Z.impl.Method: %.as.Z.impl.Method.type = struct_value () [symbolic] -// CHECK:STDOUT: %require_complete: = require_complete_type %Self.as_type.0cf [symbolic] +// CHECK:STDOUT: %require_complete.350: = require_complete_type %Self.as_type.0cf [symbolic] // CHECK:STDOUT: %Point: type = class_type @Point [concrete] // CHECK:STDOUT: %.354: = impl_self_witness %Point, @Z [concrete] // CHECK:STDOUT: %Z.impl_witness: = impl_witness @Point.as.Z.impl.%Z.impl_witness_table [concrete] @@ -285,9 +285,22 @@ class X { // CHECK:STDOUT: %Point.as.Z.impl.Method.bound: = bound_method %Point.val, %Point.as.Z.impl.Method [concrete] // CHECK:STDOUT: %.e6b: ref %Point = temporary invalid, %Point.val [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc29_7.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc29_7.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.e02: %pattern_type.9d8 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.8c1: %pattern_type.9d8 = wrapper_binding_pattern self, %self.param_patt.e02 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc29_7.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc29_7.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.e6b, %Destroy.WithSelf.Op.403171.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc29_7.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.e6b, %Destroy.WithSelf.SelfDestruct.db3fdb.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -299,6 +312,37 @@ class X { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc29_7.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc29_7.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc29_7.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.9d8 = ref_param_pattern [concrete = constants.%self.param_patt.e02] +// CHECK:STDOUT: %self.patt: %pattern_type.9d8 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.8c1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Point = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Point = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc29_7.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.9d8 = ref_param_pattern [concrete = constants.%self.param_patt.e02] +// CHECK:STDOUT: %self.patt: %pattern_type.9d8 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.8c1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Point = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Point = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -318,7 +362,7 @@ class X { // CHECK:STDOUT: // CHECK:STDOUT: !with Self: // CHECK:STDOUT: %Z.WithSelf.Zero.decl: @Z.WithSelf.%Z.WithSelf.Zero.type (%Z.WithSelf.Zero.type.68b) = fn_decl @Z.WithSelf.Zero [symbolic = @Z.WithSelf.%Z.WithSelf.Zero (constants.%Z.WithSelf.Zero.087)] {} {} -// CHECK:STDOUT: %assoc0: %Z.assoc_type = assoc_entity element0, %Z.WithSelf.Zero.decl [concrete = constants.%assoc0.627] +// CHECK:STDOUT: %assoc0: %Z.assoc_type = assoc_entity element0, %Z.WithSelf.Zero.decl [concrete = constants.%assoc0] // CHECK:STDOUT: %Z.WithSelf.Method.decl: @Z.WithSelf.%Z.WithSelf.Method.type (%Z.WithSelf.Method.type.d41) = fn_decl @Z.WithSelf.Method [symbolic = @Z.WithSelf.%Z.WithSelf.Method (constants.%Z.WithSelf.Method.ead)] { // CHECK:STDOUT: %self.param_patt.loc5_13.1: @Z.WithSelf.Method.%pattern_type (%pattern_type.52a) = value_param_pattern [symbolic = %self.param_patt.loc5_13.2 (constants.%self.param_patt.241)] // CHECK:STDOUT: %self.patt.loc5_13.1: @Z.WithSelf.Method.%pattern_type (%pattern_type.52a) = wrapper_binding_pattern self, %self.param_patt.loc5_13.1 [symbolic = %self.patt.loc5_13.2 (constants.%self.patt.b15)] @@ -444,7 +488,7 @@ class X { // CHECK:STDOUT: %self.patt.loc13_22.2: @.as.Z.impl.Method.%pattern_type (%pattern_type.52a) = wrapper_binding_pattern self, %self.param_patt.loc13_22.2 [symbolic = %self.patt.loc13_22.2 (constants.%self.patt.b15)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %Self.as_type.loc13_22.1 [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type %Self.as_type.loc13_22.1 [symbolic = %require_complete (constants.%require_complete.350)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%self.param: @.as.Z.impl.Method.%Self.as_type.loc13_22.1 (%Self.as_type.0cf)) { // CHECK:STDOUT: !entry: @@ -466,7 +510,7 @@ class X { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Point.ref.loc28: type = name_ref Point, file.%Point.decl [concrete = constants.%Point] // CHECK:STDOUT: %Z.ref.loc28: type = name_ref Z, file.%Z.decl [concrete = constants.%Z.type] -// CHECK:STDOUT: %Zero.ref: %Z.assoc_type = name_ref Zero, @Z.WithSelf.%assoc0 [concrete = constants.%assoc0.627] +// CHECK:STDOUT: %Zero.ref: %Z.assoc_type = name_ref Zero, @Z.WithSelf.%assoc0 [concrete = constants.%assoc0] // CHECK:STDOUT: %Z.facet: %Z.type = facet_value %Point.ref.loc28, (constants.%Z.impl_witness) [concrete = constants.%Z.facet] // CHECK:STDOUT: %.loc28: %Z.type = converted %Point.ref.loc28, %Z.facet [concrete = constants.%Z.facet] // CHECK:STDOUT: %impl.elem0: %.dfa = impl_witness_access constants.%Z.impl_witness, element0 [concrete = constants.%Point.as.Z.impl.Zero] @@ -483,14 +527,32 @@ class X { // CHECK:STDOUT: %.loc29_7.2: ref %Point = temporary %.loc29_5.2, %.loc29_7.1 [concrete = constants.%.e6b] // CHECK:STDOUT: %.loc29_7.3: %Point = acquire_value %.loc29_7.2 [concrete = constants.%Point.val] // CHECK:STDOUT: %Point.as.Z.impl.Method.call: init %empty_tuple.type = call %bound_method(%.loc29_7.3) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.e6b) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.e6b) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc29_7.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc29_7.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc29_7.2(%self.param: ref %Point) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc29_7.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc29_7.2(%self.param: ref %Point) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc29_7.2(%self.param: ref %Point) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc29_7.2(%self.param: ref %Point) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/impl_as.carbon b/toolchain/check/testdata/impl/impl_as.carbon index 502fdf9bc101..5d49a98ca1fe 100644 --- a/toolchain/check/testdata/impl/impl_as.carbon +++ b/toolchain/check/testdata/impl/impl_as.carbon @@ -35,7 +35,7 @@ class C { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Simple.WithSelf.F.66e: %Simple.WithSelf.F.type.49c = struct_value () [symbolic] // CHECK:STDOUT: %Simple.assoc_type: type = assoc_entity_type @Simple [concrete] -// CHECK:STDOUT: %assoc0.210: %Simple.assoc_type = assoc_entity element0, @Simple.WithSelf.%Simple.WithSelf.F.decl [concrete] +// CHECK:STDOUT: %assoc0: %Simple.assoc_type = assoc_entity element0, @Simple.WithSelf.%Simple.WithSelf.F.decl [concrete] // CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %.dd3: = impl_self_witness %C, @Simple [concrete] // CHECK:STDOUT: %Simple.impl_witness: = impl_witness @C.as.Simple.impl.%Simple.impl_witness_table [concrete] @@ -52,8 +52,21 @@ class C { // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete] // CHECK:STDOUT: %C.val: %C = struct_value () [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc23_7.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc23_7.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.99a: %pattern_type.98b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.cbd: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt.99a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc23_7.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc23_7.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc23_7.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -65,6 +78,37 @@ class C { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc23_7.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc23_7.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc23_7.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc23_7.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -82,7 +126,7 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: !with Self: // CHECK:STDOUT: %Simple.WithSelf.F.decl: @Simple.WithSelf.%Simple.WithSelf.F.type (%Simple.WithSelf.F.type.49c) = fn_decl @Simple.WithSelf.F [symbolic = @Simple.WithSelf.%Simple.WithSelf.F (constants.%Simple.WithSelf.F.66e)] {} {} -// CHECK:STDOUT: %assoc0: %Simple.assoc_type = assoc_entity element0, %Simple.WithSelf.F.decl [concrete = constants.%assoc0.210] +// CHECK:STDOUT: %assoc0: %Simple.assoc_type = assoc_entity element0, %Simple.WithSelf.F.decl [concrete = constants.%assoc0] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self @@ -137,15 +181,33 @@ class C { // CHECK:STDOUT: %c.patt: %pattern_type.98b = ref_binding_pattern c [concrete = constants.%c.patt] // CHECK:STDOUT: %c.var_patt: %pattern_type.98b = var_pattern %c.patt [concrete = constants.%c.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %c.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%c.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %c.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%c.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc23_7.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc23_7.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc23_7.2(%self.param: ref %C) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc23_7.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc23_7.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc23_7.2(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc23_7.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/impl_thunk.carbon b/toolchain/check/testdata/impl/impl_thunk.carbon index c03317e58036..986dc37f2ab7 100644 --- a/toolchain/check/testdata/impl/impl_thunk.carbon +++ b/toolchain/check/testdata/impl/impl_thunk.carbon @@ -373,8 +373,73 @@ impl () as I({}) { // CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.type.48cdab.2: type = fn_type @empty_tuple.type.as.I.impl.F.loc10_48.2 [concrete] // CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.bd5be1.2: %empty_tuple.type.as.I.impl.F.type.48cdab.2 = struct_value () [concrete] // CHECK:STDOUT: %struct: %struct_type.c.d.15a = struct_value (%empty_tuple, %empty_struct) [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_48.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc10_48.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete] +// CHECK:STDOUT: %self.param_patt.65a: %pattern_type.cb1 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.df1: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt.65a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_48.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc10_48.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.e6d: %pattern_type.844 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.82a: %pattern_type.844 = wrapper_binding_pattern self, %self.param_patt.e6d [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_48.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc10_48.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10_48.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_48.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc10_48.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_48.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc10_48.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_48.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.844 = ref_param_pattern [concrete = constants.%self.param_patt.e6d] +// CHECK:STDOUT: %self.patt: %pattern_type.844 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.82a] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.d.c.b36 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.d.c.b36 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc10_48.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.844 = ref_param_pattern [concrete = constants.%self.param_patt.e6d] +// CHECK:STDOUT: %self.patt: %pattern_type.844 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.82a] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.d.c.b36 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.d.c.b36 = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @empty_tuple.type.as.I.impl: %.loc8_7.2 as %I.ref { @@ -437,17 +502,44 @@ impl () as I({}) { // 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.Op.bound: = bound_method %.loc10_48.2, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%.loc10_48.2) +// 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: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_48.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_48.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_48.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_48.2(%self.param: ref %empty_tuple.type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_48.2(%self.param: ref %empty_tuple.type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_48.3(%self.param: ref %struct_type.d.c.b36) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_48.2(%self.param: ref %empty_tuple.type) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_48.3(%self.param: ref %struct_type.d.c.b36) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_48.3(%self.param: ref %struct_type.d.c.b36) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_48.3(%self.param: ref %struct_type.d.c.b36) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -992,10 +1084,96 @@ impl () as I({}) { // CHECK:STDOUT: %A.as.X.impl.F.type.48cdab.1: type = fn_type @A.as.X.impl.F.loc23_14.1 [concrete] // CHECK:STDOUT: %A.as.X.impl.F.bd5be1.1: %A.as.X.impl.F.type.48cdab.1 = struct_value () [concrete] // CHECK:STDOUT: %X.facet: %X.type = facet_value %A, (%X.impl_witness) [concrete] +// CHECK:STDOUT: %pattern_type.9ef: type = pattern_type %A [concrete] // CHECK:STDOUT: %A.as.X.impl.F.type.48cdab.2: type = fn_type @A.as.X.impl.F.loc23_14.2 [concrete] // CHECK:STDOUT: %A.as.X.impl.F.bd5be1.2: %A.as.X.impl.F.type.48cdab.2 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc23_14.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc23_14.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.8fb: %pattern_type.9ef = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.e64: %pattern_type.9ef = wrapper_binding_pattern self, %self.param_patt.8fb [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc23_14.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc23_14.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.7bd: type = pattern_type %struct_type.base.cb7 [concrete] +// CHECK:STDOUT: %self.param_patt.c67: %pattern_type.7bd = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.e77: %pattern_type.7bd = wrapper_binding_pattern self, %self.param_patt.c67 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc23_14.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc23_14.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.039: %pattern_type.e39 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.535: %pattern_type.e39 = wrapper_binding_pattern self, %self.param_patt.039 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc23_14.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc23_14.4 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc23_14.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc23_14.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc23_14.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc23_14.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.9ef = ref_param_pattern [concrete = constants.%self.param_patt.8fb] +// CHECK:STDOUT: %self.patt: %pattern_type.9ef = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.e64] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %A = ref_param call_param0 +// CHECK:STDOUT: %self: ref %A = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc23_14.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.9ef = ref_param_pattern [concrete = constants.%self.param_patt.8fb] +// CHECK:STDOUT: %self.patt: %pattern_type.9ef = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.e64] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %A = ref_param call_param0 +// CHECK:STDOUT: %self: ref %A = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc23_14.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.7bd = ref_param_pattern [concrete = constants.%self.param_patt.c67] +// CHECK:STDOUT: %self.patt: %pattern_type.7bd = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.e77] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.base.cb7 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.base.cb7 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc23_14.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.7bd = ref_param_pattern [concrete = constants.%self.param_patt.c67] +// CHECK:STDOUT: %self.patt: %pattern_type.7bd = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.e77] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.base.cb7 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.base.cb7 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc23_14.4 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e39 = ref_param_pattern [concrete = constants.%self.param_patt.039] +// CHECK:STDOUT: %self.patt: %pattern_type.e39 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.535] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %B = ref_param call_param0 +// CHECK:STDOUT: %self: ref %B = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc23_14.4 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e39 = ref_param_pattern [concrete = constants.%self.param_patt.039] +// CHECK:STDOUT: %self.patt: %pattern_type.e39 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.535] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %B = ref_param call_param0 +// CHECK:STDOUT: %self: ref %B = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @A.as.X.impl: %A.ref as %X.ref { @@ -1034,25 +1212,61 @@ impl () as I({}) { // CHECK:STDOUT: %.loc23_14.3: ref %A = class_element_access %.loc23_14.2, element0 // CHECK:STDOUT: %.loc23_14.4: ref %A = converted %A.as.X.impl.F.call, %.loc23_14.3 // CHECK:STDOUT: %.loc23_14.5: %A = acquire_value %.loc23_14.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.loc23_14.2, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%.loc23_14.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc23_14.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc23_14.2) // CHECK:STDOUT: return to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc23_14.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc23_14.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc23_14.2(%self.param: ref %A) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc23_14.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc23_14.2(%self.param: ref %A) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc23_14.3(%self.param: ref %struct_type.base.cb7) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc23_14.2(%self.param: ref %A) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc23_14.2(%self.param: ref %A) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc23_14.3(%self.param: ref %struct_type.base.cb7) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc23_14.4(%self.param: ref %B) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc23_14.3(%self.param: ref %struct_type.base.cb7) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc23_14.3(%self.param: ref %struct_type.base.cb7) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc23_14.4(%self.param: ref %B) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc23_14.4(%self.param: ref %B) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc23_14.4(%self.param: ref %B) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1497,8 +1711,52 @@ impl () as I({}) { // CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.type.48cdab.2: type = fn_type @empty_tuple.type.as.I.impl.F.loc10_29.2 [concrete] // CHECK:STDOUT: %empty_tuple.type.as.I.impl.F.bd5be1.2: %empty_tuple.type.as.I.impl.F.type.48cdab.2 = struct_value () [concrete] // CHECK:STDOUT: %struct: %struct_type.a.b.f95 = struct_value (%empty_struct, %empty_struct) [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_29.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc10_29.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.aa3: %pattern_type.914 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.a9d: %pattern_type.914 = wrapper_binding_pattern self, %self.param_patt.aa3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_29.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc10_29.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10_29.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_29.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc10_29.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_29.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.914 = ref_param_pattern [concrete = constants.%self.param_patt.aa3] +// CHECK:STDOUT: %self.patt: %pattern_type.914 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a9d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.b.a.1b0 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.b.a.1b0 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc10_29.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.914 = ref_param_pattern [concrete = constants.%self.param_patt.aa3] +// CHECK:STDOUT: %self.patt: %pattern_type.914 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a9d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.b.a.1b0 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.b.a.1b0 = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: impl @empty_tuple.type.as.I.impl: %.loc8_7.2 as %I.type { @@ -1549,15 +1807,33 @@ impl () as I({}) { // CHECK:STDOUT: %.loc10_29.12: init %empty_struct_type to %.loc10_29.9 = in_place_init %.loc10_29.11 [concrete = constants.%empty_struct] // CHECK:STDOUT: %.loc10_29.13: init %struct_type.a.b.f95 to %return.param = struct_init (%.loc10_29.7, %.loc10_29.12) [concrete = constants.%struct] // CHECK:STDOUT: %.loc10_29.14: init %struct_type.a.b.f95 = converted %empty_tuple.type.as.I.impl.F.call, %.loc10_29.13 [concrete = constants.%struct] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.loc10_29.2, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%.loc10_29.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc10_29.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc10_29.2) // CHECK:STDOUT: return %.loc10_29.14 to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_29.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_29.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_29.2(%self.param: ref %struct_type.b.a.1b0) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_29.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_29.2(%self.param: ref %struct_type.b.a.1b0) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_29.2(%self.param: ref %struct_type.b.a.1b0) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_29.2(%self.param: ref %struct_type.b.a.1b0) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// 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 e5a872f19a1c..0b89ab07fd60 100644 --- a/toolchain/check/testdata/impl/import_thunk.carbon +++ b/toolchain/check/testdata/impl/import_thunk.carbon @@ -146,24 +146,30 @@ fn G() { // CHECK:STDOUT: %I.WithSelf.F.a9c: %I.WithSelf.F.type.ca5 = struct_value () [symbolic] // CHECK:STDOUT: %C.as.I.impl.F.type.9a27ec.2: type = fn_type @C.as.I.impl.F.loc8_24.2, @C.as.I.impl(%Y) [symbolic] // CHECK:STDOUT: %C.as.I.impl.F.84dd70.2: %C.as.I.impl.F.type.9a27ec.2 = struct_value () [symbolic] -// CHECK:STDOUT: %require_complete: = require_complete_type %C.6b1ed7.2 [symbolic] +// CHECK:STDOUT: %require_complete.e14: = require_complete_type %C.6b1ed7.2 [symbolic] // CHECK:STDOUT: %C.as.I.impl.F.specific_fn: = specific_function %C.as.I.impl.F.84dd70.1, @C.as.I.impl.F.loc8_24.1(%Y) [symbolic] // CHECK:STDOUT: %C.val: %C.6b1ed7.2 = struct_value () [symbolic] // CHECK:STDOUT: %.e66: ref %C.6b1ed7.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.Op.type.d3e: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Self.0e7) [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.42b: %Destroy.WithSelf.Op.type.d3e = struct_value () [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.4e5: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Self.0e7) [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.4a0: %Destroy.WithSelf.SelfDestruct.type.4e5 = struct_value () [symbolic] // CHECK:STDOUT: %Destroy.assoc_type: type = assoc_entity_type @Destroy [concrete] -// CHECK:STDOUT: %assoc0: %Destroy.assoc_type = assoc_entity element0, imports.%Core.import_ref.918 [concrete] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %C.6b1ed7.2, @Destroy [symbolic] -// CHECK:STDOUT: %Destroy.facet.886: %Destroy.type = facet_value %C.6b1ed7.2, (%Destroy.lookup_impl_witness) [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ba0: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Destroy.facet.886) [symbolic] -// CHECK:STDOUT: %.854: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.ba0, %Destroy.facet.886 [symbolic] -// CHECK:STDOUT: %impl.elem0: %.854 = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic] -// CHECK:STDOUT: %bound_method.3e7: = bound_method %.e66, %impl.elem0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn: = specific_impl_function %impl.elem0, @Destroy.WithSelf.Op.1(%Destroy.facet.886) [symbolic] -// CHECK:STDOUT: %bound_method.ef4: = bound_method %.e66, %specific_impl_fn [symbolic] +// CHECK:STDOUT: %assoc2: %Destroy.assoc_type = assoc_entity element2, imports.%Core.import_ref.71d [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.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.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.lookup_impl_witness.22d: = lookup_impl_witness %C.6b1ed7.2, @Destroy [symbolic] +// CHECK:STDOUT: %Destroy.facet.886: %Destroy.type = facet_value %C.6b1ed7.2, (%Destroy.lookup_impl_witness.22d) [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.434: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.886) [symbolic] +// CHECK:STDOUT: %.538: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.434, %Destroy.facet.886 [symbolic] +// CHECK:STDOUT: %impl.elem2: %.538 = impl_witness_access %Destroy.lookup_impl_witness.22d, element2 [symbolic] +// CHECK:STDOUT: %bound_method.5ab: = bound_method %.e66, %impl.elem2 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.463: = specific_impl_function %impl.elem2, @Destroy.WithSelf.SelfDestruct.1(%Destroy.facet.886) [symbolic] +// CHECK:STDOUT: %bound_method.bf9: = bound_method %.e66, %specific_impl_fn.463 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -179,8 +185,25 @@ 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.c64: %Destroy.assoc_type = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [concrete = constants.%assoc0] -// CHECK:STDOUT: %Core.import_ref.918: @Destroy.WithSelf.%Destroy.WithSelf.Op.type (%Destroy.WithSelf.Op.type.d3e) = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [symbolic = @Destroy.WithSelf.%Destroy.WithSelf.Op (constants.%Destroy.WithSelf.Op.42b)] +// CHECK:STDOUT: %Core.import_ref.e39: %Destroy.assoc_type = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [concrete = constants.%assoc2] +// CHECK:STDOUT: %Core.import_ref.71d: @Destroy.WithSelf.%Destroy.WithSelf.SelfDestruct.type (%Destroy.WithSelf.SelfDestruct.type.4e5) = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [symbolic = @Destroy.WithSelf.%Destroy.WithSelf.SelfDestruct (constants.%Destroy.WithSelf.SelfDestruct.4a0)] +// 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: %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: %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: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -301,7 +324,7 @@ fn G() { // CHECK:STDOUT: %x.patt.loc8_16.2: @C.as.I.impl.F.loc8_24.1.%pattern_type (%pattern_type.d0f) = wrapper_binding_pattern x, %x.param_patt.loc8_16.2 [symbolic = %x.patt.loc8_16.2 (constants.%x.patt.bce)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %C.loc8_21.1 [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type %C.loc8_21.1 [symbolic = %require_complete (constants.%require_complete.e14)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%x.param: @C.as.I.impl.F.loc8_24.1.%C.loc8_21.1 (%C.6b1ed7.2)) { // CHECK:STDOUT: !entry: @@ -316,17 +339,17 @@ fn G() { // CHECK:STDOUT: %C.as.I.impl.F: @C.as.I.impl.F.loc8_24.2.%C.as.I.impl.F.type (%C.as.I.impl.F.type.9a27ec.1) = struct_value () [symbolic = %C.as.I.impl.F (constants.%C.as.I.impl.F.84dd70.1)] // CHECK:STDOUT: %C.as.I.impl.F.specific_fn.loc8_24.2: = specific_function %C.as.I.impl.F, @C.as.I.impl.F.loc8_24.1(%Y) [symbolic = %C.as.I.impl.F.specific_fn.loc8_24.2 (constants.%C.as.I.impl.F.specific_fn)] // CHECK:STDOUT: %C: type = class_type @C, @C(%Y) [symbolic = %C (constants.%C.6b1ed7.2)] -// CHECK:STDOUT: %require_complete: = require_complete_type %C [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type %C [symbolic = %require_complete (constants.%require_complete.e14)] // CHECK:STDOUT: %C.val: @C.as.I.impl.F.loc8_24.2.%C (%C.6b1ed7.2) = struct_value () [symbolic = %C.val (constants.%C.val)] // CHECK:STDOUT: %.9: ref @C.as.I.impl.F.loc8_24.2.%C (%C.6b1ed7.2) = temporary invalid, %C.val [symbolic = %.9 (constants.%.e66)] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %C, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)] +// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %C, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.22d)] // CHECK:STDOUT: %Destroy.facet.3: %Destroy.type = facet_value %C, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.3 (constants.%Destroy.facet.886)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Destroy.facet.3) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.ba0)] -// CHECK:STDOUT: %.10: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet.3 [symbolic = %.10 (constants.%.854)] -// CHECK:STDOUT: %impl.elem0.2: @C.as.I.impl.F.loc8_24.2.%.10 (%.854) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.2 (constants.%impl.elem0)] -// CHECK:STDOUT: %bound_method.3: = bound_method %.9, %impl.elem0.2 [symbolic = %bound_method.3 (constants.%bound_method.3e7)] -// CHECK:STDOUT: %specific_impl_fn.2: = specific_impl_function %impl.elem0.2, @Destroy.WithSelf.Op.1(%Destroy.facet.3) [symbolic = %specific_impl_fn.2 (constants.%specific_impl_fn)] -// CHECK:STDOUT: %bound_method.4: = bound_method %.9, %specific_impl_fn.2 [symbolic = %bound_method.4 (constants.%bound_method.ef4)] +// 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.434)] +// CHECK:STDOUT: %.10: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type, %Destroy.facet.3 [symbolic = %.10 (constants.%.538)] +// CHECK:STDOUT: %impl.elem2.2: @C.as.I.impl.F.loc8_24.2.%.10 (%.538) = 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.5ab)] +// 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.463)] +// CHECK:STDOUT: %bound_method.4: = bound_method %.9, %specific_impl_fn.2 [symbolic = %bound_method.4 (constants.%bound_method.bf9)] // 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: @@ -339,22 +362,31 @@ fn G() { // CHECK:STDOUT: %.5: ref @C.as.I.impl.F.loc8_24.2.%C (%C.6b1ed7.2) = temporary %.2, %.4 [symbolic = %.9 (constants.%.e66)] // CHECK:STDOUT: %.6: @C.as.I.impl.F.loc8_24.2.%C (%C.6b1ed7.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: %Op.ref: %Destroy.assoc_type = name_ref Op, imports.%Core.import_ref.c64 [concrete = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0.1: @C.as.I.impl.F.loc8_24.2.%.10 (%.854) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.2 (constants.%impl.elem0)] -// CHECK:STDOUT: %bound_method.1: = bound_method %.5, %impl.elem0.1 [symbolic = %bound_method.3 (constants.%bound_method.3e7)] -// CHECK:STDOUT: %Destroy.facet.1: %Destroy.type = facet_value constants.%C.6b1ed7.2, (constants.%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.3 (constants.%Destroy.facet.886)] +// CHECK:STDOUT: %SelfDestruct.ref: %Destroy.assoc_type = name_ref SelfDestruct, imports.%Core.import_ref.e39 [concrete = constants.%assoc2] +// CHECK:STDOUT: %impl.elem2.1: @C.as.I.impl.F.loc8_24.2.%.10 (%.538) = impl_witness_access constants.%Destroy.lookup_impl_witness.22d, 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.5ab)] +// CHECK:STDOUT: %Destroy.facet.1: %Destroy.type = facet_value constants.%C.6b1ed7.2, (constants.%Destroy.lookup_impl_witness.22d) [symbolic = %Destroy.facet.3 (constants.%Destroy.facet.886)] // CHECK:STDOUT: %.7: %Destroy.type = converted constants.%C.6b1ed7.2, %Destroy.facet.1 [symbolic = %Destroy.facet.3 (constants.%Destroy.facet.886)] -// CHECK:STDOUT: %Destroy.facet.2: %Destroy.type = facet_value constants.%C.6b1ed7.2, (constants.%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.3 (constants.%Destroy.facet.886)] +// CHECK:STDOUT: %Destroy.facet.2: %Destroy.type = facet_value constants.%C.6b1ed7.2, (constants.%Destroy.lookup_impl_witness.22d) [symbolic = %Destroy.facet.3 (constants.%Destroy.facet.886)] // CHECK:STDOUT: %.8: %Destroy.type = converted constants.%C.6b1ed7.2, %Destroy.facet.2 [symbolic = %Destroy.facet.3 (constants.%Destroy.facet.886)] -// CHECK:STDOUT: %specific_impl_fn.1: = specific_impl_function %impl.elem0.1, @Destroy.WithSelf.Op.1(constants.%Destroy.facet.886) [symbolic = %specific_impl_fn.2 (constants.%specific_impl_fn)] -// CHECK:STDOUT: %bound_method.2: = bound_method %.5, %specific_impl_fn.1 [symbolic = %bound_method.4 (constants.%bound_method.ef4)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.2(%.5) +// CHECK:STDOUT: %specific_impl_fn.1: = specific_impl_function %impl.elem2.1, @Destroy.WithSelf.SelfDestruct.1(constants.%Destroy.facet.886) [symbolic = %specific_impl_fn.2 (constants.%specific_impl_fn.463)] +// CHECK:STDOUT: %bound_method.2: = bound_method %.5, %specific_impl_fn.1 [symbolic = %bound_method.4 (constants.%bound_method.bf9)] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %bound_method.2(%.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: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.2(%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: !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) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%X) { // CHECK:STDOUT: %X.patt.loc5_10.2 => constants.%X.patt // CHECK:STDOUT: %X.loc5_10.1 => constants.%X @@ -398,7 +430,7 @@ fn G() { // CHECK:STDOUT: %x.patt.loc8_16.2 => constants.%x.patt.bce // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%require_complete +// CHECK:STDOUT: %require_complete => constants.%require_complete.e14 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I.WithSelf(constants.%I.facet) { @@ -432,8 +464,9 @@ fn G() { // CHECK:STDOUT: %Self.dda: %I.type = symbolic_binding Self, 0 [symbolic] // CHECK:STDOUT: %I.WithSelf.F.type.418: type = fn_type @I.WithSelf.F, @I.WithSelf(%Self.dda) [symbolic] // CHECK:STDOUT: %I.WithSelf.F.ca5: %I.WithSelf.F.type.418 = struct_value () [symbolic] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [concrete] // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete] -// CHECK:STDOUT: %assoc0.232: %I.assoc_type = assoc_entity element0, imports.%Main.import_ref.9f7 [concrete] +// CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, imports.%Main.import_ref.9f7 [concrete] // CHECK:STDOUT: %Y: %empty_tuple.type = symbolic_binding Y, 0 [symbolic] // CHECK:STDOUT: %C.6b1ed7.2: type = class_type @C, @C(%Y) [symbolic] // CHECK:STDOUT: %.4ce: = impl_self_witness %C.6b1ed7.2, @I [symbolic] @@ -446,19 +479,19 @@ fn G() { // CHECK:STDOUT: %x.param_patt.bc9: %pattern_type.d0f = value_param_pattern [symbolic] // CHECK:STDOUT: %Y.patt: %pattern_type.cb1 = symbolic_binding_pattern Y, 0 [symbolic] // CHECK:STDOUT: %x.patt.bce: %pattern_type.d0f = wrapper_binding_pattern x, %x.param_patt.bc9 [symbolic] -// CHECK:STDOUT: %require_complete: = require_complete_type %C.6b1ed7.2 [symbolic] +// CHECK:STDOUT: %require_complete.e14: = require_complete_type %C.6b1ed7.2 [symbolic] // CHECK:STDOUT: %I.facet.38e: %I.type = facet_value %C.6b1ed7.2, (%I.impl_witness.079) [symbolic] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %C.6b1ed7.2, @Destroy [symbolic] -// CHECK:STDOUT: %Destroy.facet.886: %Destroy.type = facet_value %C.6b1ed7.2, (%Destroy.lookup_impl_witness) [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ba0: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Destroy.facet.886) [symbolic] -// CHECK:STDOUT: %.854: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.ba0, %Destroy.facet.886 [symbolic] -// CHECK:STDOUT: %impl.elem0: %.854 = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn: = specific_impl_function %impl.elem0, @Destroy.WithSelf.Op.1(%Destroy.facet.886) [symbolic] +// CHECK:STDOUT: %Destroy.lookup_impl_witness.22d: = lookup_impl_witness %C.6b1ed7.2, @Destroy [symbolic] +// CHECK:STDOUT: %Destroy.facet.886: %Destroy.type = facet_value %C.6b1ed7.2, (%Destroy.lookup_impl_witness.22d) [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.434: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.886) [symbolic] +// CHECK:STDOUT: %.538: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.434, %Destroy.facet.886 [symbolic] +// CHECK:STDOUT: %impl.elem2: %.538 = impl_witness_access %Destroy.lookup_impl_witness.22d, element2 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.463: = specific_impl_function %impl.elem2, @Destroy.WithSelf.SelfDestruct.1(%Destroy.facet.886) [symbolic] // CHECK:STDOUT: %C.val.2b2: %C.6b1ed7.2 = struct_value () [symbolic] // CHECK:STDOUT: %.e66: ref %C.6b1ed7.2 = temporary invalid, %C.val.2b2 [symbolic] -// CHECK:STDOUT: %bound_method.ef4: = bound_method %.e66, %specific_impl_fn [symbolic] -// CHECK:STDOUT: %bound_method.3e7: = bound_method %.e66, %impl.elem0 [symbolic] +// CHECK:STDOUT: %bound_method.bf9: = bound_method %.e66, %specific_impl_fn.463 [symbolic] +// CHECK:STDOUT: %bound_method.5ab: = bound_method %.e66, %impl.elem2 [symbolic] // CHECK:STDOUT: %C.as.I.impl.F.specific_fn.79d: = specific_function %C.as.I.impl.F.c1d971.2, @C.as.I.impl.F.2(%Y) [symbolic] // CHECK:STDOUT: %.3b5: = impl_self_witness %C.2c9, @I [concrete] // CHECK:STDOUT: %I.impl_witness.973: = impl_witness imports.%I.impl_witness_table, @C.as.I.impl(%empty_tuple) [concrete] @@ -478,13 +511,25 @@ fn G() { // CHECK:STDOUT: %C.as.I.impl.F.specific_fn.e3e0cd.2: = specific_function %C.as.I.impl.F.4ca3bc.1, @C.as.I.impl.F.2(%empty_tuple) [concrete] // CHECK:STDOUT: %C.val.168: %C.2c9 = struct_value () [concrete] // CHECK:STDOUT: %.790: ref %C.2c9 = temporary invalid, %C.val.168 [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc7_16.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc7_16.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.acd: %pattern_type.7b9 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.433: %pattern_type.7b9 = wrapper_binding_pattern self, %self.param_patt.acd [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc7_16.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc7_16.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.6c4ec3.2: = custom_witness (%Destroy.WithSelf.Op.403171.2), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.24b: %Destroy.type = facet_value %C.2c9, (%custom_witness.6c4ec3.2) [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.07b: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Destroy.facet.24b) [concrete] -// CHECK:STDOUT: %.34c: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.07b, %Destroy.facet.24b [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.790, %Destroy.WithSelf.Op.403171.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc7_16.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f8f19d.2: = custom_witness (%Destroy.WithSelf.Op.403171.2, %Destroy.WithSelf.SubobjectDestroy.d01daf.2, %Destroy.WithSelf.SelfDestruct.db3fdb.2), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.9ef: %Destroy.type = facet_value %C.2c9, (%custom_witness.f8f19d.2) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.f58: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.9ef) [concrete] +// CHECK:STDOUT: %.216: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.f58, %Destroy.facet.9ef [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.790, %Destroy.WithSelf.SelfDestruct.db3fdb.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -498,7 +543,7 @@ fn G() { // CHECK:STDOUT: %Main.import_ref.8f2: = import_ref Main//b, loc5_17, loaded [concrete = constants.%complete_type] // CHECK:STDOUT: %Main.import_ref.3fc = import_ref Main//b, inst{{[0-9A-F]+}} [no loc], unloaded // CHECK:STDOUT: %Main.import_ref.c90e1a.1: %empty_tuple.type = import_ref Main//b, loc5_10, loaded [symbolic = @C.%X (constants.%X)] -// CHECK:STDOUT: %Main.import_ref.1b3: %I.assoc_type = import_ref Main//a, loc5_14, loaded [concrete = constants.%assoc0.232] +// CHECK:STDOUT: %Main.import_ref.1b3: %I.assoc_type = import_ref Main//a, loc5_14, loaded [concrete = constants.%assoc0] // CHECK:STDOUT: %Main.F.006 = import_ref Main//a, F, unloaded // CHECK:STDOUT: %I.WithSelf.F.decl: %I.WithSelf.F.type.418 = fn_decl @I.WithSelf.F [symbolic = @I.WithSelf.%I.WithSelf.F (constants.%I.WithSelf.F.ca5)] {} {} // CHECK:STDOUT: %Main.import_ref.e59c42.2: %I.type = import_ref Main//a, loc4_13, loaded [symbolic = constants.%Self.dda] @@ -516,6 +561,37 @@ fn G() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc7_16.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc7_16.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc7_16.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.7b9 = ref_param_pattern [concrete = constants.%self.param_patt.acd] +// CHECK:STDOUT: %self.patt: %pattern_type.7b9 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.433] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C.2c9 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C.2c9 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc7_16.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.7b9 = ref_param_pattern [concrete = constants.%self.param_patt.acd] +// CHECK:STDOUT: %self.patt: %pattern_type.7b9 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.433] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C.2c9 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C.2c9 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .I = imports.%Main.I @@ -578,7 +654,7 @@ fn G() { // CHECK:STDOUT: %.loc7_7: %empty_tuple.type = converted %.loc7_6, %empty_tuple [concrete = constants.%empty_tuple] // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%empty_tuple) [concrete = constants.%C.2c9] // CHECK:STDOUT: %I.ref: type = name_ref I, imports.%Main.I [concrete = constants.%I.type] -// CHECK:STDOUT: %F.ref.loc7_11: %I.assoc_type = name_ref F, imports.%Main.import_ref.1b3 [concrete = constants.%assoc0.232] +// CHECK:STDOUT: %F.ref.loc7_11: %I.assoc_type = name_ref F, imports.%Main.import_ref.1b3 [concrete = constants.%assoc0] // CHECK:STDOUT: %I.facet: %I.type = facet_value %C, (constants.%I.impl_witness.973) [concrete = constants.%I.facet.b89] // CHECK:STDOUT: %.loc7_8: %I.type = converted %C, %I.facet [concrete = constants.%I.facet.b89] // CHECK:STDOUT: %impl.elem0: %.902 = impl_witness_access constants.%I.impl_witness.973, element0 [concrete = constants.%C.as.I.impl.F.4ca3bc.2] @@ -595,7 +671,7 @@ fn G() { // CHECK:STDOUT: %.loc7_16.6: ref %C.2c9 = temporary %.loc7_16.3, %.loc7_16.5 [concrete = constants.%.790] // CHECK:STDOUT: %.loc7_16.7: %C.2c9 = acquire_value %.loc7_16.6 [concrete = constants.%C.val.168] // CHECK:STDOUT: %C.as.I.impl.F.call: init %empty_tuple.type = call %C.as.I.impl.F.specific_fn(%.loc7_16.7) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.790) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.790) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -610,17 +686,17 @@ fn G() { // CHECK:STDOUT: %C.as.I.impl.F: @C.as.I.impl.F.1.%C.as.I.impl.F.type (%C.as.I.impl.F.type.c7d3b5.2) = struct_value () [symbolic = %C.as.I.impl.F (constants.%C.as.I.impl.F.c1d971.2)] // CHECK:STDOUT: %C.as.I.impl.F.specific_fn: = specific_function %C.as.I.impl.F, @C.as.I.impl.F.2(%Y) [symbolic = %C.as.I.impl.F.specific_fn (constants.%C.as.I.impl.F.specific_fn.79d)] // CHECK:STDOUT: %C: type = class_type @C, @C(%Y) [symbolic = %C (constants.%C.6b1ed7.2)] -// CHECK:STDOUT: %require_complete: = require_complete_type %C [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type %C [symbolic = %require_complete (constants.%require_complete.e14)] // CHECK:STDOUT: %C.val: @C.as.I.impl.F.1.%C (%C.6b1ed7.2) = struct_value () [symbolic = %C.val (constants.%C.val.2b2)] // CHECK:STDOUT: %.1: ref @C.as.I.impl.F.1.%C (%C.6b1ed7.2) = temporary invalid, %C.val [symbolic = %.1 (constants.%.e66)] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %C, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)] +// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %C, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.22d)] // CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %C, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet.886)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Destroy.facet) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.ba0)] -// CHECK:STDOUT: %.2: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet [symbolic = %.2 (constants.%.854)] -// CHECK:STDOUT: %impl.elem0: @C.as.I.impl.F.1.%.2 (%.854) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0 (constants.%impl.elem0)] -// CHECK:STDOUT: %bound_method.1: = bound_method %.1, %impl.elem0 [symbolic = %bound_method.1 (constants.%bound_method.3e7)] -// CHECK:STDOUT: %specific_impl_fn: = specific_impl_function %impl.elem0, @Destroy.WithSelf.Op.1(%Destroy.facet) [symbolic = %specific_impl_fn (constants.%specific_impl_fn)] -// CHECK:STDOUT: %bound_method.2: = bound_method %.1, %specific_impl_fn [symbolic = %bound_method.2 (constants.%bound_method.ef4)] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet) [symbolic = %Destroy.WithSelf.SelfDestruct.type (constants.%Destroy.WithSelf.SelfDestruct.type.434)] +// CHECK:STDOUT: %.2: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type, %Destroy.facet [symbolic = %.2 (constants.%.538)] +// CHECK:STDOUT: %impl.elem2: @C.as.I.impl.F.1.%.2 (%.538) = impl_witness_access %Destroy.lookup_impl_witness, element2 [symbolic = %impl.elem2 (constants.%impl.elem2)] +// CHECK:STDOUT: %bound_method.1: = bound_method %.1, %impl.elem2 [symbolic = %bound_method.1 (constants.%bound_method.5ab)] +// CHECK:STDOUT: %specific_impl_fn: = specific_impl_function %impl.elem2, @Destroy.WithSelf.SelfDestruct.1(%Destroy.facet) [symbolic = %specific_impl_fn (constants.%specific_impl_fn.463)] +// CHECK:STDOUT: %bound_method.2: = bound_method %.1, %specific_impl_fn [symbolic = %bound_method.2 (constants.%bound_method.bf9)] // CHECK:STDOUT: // CHECK:STDOUT: fn [thunk imports.%Main.F.b80 for imports.%I.WithSelf.F.decl, @I.WithSelf.F(constants.%I.facet.38e)]; // CHECK:STDOUT: } @@ -633,15 +709,33 @@ fn G() { // CHECK:STDOUT: %x.patt: @C.as.I.impl.F.2.%pattern_type (%pattern_type.d0f) = wrapper_binding_pattern x, %x.param_patt [symbolic = %x.patt (constants.%x.patt.bce)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %C [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type %C [symbolic = %require_complete (constants.%require_complete.e14)] // CHECK:STDOUT: // CHECK:STDOUT: fn; // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc7_16.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_16.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_16.2(%self.param: ref %C.2c9) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc7_16.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc7_16.2(%self.param: ref %C.2c9) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_16.2(%self.param: ref %C.2c9) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc7_16.2(%self.param: ref %C.2c9) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -695,7 +789,7 @@ fn G() { // CHECK:STDOUT: %x.patt => constants.%x.patt.bce // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%require_complete +// CHECK:STDOUT: %require_complete => constants.%require_complete.e14 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @I.WithSelf.F(constants.%I.facet.38e) {} @@ -733,14 +827,14 @@ fn G() { // CHECK:STDOUT: %require_complete => constants.%complete_type // CHECK:STDOUT: %C.val => constants.%C.val.168 // CHECK:STDOUT: %.1 => constants.%.790 -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.6c4ec3.2 -// CHECK:STDOUT: %Destroy.facet => constants.%Destroy.facet.24b -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.07b -// CHECK:STDOUT: %.2 => constants.%.34c -// CHECK:STDOUT: %impl.elem0 => constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %bound_method.1 => constants.%Destroy.WithSelf.Op.bound -// CHECK:STDOUT: %specific_impl_fn => constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %bound_method.2 => constants.%Destroy.WithSelf.Op.bound +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.f8f19d.2 +// CHECK:STDOUT: %Destroy.facet => constants.%Destroy.facet.9ef +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.f58 +// CHECK:STDOUT: %.2 => constants.%.216 +// CHECK:STDOUT: %impl.elem2 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %bound_method.1 => constants.%Destroy.WithSelf.SelfDestruct.bound +// CHECK:STDOUT: %specific_impl_fn => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %bound_method.2 => constants.%Destroy.WithSelf.SelfDestruct.bound // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @C.as.I.impl.F.2(constants.%empty_tuple) { diff --git a/toolchain/check/testdata/impl/lookup/canonical_query_self.carbon b/toolchain/check/testdata/impl/lookup/canonical_query_self.carbon index a389c2e46af8..21890f2d66b6 100644 --- a/toolchain/check/testdata/impl/lookup/canonical_query_self.carbon +++ b/toolchain/check/testdata/impl/lookup/canonical_query_self.carbon @@ -93,7 +93,7 @@ fn G() { // CHECK:STDOUT: %t.patt.4c5: %pattern_type.936 = wrapper_binding_pattern t, %t.param_patt.ed4 [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] -// CHECK:STDOUT: %require_complete: = require_complete_type %T.as_type [symbolic] +// CHECK:STDOUT: %require_complete.b4a: = require_complete_type %T.as_type [symbolic] // CHECK:STDOUT: %I.lookup_impl_witness: = lookup_impl_witness %T, @I [symbolic] // CHECK:STDOUT: %I.facet.d3d: %I.type = facet_value %T.as_type, (%I.lookup_impl_witness) [symbolic] // CHECK:STDOUT: %J.lookup_impl_witness: = lookup_impl_witness %T, @J [symbolic] @@ -105,10 +105,10 @@ fn G() { // CHECK:STDOUT: %J.WithSelf.JJ.type.2d7: type = fn_type @J.WithSelf.JJ, @J.WithSelf(%J.facet.cbc) [symbolic] // CHECK:STDOUT: %J.WithSelf.JJ.6d6: %J.WithSelf.JJ.type.2d7 = struct_value () [symbolic] // CHECK:STDOUT: %.443: type = fn_type_with_self_type %J.WithSelf.JJ.type.2d7, %J.facet.cbc [symbolic] -// CHECK:STDOUT: %impl.elem0: %.443 = impl_witness_access %J.lookup_impl_witness, element0 [symbolic] +// CHECK:STDOUT: %impl.elem0.2aa: %.443 = impl_witness_access %J.lookup_impl_witness, element0 [symbolic] // CHECK:STDOUT: %self.param_patt.ad3: %pattern_type.936 = value_param_pattern [symbolic] // CHECK:STDOUT: %self.patt.527: %pattern_type.936 = wrapper_binding_pattern self, %self.param_patt.ad3 [symbolic] -// CHECK:STDOUT: %specific_impl_fn: = specific_impl_function %impl.elem0, @J.WithSelf.JJ(%J.facet.cbc) [symbolic] +// CHECK:STDOUT: %specific_impl_fn.3ee: = specific_impl_function %impl.elem0.2aa, @J.WithSelf.JJ(%J.facet.cbc) [symbolic] // CHECK:STDOUT: %G.type: type = fn_type @G [concrete] // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] // CHECK:STDOUT: %C: type = class_type @C [concrete] @@ -141,9 +141,22 @@ fn G() { // CHECK:STDOUT: %.c59: type = fn_type_with_self_type %J.WithSelf.JJ.type.088, %J.facet.85d [concrete] // CHECK:STDOUT: %C.as.J.impl.JJ.bound: = bound_method %.5d3, %C.as.J.impl.JJ [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc40_8.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc40_8.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.967: %pattern_type.f79 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.2f2: %pattern_type.f79 = wrapper_binding_pattern self, %self.param_patt.967 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc40_8.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc40_8.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.5d3, %Destroy.WithSelf.Op.403171.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc40_8.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.5d3, %Destroy.WithSelf.SelfDestruct.db3fdb.2 [concrete] // CHECK:STDOUT: %facet_value: %facet_type = facet_value %C, (%I.impl_witness, %J.impl_witness) [concrete] // CHECK:STDOUT: %t.param_patt.5f8: %pattern_type.f79 = value_param_pattern [concrete] // CHECK:STDOUT: %t.patt.094: %pattern_type.f79 = wrapper_binding_pattern t, %t.param_patt.5f8 [concrete] @@ -163,6 +176,37 @@ fn G() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc40_8.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc40_8.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc40_8.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f79 = ref_param_pattern [concrete = constants.%self.param_patt.967] +// CHECK:STDOUT: %self.patt: %pattern_type.f79 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.2f2] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc40_8.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f79 = ref_param_pattern [concrete = constants.%self.param_patt.967] +// CHECK:STDOUT: %self.patt: %pattern_type.f79 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.2f2] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -345,15 +389,15 @@ fn G() { // CHECK:STDOUT: %t.patt.loc22_25.2: @F.%pattern_type (%pattern_type.936) = wrapper_binding_pattern t, %t.param_patt.loc22_25.2 [symbolic = %t.patt.loc22_25.2 (constants.%t.patt.4c5)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %T.as_type.loc22_27.1 [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type %T.as_type.loc22_27.1 [symbolic = %require_complete (constants.%require_complete.b4a)] // CHECK:STDOUT: %I.lookup_impl_witness: = lookup_impl_witness %T.loc22_15.1, @I [symbolic = %I.lookup_impl_witness (constants.%I.lookup_impl_witness)] // CHECK:STDOUT: %I.facet.loc26_18.2: %I.type = facet_value %T.as_type.loc22_27.1, (%I.lookup_impl_witness) [symbolic = %I.facet.loc26_18.2 (constants.%I.facet.d3d)] // CHECK:STDOUT: %J.lookup_impl_witness: = lookup_impl_witness %T.loc22_15.1, @J [symbolic = %J.lookup_impl_witness (constants.%J.lookup_impl_witness)] // CHECK:STDOUT: %J.facet.loc26_33.2: %J.type = facet_value %T.as_type.loc22_27.1, (%J.lookup_impl_witness) [symbolic = %J.facet.loc26_33.2 (constants.%J.facet.cbc)] // CHECK:STDOUT: %J.WithSelf.JJ.type: type = fn_type @J.WithSelf.JJ, @J.WithSelf(%J.facet.loc26_33.2) [symbolic = %J.WithSelf.JJ.type (constants.%J.WithSelf.JJ.type.2d7)] // CHECK:STDOUT: %.loc26_69: type = fn_type_with_self_type %J.WithSelf.JJ.type, %J.facet.loc26_33.2 [symbolic = %.loc26_69 (constants.%.443)] -// CHECK:STDOUT: %impl.elem0.loc26_69.2: @F.%.loc26_69 (%.443) = impl_witness_access %J.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc26_69.2 (constants.%impl.elem0)] -// CHECK:STDOUT: %specific_impl_fn.loc26_69.2: = specific_impl_function %impl.elem0.loc26_69.2, @J.WithSelf.JJ(%J.facet.loc26_33.2) [symbolic = %specific_impl_fn.loc26_69.2 (constants.%specific_impl_fn)] +// CHECK:STDOUT: %impl.elem0.loc26_69.2: @F.%.loc26_69 (%.443) = impl_witness_access %J.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc26_69.2 (constants.%impl.elem0.2aa)] +// CHECK:STDOUT: %specific_impl_fn.loc26_69.2: = specific_impl_function %impl.elem0.loc26_69.2, @J.WithSelf.JJ(%J.facet.loc26_33.2) [symbolic = %specific_impl_fn.loc26_69.2 (constants.%specific_impl_fn.3ee)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%t.param: @F.%T.as_type.loc22_27.1 (%T.as_type)) { // CHECK:STDOUT: !entry: @@ -384,13 +428,13 @@ fn G() { // CHECK:STDOUT: %as_type.loc26_67: type = facet_access_type %.loc26_63 [symbolic = %T.as_type.loc22_27.1 (constants.%T.as_type)] // CHECK:STDOUT: %.loc26_67: type = converted %.loc26_63, %as_type.loc26_67 [symbolic = %T.as_type.loc22_27.1 (constants.%T.as_type)] // CHECK:STDOUT: %JJ.ref: %J.assoc_type = name_ref JJ, @J.WithSelf.%assoc0 [concrete = constants.%assoc0.7d8] -// CHECK:STDOUT: %impl.elem0.loc26_69.1: @F.%.loc26_69 (%.443) = impl_witness_access constants.%J.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc26_69.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %impl.elem0.loc26_69.1: @F.%.loc26_69 (%.443) = impl_witness_access constants.%J.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc26_69.2 (constants.%impl.elem0.2aa)] // CHECK:STDOUT: %bound_method.loc26_69: = bound_method %t.ref, %impl.elem0.loc26_69.1 // CHECK:STDOUT: %J.facet.loc26_73.1: %J.type = facet_value constants.%T.as_type, (constants.%J.lookup_impl_witness) [symbolic = %J.facet.loc26_33.2 (constants.%J.facet.cbc)] // CHECK:STDOUT: %.loc26_73.1: %J.type = converted constants.%T.as_type, %J.facet.loc26_73.1 [symbolic = %J.facet.loc26_33.2 (constants.%J.facet.cbc)] // CHECK:STDOUT: %J.facet.loc26_73.2: %J.type = facet_value constants.%T.as_type, (constants.%J.lookup_impl_witness) [symbolic = %J.facet.loc26_33.2 (constants.%J.facet.cbc)] // CHECK:STDOUT: %.loc26_73.2: %J.type = converted constants.%T.as_type, %J.facet.loc26_73.2 [symbolic = %J.facet.loc26_33.2 (constants.%J.facet.cbc)] -// CHECK:STDOUT: %specific_impl_fn.loc26_69.1: = specific_impl_function %impl.elem0.loc26_69.1, @J.WithSelf.JJ(constants.%J.facet.cbc) [symbolic = %specific_impl_fn.loc26_69.2 (constants.%specific_impl_fn)] +// CHECK:STDOUT: %specific_impl_fn.loc26_69.1: = specific_impl_function %impl.elem0.loc26_69.1, @J.WithSelf.JJ(constants.%J.facet.cbc) [symbolic = %specific_impl_fn.loc26_69.2 (constants.%specific_impl_fn.3ee)] // CHECK:STDOUT: %bound_method.loc26_73: = bound_method %t.ref, %specific_impl_fn.loc26_69.1 // CHECK:STDOUT: %J.WithSelf.JJ.call: init %empty_tuple.type = call %bound_method.loc26_73(%t.ref) // CHECK:STDOUT: return @@ -435,7 +479,7 @@ fn G() { // CHECK:STDOUT: %bound_method: = bound_method %.loc40_8.2, %impl.elem0 [concrete = constants.%C.as.J.impl.JJ.bound] // CHECK:STDOUT: %.loc40_8.3: %C = acquire_value %.loc40_8.2 [concrete = constants.%C.val] // CHECK:STDOUT: %C.as.J.impl.JJ.call: init %empty_tuple.type = call %bound_method(%.loc40_8.3) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc40: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.5d3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc40: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.5d3) // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F] // CHECK:STDOUT: %C.ref.loc46_5: type = name_ref C, %C.decl [concrete = constants.%C] // CHECK:STDOUT: %.loc46_9.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] @@ -453,7 +497,7 @@ fn G() { // CHECK:STDOUT: %.loc46_11.2: ref %C = temporary %.loc46_9.2, %.loc46_11.1 [concrete = constants.%.5d3] // CHECK:STDOUT: %.loc46_11.3: %C = acquire_value %.loc46_11.2 [concrete = constants.%C.val] // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn(%.loc46_11.3) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc46: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.5d3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc46: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.5d3) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -467,10 +511,28 @@ fn G() { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc40_8.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc40_8.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc40_8.2(%self.param: ref %C) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc40_8.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc40_8.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc40_8.2(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc40_8.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/lookup/fail_poison_custom_witness.carbon b/toolchain/check/testdata/impl/lookup/fail_poison_custom_witness.carbon index bd0a6e8296e8..27dc29397407 100644 --- a/toolchain/check/testdata/impl/lookup/fail_poison_custom_witness.carbon +++ b/toolchain/check/testdata/impl/lookup/fail_poison_custom_witness.carbon @@ -14,10 +14,37 @@ package Core library "destroy"; +// TODO: uncomment when `require impls` adds a witness table entry. +// interface SubobjectDestroy { +// final fn Op(ref self) = "subobject.destroy"; +// } + interface Destroy { + // TODO: uncomment when `require impls` adds a witness table entry. + // require impls SubobjectDestroy; + + // TODO: change `Self` to `partial Self`. fn Op(ref self); + + // TODO: remove when `require impls` adds a witness table entry. + final fn SubobjectDestroy(unused ref self) { + // This function body is ignored by the toolchain. We can't use + // a built-in because the compiler treats it as an error. We + // should address this at some point, but it's not a high + // priority right now. + } + + final fn SelfDestruct(ref self) { + self.Op(); + self.SubobjectDestroy(); + } } +// TODO: uncomment when `require impls` adds a witness table entry. +// impl forall [T: SubobjectDestroy] partial T as Destroy { +// alias Op = T.Op; +// } + impl forall [T: type] T as Destroy { fn Op(unused ref self) {} } @@ -40,7 +67,7 @@ struct A { // CHECK:STDERR: class B { // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: fail_poison_custom_witness.carbon:[[@LINE-14]]:1: in import [InImport] -// CHECK:STDERR: destroy.carbon:8:1: note: the use tried to select the `impl` here, but a custom witness was already chosen [PoisonedImplLookupCustomResultNoteBadImpl] +// CHECK:STDERR: destroy.carbon:35:1: note: the use tried to select the `impl` here, but a custom witness was already chosen [PoisonedImplLookupCustomResultNoteBadImpl] // CHECK:STDERR: impl forall [T: type] T as Destroy { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: diff --git a/toolchain/check/testdata/impl/lookup/import.carbon b/toolchain/check/testdata/impl/lookup/import.carbon index 3acf9241add7..ecd49a14cd4e 100644 --- a/toolchain/check/testdata/impl/lookup/import.carbon +++ b/toolchain/check/testdata/impl/lookup/import.carbon @@ -1783,7 +1783,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %pattern_type.615: type = pattern_type %Self.as_type.59a [symbolic] // CHECK:STDOUT: %self.param_patt.f96: %pattern_type.615 = value_param_pattern [symbolic] // CHECK:STDOUT: %self.patt.94a: %pattern_type.615 = wrapper_binding_pattern self, %self.param_patt.f96 [symbolic] -// CHECK:STDOUT: %require_complete: = require_complete_type %Self.as_type.59a [symbolic] +// CHECK:STDOUT: %require_complete.3ff: = require_complete_type %Self.as_type.59a [symbolic] // CHECK:STDOUT: %.9fa: = impl_self_witness %AnyParam.591, @Y [concrete] // CHECK:STDOUT: %Y.impl_witness: = impl_witness @AnyParam.as.Y.impl.%Y.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type.f0f: type = pattern_type %AnyParam.591 [concrete] @@ -1801,11 +1801,24 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete] // CHECK:STDOUT: %AnyParam.val: %AnyParam.591 = struct_value () [concrete] // CHECK:STDOUT: %Y.assoc_type: type = assoc_entity_type @Y [concrete] -// CHECK:STDOUT: %assoc0.970: %Y.assoc_type = assoc_entity element0, imports.%PackageHasParam.import_ref.ee7 [concrete] +// CHECK:STDOUT: %assoc0: %Y.assoc_type = assoc_entity element0, imports.%PackageHasParam.import_ref.ee7 [concrete] // CHECK:STDOUT: %.5a4: type = fn_type_with_self_type %Y.WithSelf.K.type.bd4, %Y.facet [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc13_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc13_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.d8d: %pattern_type.f0f = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.af8: %pattern_type.f0f = wrapper_binding_pattern self, %self.param_patt.d8d [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc13_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc13_3.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc13_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1825,7 +1838,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %PackageHasParam.import_ref.b3b: type = import_ref PackageHasParam//default, loc4_17, loaded [symbolic = @AnyParam.%T (constants.%T)] // CHECK:STDOUT: %PackageHasParam.import_ref.b42: @AnyParam.%T (%T) = import_ref PackageHasParam//default, loc4_26, loaded [symbolic = @AnyParam.%X (constants.%X)] // CHECK:STDOUT: %PackageHasParam.Y: type = import_ref PackageHasParam//default, Y, loaded [concrete = constants.%Y.type] -// CHECK:STDOUT: %PackageHasParam.import_ref.03c: %Y.assoc_type = import_ref PackageHasParam//default, loc7_21, loaded [concrete = constants.%assoc0.970] +// CHECK:STDOUT: %PackageHasParam.import_ref.03c: %Y.assoc_type = import_ref PackageHasParam//default, loc7_21, loaded [concrete = constants.%assoc0] // CHECK:STDOUT: %PackageHasParam.K: @Y.WithSelf.%Y.WithSelf.K.type (%Y.WithSelf.K.type.977) = import_ref PackageHasParam//default, K, loaded [symbolic = @Y.WithSelf.%Y.WithSelf.K (constants.%Y.WithSelf.K.d2d)] // CHECK:STDOUT: %PackageHasParam.import_ref.fa191b.2: %Y.type = import_ref PackageHasParam//default, loc6_13, loaded [symbolic = constants.%Self.aff] // CHECK:STDOUT: %PackageHasParam.import_ref.2ff5 = import_ref PackageHasParam//default, loc6_13, unloaded @@ -1833,6 +1846,37 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc13_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc13_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc13_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f0f = ref_param_pattern [concrete = constants.%self.param_patt.d8d] +// CHECK:STDOUT: %self.patt: %pattern_type.f0f = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.af8] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %AnyParam.591 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %AnyParam.591 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc13_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f0f = ref_param_pattern [concrete = constants.%self.param_patt.d8d] +// CHECK:STDOUT: %self.patt: %pattern_type.f0f = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.af8] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %AnyParam.591 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %AnyParam.591 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -1935,7 +1979,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %self.patt: @Y.WithSelf.K.%pattern_type (%pattern_type.615) = wrapper_binding_pattern self, %self.param_patt [symbolic = %self.patt (constants.%self.patt.94a)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %Self.as_type [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type %Self.as_type [symbolic = %require_complete (constants.%require_complete.3ff)] // CHECK:STDOUT: // CHECK:STDOUT: fn; // CHECK:STDOUT: } @@ -1966,20 +2010,38 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %obj.ref: ref %AnyParam.591 = name_ref obj, %obj // CHECK:STDOUT: %PackageHasParam.ref.loc14: = name_ref PackageHasParam, imports.%PackageHasParam [concrete = imports.%PackageHasParam] // CHECK:STDOUT: %Y.ref: type = name_ref Y, imports.%PackageHasParam.Y [concrete = constants.%Y.type] -// CHECK:STDOUT: %K.ref: %Y.assoc_type = name_ref K, imports.%PackageHasParam.import_ref.03c [concrete = constants.%assoc0.970] +// CHECK:STDOUT: %K.ref: %Y.assoc_type = name_ref K, imports.%PackageHasParam.import_ref.03c [concrete = constants.%assoc0] // CHECK:STDOUT: %impl.elem0: %.5a4 = impl_witness_access constants.%Y.impl_witness, element0 [concrete = constants.%AnyParam.as.Y.impl.K] // CHECK:STDOUT: %bound_method: = bound_method %obj.ref, %impl.elem0 // CHECK:STDOUT: %.loc14: %AnyParam.591 = acquire_value %obj.ref // CHECK:STDOUT: %AnyParam.as.Y.impl.K.call: init %empty_tuple.type = call %bound_method(%.loc14) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %obj.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%obj.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %obj.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%obj.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc13_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc13_3.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc13_3.2(%self.param: ref %AnyParam.591) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc13_3.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc13_3.2(%self.param: ref %AnyParam.591) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc13_3.2(%self.param: ref %AnyParam.591) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc13_3.2(%self.param: ref %AnyParam.591) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2077,9 +2139,9 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %pattern_type.615: type = pattern_type %Self.as_type.59a [symbolic] // CHECK:STDOUT: %self.param_patt.f96: %pattern_type.615 = value_param_pattern [symbolic] // CHECK:STDOUT: %self.patt.94a: %pattern_type.615 = wrapper_binding_pattern self, %self.param_patt.f96 [symbolic] -// CHECK:STDOUT: %require_complete: = require_complete_type %Self.as_type.59a [symbolic] +// CHECK:STDOUT: %require_complete.3ff: = require_complete_type %Self.as_type.59a [symbolic] // CHECK:STDOUT: %Y.assoc_type: type = assoc_entity_type @Y [concrete] -// CHECK:STDOUT: %assoc0.970: %Y.assoc_type = assoc_entity element0, imports.%PackageHasParam.import_ref.ee7 [concrete] +// CHECK:STDOUT: %assoc0: %Y.assoc_type = assoc_entity element0, imports.%PackageHasParam.import_ref.ee7 [concrete] // CHECK:STDOUT: %Y.impl_witness: = impl_witness imports.%Y.impl_witness_table [concrete] // CHECK:STDOUT: %Y.facet: %Y.type = facet_value %AnyParam.591, (%Y.impl_witness) [concrete] // CHECK:STDOUT: %Y.WithSelf.K.type.a87: type = fn_type @Y.WithSelf.K, @Y.WithSelf(%Y.facet) [concrete] @@ -2088,8 +2150,21 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %AnyParam.as.Y.impl.K.type: type = fn_type @AnyParam.as.Y.impl.K [concrete] // CHECK:STDOUT: %AnyParam.as.Y.impl.K: %AnyParam.as.Y.impl.K.type = struct_value () [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc8_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.d8d: %pattern_type.f0f = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.af8: %pattern_type.f0f = wrapper_binding_pattern self, %self.param_patt.d8d [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc8_3.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -2116,7 +2191,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %PackageGenericInterface.import_ref.b00 = import_ref PackageGenericInterface//default, loc6_37, unloaded // CHECK:STDOUT: %PackageGenericInterface.import_ref.b3bc94.2: type = import_ref PackageGenericInterface//default, loc6_29, loaded [symbolic = @GenericInterface.%U (constants.%U)] // CHECK:STDOUT: %PackageHasParam.Y: type = import_ref PackageHasParam//default, Y, loaded [concrete = constants.%Y.type] -// CHECK:STDOUT: %PackageHasParam.import_ref.03c: %Y.assoc_type = import_ref PackageHasParam//default, loc7_21, loaded [concrete = constants.%assoc0.970] +// CHECK:STDOUT: %PackageHasParam.import_ref.03c: %Y.assoc_type = import_ref PackageHasParam//default, loc7_21, loaded [concrete = constants.%assoc0] // CHECK:STDOUT: %PackageHasParam.K = import_ref PackageHasParam//default, K, unloaded // CHECK:STDOUT: %PackageHasParam.import_ref.fa191b.2: %Y.type = import_ref PackageHasParam//default, loc6_13, loaded [symbolic = constants.%Self.aff] // CHECK:STDOUT: %PackageHasParam.import_ref.2ff5 = import_ref PackageHasParam//default, loc6_13, unloaded @@ -2129,6 +2204,37 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc8_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f0f = ref_param_pattern [concrete = constants.%self.param_patt.d8d] +// CHECK:STDOUT: %self.patt: %pattern_type.f0f = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.af8] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %AnyParam.591 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %AnyParam.591 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc8_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f0f = ref_param_pattern [concrete = constants.%self.param_patt.d8d] +// CHECK:STDOUT: %self.patt: %pattern_type.f0f = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.af8] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %AnyParam.591 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %AnyParam.591 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -2212,13 +2318,13 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %obj.ref: ref %AnyParam.591 = name_ref obj, %obj // CHECK:STDOUT: %PackageHasParam.ref.loc10: = name_ref PackageHasParam, imports.%PackageHasParam [concrete = imports.%PackageHasParam] // CHECK:STDOUT: %Y.ref: type = name_ref Y, imports.%PackageHasParam.Y [concrete = constants.%Y.type] -// CHECK:STDOUT: %K.ref: %Y.assoc_type = name_ref K, imports.%PackageHasParam.import_ref.03c [concrete = constants.%assoc0.970] +// CHECK:STDOUT: %K.ref: %Y.assoc_type = name_ref K, imports.%PackageHasParam.import_ref.03c [concrete = constants.%assoc0] // CHECK:STDOUT: %impl.elem0: %.f2f = impl_witness_access constants.%Y.impl_witness, element0 [concrete = constants.%AnyParam.as.Y.impl.K] // CHECK:STDOUT: %bound_method: = bound_method %obj.ref, %impl.elem0 // CHECK:STDOUT: %.loc10: %AnyParam.591 = acquire_value %obj.ref // CHECK:STDOUT: %AnyParam.as.Y.impl.K.call: init %empty_tuple.type = call %bound_method(%.loc10) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %obj.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%obj.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %obj.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%obj.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2230,17 +2336,35 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %self.patt: @Y.WithSelf.K.%pattern_type (%pattern_type.615) = wrapper_binding_pattern self, %self.param_patt [symbolic = %self.patt (constants.%self.patt.94a)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %Self.as_type [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type %Self.as_type [symbolic = %require_complete (constants.%require_complete.3ff)] // CHECK:STDOUT: // CHECK:STDOUT: fn; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @AnyParam.as.Y.impl.K [from "has_generic_interface.carbon"]; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.2(%self.param: ref %AnyParam.591) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.2(%self.param: ref %AnyParam.591) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.2(%self.param: ref %AnyParam.591) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.2(%self.param: ref %AnyParam.591) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2323,7 +2447,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %pattern_type.615: type = pattern_type %Self.as_type.59a [symbolic] // CHECK:STDOUT: %self.param_patt.f96: %pattern_type.615 = value_param_pattern [symbolic] // CHECK:STDOUT: %self.patt.94a: %pattern_type.615 = wrapper_binding_pattern self, %self.param_patt.f96 [symbolic] -// CHECK:STDOUT: %require_complete: = require_complete_type %Self.as_type.59a [symbolic] +// CHECK:STDOUT: %require_complete.3ff: = require_complete_type %Self.as_type.59a [symbolic] // CHECK:STDOUT: %.cce: = impl_self_witness %AnyParam.21c, @Y [concrete] // CHECK:STDOUT: %Y.impl_witness: = impl_witness @AnyParam.as.Y.impl.%Y.impl_witness_table [concrete] // CHECK:STDOUT: %pattern_type.005: type = pattern_type %AnyParam.21c [concrete] @@ -2341,11 +2465,24 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete] // CHECK:STDOUT: %AnyParam.val: %AnyParam.21c = struct_value () [concrete] // CHECK:STDOUT: %Y.assoc_type: type = assoc_entity_type @Y [concrete] -// CHECK:STDOUT: %assoc0.970: %Y.assoc_type = assoc_entity element0, imports.%PackageHasParam.import_ref.ee7 [concrete] +// CHECK:STDOUT: %assoc0: %Y.assoc_type = assoc_entity element0, imports.%PackageHasParam.import_ref.ee7 [concrete] // CHECK:STDOUT: %.66a: type = fn_type_with_self_type %Y.WithSelf.K.type.2f6, %Y.facet [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc13_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc13_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.387: %pattern_type.005 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.357: %pattern_type.005 = wrapper_binding_pattern self, %self.param_patt.387 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc13_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc13_3.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc13_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -2365,7 +2502,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %PackageHasParam.import_ref.b3b: type = import_ref PackageHasParam//default, loc4_17, loaded [symbolic = @AnyParam.%T (constants.%T)] // CHECK:STDOUT: %PackageHasParam.import_ref.b42: @AnyParam.%T (%T) = import_ref PackageHasParam//default, loc4_26, loaded [symbolic = @AnyParam.%X (constants.%X)] // CHECK:STDOUT: %PackageHasParam.Y: type = import_ref PackageHasParam//default, Y, loaded [concrete = constants.%Y.type] -// CHECK:STDOUT: %PackageHasParam.import_ref.03c: %Y.assoc_type = import_ref PackageHasParam//default, loc7_21, loaded [concrete = constants.%assoc0.970] +// CHECK:STDOUT: %PackageHasParam.import_ref.03c: %Y.assoc_type = import_ref PackageHasParam//default, loc7_21, loaded [concrete = constants.%assoc0] // CHECK:STDOUT: %PackageHasParam.K: @Y.WithSelf.%Y.WithSelf.K.type (%Y.WithSelf.K.type.977) = import_ref PackageHasParam//default, K, loaded [symbolic = @Y.WithSelf.%Y.WithSelf.K (constants.%Y.WithSelf.K.d2d)] // CHECK:STDOUT: %PackageHasParam.import_ref.fa191b.2: %Y.type = import_ref PackageHasParam//default, loc6_13, loaded [symbolic = constants.%Self.aff] // CHECK:STDOUT: %PackageHasParam.import_ref.2ff5 = import_ref PackageHasParam//default, loc6_13, unloaded @@ -2373,6 +2510,37 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc13_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc13_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc13_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.005 = ref_param_pattern [concrete = constants.%self.param_patt.387] +// CHECK:STDOUT: %self.patt: %pattern_type.005 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.357] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %AnyParam.21c = ref_param call_param0 +// CHECK:STDOUT: %self: ref %AnyParam.21c = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc13_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.005 = ref_param_pattern [concrete = constants.%self.param_patt.387] +// CHECK:STDOUT: %self.patt: %pattern_type.005 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.357] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %AnyParam.21c = ref_param call_param0 +// CHECK:STDOUT: %self: ref %AnyParam.21c = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -2470,7 +2638,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %self.patt: @Y.WithSelf.K.%pattern_type (%pattern_type.615) = wrapper_binding_pattern self, %self.param_patt [symbolic = %self.patt (constants.%self.patt.94a)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %Self.as_type [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type %Self.as_type [symbolic = %require_complete (constants.%require_complete.3ff)] // CHECK:STDOUT: // CHECK:STDOUT: fn; // CHECK:STDOUT: } @@ -2501,20 +2669,38 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %obj.ref: ref %AnyParam.21c = name_ref obj, %obj // CHECK:STDOUT: %PackageHasParam.ref.loc14: = name_ref PackageHasParam, imports.%PackageHasParam [concrete = imports.%PackageHasParam] // CHECK:STDOUT: %Y.ref: type = name_ref Y, imports.%PackageHasParam.Y [concrete = constants.%Y.type] -// CHECK:STDOUT: %K.ref: %Y.assoc_type = name_ref K, imports.%PackageHasParam.import_ref.03c [concrete = constants.%assoc0.970] +// CHECK:STDOUT: %K.ref: %Y.assoc_type = name_ref K, imports.%PackageHasParam.import_ref.03c [concrete = constants.%assoc0] // CHECK:STDOUT: %impl.elem0: %.66a = impl_witness_access constants.%Y.impl_witness, element0 [concrete = constants.%AnyParam.as.Y.impl.K] // CHECK:STDOUT: %bound_method: = bound_method %obj.ref, %impl.elem0 // CHECK:STDOUT: %.loc14: %AnyParam.21c = acquire_value %obj.ref // CHECK:STDOUT: %AnyParam.as.Y.impl.K.call: init %empty_tuple.type = call %bound_method(%.loc14) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %obj.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%obj.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %obj.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%obj.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc13_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc13_3.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc13_3.2(%self.param: ref %AnyParam.21c) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc13_3.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc13_3.2(%self.param: ref %AnyParam.21c) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc13_3.2(%self.param: ref %AnyParam.21c) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc13_3.2(%self.param: ref %AnyParam.21c) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2608,9 +2794,9 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %pattern_type.615: type = pattern_type %Self.as_type.59a [symbolic] // CHECK:STDOUT: %self.param_patt.f96: %pattern_type.615 = value_param_pattern [symbolic] // CHECK:STDOUT: %self.patt.94a: %pattern_type.615 = wrapper_binding_pattern self, %self.param_patt.f96 [symbolic] -// CHECK:STDOUT: %require_complete: = require_complete_type %Self.as_type.59a [symbolic] +// CHECK:STDOUT: %require_complete.3ff: = require_complete_type %Self.as_type.59a [symbolic] // CHECK:STDOUT: %Y.assoc_type: type = assoc_entity_type @Y [concrete] -// CHECK:STDOUT: %assoc0.970: %Y.assoc_type = assoc_entity element0, imports.%PackageHasParam.import_ref.ee7 [concrete] +// CHECK:STDOUT: %assoc0: %Y.assoc_type = assoc_entity element0, imports.%PackageHasParam.import_ref.ee7 [concrete] // CHECK:STDOUT: %Y.impl_witness: = impl_witness imports.%Y.impl_witness_table [concrete] // CHECK:STDOUT: %Y.facet: %Y.type = facet_value %AnyParam.21c, (%Y.impl_witness) [concrete] // CHECK:STDOUT: %Y.WithSelf.K.type.4f4: type = fn_type @Y.WithSelf.K, @Y.WithSelf(%Y.facet) [concrete] @@ -2619,8 +2805,21 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %AnyParam.as.Y.impl.K.type: type = fn_type @AnyParam.as.Y.impl.K [concrete] // CHECK:STDOUT: %AnyParam.as.Y.impl.K: %AnyParam.as.Y.impl.K.type = struct_value () [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc8_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.387: %pattern_type.005 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.357: %pattern_type.005 = wrapper_binding_pattern self, %self.param_patt.387 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc8_3.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -2648,7 +2847,7 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %PackageGenericClass.import_ref.772 = import_ref PackageGenericClass//default, inst{{[0-9A-F]+}} [no loc], unloaded // CHECK:STDOUT: %PackageGenericClass.import_ref.b3b: type = import_ref PackageGenericClass//default, loc6_21, loaded [symbolic = @GenericClass.%U (constants.%U)] // CHECK:STDOUT: %PackageHasParam.Y: type = import_ref PackageHasParam//default, Y, loaded [concrete = constants.%Y.type] -// CHECK:STDOUT: %PackageHasParam.import_ref.03c: %Y.assoc_type = import_ref PackageHasParam//default, loc7_21, loaded [concrete = constants.%assoc0.970] +// CHECK:STDOUT: %PackageHasParam.import_ref.03c: %Y.assoc_type = import_ref PackageHasParam//default, loc7_21, loaded [concrete = constants.%assoc0] // CHECK:STDOUT: %PackageHasParam.K = import_ref PackageHasParam//default, K, unloaded // CHECK:STDOUT: %PackageHasParam.import_ref.fa191b.2: %Y.type = import_ref PackageHasParam//default, loc6_13, loaded [symbolic = constants.%Self.aff] // CHECK:STDOUT: %PackageHasParam.import_ref.2ff5 = import_ref PackageHasParam//default, loc6_13, unloaded @@ -2661,6 +2860,37 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc8_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.005 = ref_param_pattern [concrete = constants.%self.param_patt.387] +// CHECK:STDOUT: %self.patt: %pattern_type.005 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.357] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %AnyParam.21c = ref_param call_param0 +// CHECK:STDOUT: %self: ref %AnyParam.21c = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc8_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.005 = ref_param_pattern [concrete = constants.%self.param_patt.387] +// CHECK:STDOUT: %self.patt: %pattern_type.005 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.357] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %AnyParam.21c = ref_param call_param0 +// CHECK:STDOUT: %self: ref %AnyParam.21c = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -2741,13 +2971,13 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %obj.ref: ref %AnyParam.21c = name_ref obj, %obj // CHECK:STDOUT: %PackageHasParam.ref.loc9: = name_ref PackageHasParam, imports.%PackageHasParam [concrete = imports.%PackageHasParam] // CHECK:STDOUT: %Y.ref: type = name_ref Y, imports.%PackageHasParam.Y [concrete = constants.%Y.type] -// CHECK:STDOUT: %K.ref: %Y.assoc_type = name_ref K, imports.%PackageHasParam.import_ref.03c [concrete = constants.%assoc0.970] +// CHECK:STDOUT: %K.ref: %Y.assoc_type = name_ref K, imports.%PackageHasParam.import_ref.03c [concrete = constants.%assoc0] // CHECK:STDOUT: %impl.elem0: %.dff = impl_witness_access constants.%Y.impl_witness, element0 [concrete = constants.%AnyParam.as.Y.impl.K] // CHECK:STDOUT: %bound_method: = bound_method %obj.ref, %impl.elem0 // CHECK:STDOUT: %.loc9: %AnyParam.21c = acquire_value %obj.ref // CHECK:STDOUT: %AnyParam.as.Y.impl.K.call: init %empty_tuple.type = call %bound_method(%.loc9) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %obj.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%obj.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %obj.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%obj.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2759,17 +2989,35 @@ fn Test(c: HasExtraInterfaces.C(type)) { // CHECK:STDOUT: %self.patt: @Y.WithSelf.K.%pattern_type (%pattern_type.615) = wrapper_binding_pattern self, %self.param_patt [symbolic = %self.patt (constants.%self.patt.94a)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %Self.as_type [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type %Self.as_type [symbolic = %require_complete (constants.%require_complete.3ff)] // CHECK:STDOUT: // CHECK:STDOUT: fn; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @AnyParam.as.Y.impl.K [from "has_generic_class.carbon"]; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.2(%self.param: ref %AnyParam.21c) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.2(%self.param: ref %AnyParam.21c) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.2(%self.param: ref %AnyParam.21c) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.2(%self.param: ref %AnyParam.21c) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/lookup/transitive.carbon b/toolchain/check/testdata/impl/lookup/transitive.carbon index 642df6da6939..8f0491fed945 100644 --- a/toolchain/check/testdata/impl/lookup/transitive.carbon +++ b/toolchain/check/testdata/impl/lookup/transitive.carbon @@ -327,6 +327,7 @@ fn Call() { // CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] +// CHECK:STDOUT: %pattern_type.98b: type = pattern_type %C [concrete] // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete] // CHECK:STDOUT: %Self.dda: %I.type = symbolic_binding Self, 0 [symbolic] // CHECK:STDOUT: %I.WithSelf.F.type.418: type = fn_type @I.WithSelf.F, @I.WithSelf(%Self.dda) [symbolic] @@ -336,7 +337,7 @@ fn Call() { // CHECK:STDOUT: %self.param_patt.58e: %pattern_type.b3a = value_param_pattern [symbolic] // CHECK:STDOUT: %self.patt.b4c: %pattern_type.b3a = wrapper_binding_pattern self, %self.param_patt.58e [symbolic] // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete] -// CHECK:STDOUT: %assoc0.232: %I.assoc_type = assoc_entity element0, imports.%Main.import_ref.9f7 [concrete] +// CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, imports.%Main.import_ref.9f7 [concrete] // CHECK:STDOUT: %I.impl_witness: = impl_witness imports.%I.impl_witness_table [concrete] // CHECK:STDOUT: %I.facet: %I.type = facet_value %C, (%I.impl_witness) [concrete] // CHECK:STDOUT: %I.WithSelf.F.type.03f: type = fn_type @I.WithSelf.F, @I.WithSelf(%I.facet) [concrete] @@ -345,8 +346,21 @@ fn Call() { // CHECK:STDOUT: %C.as.I.impl.F.type: type = fn_type @C.as.I.impl.F [concrete] // CHECK:STDOUT: %C.as.I.impl.F: %C.as.I.impl.F.type = struct_value () [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_7.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc9_7.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.99a: %pattern_type.98b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.cbd: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt.99a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_7.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc9_7.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9_7.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -359,7 +373,7 @@ fn Call() { // CHECK:STDOUT: } // CHECK:STDOUT: %Main.import_ref.8db: = import_ref Main//get, inst{{[0-9A-F]+}} [indirect], loaded [concrete = constants.%complete_type] // CHECK:STDOUT: %Main.import_ref.0a8 = import_ref Main//get, inst{{[0-9A-F]+}} [indirect], unloaded -// CHECK:STDOUT: %Main.import_ref.1b3: %I.assoc_type = import_ref Main//i, loc4_25, loaded [concrete = constants.%assoc0.232] +// CHECK:STDOUT: %Main.import_ref.1b3: %I.assoc_type = import_ref Main//i, loc4_25, loaded [concrete = constants.%assoc0] // CHECK:STDOUT: %Main.F = import_ref Main//i, F, unloaded // CHECK:STDOUT: %Main.import_ref.e59c42.2: %I.type = import_ref Main//i, loc4_13, loaded [symbolic = constants.%Self.dda] // CHECK:STDOUT: %Main.import_ref.223 = import_ref Main//i, loc4_13, unloaded @@ -372,6 +386,37 @@ fn Call() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_7.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc9_7.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_7.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc9_7.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Get = imports.%Main.Get @@ -411,14 +456,14 @@ fn Call() { // CHECK:STDOUT: %.loc9_7.1: ref %C = temporary_storage // CHECK:STDOUT: %Get.call: init %C to %.loc9_7.1 = call %Get.ref() // CHECK:STDOUT: %I.ref: type = name_ref I, imports.%Main.I [concrete = constants.%I.type] -// CHECK:STDOUT: %F.ref: %I.assoc_type = name_ref F, imports.%Main.import_ref.1b3 [concrete = constants.%assoc0.232] +// CHECK:STDOUT: %F.ref: %I.assoc_type = name_ref F, imports.%Main.import_ref.1b3 [concrete = constants.%assoc0] // CHECK:STDOUT: %impl.elem0: %.77f = impl_witness_access constants.%I.impl_witness, element0 [concrete = constants.%C.as.I.impl.F] // CHECK:STDOUT: %bound_method: = bound_method %Get.call, %impl.elem0 // CHECK:STDOUT: %.loc9_7.2: ref %C = temporary %.loc9_7.1, %Get.call // CHECK:STDOUT: %.loc9_7.3: %C = acquire_value %.loc9_7.2 // CHECK:STDOUT: %C.as.I.impl.F.call: init %empty_tuple.type = call %bound_method(%.loc9_7.3) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.loc9_7.2, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%.loc9_7.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc9_7.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc9_7.2) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -436,10 +481,28 @@ fn Call() { // CHECK:STDOUT: // CHECK:STDOUT: fn @C.as.I.impl.F [from "c.carbon"]; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_7.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_7.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_7.2(%self.param: ref %C) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_7.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_7.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_7.2(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_7.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/index/expr_category.carbon b/toolchain/check/testdata/index/expr_category.carbon index 76344b06ab29..91daa6820afc 100644 --- a/toolchain/check/testdata/index/expr_category.carbon +++ b/toolchain/check/testdata/index/expr_category.carbon @@ -74,6 +74,7 @@ fn ValueBinding(b: array(i32, 3)) { // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.8eb: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%i32, %ImplicitAs.facet) [concrete] // CHECK:STDOUT: %.b7a: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.8eb, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.094: = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.e39 [concrete] +// CHECK:STDOUT: %pattern_type.6b6: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.e39, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete] // CHECK:STDOUT: %bound_method.953: = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.0c6: %i32 = int_value 1 [concrete] @@ -107,10 +108,35 @@ fn ValueBinding(b: array(i32, 3)) { // CHECK:STDOUT: %bound_method.b7a: = bound_method %int_4.0c1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_4.4eb: %i32 = int_value 4 [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %self.param_patt.af0: %pattern_type.f00 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.954: %pattern_type.f00 = wrapper_binding_pattern self, %self.param_patt.af0 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc21 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc21 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc21 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc18_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc18_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc18_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc18_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.c42: %pattern_type.771 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.3bc: %pattern_type.771 = wrapper_binding_pattern self, %self.param_patt.c42 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc18_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc18_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc18_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] // CHECK:STDOUT: %b.patt.911d20.2: %pattern_type.771 = wrapper_binding_pattern b, %b.param_patt [concrete] // CHECK:STDOUT: %ValueBinding.type: type = fn_type @ValueBinding [concrete] // CHECK:STDOUT: %ValueBinding: %ValueBinding.type = struct_value () [concrete] @@ -135,6 +161,65 @@ fn ValueBinding(b: array(i32, 3)) { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc21 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f00 = ref_param_pattern [concrete = constants.%self.param_patt.af0] +// CHECK:STDOUT: %self.patt: %pattern_type.f00 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.954] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr.d08 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr.d08 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc21 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f00 = ref_param_pattern [concrete = constants.%self.param_patt.af0] +// CHECK:STDOUT: %self.patt: %pattern_type.f00 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.954] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr.d08 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr.d08 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc18_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc18_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc18_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc18_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc18_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.771 = ref_param_pattern [concrete = constants.%self.param_patt.c42] +// CHECK:STDOUT: %self.patt: %pattern_type.771 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.3bc] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc18_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.771 = ref_param_pattern [concrete = constants.%self.param_patt.c42] +// CHECK:STDOUT: %self.patt: %pattern_type.771 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.3bc] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -274,24 +359,60 @@ fn ValueBinding(b: array(i32, 3)) { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc22_8: init %i32 = call %bound_method.loc22_8.2(%int_4) [concrete = constants.%int_4.4eb] // CHECK:STDOUT: %.loc22_8: init %i32 = converted %int_4, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc22_8 [concrete = constants.%int_4.4eb] // CHECK:STDOUT: assign %.loc22_6, %.loc22_8 -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc21: = bound_method %pa.var, constants.%Destroy.WithSelf.Op.403171.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc21: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc21(%pa.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc18: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc18: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc18(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc21: = bound_method %pa.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc21: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc21(%pa.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc18: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc18: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc18(%a.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc21(%self.param: ref %ptr.d08) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc21(%self.param: ref %ptr.d08) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc21(%self.param: ref %ptr.d08) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc18_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18_3.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc18_3.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc18_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18_3.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc18_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc18_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18_3.3(%self.param: ref %array_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc18_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -378,10 +499,10 @@ fn ValueBinding(b: array(i32, 3)) { // CHECK:STDOUT: %.loc32_7.2: %i32 = converted %int_0.loc32, %.loc32_7.1 [concrete = constants.%int_0.3c0] // CHECK:STDOUT: %.loc32_8.1: ref %i32 = array_index %.loc32_5.2, %.loc32_7.2 // CHECK:STDOUT: %.loc32_8.2: %i32 = acquire_value %.loc32_8.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc32: = bound_method %.loc32_5.2, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc32: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc32(%.loc32_5.2) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc26: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc26: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc26(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc32: = bound_method %.loc32_5.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc32: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc32(%.loc32_5.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc26: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc26: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc26(%a.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/index/fail_expr_category.carbon b/toolchain/check/testdata/index/fail_expr_category.carbon index c14410891cd0..2348d24eb845 100644 --- a/toolchain/check/testdata/index/fail_expr_category.carbon +++ b/toolchain/check/testdata/index/fail_expr_category.carbon @@ -81,6 +81,7 @@ fn G(b: array(i32, 3)) { // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.8eb: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%i32, %ImplicitAs.facet) [concrete] // CHECK:STDOUT: %.b7a: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.8eb, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.7b4: = bound_method %int_0.5c6, %Core.IntLiteral.as.ImplicitAs.impl.Convert.e39 [concrete] +// CHECK:STDOUT: %pattern_type.6b6: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.e39, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete] // CHECK:STDOUT: %bound_method.6e0: = bound_method %int_0.5c6, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.3c0: %i32 = int_value 0 [concrete] @@ -102,10 +103,35 @@ fn G(b: array(i32, 3)) { // CHECK:STDOUT: %pf.patt: %pattern_type.f00 = ref_binding_pattern pf [concrete] // CHECK:STDOUT: %pf.var_patt: %pattern_type.f00 = var_pattern %pf.patt [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc41_5.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc41_5.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc41_5.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc41_5.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.c42: %pattern_type.771 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.3bc: %pattern_type.771 = wrapper_binding_pattern self, %self.param_patt.c42 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc41_5.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc41_5.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc41_5.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.af0: %pattern_type.f00 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.954: %pattern_type.f00 = wrapper_binding_pattern self, %self.param_patt.af0 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc36 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc36 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc36 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -127,6 +153,65 @@ fn G(b: array(i32, 3)) { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc41_5.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc41_5.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc41_5.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc41_5.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc41_5.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.771 = ref_param_pattern [concrete = constants.%self.param_patt.c42] +// CHECK:STDOUT: %self.patt: %pattern_type.771 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.3bc] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc41_5.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.771 = ref_param_pattern [concrete = constants.%self.param_patt.c42] +// CHECK:STDOUT: %self.patt: %pattern_type.771 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.3bc] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc36 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f00 = ref_param_pattern [concrete = constants.%self.param_patt.af0] +// CHECK:STDOUT: %self.patt: %pattern_type.f00 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.954] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr.d08 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr.d08 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc36 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f00 = ref_param_pattern [concrete = constants.%self.param_patt.af0] +// CHECK:STDOUT: %self.patt: %pattern_type.f00 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.954] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr.d08 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr.d08 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -265,28 +350,64 @@ fn G(b: array(i32, 3)) { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc41_10: init %i32 = call %bound_method.loc41_10.2(%int_4.loc41) [concrete = constants.%int_4.4eb] // CHECK:STDOUT: %.loc41_10: init %i32 = converted %int_4.loc41, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc41_10 [concrete = constants.%int_4.4eb] // CHECK:STDOUT: assign %.loc41_8.2, %.loc41_10 -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc41: = bound_method %.loc41_5.2, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc41: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc41(%.loc41_5.2) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc36_28: = bound_method %.loc36_28.2, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc36_28: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc36_28(%.loc36_28.2) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc36_3: = bound_method %pf.var, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc36_3: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc36_3(%pf.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc23: = bound_method %pb.var, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc23: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc23(%pb.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc41: = bound_method %.loc41_5.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc41: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc41(%.loc41_5.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc36_28: = bound_method %.loc36_28.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc36_28: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc36_28(%.loc36_28.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc36_3: = bound_method %pf.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc36_3: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc36_3(%pf.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc23: = bound_method %pb.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc23: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc23(%pb.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc41_5.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc41_5.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc41_5.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc41_5.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc41_5.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc41_5.3(%self.param: ref %array_type) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc41_5.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc41_5.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc41_5.3(%self.param: ref %array_type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc41_5.3(%self.param: ref %array_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc41_5.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc36(%self.param: ref %ptr.d08) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc36(%self.param: ref %ptr.d08) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc36(%self.param: ref %ptr.d08) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/index/fail_name_not_found.carbon b/toolchain/check/testdata/index/fail_name_not_found.carbon index aabda6655e0a..f9097da29f1b 100644 --- a/toolchain/check/testdata/index/fail_name_not_found.carbon +++ b/toolchain/check/testdata/index/fail_name_not_found.carbon @@ -37,8 +37,21 @@ fn Main() { // CHECK:STDOUT: %b.var_patt: %pattern_type.6b6 = var_pattern %b.patt [concrete] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc20_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc20_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc20_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc20_3.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc20_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -52,6 +65,37 @@ fn Main() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc20_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc20_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc20_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc20_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -74,15 +118,33 @@ fn Main() { // CHECK:STDOUT: %b.patt: %pattern_type.6b6 = ref_binding_pattern b [concrete = constants.%b.patt] // CHECK:STDOUT: %b.var_patt: %pattern_type.6b6 = var_pattern %b.patt [concrete = constants.%b.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %b.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%b.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %b.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%b.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc20_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc20_3.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc20_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc20_3.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc20_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc20_3.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc20_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/as_type_of_type.carbon b/toolchain/check/testdata/interface/as_type_of_type.carbon index f30ab9497153..08da7387c55c 100644 --- a/toolchain/check/testdata/interface/as_type_of_type.carbon +++ b/toolchain/check/testdata/interface/as_type_of_type.carbon @@ -57,12 +57,12 @@ fn F(generic T: Empty) { // CHECK:STDOUT: %impl.elem0.98b: %.ddb = impl_witness_access %DefaultOrUnformed.lookup_impl_witness, element0 [symbolic] // CHECK:STDOUT: %specific_impl_fn.f14: = specific_impl_function %impl.elem0.98b, @DefaultOrUnformed.WithSelf.Op(%DefaultOrUnformed.facet) [symbolic] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %ptr, @Destroy [symbolic] -// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %ptr, (%Destroy.lookup_impl_witness) [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.67a: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet) [symbolic] -// CHECK:STDOUT: %.0f5: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.67a, %Destroy.facet [symbolic] -// CHECK:STDOUT: %impl.elem0.584: %.0f5 = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.e4d: = specific_impl_function %impl.elem0.584, @Destroy.WithSelf.Op(%Destroy.facet) [symbolic] +// CHECK:STDOUT: %Destroy.lookup_impl_witness.91e: = lookup_impl_witness %ptr, @Destroy [symbolic] +// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %ptr, (%Destroy.lookup_impl_witness.91e) [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.8e3: type = fn_type @Destroy.WithSelf.SelfDestruct, @Destroy.WithSelf(%Destroy.facet) [symbolic] +// CHECK:STDOUT: %.796: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.8e3, %Destroy.facet [symbolic] +// CHECK:STDOUT: %impl.elem2: %.796 = impl_witness_access %Destroy.lookup_impl_witness.91e, element2 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.6c0: = specific_impl_function %impl.elem2, @Destroy.WithSelf.SelfDestruct(%Destroy.facet) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -148,12 +148,12 @@ fn F(generic T: Empty) { // CHECK:STDOUT: %.loc22_19.4: type = fn_type_with_self_type %DefaultOrUnformed.WithSelf.Op.type, %DefaultOrUnformed.facet.loc22_19.2 [symbolic = %.loc22_19.4 (constants.%.ddb)] // CHECK:STDOUT: %impl.elem0.loc22_19.2: @F.%.loc22_19.4 (%.ddb) = impl_witness_access %DefaultOrUnformed.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc22_19.2 (constants.%impl.elem0.98b)] // CHECK:STDOUT: %specific_impl_fn.loc22_19.2: = specific_impl_function %impl.elem0.loc22_19.2, @DefaultOrUnformed.WithSelf.Op(%DefaultOrUnformed.facet.loc22_19.2) [symbolic = %specific_impl_fn.loc22_19.2 (constants.%specific_impl_fn.f14)] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %ptr.loc22_18.2, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)] +// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %ptr.loc22_18.2, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.91e)] // CHECK:STDOUT: %Destroy.facet.loc22_3.3: %Destroy.type = facet_value %ptr.loc22_18.2, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.loc22_3.3 (constants.%Destroy.facet)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.loc22_3.3) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.67a)] -// CHECK:STDOUT: %.loc22_3.3: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet.loc22_3.3 [symbolic = %.loc22_3.3 (constants.%.0f5)] -// CHECK:STDOUT: %impl.elem0.loc22_3.2: @F.%.loc22_3.3 (%.0f5) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc22_3.2 (constants.%impl.elem0.584)] -// CHECK:STDOUT: %specific_impl_fn.loc22_3.2: = specific_impl_function %impl.elem0.loc22_3.2, @Destroy.WithSelf.Op(%Destroy.facet.loc22_3.3) [symbolic = %specific_impl_fn.loc22_3.2 (constants.%specific_impl_fn.e4d)] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type: type = fn_type @Destroy.WithSelf.SelfDestruct, @Destroy.WithSelf(%Destroy.facet.loc22_3.3) [symbolic = %Destroy.WithSelf.SelfDestruct.type (constants.%Destroy.WithSelf.SelfDestruct.type.8e3)] +// CHECK:STDOUT: %.loc22_3.3: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type, %Destroy.facet.loc22_3.3 [symbolic = %.loc22_3.3 (constants.%.796)] +// CHECK:STDOUT: %impl.elem2.loc22_3.2: @F.%.loc22_3.3 (%.796) = impl_witness_access %Destroy.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc22_3.2 (constants.%impl.elem2)] +// CHECK:STDOUT: %specific_impl_fn.loc22_3.2: = specific_impl_function %impl.elem2.loc22_3.2, @Destroy.WithSelf.SelfDestruct(%Destroy.facet.loc22_3.3) [symbolic = %specific_impl_fn.loc22_3.2 (constants.%specific_impl_fn.6c0)] // CHECK:STDOUT: // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: @@ -177,15 +177,15 @@ fn F(generic T: Empty) { // CHECK:STDOUT: %x.patt.loc22_15.1: @F.%pattern_type (%pattern_type.777) = ref_binding_pattern x [symbolic = %x.patt.loc22_15.2 (constants.%x.patt)] // CHECK:STDOUT: %x.var_patt.loc22_3.1: @F.%pattern_type (%pattern_type.777) = var_pattern %x.patt.loc22_15.1 [symbolic = %x.var_patt.loc22_3.2 (constants.%x.var_patt)] // CHECK:STDOUT: } -// CHECK:STDOUT: %impl.elem0.loc22_3.1: @F.%.loc22_3.3 (%.0f5) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc22_3.2 (constants.%impl.elem0.584)] -// CHECK:STDOUT: %bound_method.loc22_3.1: = bound_method %x.var, %impl.elem0.loc22_3.1 -// CHECK:STDOUT: %Destroy.facet.loc22_3.1: %Destroy.type = facet_value constants.%ptr, (constants.%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.loc22_3.3 (constants.%Destroy.facet)] +// CHECK:STDOUT: %impl.elem2.loc22_3.1: @F.%.loc22_3.3 (%.796) = impl_witness_access constants.%Destroy.lookup_impl_witness.91e, element2 [symbolic = %impl.elem2.loc22_3.2 (constants.%impl.elem2)] +// CHECK:STDOUT: %bound_method.loc22_3.1: = bound_method %x.var, %impl.elem2.loc22_3.1 +// CHECK:STDOUT: %Destroy.facet.loc22_3.1: %Destroy.type = facet_value constants.%ptr, (constants.%Destroy.lookup_impl_witness.91e) [symbolic = %Destroy.facet.loc22_3.3 (constants.%Destroy.facet)] // CHECK:STDOUT: %.loc22_3.1: %Destroy.type = converted constants.%ptr, %Destroy.facet.loc22_3.1 [symbolic = %Destroy.facet.loc22_3.3 (constants.%Destroy.facet)] -// CHECK:STDOUT: %Destroy.facet.loc22_3.2: %Destroy.type = facet_value constants.%ptr, (constants.%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.loc22_3.3 (constants.%Destroy.facet)] +// CHECK:STDOUT: %Destroy.facet.loc22_3.2: %Destroy.type = facet_value constants.%ptr, (constants.%Destroy.lookup_impl_witness.91e) [symbolic = %Destroy.facet.loc22_3.3 (constants.%Destroy.facet)] // CHECK:STDOUT: %.loc22_3.2: %Destroy.type = converted constants.%ptr, %Destroy.facet.loc22_3.2 [symbolic = %Destroy.facet.loc22_3.3 (constants.%Destroy.facet)] -// CHECK:STDOUT: %specific_impl_fn.loc22_3.1: = specific_impl_function %impl.elem0.loc22_3.1, @Destroy.WithSelf.Op(constants.%Destroy.facet) [symbolic = %specific_impl_fn.loc22_3.2 (constants.%specific_impl_fn.e4d)] +// CHECK:STDOUT: %specific_impl_fn.loc22_3.1: = specific_impl_function %impl.elem2.loc22_3.1, @Destroy.WithSelf.SelfDestruct(constants.%Destroy.facet) [symbolic = %specific_impl_fn.loc22_3.2 (constants.%specific_impl_fn.6c0)] // CHECK:STDOUT: %bound_method.loc22_3.2: = bound_method %x.var, %specific_impl_fn.loc22_3.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc22_3.2(%x.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %bound_method.loc22_3.2(%x.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interface/default_fn.carbon b/toolchain/check/testdata/interface/default_fn.carbon index 2e86d5cef68e..fe4fbd6b3aa7 100644 --- a/toolchain/check/testdata/interface/default_fn.carbon +++ b/toolchain/check/testdata/interface/default_fn.carbon @@ -64,7 +64,7 @@ fn Call() { ().(I.G)(); } // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %I.WithSelf.F.02a: %I.WithSelf.F.type.933 = struct_value () [symbolic] // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete] -// CHECK:STDOUT: %assoc0.08d: %I.assoc_type = assoc_entity element0, @I.WithSelf.%I.WithSelf.F.decl [concrete] +// CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.WithSelf.%I.WithSelf.F.decl [concrete] // CHECK:STDOUT: %.c3e: = impl_self_witness %C, @I [concrete] // CHECK:STDOUT: %I.impl_witness: = impl_witness @C.as.I.impl.%I.impl_witness_table [concrete] // CHECK:STDOUT: %I.facet: %I.type = facet_value %C, (%I.impl_witness) [concrete] @@ -72,7 +72,7 @@ fn Call() { ().(I.G)(); } // CHECK:STDOUT: %I.WithSelf.F.ee1: %I.WithSelf.F.type.684 = struct_value () [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] -// CHECK:STDOUT: %require_complete: = require_complete_type %Self.as_type.0fa [symbolic] +// CHECK:STDOUT: %require_complete.c77: = require_complete_type %Self.as_type.0fa [symbolic] // CHECK:STDOUT: %pattern_type.98b: type = pattern_type %C [concrete] // CHECK:STDOUT: %c.patt: %pattern_type.98b = ref_binding_pattern c [concrete] // CHECK:STDOUT: %c.var_patt: %pattern_type.98b = var_pattern %c.patt [concrete] @@ -82,8 +82,52 @@ fn Call() { ().(I.G)(); } // CHECK:STDOUT: %self.param_patt.303: %pattern_type.98b = value_param_pattern [concrete] // CHECK:STDOUT: %self.patt.36a: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt.303 [concrete] // CHECK:STDOUT: %I.WithSelf.F.specific_fn: = specific_function %I.WithSelf.F.ee1, @I.WithSelf.F(%I.facet) [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_7.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc9_7.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.99a: %pattern_type.98b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.cbd: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt.99a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_7.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc9_7.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9_7.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_7.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc9_7.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_7.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc9_7.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: interface @I { @@ -103,7 +147,7 @@ fn Call() { ().(I.G)(); } // CHECK:STDOUT: } // CHECK:STDOUT: %self: @I.WithSelf.F.%Self.as_type.loc7_25.1 (%Self.as_type.0fa) = wrapper_binding self, %self.param // CHECK:STDOUT: } -// CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, %I.WithSelf.F.decl [concrete = constants.%assoc0.08d] +// CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, %I.WithSelf.F.decl [concrete = constants.%assoc0] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self @@ -151,7 +195,7 @@ fn Call() { ().(I.G)(); } // CHECK:STDOUT: %self.patt.loc7_25.2: @I.WithSelf.F.%pattern_type (%pattern_type.492) = wrapper_binding_pattern self, %self.param_patt.loc7_25.2 [symbolic = %self.patt.loc7_25.2 (constants.%self.patt.ce2)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %Self.as_type.loc7_25.1 [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type %Self.as_type.loc7_25.1 [symbolic = %require_complete (constants.%require_complete.c77)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%self.param: @I.WithSelf.F.%Self.as_type.loc7_25.1 (%Self.as_type.0fa)) { // CHECK:STDOUT: !entry: @@ -168,7 +212,7 @@ fn Call() { ().(I.G)(); } // CHECK:STDOUT: } // CHECK:STDOUT: %c.ref: ref %C = name_ref c, %c // CHECK:STDOUT: %I.ref: type = name_ref I, @C.%I.decl [concrete = constants.%I.type] -// CHECK:STDOUT: %F.ref: %I.assoc_type = name_ref F, @I.WithSelf.%assoc0 [concrete = constants.%assoc0.08d] +// CHECK:STDOUT: %F.ref: %I.assoc_type = name_ref F, @I.WithSelf.%assoc0 [concrete = constants.%assoc0] // CHECK:STDOUT: %impl.elem0: %.938 = impl_witness_access constants.%I.impl_witness, element0 [concrete = constants.%I.WithSelf.F.ee1] // CHECK:STDOUT: %bound_method.loc10_8: = bound_method %c.ref, %impl.elem0 // CHECK:STDOUT: %I.facet.loc10_15.1: %I.type = facet_value constants.%C, (constants.%I.impl_witness) [concrete = constants.%I.facet] @@ -179,16 +223,34 @@ fn Call() { ().(I.G)(); } // CHECK:STDOUT: %bound_method.loc10_15: = bound_method %c.ref, %specific_fn // CHECK:STDOUT: %.loc10_7: %C = acquire_value %c.ref // CHECK:STDOUT: %I.WithSelf.F.call: init %empty_tuple.type = call %bound_method.loc10_15(%.loc10_7) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %c.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%c.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %c.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%c.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_7.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_7.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_7.2(%self.param: ref %C) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_7.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_7.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_7.2(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_7.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/fail_incorrect_destroy_method_declarations.carbon b/toolchain/check/testdata/interface/fail_incorrect_destroy_method_declarations.carbon new file mode 100644 index 000000000000..027e87710fd9 --- /dev/null +++ b/toolchain/check/testdata/interface/fail_incorrect_destroy_method_declarations.carbon @@ -0,0 +1,325 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/none.carbon +// +// AUTOUPDATE +// TIP: To test this file alone, run: +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/fail_incorrect_destroy_method_declarations.carbon +// TIP: To dump output, run: +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/fail_incorrect_destroy_method_declarations.carbon + +// TODO: remove `SubobjectDestroy` when `require impls` adds a witness table entry. + +// --- fail_too_few_assoc_functions_declared.carbon + +package Core library "too_few_assoc_functions_declared"; + +// CHECK:STDERR: fail_too_few_assoc_functions_declared.carbon:[[@LINE+4]]:1: error: semantics TODO: `interface `Core.Destroy` needs exactly 3 associated functions` [SemanticsTodo] +// CHECK:STDERR: interface Destroy { +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: +interface Destroy { + final fn SubobjectDestroy(ref self) {} + final fn SelfDestruct(unused ref self) {} +} + +// --- fail_too_many_assoc_functions_declared.carbon + +package Core library "too_many_assoc_functions_declared"; + +// CHECK:STDERR: fail_too_many_assoc_functions_declared.carbon:[[@LINE+4]]:1: error: semantics TODO: `interface `Core.Destroy` needs exactly 3 associated functions` [SemanticsTodo] +// CHECK:STDERR: interface Destroy { +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: +interface Destroy { + fn Op(ref self); + final fn SubobjectDestroy(ref self) {} + final fn SelfDestruct(unused ref self) {} + fn Extra(ref self) {} +} + +// --- fail_op_associated_type.carbon + +package Core library "op_associated_type"; + +interface Destroy { + // CHECK:STDERR: fail_op_associated_type.carbon:[[@LINE+4]]:7: error: semantics TODO: `associated entity must be a method` [SemanticsTodo] + // CHECK:STDERR: let Op: type; + // CHECK:STDERR: ^~~~~~~~ + // CHECK:STDERR: + let Op: type; + final fn SubobjectDestroy(ref self) {} + final fn SelfDestruct(unused ref self) {} +} + +// --- fail_op_wrong_name.carbon + +package Core library "op_wrong_name"; + +interface Destroy { + // CHECK:STDERR: fail_op_wrong_name.carbon:[[@LINE+4]]:3: error: semantics TODO: `associated function #1 must be named `Op`` [SemanticsTodo] + // CHECK:STDERR: final fn SubobjectDestroy(ref self) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + final fn SubobjectDestroy(ref self) {} + fn Op(ref self); + final fn SelfDestruct(unused ref self) {} +} + +// --- fail_op_no_params.carbon + +package Core library "op_no_params"; + +interface Destroy { + // CHECK:STDERR: fail_op_no_params.carbon:[[@LINE+4]]:3: error: semantics TODO: `associated function must have exactly 1 parameter` [SemanticsTodo] + // CHECK:STDERR: fn Op(); + // CHECK:STDERR: ^~~~~~~~ + // CHECK:STDERR: + fn Op(); + final fn SubobjectDestroy(unused ref self) {} + final fn SelfDestruct(unused ref self) {} +} + +// --- fail_op_two_params.carbon + +package Core library "op_two_params"; + +interface Destroy { + // CHECK:STDERR: fail_op_two_params.carbon:[[@LINE+4]]:3: error: semantics TODO: `associated function must have exactly 1 parameter` [SemanticsTodo] + // CHECK:STDERR: fn Op(ref self, x: Self); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + fn Op(ref self, x: Self); + final fn SubobjectDestroy(unused ref self) {} + final fn SelfDestruct(unused ref self) {} +} + +// --- fail_op_param_not_self.carbon + +package Core library "op_param_not_self"; + +class C {} + +interface Destroy { + // CHECK:STDERR: fail_op_param_not_self.carbon:[[@LINE+4]]:3: error: semantics TODO: `associated function must take `ref self` as its parameter` [SemanticsTodo] + // CHECK:STDERR: fn Op(c: C); + // CHECK:STDERR: ^~~~~~~~~~~~ + // CHECK:STDERR: + fn Op(c: C); + final fn SubobjectDestroy(unused ref self) {} + final fn SelfDestruct(unused ref self) {} +} + +// --- fail_op_param_is_generic.carbon + +package Core library "op_param_is_generic"; + +interface Destroy { + // CHECK:STDERR: fail_op_param_is_generic.carbon:[[@LINE+4]]:3: error: semantics TODO: `associated function must take `ref self` as its parameter` [SemanticsTodo] + // CHECK:STDERR: fn Op[T: type](ref c: T); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + fn Op[T: type](ref c: T); + final fn SubobjectDestroy(unused ref self) {} + final fn SelfDestruct(unused ref self) {} +} + +// --- fail_op_self_param_not_reference.carbon + +package Core library "op_self_param_not_reference"; + +interface Destroy { + // CHECK:STDERR: fail_op_self_param_not_reference.carbon:[[@LINE+4]]:3: error: semantics TODO: `associated function must take `ref self` as its parameter` [SemanticsTodo] + // CHECK:STDERR: fn Op(self); + // CHECK:STDERR: ^~~~~~~~~~~~ + // CHECK:STDERR: + fn Op(self); + final fn SubobjectDestroy(unused ref self) {} + final fn SelfDestruct(unused ref self) {} +} + +// --- fail_op_explicit_self_type.carbon + +package Core library "op_explicit_self_type"; + +interface Destroy { + // CHECK:STDERR: fail_op_explicit_self_type.carbon:[[@LINE+4]]:3: error: semantics TODO: `associated function must take `ref self` as its parameter` [SemanticsTodo] + // CHECK:STDERR: fn Op(ref s: Self); + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + fn Op(ref s: Self); + final fn SubobjectDestroy(unused ref self) {} + final fn SelfDestruct(unused ref self) {} +} + +// --- fail_op_final.carbon + +package Core library "op_final"; + +interface Destroy { + // CHECK:STDERR: fail_op_final.carbon:[[@LINE+4]]:3: error: semantics TODO: `associated function must not have an interface modifier` [SemanticsTodo] + // CHECK:STDERR: final fn Op(unused ref self) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + final fn Op(unused ref self) {} + final fn SubobjectDestroy(unused ref self) {} + final fn SelfDestruct(unused ref self) {} +} + +// --- fail_op_default.carbon + +package Core library "op_default"; + +interface Destroy { + // CHECK:STDERR: fail_op_default.carbon:[[@LINE+4]]:3: error: semantics TODO: `associated function must not have an interface modifier` [SemanticsTodo] + // CHECK:STDERR: default fn Op(unused ref self) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + default fn Op(unused ref self) {} + final fn SubobjectDestroy(unused ref self) {} + final fn SelfDestruct(unused ref self) {} +} + +// --- fail_self_destruct_associated_type.carbon + +package Core library "self_destruct_associated_type"; + +interface Destroy { + fn Op(ref self); + final fn SubobjectDestroy(unused ref self) {} + // CHECK:STDERR: fail_self_destruct_associated_type.carbon:[[@LINE+4]]:7: error: semantics TODO: `associated entity must be a method` [SemanticsTodo] + // CHECK:STDERR: let SelfDestruct: type; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + let SelfDestruct: type; +} + +// --- fail_self_destruct_wrong_name.carbon + +package Core library "self_destruct_wrong_name"; + +interface Destroy { + fn Op(ref self); + final fn SubobjectDestroy(unused ref self) {} + // CHECK:STDERR: fail_self_destruct_wrong_name.carbon:[[@LINE+4]]:3: error: semantics TODO: `associated function #3 must be named `SelfDestruct`` [SemanticsTodo] + // CHECK:STDERR: final fn selfDestruct(unused ref self) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + final fn selfDestruct(unused ref self) {} +} + +// --- fail_self_destruct_no_params.carbon + +package Core library "self_destruct_no_params"; + +interface Destroy { + fn Op(ref self); + final fn SubobjectDestroy(unused ref self) {} + // CHECK:STDERR: fail_self_destruct_no_params.carbon:[[@LINE+4]]:3: error: semantics TODO: `associated function must have exactly 1 parameter` [SemanticsTodo] + // CHECK:STDERR: final fn SelfDestruct() {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + final fn SelfDestruct() {} +} + +// --- fail_self_destruct_two_params.carbon + +package Core library "self_destruct_two_params"; + +interface Destroy { + fn Op(ref self); + final fn SubobjectDestroy(unused ref self) {} + // CHECK:STDERR: fail_self_destruct_two_params.carbon:[[@LINE+4]]:3: error: semantics TODO: `associated function must have exactly 1 parameter` [SemanticsTodo] + // CHECK:STDERR: final fn SelfDestruct(unused ref self, unused x: Self) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + final fn SelfDestruct(unused ref self, unused x: Self) {} +} + +// --- fail_self_destruct_param_not_self.carbon + +package Core library "self_destruct_param_not_self"; + +class C {} + +interface Destroy { + fn Op(ref self); + final fn SubobjectDestroy(unused ref self) {} + // CHECK:STDERR: fail_self_destruct_param_not_self.carbon:[[@LINE+4]]:3: error: semantics TODO: `associated function must take `ref self` as its parameter` [SemanticsTodo] + // CHECK:STDERR: final fn SelfDestruct(unused ref c: C) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + final fn SelfDestruct(unused ref c: C) {} +} + +// --- fail_self_destruct_param_is_generic.carbon + +package Core library "self_destruct_param_is_generic"; + +interface Destroy { + fn Op(ref self); + final fn SubobjectDestroy(unused ref self) {} + // CHECK:STDERR: fail_self_destruct_param_is_generic.carbon:[[@LINE+4]]:3: error: semantics TODO: `associated function must take `ref self` as its parameter` [SemanticsTodo] + // CHECK:STDERR: final fn SelfDestruct[T: type](unused ref c: T) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + final fn SelfDestruct[T: type](unused ref c: T) {} +} + +// --- fail_self_destruct_self_param_not_reference.carbon + +package Core library "self_destruct_self_param_not_reference"; + +interface Destroy { + fn Op(ref self); + final fn SubobjectDestroy(unused ref self) {} + // CHECK:STDERR: fail_self_destruct_self_param_not_reference.carbon:[[@LINE+4]]:3: error: semantics TODO: `associated function must take `ref self` as its parameter` [SemanticsTodo] + // CHECK:STDERR: final fn SelfDestruct(unused self) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + final fn SelfDestruct(unused self) {} +} + +// --- fail_self_destruct_explicit_self_type.carbon + +package Core library "self_destruct_explicit_self_type"; + +interface Destroy { + fn Op(ref self); + final fn SubobjectDestroy(unused ref self) {} + // CHECK:STDERR: fail_self_destruct_explicit_self_type.carbon:[[@LINE+4]]:3: error: semantics TODO: `associated function must take `ref self` as its parameter` [SemanticsTodo] + // CHECK:STDERR: final fn SelfDestruct(unused ref s: Self) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + final fn SelfDestruct(unused ref s: Self) {} +} + +// --- fail_self_destruct_not_final.carbon + +package Core library "self_destruct_not_final"; + +interface Destroy { + fn Op(ref self); + final fn SubobjectDestroy(unused ref self) {} + // CHECK:STDERR: fail_self_destruct_not_final.carbon:[[@LINE+4]]:3: error: semantics TODO: `associated function must be `final`` [SemanticsTodo] + // CHECK:STDERR: fn SelfDestruct(unused ref self) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + fn SelfDestruct(unused ref self) {} +} + +// --- fail_self_destruct_default.carbon + +package Core library "self_destruct_default"; + +interface Destroy { + fn Op(ref self); + final fn SubobjectDestroy(unused ref self) {} + // CHECK:STDERR: fail_self_destruct_default.carbon:[[@LINE+4]]:3: error: semantics TODO: `associated function must be `final`` [SemanticsTodo] + // CHECK:STDERR: default fn SelfDestruct(unused ref self) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + default fn SelfDestruct(unused ref self) {} +} diff --git a/toolchain/check/testdata/interface/fail_incorrect_subobject_destroy_method_declarations.carbon b/toolchain/check/testdata/interface/fail_incorrect_subobject_destroy_method_declarations.carbon new file mode 100644 index 000000000000..a702c4786230 --- /dev/null +++ b/toolchain/check/testdata/interface/fail_incorrect_subobject_destroy_method_declarations.carbon @@ -0,0 +1,168 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/none.carbon +// +// AUTOUPDATE +// TIP: To test this file alone, run: +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/fail_incorrect_subobject_destroy_method_declarations.carbon +// TIP: To dump output, run: +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/fail_incorrect_subobject_destroy_method_declarations.carbon + +// TODO: change to `SubobjectDestroy` when `require impls` adds a witness table entry. + +// --- fail_op_not_declared.carbon + +package Core library "op_not_declared"; + +// CHECK:STDERR: fail_op_not_declared.carbon:[[@LINE+4]]:1: error: semantics TODO: `interface `Core.Destroy` needs exactly 3 associated functions` [SemanticsTodo] +// CHECK:STDERR: interface Destroy { +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: +interface Destroy { + fn Op(ref self); + final fn SelfDestruct(unused ref self) {} +} + +// --- fail_op_associated_type.carbon + +package Core library "op_associated_type"; + +interface Destroy { + fn Op(ref self); + // CHECK:STDERR: fail_op_associated_type.carbon:[[@LINE+4]]:7: error: semantics TODO: `associated entity must be a method` [SemanticsTodo] + // CHECK:STDERR: let SubobjectDestroy: type; + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + let SubobjectDestroy: type; + final fn SelfDestruct(unused ref self) {} +} + +// --- fail_op_wrong_name.carbon + +package Core library "op_wrong_name"; + +interface Destroy { + fn Op(ref self); + // CHECK:STDERR: fail_op_wrong_name.carbon:[[@LINE+4]]:3: error: semantics TODO: `associated function #2 must be named `SubobjectDestroy`` [SemanticsTodo] + // CHECK:STDERR: final fn SelfDestruct(unused ref self) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + final fn SelfDestruct(unused ref self) {} + final fn SubobjectDestroy(unused ref self) {} +} + +// --- fail_op_no_params.carbon + +package Core library "op_no_params"; + +interface Destroy { + fn Op(ref self); + // CHECK:STDERR: fail_op_no_params.carbon:[[@LINE+4]]:3: error: semantics TODO: `associated function must have exactly 1 parameter` [SemanticsTodo] + // CHECK:STDERR: final fn SubobjectDestroy() {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + final fn SubobjectDestroy() {} + final fn SelfDestruct(unused ref self) {} +} + +// --- fail_op_two_params.carbon + +package Core library "op_two_params"; + +interface Destroy { + fn Op(ref self); + // CHECK:STDERR: fail_op_two_params.carbon:[[@LINE+4]]:3: error: semantics TODO: `associated function must have exactly 1 parameter` [SemanticsTodo] + // CHECK:STDERR: final fn SubobjectDestroy(unused ref self, unused x: Self) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + final fn SubobjectDestroy(unused ref self, unused x: Self) {} + final fn SelfDestruct(unused ref self) {} +} + +// --- fail_op_param_not_self.carbon + +package Core library "op_param_not_self"; + +class C {} + +interface Destroy { + fn Op(ref self); + // CHECK:STDERR: fail_op_param_not_self.carbon:[[@LINE+4]]:3: error: semantics TODO: `associated function must take `ref self` as its parameter` [SemanticsTodo] + // CHECK:STDERR: final fn SubobjectDestroy(unused ref c: C) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + final fn SubobjectDestroy(unused ref c: C) {} + final fn SelfDestruct(unused ref self) {} +} + +// --- fail_op_param_is_generic.carbon + +package Core library "op_param_is_generic"; + +interface Destroy { + fn Op(ref self); + // CHECK:STDERR: fail_op_param_is_generic.carbon:[[@LINE+4]]:3: error: semantics TODO: `associated function must take `ref self` as its parameter` [SemanticsTodo] + // CHECK:STDERR: final fn SubobjectDestroy[T: type](unused ref c: T) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + final fn SubobjectDestroy[T: type](unused ref c: T) {} + final fn SelfDestruct(unused ref self) {} +} + +// --- fail_op_self_param_not_reference.carbon + +package Core library "op_self_param_not_reference"; + +interface Destroy { + fn Op(ref self); + // CHECK:STDERR: fail_op_self_param_not_reference.carbon:[[@LINE+4]]:3: error: semantics TODO: `associated function must take `ref self` as its parameter` [SemanticsTodo] + // CHECK:STDERR: final fn SubobjectDestroy(unused self) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + final fn SubobjectDestroy(unused self) {} + final fn SelfDestruct(unused ref self) {} +} + +// --- fail_op_explicit_self_type.carbon + +package Core library "op_explicit_self_type"; + +interface Destroy { + fn Op(ref self); + // CHECK:STDERR: fail_op_explicit_self_type.carbon:[[@LINE+4]]:3: error: semantics TODO: `associated function must take `ref self` as its parameter` [SemanticsTodo] + // CHECK:STDERR: final fn SubobjectDestroy(unused ref s: Self) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + final fn SubobjectDestroy(unused ref s: Self) {} + final fn SelfDestruct(unused ref self) {} +} + +// --- fail_op_not_final.carbon + +package Core library "op_not_final"; + +interface Destroy { + fn Op(ref self); + // CHECK:STDERR: fail_op_not_final.carbon:[[@LINE+4]]:3: error: semantics TODO: `associated function must be `final`` [SemanticsTodo] + // CHECK:STDERR: fn SubobjectDestroy(unused ref self) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + fn SubobjectDestroy(unused ref self) {} + final fn SelfDestruct(unused ref self) {} +} + +// --- fail_op_default.carbon + +package Core library "op_default"; + +interface Destroy { + fn Op(ref self); + // CHECK:STDERR: fail_op_default.carbon:[[@LINE+4]]:3: error: semantics TODO: `associated function must be `final`` [SemanticsTodo] + // CHECK:STDERR: default fn SubobjectDestroy(unused ref self) {} + // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // CHECK:STDERR: + default fn SubobjectDestroy(unused ref self) {} + final fn SelfDestruct(unused ref self) {} +} diff --git a/toolchain/check/testdata/interface/generic_method.carbon b/toolchain/check/testdata/interface/generic_method.carbon index 1fe570d5e8bf..ccf63031c28a 100644 --- a/toolchain/check/testdata/interface/generic_method.carbon +++ b/toolchain/check/testdata/interface/generic_method.carbon @@ -190,17 +190,56 @@ fn CallIndirect() { // CHECK:STDOUT: %return.patt.8bb: %pattern_type.b33 = return_slot_pattern %return.param_patt.75d, %tuple.type.2cd [concrete] // CHECK:STDOUT: %Y.as.A.impl.F.specific_fn: = specific_function %Y.as.A.impl.F, @Y.as.A.impl.F(%Z) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc23_22.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc23_22.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.6cb: type = pattern_type %X [concrete] +// CHECK:STDOUT: %self.param_patt.925: %pattern_type.6cb = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.617: %pattern_type.6cb = wrapper_binding_pattern self, %self.param_patt.925 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc23_22.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc23_22.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.7ab: type = pattern_type %Y [concrete] +// CHECK:STDOUT: %self.param_patt.1fb: %pattern_type.7ab = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.eee: %pattern_type.7ab = wrapper_binding_pattern self, %self.param_patt.1fb [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc23_22.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc23_22.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.6c4ec3.3: = custom_witness (%Destroy.WithSelf.Op.403171.3), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc23_22.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f8f19d.3: = custom_witness (%Destroy.WithSelf.Op.403171.3, %Destroy.WithSelf.SubobjectDestroy.d01daf.3, %Destroy.WithSelf.SelfDestruct.db3fdb.3), @Destroy [concrete] +// CHECK:STDOUT: %self.param_patt.bff: %pattern_type.b4b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.eb4: %pattern_type.b4b = wrapper_binding_pattern self, %self.param_patt.bff [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc23_22.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc23_22.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.64d: %pattern_type.b33 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.a7a: %pattern_type.b33 = wrapper_binding_pattern self, %self.param_patt.64d [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc23_22.5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.5: type = fn_type @Destroy.WithSelf.Op.loc23_22.5 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.5: %Destroy.WithSelf.Op.type.ef016f.5 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.6c4ec3.5: = custom_witness (%Destroy.WithSelf.Op.403171.5), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.0af: %Destroy.type = facet_value %tuple.type.2cd, (%custom_witness.6c4ec3.5) [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.5f3: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Destroy.facet.0af) [concrete] -// CHECK:STDOUT: %.1e4: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.5f3, %Destroy.facet.0af [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5: type = fn_type @Destroy.WithSelf.SelfDestruct.loc23_22.5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.5: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f8f19d.5: = custom_witness (%Destroy.WithSelf.Op.403171.5, %Destroy.WithSelf.SubobjectDestroy.d01daf.5, %Destroy.WithSelf.SelfDestruct.db3fdb.5), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.6e7: %Destroy.type = facet_value %tuple.type.2cd, (%custom_witness.f8f19d.5) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.a73: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.6e7) [concrete] +// CHECK:STDOUT: %.29b: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.a73, %Destroy.facet.6e7 [concrete] +// CHECK:STDOUT: %self.param_patt.37e: %pattern_type.34e = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.f3f: %pattern_type.34e = wrapper_binding_pattern self, %self.param_patt.37e [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc22 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.6: type = fn_type @Destroy.WithSelf.Op.loc22 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.6: %Destroy.WithSelf.Op.type.ef016f.6 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.6: type = fn_type @Destroy.WithSelf.SelfDestruct.loc22 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.6: %Destroy.WithSelf.SelfDestruct.type.fbceb5.6 = struct_value () [concrete] // CHECK:STDOUT: %BitAndWith.type.a06: type = generic_interface_type @BitAndWith [concrete] // CHECK:STDOUT: %BitAndWith.generic: %BitAndWith.type.a06 = struct_value () [concrete] // CHECK:STDOUT: %BitAndWith.type.411: type = facet_type <@BitAndWith, @BitAndWith(type)> [concrete] @@ -236,13 +275,13 @@ fn CallIndirect() { // CHECK:STDOUT: %require_complete.d14: = require_complete_type %tuple.type.c2a [symbolic] // CHECK:STDOUT: %Destroy.lookup_impl_witness.a02: = lookup_impl_witness %tuple.type.c2a, @Destroy [symbolic] // CHECK:STDOUT: %Destroy.facet.2f8: %Destroy.type = facet_value %tuple.type.c2a, (%Destroy.lookup_impl_witness.a02) [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.2ac: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Destroy.facet.2f8) [symbolic] -// CHECK:STDOUT: %.89c: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.2ac, %Destroy.facet.2f8 [symbolic] -// CHECK:STDOUT: %impl.elem0.a1a: %.89c = impl_witness_access %Destroy.lookup_impl_witness.a02, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.65e: = specific_impl_function %impl.elem0.a1a, @Destroy.WithSelf.Op.1(%Destroy.facet.2f8) [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.3cf: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.2f8) [symbolic] +// CHECK:STDOUT: %.faf: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.3cf, %Destroy.facet.2f8 [symbolic] +// CHECK:STDOUT: %impl.elem2: %.faf = impl_witness_access %Destroy.lookup_impl_witness.a02, element2 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.8a0: = specific_impl_function %impl.elem2, @Destroy.WithSelf.SelfDestruct.1(%Destroy.facet.2f8) [symbolic] // CHECK:STDOUT: %CallIndirect.type: type = fn_type @CallIndirect [concrete] // CHECK:STDOUT: %CallIndirect: %CallIndirect.type = struct_value () [concrete] -// CHECK:STDOUT: %facet_value: %facet_type = facet_value %Y, (%A.impl_witness, %custom_witness.6c4ec3.3) [concrete] +// CHECK:STDOUT: %facet_value: %facet_type = facet_value %Y, (%A.impl_witness, %custom_witness.f8f19d.3) [concrete] // CHECK:STDOUT: %CallGeneric.specific_fn: = specific_function %CallGeneric, @CallGeneric(%facet_value) [concrete] // CHECK:STDOUT: %complete_type.458: = complete_type_witness %ptr.415 [concrete] // CHECK:STDOUT: %complete_type.dec: = complete_type_witness %tuple.type.2cd [concrete] @@ -279,6 +318,93 @@ fn CallIndirect() { // CHECK:STDOUT: %BitAndWith.impl_witness_table = impl_witness_table (%Core.import_ref.9c3), @type.as.BitAndWith.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc23_22.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc23_22.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc23_22.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6cb = ref_param_pattern [concrete = constants.%self.param_patt.925] +// CHECK:STDOUT: %self.patt: %pattern_type.6cb = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.617] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %X = ref_param call_param0 +// CHECK:STDOUT: %self: ref %X = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc23_22.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6cb = ref_param_pattern [concrete = constants.%self.param_patt.925] +// CHECK:STDOUT: %self.patt: %pattern_type.6cb = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.617] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %X = ref_param call_param0 +// CHECK:STDOUT: %self: ref %X = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc23_22.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.7ab = ref_param_pattern [concrete = constants.%self.param_patt.1fb] +// CHECK:STDOUT: %self.patt: %pattern_type.7ab = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.eee] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Y = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Y = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc23_22.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.7ab = ref_param_pattern [concrete = constants.%self.param_patt.1fb] +// CHECK:STDOUT: %self.patt: %pattern_type.7ab = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.eee] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Y = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Y = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc23_22.4 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b4b = ref_param_pattern [concrete = constants.%self.param_patt.bff] +// CHECK:STDOUT: %self.patt: %pattern_type.b4b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.eb4] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr.415 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr.415 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc23_22.4 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b4b = ref_param_pattern [concrete = constants.%self.param_patt.bff] +// CHECK:STDOUT: %self.patt: %pattern_type.b4b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.eb4] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr.415 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr.415 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc23_22.5 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b33 = ref_param_pattern [concrete = constants.%self.param_patt.64d] +// CHECK:STDOUT: %self.patt: %pattern_type.b33 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a7a] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.2cd = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.2cd = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.5: %Destroy.WithSelf.Op.type.ef016f.5 = fn_decl @Destroy.WithSelf.Op.loc23_22.5 [concrete = constants.%Destroy.WithSelf.Op.403171.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b33 = ref_param_pattern [concrete = constants.%self.param_patt.64d] +// CHECK:STDOUT: %self.patt: %pattern_type.b33 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a7a] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.2cd = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.2cd = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc22 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.34e = ref_param_pattern [concrete = constants.%self.param_patt.37e] +// CHECK:STDOUT: %self.patt: %pattern_type.34e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.f3f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Z = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Z = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.6: %Destroy.WithSelf.Op.type.ef016f.6 = fn_decl @Destroy.WithSelf.Op.loc22 [concrete = constants.%Destroy.WithSelf.Op.403171.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.34e = ref_param_pattern [concrete = constants.%self.param_patt.37e] +// CHECK:STDOUT: %self.patt: %pattern_type.34e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.f3f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Z = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Z = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -567,34 +693,88 @@ fn CallIndirect() { // CHECK:STDOUT: %.loc23_22.1: ref %tuple.type.2cd = temporary_storage // CHECK:STDOUT: %Y.as.A.impl.F.call: init %tuple.type.2cd to %.loc23_22.1 = call %specific_fn(%addr) // CHECK:STDOUT: %.loc23_22.2: ref %tuple.type.2cd = temporary %.loc23_22.1, %Y.as.A.impl.F.call -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc23: = bound_method %.loc23_22.2, constants.%Destroy.WithSelf.Op.403171.5 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc23: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc23(%.loc23_22.2) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc22: = bound_method %u.var, constants.%Destroy.WithSelf.Op.403171.6 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc22: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc22(%u.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc23: = bound_method %.loc23_22.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc23: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc23(%.loc23_22.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc22: = bound_method %u.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.6 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc22: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc22(%u.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc23_22.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc23_22.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc23_22.2(%self.param: ref %X) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc23_22.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc23_22.2(%self.param: ref %X) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc23_22.3(%self.param: ref %Y) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc23_22.2(%self.param: ref %X) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc23_22.2(%self.param: ref %X) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc23_22.3(%self.param: ref %Y) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc23_22.3(%self.param: ref %Y) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc23_22.3(%self.param: ref %Y) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc23_22.4(%self.param: ref %ptr.415) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc23_22.4(%self.param: ref %ptr.415) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc23_22.5(%self.param: ref %tuple.type.2cd) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc23_22.4(%self.param: ref %ptr.415) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc23_22.5(%self.param: ref %tuple.type.2cd) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc22(%self.param: ref %Z) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc23_22.5(%self.param: ref %tuple.type.2cd) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc23_22.5(%self.param: ref %tuple.type.2cd) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.5(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.5(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc22(%self.param: ref %Z) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc22(%self.param: ref %Z) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc22(%self.param: ref %Z) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.6(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.6(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -614,10 +794,10 @@ fn CallIndirect() { // CHECK:STDOUT: %require_complete: = require_complete_type %tuple.type [symbolic = %require_complete (constants.%require_complete.d14)] // CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %tuple.type, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.a02)] // CHECK:STDOUT: %Destroy.facet.loc28_12.3: %Destroy.type = facet_value %tuple.type, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.loc28_12.3 (constants.%Destroy.facet.2f8)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Destroy.facet.loc28_12.3) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.2ac)] -// CHECK:STDOUT: %.loc28_12.5: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet.loc28_12.3 [symbolic = %.loc28_12.5 (constants.%.89c)] -// CHECK:STDOUT: %impl.elem0.loc28_12.2: @CallGeneric.%.loc28_12.5 (%.89c) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc28_12.2 (constants.%impl.elem0.a1a)] -// CHECK:STDOUT: %specific_impl_fn.loc28_12.2: = specific_impl_function %impl.elem0.loc28_12.2, @Destroy.WithSelf.Op.1(%Destroy.facet.loc28_12.3) [symbolic = %specific_impl_fn.loc28_12.2 (constants.%specific_impl_fn.65e)] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.loc28_12.3) [symbolic = %Destroy.WithSelf.SelfDestruct.type (constants.%Destroy.WithSelf.SelfDestruct.type.3cf)] +// CHECK:STDOUT: %.loc28_12.5: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type, %Destroy.facet.loc28_12.3 [symbolic = %.loc28_12.5 (constants.%.faf)] +// CHECK:STDOUT: %impl.elem2.loc28_12.2: @CallGeneric.%.loc28_12.5 (%.faf) = impl_witness_access %Destroy.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc28_12.2 (constants.%impl.elem2)] +// CHECK:STDOUT: %specific_impl_fn.loc28_12.2: = specific_impl_function %impl.elem2.loc28_12.2, @Destroy.WithSelf.SelfDestruct.1(%Destroy.facet.loc28_12.3) [symbolic = %specific_impl_fn.loc28_12.2 (constants.%specific_impl_fn.8a0)] // CHECK:STDOUT: // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: @@ -649,17 +829,17 @@ fn CallIndirect() { // CHECK:STDOUT: %.loc28_12.1: ref @CallGeneric.%tuple.type (%tuple.type.c2a) = temporary_storage // CHECK:STDOUT: %A.WithSelf.F.call: init @CallGeneric.%tuple.type (%tuple.type.c2a) to %.loc28_12.1 = call %specific_impl_fn.loc28_4.1(%addr) // CHECK:STDOUT: %.loc28_12.2: ref @CallGeneric.%tuple.type (%tuple.type.c2a) = temporary %.loc28_12.1, %A.WithSelf.F.call -// CHECK:STDOUT: %impl.elem0.loc28_12.1: @CallGeneric.%.loc28_12.5 (%.89c) = impl_witness_access constants.%Destroy.lookup_impl_witness.a02, element0 [symbolic = %impl.elem0.loc28_12.2 (constants.%impl.elem0.a1a)] -// CHECK:STDOUT: %bound_method.loc28_12.1: = bound_method %.loc28_12.2, %impl.elem0.loc28_12.1 +// CHECK:STDOUT: %impl.elem2.loc28_12.1: @CallGeneric.%.loc28_12.5 (%.faf) = impl_witness_access constants.%Destroy.lookup_impl_witness.a02, element2 [symbolic = %impl.elem2.loc28_12.2 (constants.%impl.elem2)] +// CHECK:STDOUT: %bound_method.loc28_12.1: = bound_method %.loc28_12.2, %impl.elem2.loc28_12.1 // CHECK:STDOUT: %Destroy.facet.loc28_12.1: %Destroy.type = facet_value constants.%tuple.type.c2a, (constants.%Destroy.lookup_impl_witness.a02) [symbolic = %Destroy.facet.loc28_12.3 (constants.%Destroy.facet.2f8)] // CHECK:STDOUT: %.loc28_12.3: %Destroy.type = converted constants.%tuple.type.c2a, %Destroy.facet.loc28_12.1 [symbolic = %Destroy.facet.loc28_12.3 (constants.%Destroy.facet.2f8)] // CHECK:STDOUT: %Destroy.facet.loc28_12.2: %Destroy.type = facet_value constants.%tuple.type.c2a, (constants.%Destroy.lookup_impl_witness.a02) [symbolic = %Destroy.facet.loc28_12.3 (constants.%Destroy.facet.2f8)] // CHECK:STDOUT: %.loc28_12.4: %Destroy.type = converted constants.%tuple.type.c2a, %Destroy.facet.loc28_12.2 [symbolic = %Destroy.facet.loc28_12.3 (constants.%Destroy.facet.2f8)] -// CHECK:STDOUT: %specific_impl_fn.loc28_12.1: = specific_impl_function %impl.elem0.loc28_12.1, @Destroy.WithSelf.Op.1(constants.%Destroy.facet.2f8) [symbolic = %specific_impl_fn.loc28_12.2 (constants.%specific_impl_fn.65e)] +// CHECK:STDOUT: %specific_impl_fn.loc28_12.1: = specific_impl_function %impl.elem2.loc28_12.1, @Destroy.WithSelf.SelfDestruct.1(constants.%Destroy.facet.2f8) [symbolic = %specific_impl_fn.loc28_12.2 (constants.%specific_impl_fn.8a0)] // CHECK:STDOUT: %bound_method.loc28_12.2: = bound_method %.loc28_12.2, %specific_impl_fn.loc28_12.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc28: init %empty_tuple.type = call %bound_method.loc28_12.2(%.loc28_12.2) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %u.var, constants.%Destroy.WithSelf.Op.403171.6 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc27: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%u.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc28: init %empty_tuple.type = call %bound_method.loc28_12.2(%.loc28_12.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %u.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.6 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc27: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%u.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -668,7 +848,7 @@ fn CallIndirect() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %CallGeneric.ref: %CallGeneric.type = name_ref CallGeneric, file.%CallGeneric.decl [concrete = constants.%CallGeneric] // CHECK:STDOUT: %Y.ref: type = name_ref Y, file.%Y.decl [concrete = constants.%Y] -// CHECK:STDOUT: %facet_value: %facet_type = facet_value %Y.ref, (constants.%A.impl_witness, constants.%custom_witness.6c4ec3.3) [concrete = constants.%facet_value] +// CHECK:STDOUT: %facet_value: %facet_type = facet_value %Y.ref, (constants.%A.impl_witness, constants.%custom_witness.f8f19d.3) [concrete = constants.%facet_value] // CHECK:STDOUT: %.loc32: %facet_type = converted %Y.ref, %facet_value [concrete = constants.%facet_value] // CHECK:STDOUT: %CallGeneric.specific_fn: = specific_function %CallGeneric.ref, @CallGeneric(constants.%facet_value) [concrete = constants.%CallGeneric.specific_fn] // CHECK:STDOUT: %CallGeneric.call: init %empty_tuple.type = call %CallGeneric.specific_fn() @@ -856,12 +1036,12 @@ fn CallIndirect() { // CHECK:STDOUT: %specific_impl_fn.loc28_4.2 => constants.%Y.as.A.impl.F.specific_fn // CHECK:STDOUT: %tuple.type => constants.%tuple.type.2cd // CHECK:STDOUT: %require_complete => constants.%complete_type.dec -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.6c4ec3.5 -// CHECK:STDOUT: %Destroy.facet.loc28_12.3 => constants.%Destroy.facet.0af -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.5f3 -// CHECK:STDOUT: %.loc28_12.5 => constants.%.1e4 -// CHECK:STDOUT: %impl.elem0.loc28_12.2 => constants.%Destroy.WithSelf.Op.403171.5 -// CHECK:STDOUT: %specific_impl_fn.loc28_12.2 => constants.%Destroy.WithSelf.Op.403171.5 +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.f8f19d.5 +// CHECK:STDOUT: %Destroy.facet.loc28_12.3 => constants.%Destroy.facet.6e7 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.a73 +// CHECK:STDOUT: %.loc28_12.5 => constants.%.29b +// CHECK:STDOUT: %impl.elem2.loc28_12.2 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 +// CHECK:STDOUT: %specific_impl_fn.loc28_12.2 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @A.WithSelf.F(constants.%X, constants.%A.facet.d1f, constants.%Z) { @@ -993,18 +1173,65 @@ fn CallIndirect() { // CHECK:STDOUT: %Z.val: %Z = struct_value () [concrete] // CHECK:STDOUT: %.7dc: ref %Z = temporary invalid, %Z.val [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc24_39.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc24_39.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.6cb: type = pattern_type %X [concrete] +// CHECK:STDOUT: %self.param_patt.925: %pattern_type.6cb = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.617: %pattern_type.6cb = wrapper_binding_pattern self, %self.param_patt.925 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc24_39.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc24_39.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.8d8: type = pattern_type %Y1 [concrete] +// CHECK:STDOUT: %self.param_patt.8d0: %pattern_type.8d8 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.ed1: %pattern_type.8d8 = wrapper_binding_pattern self, %self.param_patt.8d0 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc24_39.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc24_39.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.dd0: type = pattern_type %Y2 [concrete] +// CHECK:STDOUT: %self.param_patt.56b: %pattern_type.dd0 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.27b: %pattern_type.dd0 = wrapper_binding_pattern self, %self.param_patt.56b [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc24_39.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc24_39.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.5df: type = pattern_type %tuple.type.59f [concrete] +// CHECK:STDOUT: %self.param_patt.c06: %pattern_type.5df = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.9dc: %pattern_type.5df = wrapper_binding_pattern self, %self.param_patt.c06 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc24_39.5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.5: type = fn_type @Destroy.WithSelf.Op.loc24_39.5 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.5: %Destroy.WithSelf.Op.type.ef016f.5 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.6c4ec3.5: = custom_witness (%Destroy.WithSelf.Op.403171.5), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5: type = fn_type @Destroy.WithSelf.SelfDestruct.loc24_39.5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.5: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f8f19d.5: = custom_witness (%Destroy.WithSelf.Op.403171.5, %Destroy.WithSelf.SubobjectDestroy.d01daf.5, %Destroy.WithSelf.SelfDestruct.db3fdb.5), @Destroy [concrete] +// CHECK:STDOUT: %self.param_patt.37e: %pattern_type.34e = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.f3f: %pattern_type.34e = wrapper_binding_pattern self, %self.param_patt.37e [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc24_39.6 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.6: type = fn_type @Destroy.WithSelf.Op.loc24_39.6 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.6: %Destroy.WithSelf.Op.type.ef016f.6 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.6: type = fn_type @Destroy.WithSelf.SelfDestruct.loc24_39.6 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.6: %Destroy.WithSelf.SelfDestruct.type.fbceb5.6 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.220: %pattern_type.6a8 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.ce6: %pattern_type.6a8 = wrapper_binding_pattern self, %self.param_patt.220 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc24_39.7 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.7: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.7: type = fn_type @Destroy.WithSelf.Op.loc24_39.7 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.7: %Destroy.WithSelf.Op.type.ef016f.7 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.6c4ec3.7: = custom_witness (%Destroy.WithSelf.Op.403171.7), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.824: %Destroy.type = facet_value %tuple.type.d40, (%custom_witness.6c4ec3.7) [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.779: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Destroy.facet.824) [concrete] -// CHECK:STDOUT: %.c7d: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.779, %Destroy.facet.824 [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.7dc, %Destroy.WithSelf.Op.403171.6 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.7: type = fn_type @Destroy.WithSelf.SelfDestruct.loc24_39.7 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.7: %Destroy.WithSelf.SelfDestruct.type.fbceb5.7 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f8f19d.7: = custom_witness (%Destroy.WithSelf.Op.403171.7, %Destroy.WithSelf.SubobjectDestroy.d01daf.7, %Destroy.WithSelf.SelfDestruct.db3fdb.7), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.3dc: %Destroy.type = facet_value %tuple.type.d40, (%custom_witness.f8f19d.7) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.0da: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.3dc) [concrete] +// CHECK:STDOUT: %.c10: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.0da, %Destroy.facet.3dc [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.7dc, %Destroy.WithSelf.SelfDestruct.db3fdb.6 [concrete] // CHECK:STDOUT: %BitAndWith.type.a06: type = generic_interface_type @BitAndWith [concrete] // CHECK:STDOUT: %BitAndWith.generic: %BitAndWith.type.a06 = struct_value () [concrete] // CHECK:STDOUT: %BitAndWith.type.411: type = facet_type <@BitAndWith, @BitAndWith(type)> [concrete] @@ -1041,13 +1268,13 @@ fn CallIndirect() { // CHECK:STDOUT: %require_complete.4e1: = require_complete_type %tuple.type.036 [symbolic] // CHECK:STDOUT: %Destroy.lookup_impl_witness.8dc: = lookup_impl_witness %tuple.type.036, @Destroy [symbolic] // CHECK:STDOUT: %Destroy.facet.fef: %Destroy.type = facet_value %tuple.type.036, (%Destroy.lookup_impl_witness.8dc) [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.937: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Destroy.facet.fef) [symbolic] -// CHECK:STDOUT: %.93b: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.937, %Destroy.facet.fef [symbolic] -// CHECK:STDOUT: %impl.elem0.743: %.93b = impl_witness_access %Destroy.lookup_impl_witness.8dc, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.618: = specific_impl_function %impl.elem0.743, @Destroy.WithSelf.Op.1(%Destroy.facet.fef) [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.d7b: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.fef) [symbolic] +// CHECK:STDOUT: %.b7a: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.d7b, %Destroy.facet.fef [symbolic] +// CHECK:STDOUT: %impl.elem2: %.b7a = impl_witness_access %Destroy.lookup_impl_witness.8dc, element2 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.613: = specific_impl_function %impl.elem2, @Destroy.WithSelf.SelfDestruct.1(%Destroy.facet.fef) [symbolic] // CHECK:STDOUT: %CallIndirect.type: type = fn_type @CallIndirect [concrete] // CHECK:STDOUT: %CallIndirect: %CallIndirect.type = struct_value () [concrete] -// CHECK:STDOUT: %facet_value: %facet_type = facet_value %tuple.type.59f, (%A.impl_witness.0e0, %custom_witness.6c4ec3.5) [concrete] +// CHECK:STDOUT: %facet_value: %facet_type = facet_value %tuple.type.59f, (%A.impl_witness.0e0, %custom_witness.f8f19d.5) [concrete] // CHECK:STDOUT: %CallGeneric.specific_fn: = specific_function %CallGeneric, @CallGeneric(%facet_value) [concrete] // CHECK:STDOUT: %complete_type.8f6: = complete_type_witness %tuple.type.d40 [concrete] // CHECK:STDOUT: %tuple.b5b: %tuple.type.202 = tuple_value (%X, %A.facet.89e, %Z) [concrete] @@ -1066,6 +1293,107 @@ fn CallIndirect() { // CHECK:STDOUT: %BitAndWith.impl_witness_table = impl_witness_table (%Core.import_ref.9c3), @type.as.BitAndWith.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc24_39.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc24_39.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc24_39.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6cb = ref_param_pattern [concrete = constants.%self.param_patt.925] +// CHECK:STDOUT: %self.patt: %pattern_type.6cb = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.617] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %X = ref_param call_param0 +// CHECK:STDOUT: %self: ref %X = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc24_39.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6cb = ref_param_pattern [concrete = constants.%self.param_patt.925] +// CHECK:STDOUT: %self.patt: %pattern_type.6cb = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.617] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %X = ref_param call_param0 +// CHECK:STDOUT: %self: ref %X = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc24_39.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.8d8 = ref_param_pattern [concrete = constants.%self.param_patt.8d0] +// CHECK:STDOUT: %self.patt: %pattern_type.8d8 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ed1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Y1 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Y1 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc24_39.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.8d8 = ref_param_pattern [concrete = constants.%self.param_patt.8d0] +// CHECK:STDOUT: %self.patt: %pattern_type.8d8 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ed1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Y1 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Y1 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc24_39.4 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.dd0 = ref_param_pattern [concrete = constants.%self.param_patt.56b] +// CHECK:STDOUT: %self.patt: %pattern_type.dd0 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.27b] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Y2 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Y2 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc24_39.4 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.dd0 = ref_param_pattern [concrete = constants.%self.param_patt.56b] +// CHECK:STDOUT: %self.patt: %pattern_type.dd0 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.27b] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Y2 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Y2 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc24_39.5 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.5df = ref_param_pattern [concrete = constants.%self.param_patt.c06] +// CHECK:STDOUT: %self.patt: %pattern_type.5df = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.9dc] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.59f = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.59f = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.5: %Destroy.WithSelf.Op.type.ef016f.5 = fn_decl @Destroy.WithSelf.Op.loc24_39.5 [concrete = constants.%Destroy.WithSelf.Op.403171.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.5df = ref_param_pattern [concrete = constants.%self.param_patt.c06] +// CHECK:STDOUT: %self.patt: %pattern_type.5df = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.9dc] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.59f = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.59f = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc24_39.6 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.34e = ref_param_pattern [concrete = constants.%self.param_patt.37e] +// CHECK:STDOUT: %self.patt: %pattern_type.34e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.f3f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Z = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Z = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.6: %Destroy.WithSelf.Op.type.ef016f.6 = fn_decl @Destroy.WithSelf.Op.loc24_39.6 [concrete = constants.%Destroy.WithSelf.Op.403171.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.34e = ref_param_pattern [concrete = constants.%self.param_patt.37e] +// CHECK:STDOUT: %self.patt: %pattern_type.34e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.f3f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Z = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Z = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.7: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc24_39.7 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.7] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6a8 = ref_param_pattern [concrete = constants.%self.param_patt.220] +// CHECK:STDOUT: %self.patt: %pattern_type.6a8 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ce6] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.d40 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.d40 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.7: %Destroy.WithSelf.Op.type.ef016f.7 = fn_decl @Destroy.WithSelf.Op.loc24_39.7 [concrete = constants.%Destroy.WithSelf.Op.403171.7] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6a8 = ref_param_pattern [concrete = constants.%self.param_patt.220] +// CHECK:STDOUT: %self.patt: %pattern_type.6a8 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ce6] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.d40 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.d40 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -1377,41 +1705,104 @@ fn CallIndirect() { // CHECK:STDOUT: %.loc24_38.6: %Z = acquire_value %.loc24_38.5 [concrete = constants.%Z.val] // CHECK:STDOUT: %tuple.type.as.A.impl.F.call: init %tuple.type.d40 to %.loc24_39.1 = call %specific_fn(%.loc24_38.6) // CHECK:STDOUT: %.loc24_39.2: ref %tuple.type.d40 = temporary %.loc24_39.1, %tuple.type.as.A.impl.F.call -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.loc24_39.2, constants.%Destroy.WithSelf.Op.403171.7 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc24_39: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%.loc24_39.2) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc24_38: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.7dc) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc24_39.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.7 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc24_39: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc24_39.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc24_38: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.7dc) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc24_39.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_39.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_39.2(%self.param: ref %X) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc24_39.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc24_39.2(%self.param: ref %X) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_39.3(%self.param: ref %Y1) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_39.2(%self.param: ref %X) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc24_39.2(%self.param: ref %X) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc24_39.3(%self.param: ref %Y1) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_39.4(%self.param: ref %Y2) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_39.3(%self.param: ref %Y1) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc24_39.3(%self.param: ref %Y1) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc24_39.4(%self.param: ref %Y2) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_39.5(%self.param: ref %tuple.type.59f) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_39.4(%self.param: ref %Y2) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc24_39.4(%self.param: ref %Y2) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc24_39.5(%self.param: ref %tuple.type.59f) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_39.6(%self.param: ref %Z) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_39.5(%self.param: ref %tuple.type.59f) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc24_39.5(%self.param: ref %tuple.type.59f) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.5(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.5(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc24_39.6(%self.param: ref %Z) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_39.7(%self.param: ref %tuple.type.d40) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_39.6(%self.param: ref %Z) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc24_39.6(%self.param: ref %Z) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.6(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.6(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc24_39.7(%self.param: ref %tuple.type.d40) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_39.7(%self.param: ref %tuple.type.d40) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc24_39.7(%self.param: ref %tuple.type.d40) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.7(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.7(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1431,10 +1822,10 @@ fn CallIndirect() { // CHECK:STDOUT: %require_complete: = require_complete_type %tuple.type [symbolic = %require_complete (constants.%require_complete.4e1)] // CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %tuple.type, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.8dc)] // CHECK:STDOUT: %Destroy.facet.loc28_12.3: %Destroy.type = facet_value %tuple.type, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet.loc28_12.3 (constants.%Destroy.facet.fef)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Destroy.facet.loc28_12.3) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.937)] -// CHECK:STDOUT: %.loc28_12.5: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet.loc28_12.3 [symbolic = %.loc28_12.5 (constants.%.93b)] -// CHECK:STDOUT: %impl.elem0.loc28_12.2: @CallGeneric.%.loc28_12.5 (%.93b) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc28_12.2 (constants.%impl.elem0.743)] -// CHECK:STDOUT: %specific_impl_fn.loc28_12.2: = specific_impl_function %impl.elem0.loc28_12.2, @Destroy.WithSelf.Op.1(%Destroy.facet.loc28_12.3) [symbolic = %specific_impl_fn.loc28_12.2 (constants.%specific_impl_fn.618)] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.loc28_12.3) [symbolic = %Destroy.WithSelf.SelfDestruct.type (constants.%Destroy.WithSelf.SelfDestruct.type.d7b)] +// CHECK:STDOUT: %.loc28_12.5: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type, %Destroy.facet.loc28_12.3 [symbolic = %.loc28_12.5 (constants.%.b7a)] +// CHECK:STDOUT: %impl.elem2.loc28_12.2: @CallGeneric.%.loc28_12.5 (%.b7a) = impl_witness_access %Destroy.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc28_12.2 (constants.%impl.elem2)] +// CHECK:STDOUT: %specific_impl_fn.loc28_12.2: = specific_impl_function %impl.elem2.loc28_12.2, @Destroy.WithSelf.SelfDestruct.1(%Destroy.facet.loc28_12.3) [symbolic = %specific_impl_fn.loc28_12.2 (constants.%specific_impl_fn.613)] // CHECK:STDOUT: // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: @@ -1455,16 +1846,16 @@ fn CallIndirect() { // CHECK:STDOUT: %.loc28_11.6: %Z = acquire_value %.loc28_11.5 [concrete = constants.%Z.val] // CHECK:STDOUT: %A.WithSelf.F.call: init @CallGeneric.%tuple.type (%tuple.type.036) to %.loc28_12.1 = call %specific_impl_fn.loc28_4.1(%.loc28_11.6) // CHECK:STDOUT: %.loc28_12.2: ref @CallGeneric.%tuple.type (%tuple.type.036) = temporary %.loc28_12.1, %A.WithSelf.F.call -// CHECK:STDOUT: %impl.elem0.loc28_12.1: @CallGeneric.%.loc28_12.5 (%.93b) = impl_witness_access constants.%Destroy.lookup_impl_witness.8dc, element0 [symbolic = %impl.elem0.loc28_12.2 (constants.%impl.elem0.743)] -// CHECK:STDOUT: %bound_method.loc28_12.1: = bound_method %.loc28_12.2, %impl.elem0.loc28_12.1 +// CHECK:STDOUT: %impl.elem2.loc28_12.1: @CallGeneric.%.loc28_12.5 (%.b7a) = impl_witness_access constants.%Destroy.lookup_impl_witness.8dc, element2 [symbolic = %impl.elem2.loc28_12.2 (constants.%impl.elem2)] +// CHECK:STDOUT: %bound_method.loc28_12.1: = bound_method %.loc28_12.2, %impl.elem2.loc28_12.1 // CHECK:STDOUT: %Destroy.facet.loc28_12.1: %Destroy.type = facet_value constants.%tuple.type.036, (constants.%Destroy.lookup_impl_witness.8dc) [symbolic = %Destroy.facet.loc28_12.3 (constants.%Destroy.facet.fef)] // CHECK:STDOUT: %.loc28_12.3: %Destroy.type = converted constants.%tuple.type.036, %Destroy.facet.loc28_12.1 [symbolic = %Destroy.facet.loc28_12.3 (constants.%Destroy.facet.fef)] // CHECK:STDOUT: %Destroy.facet.loc28_12.2: %Destroy.type = facet_value constants.%tuple.type.036, (constants.%Destroy.lookup_impl_witness.8dc) [symbolic = %Destroy.facet.loc28_12.3 (constants.%Destroy.facet.fef)] // CHECK:STDOUT: %.loc28_12.4: %Destroy.type = converted constants.%tuple.type.036, %Destroy.facet.loc28_12.2 [symbolic = %Destroy.facet.loc28_12.3 (constants.%Destroy.facet.fef)] -// CHECK:STDOUT: %specific_impl_fn.loc28_12.1: = specific_impl_function %impl.elem0.loc28_12.1, @Destroy.WithSelf.Op.1(constants.%Destroy.facet.fef) [symbolic = %specific_impl_fn.loc28_12.2 (constants.%specific_impl_fn.618)] +// CHECK:STDOUT: %specific_impl_fn.loc28_12.1: = specific_impl_function %impl.elem2.loc28_12.1, @Destroy.WithSelf.SelfDestruct.1(constants.%Destroy.facet.fef) [symbolic = %specific_impl_fn.loc28_12.2 (constants.%specific_impl_fn.613)] // CHECK:STDOUT: %bound_method.loc28_12.2: = bound_method %.loc28_12.2, %specific_impl_fn.loc28_12.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc28_12: init %empty_tuple.type = call %bound_method.loc28_12.2(%.loc28_12.2) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc28_11: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.7dc) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc28_12: init %empty_tuple.type = call %bound_method.loc28_12.2(%.loc28_12.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc28_11: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.7dc) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -1477,7 +1868,7 @@ fn CallIndirect() { // CHECK:STDOUT: %.loc33_22: %tuple.type.693 = tuple_literal (%Y1.ref, %Y2.ref) [concrete = constants.%tuple.71f] // CHECK:STDOUT: %.loc33_27: type = type_literal type [concrete = type] // CHECK:STDOUT: %.loc33_24: type = converted %.loc33_22, constants.%tuple.type.59f [concrete = constants.%tuple.type.59f] -// CHECK:STDOUT: %facet_value: %facet_type = facet_value %.loc33_24, (constants.%A.impl_witness.0e0, constants.%custom_witness.6c4ec3.5) [concrete = constants.%facet_value] +// CHECK:STDOUT: %facet_value: %facet_type = facet_value %.loc33_24, (constants.%A.impl_witness.0e0, constants.%custom_witness.f8f19d.5) [concrete = constants.%facet_value] // CHECK:STDOUT: %.loc33_31: %facet_type = converted %.loc33_24, %facet_value [concrete = constants.%facet_value] // CHECK:STDOUT: %CallGeneric.specific_fn: = specific_function %CallGeneric.ref, @CallGeneric(constants.%facet_value) [concrete = constants.%CallGeneric.specific_fn] // CHECK:STDOUT: %CallGeneric.call: init %empty_tuple.type = call %CallGeneric.specific_fn() @@ -1741,12 +2132,12 @@ fn CallIndirect() { // CHECK:STDOUT: %specific_impl_fn.loc28_4.2 => constants.%tuple.type.as.A.impl.F.specific_fn.981 // CHECK:STDOUT: %tuple.type => constants.%tuple.type.d40 // CHECK:STDOUT: %require_complete => constants.%complete_type.8f6 -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.6c4ec3.7 -// CHECK:STDOUT: %Destroy.facet.loc28_12.3 => constants.%Destroy.facet.824 -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.779 -// CHECK:STDOUT: %.loc28_12.5 => constants.%.c7d -// CHECK:STDOUT: %impl.elem0.loc28_12.2 => constants.%Destroy.WithSelf.Op.403171.7 -// CHECK:STDOUT: %specific_impl_fn.loc28_12.2 => constants.%Destroy.WithSelf.Op.403171.7 +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.f8f19d.7 +// CHECK:STDOUT: %Destroy.facet.loc28_12.3 => constants.%Destroy.facet.3dc +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.0da +// CHECK:STDOUT: %.loc28_12.5 => constants.%.c10 +// CHECK:STDOUT: %impl.elem2.loc28_12.2 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.7 +// CHECK:STDOUT: %specific_impl_fn.loc28_12.2 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.7 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @A.WithSelf.F(constants.%X, constants.%A.facet.89e, constants.%Z) { diff --git a/toolchain/check/testdata/interface/modifiers.carbon b/toolchain/check/testdata/interface/modifiers.carbon index 530b160aabd7..36d13d99cefb 100644 --- a/toolchain/check/testdata/interface/modifiers.carbon +++ b/toolchain/check/testdata/interface/modifiers.carbon @@ -860,9 +860,22 @@ interface C { // CHECK:STDOUT: %CallMethod.type: type = fn_type @CallMethod [concrete] // CHECK:STDOUT: %CallMethod: %CallMethod.type = struct_value () [concrete] // CHECK:STDOUT: %CallMethod.specific_fn: = specific_function %CallMethod, @CallMethod(%DefaultMethod.facet) [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_15.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc11_15.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.99a: %pattern_type.98b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.cbd: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt.99a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_15.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc11_15.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.115, %Destroy.WithSelf.Op.403171.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc11_15.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.115, %Destroy.WithSelf.SelfDestruct.db3fdb.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -870,6 +883,37 @@ interface C { // CHECK:STDOUT: %Main.CallMethod: %CallMethod.type = import_ref Main//default_interfaces, CallMethod, loaded [concrete = constants.%CallMethod] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_15.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc11_15.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_15.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc11_15.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {} @@ -920,14 +964,32 @@ interface C { // CHECK:STDOUT: %.loc12_15.2: %DefaultMethod.type = converted constants.%C, %DefaultMethod.facet.loc12_15.2 [concrete = constants.%DefaultMethod.facet] // CHECK:STDOUT: %CallMethod.specific_fn: = specific_function %CallMethod.ref, @CallMethod(constants.%DefaultMethod.facet) [concrete = constants.%CallMethod.specific_fn] // CHECK:STDOUT: %CallMethod.call: init %empty_tuple.type = call %CallMethod.specific_fn(%c.ref) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.115) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.115) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_15.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_15.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_15.2(%self.param: ref %C) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_15.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_15.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_15.2(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_15.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1046,9 +1108,22 @@ interface C { // CHECK:STDOUT: %CallMethod.type: type = fn_type @CallMethod [concrete] // CHECK:STDOUT: %CallMethod: %CallMethod.type = struct_value () [concrete] // CHECK:STDOUT: %CallMethod.specific_fn: = specific_function %CallMethod, @CallMethod(%DefaultMethod.facet) [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc14_15.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc14_15.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.99a: %pattern_type.98b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.cbd: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt.99a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc14_15.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc14_15.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.115, %Destroy.WithSelf.Op.403171.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc14_15.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.115, %Destroy.WithSelf.SelfDestruct.db3fdb.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1056,6 +1131,37 @@ interface C { // CHECK:STDOUT: %Main.CallMethod: %CallMethod.type = import_ref Main//default_interfaces, CallMethod, loaded [concrete = constants.%CallMethod] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc14_15.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc14_15.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc14_15.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc14_15.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {} @@ -1137,14 +1243,32 @@ interface C { // CHECK:STDOUT: %.loc15_15.2: %DefaultMethod.type = converted constants.%C, %DefaultMethod.facet.loc15_15.2 [concrete = constants.%DefaultMethod.facet] // CHECK:STDOUT: %CallMethod.specific_fn: = specific_function %CallMethod.ref, @CallMethod(constants.%DefaultMethod.facet) [concrete = constants.%CallMethod.specific_fn] // CHECK:STDOUT: %CallMethod.call: init %empty_tuple.type = call %CallMethod.specific_fn(%c.ref) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.115) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.115) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc14_15.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc14_15.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc14_15.2(%self.param: ref %C) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc14_15.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc14_15.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc14_15.2(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc14_15.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1238,9 +1362,22 @@ interface C { // CHECK:STDOUT: %CallMethod.type: type = fn_type @CallMethod [concrete] // CHECK:STDOUT: %CallMethod: %CallMethod.type = struct_value () [concrete] // CHECK:STDOUT: %CallMethod.specific_fn: = specific_function %CallMethod, @CallMethod(%FinalMethod.facet) [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_15.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc11_15.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.99a: %pattern_type.98b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.cbd: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt.99a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_15.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc11_15.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.115, %Destroy.WithSelf.Op.403171.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc11_15.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.115, %Destroy.WithSelf.SelfDestruct.db3fdb.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1248,6 +1385,37 @@ interface C { // CHECK:STDOUT: %Main.CallMethod: %CallMethod.type = import_ref Main//final_interfaces, CallMethod, loaded [concrete = constants.%CallMethod] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_15.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc11_15.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_15.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc11_15.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {} @@ -1298,14 +1466,32 @@ interface C { // CHECK:STDOUT: %.loc12_15.2: %FinalMethod.type = converted constants.%C, %FinalMethod.facet.loc12_15.2 [concrete = constants.%FinalMethod.facet] // CHECK:STDOUT: %CallMethod.specific_fn: = specific_function %CallMethod.ref, @CallMethod(constants.%FinalMethod.facet) [concrete = constants.%CallMethod.specific_fn] // CHECK:STDOUT: %CallMethod.call: init %empty_tuple.type = call %CallMethod.specific_fn(%c.ref) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.115) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.115) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_15.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_15.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_15.2(%self.param: ref %C) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_15.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_15.2(%self.param: ref %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_15.2(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_15.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/observe.carbon b/toolchain/check/testdata/interface/observe.carbon index a5ea9a37ffec..368ca6fc6658 100644 --- a/toolchain/check/testdata/interface/observe.carbon +++ b/toolchain/check/testdata/interface/observe.carbon @@ -401,17 +401,17 @@ fn F[T: I(C)](t: T) { // CHECK:STDOUT: %Transitive.assoc_type: type = assoc_entity_type @Transitive [concrete] // CHECK:STDOUT: %assoc0.1be: %Transitive.assoc_type = assoc_entity element0, @Transitive.WithSelf.%A [concrete] // CHECK:STDOUT: %Transitive.lookup_impl_witness: = lookup_impl_witness %Self.77c, @Transitive [symbolic] -// CHECK:STDOUT: %impl.elem0: %facet_type.b1b = impl_witness_access %Transitive.lookup_impl_witness, element0 [symbolic] +// CHECK:STDOUT: %impl.elem0.b02: %facet_type.b1b = impl_witness_access %Transitive.lookup_impl_witness, element0 [symbolic] // CHECK:STDOUT: %facet_type.130: type = facet_type <@Q & @Destroy where TODO> [concrete] // CHECK:STDOUT: %assoc1: %Transitive.assoc_type = assoc_entity element1, @Transitive.WithSelf.%B [concrete] -// CHECK:STDOUT: %impl.elem1: %facet_type.130 = impl_witness_access %Transitive.lookup_impl_witness, element1 [symbolic] +// CHECK:STDOUT: %impl.elem1.1d6: %facet_type.130 = impl_witness_access %Transitive.lookup_impl_witness, element1 [symbolic] // CHECK:STDOUT: %facet_type.4c8: type = facet_type <@R & @Destroy where TODO> [concrete] // CHECK:STDOUT: %assoc2: %Transitive.assoc_type = assoc_entity element2, @Transitive.WithSelf.%C [concrete] // CHECK:STDOUT: %Self.as_type.7f2: type = facet_access_type %Self.77c [symbolic] // CHECK:STDOUT: %pattern_type.b5c: type = pattern_type %Self.as_type.7f2 [symbolic] // CHECK:STDOUT: %self.param_patt.ae9: %pattern_type.b5c = value_param_pattern [symbolic] // CHECK:STDOUT: %self.patt.03f: %pattern_type.b5c = wrapper_binding_pattern self, %self.param_patt.ae9 [symbolic] -// CHECK:STDOUT: %as_type.d30: type = facet_access_type %impl.elem0 [symbolic] +// CHECK:STDOUT: %as_type.d30: type = facet_access_type %impl.elem0.b02 [symbolic] // CHECK:STDOUT: %.117: Core.Form = init_form %as_type.d30 [symbolic] // CHECK:STDOUT: %pattern_type.51a: type = pattern_type %as_type.d30 [symbolic] // CHECK:STDOUT: %return.param_patt.931: %pattern_type.51a = out_param_pattern [symbolic] @@ -427,7 +427,7 @@ fn F[T: I(C)](t: T) { // CHECK:STDOUT: %Transitive.WithSelf.TakesC.type: type = fn_type @Transitive.WithSelf.TakesC, @Transitive.WithSelf(%Self.77c) [symbolic] // CHECK:STDOUT: %Transitive.WithSelf.TakesC: %Transitive.WithSelf.TakesC.type = struct_value () [symbolic] // CHECK:STDOUT: %assoc4: %Transitive.assoc_type = assoc_entity element4, @Transitive.WithSelf.%Transitive.WithSelf.TakesC.decl [concrete] -// CHECK:STDOUT: %as_type.aed: type = facet_access_type %impl.elem1 [symbolic] +// CHECK:STDOUT: %as_type.aed: type = facet_access_type %impl.elem1.1d6 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -454,8 +454,8 @@ fn F[T: I(C)](t: T) { // CHECK:STDOUT: %return.param_patt.loc13_20.1: @Transitive.WithSelf.GetA.%pattern_type.loc13_20 (%pattern_type.51a) = out_param_pattern [symbolic = %return.param_patt.loc13_20.2 (constants.%return.param_patt.931)] // CHECK:STDOUT: %return.patt.loc13_17.1: @Transitive.WithSelf.GetA.%pattern_type.loc13_20 (%pattern_type.51a) = return_slot_pattern %return.param_patt.loc13_20.1, %.loc13_20.2 [symbolic = %return.patt.loc13_17.2 (constants.%return.patt.680)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %impl.elem0.loc13_20.2: %facet_type.b1b = impl_witness_access constants.%Transitive.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc13_20.1 (constants.%impl.elem0)] -// CHECK:STDOUT: %A.ref: %facet_type.b1b = name_ref A, %impl.elem0.loc13_20.2 [symbolic = %impl.elem0.loc13_20.1 (constants.%impl.elem0)] +// CHECK:STDOUT: %impl.elem0.loc13_20.2: %facet_type.b1b = impl_witness_access constants.%Transitive.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc13_20.1 (constants.%impl.elem0.b02)] +// CHECK:STDOUT: %A.ref: %facet_type.b1b = name_ref A, %impl.elem0.loc13_20.2 [symbolic = %impl.elem0.loc13_20.1 (constants.%impl.elem0.b02)] // CHECK:STDOUT: %A.as_type: type = facet_access_type %A.ref [symbolic = %as_type (constants.%as_type.d30)] // CHECK:STDOUT: %.loc13_20.2: type = converted %A.ref, %A.as_type [symbolic = %as_type (constants.%as_type.d30)] // CHECK:STDOUT: %.loc13_20.3: Core.Form = init_form %.loc13_20.2 [symbolic = %.loc13_20.1 (constants.%.117)] @@ -493,10 +493,10 @@ fn F[T: I(C)](t: T) { // CHECK:STDOUT: %c: @Transitive.WithSelf.TakesC.%as_type (%as_type.472) = wrapper_binding c, %c.param // CHECK:STDOUT: } // CHECK:STDOUT: %assoc4: %Transitive.assoc_type = assoc_entity element4, %Transitive.WithSelf.TakesC.decl [concrete = constants.%assoc4] -// CHECK:STDOUT: %impl.elem0.loc16: %facet_type.b1b = impl_witness_access constants.%Transitive.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10 (constants.%impl.elem0)] -// CHECK:STDOUT: %A.ref: %facet_type.b1b = name_ref A, %impl.elem0.loc16 [symbolic = %impl.elem0.loc10 (constants.%impl.elem0)] -// CHECK:STDOUT: %impl.elem1.loc16: %facet_type.130 = impl_witness_access constants.%Transitive.lookup_impl_witness, element1 [symbolic = %impl.elem1.loc11 (constants.%impl.elem1)] -// CHECK:STDOUT: %B.ref: %facet_type.130 = name_ref B, %impl.elem1.loc16 [symbolic = %impl.elem1.loc11 (constants.%impl.elem1)] +// CHECK:STDOUT: %impl.elem0.loc16: %facet_type.b1b = impl_witness_access constants.%Transitive.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc10 (constants.%impl.elem0.b02)] +// CHECK:STDOUT: %A.ref: %facet_type.b1b = name_ref A, %impl.elem0.loc16 [symbolic = %impl.elem0.loc10 (constants.%impl.elem0.b02)] +// CHECK:STDOUT: %impl.elem1.loc16: %facet_type.130 = impl_witness_access constants.%Transitive.lookup_impl_witness, element1 [symbolic = %impl.elem1.loc11 (constants.%impl.elem1.1d6)] +// CHECK:STDOUT: %B.ref: %facet_type.130 = name_ref B, %impl.elem1.loc16 [symbolic = %impl.elem1.loc11 (constants.%impl.elem1.1d6)] // CHECK:STDOUT: %B.as_type.loc16_16.1: type = facet_access_type %B.ref [symbolic = %as_type.loc16_16 (constants.%as_type.aed)] // CHECK:STDOUT: %.loc16_16.1: type = converted %B.ref, %B.as_type.loc16_16.1 [symbolic = %as_type.loc16_16 (constants.%as_type.aed)] // CHECK:STDOUT: %A.as_type: type = facet_access_type %A.ref [symbolic = %as_type.loc16_11 (constants.%as_type.d30)] @@ -528,7 +528,7 @@ fn F[T: I(C)](t: T) { // CHECK:STDOUT: // CHECK:STDOUT: !observes: // CHECK:STDOUT: @Transitive.observe { -// CHECK:STDOUT: observe constants.%impl.elem0 == constants.%impl.elem1 == constants.%impl.elem2 +// CHECK:STDOUT: observe constants.%impl.elem0.b02 == constants.%impl.elem1.1d6 == constants.%impl.elem2 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -539,7 +539,7 @@ fn F[T: I(C)](t: T) { // CHECK:STDOUT: %self.param_patt.loc13_11.2: @Transitive.WithSelf.GetA.%pattern_type.loc13_11 (%pattern_type.b5c) = value_param_pattern [symbolic = %self.param_patt.loc13_11.2 (constants.%self.param_patt.ae9)] // CHECK:STDOUT: %self.patt.loc13_11.2: @Transitive.WithSelf.GetA.%pattern_type.loc13_11 (%pattern_type.b5c) = wrapper_binding_pattern self, %self.param_patt.loc13_11.2 [symbolic = %self.patt.loc13_11.2 (constants.%self.patt.03f)] // CHECK:STDOUT: %Transitive.lookup_impl_witness: = lookup_impl_witness %Self, @Transitive [symbolic = %Transitive.lookup_impl_witness (constants.%Transitive.lookup_impl_witness)] -// CHECK:STDOUT: %impl.elem0.loc13_20.1: %facet_type.b1b = impl_witness_access %Transitive.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc13_20.1 (constants.%impl.elem0)] +// CHECK:STDOUT: %impl.elem0.loc13_20.1: %facet_type.b1b = impl_witness_access %Transitive.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc13_20.1 (constants.%impl.elem0.b02)] // CHECK:STDOUT: %as_type: type = facet_access_type %impl.elem0.loc13_20.1 [symbolic = %as_type (constants.%as_type.d30)] // CHECK:STDOUT: %.loc13_20.1: Core.Form = init_form %as_type [symbolic = %.loc13_20.1 (constants.%.117)] // CHECK:STDOUT: %pattern_type.loc13_20: type = pattern_type %as_type [symbolic = %pattern_type.loc13_20 (constants.%pattern_type.51a)] @@ -574,7 +574,7 @@ fn F[T: I(C)](t: T) { // CHECK:STDOUT: %self.param_patt.loc13_11.2 => constants.%self.param_patt.ae9 // CHECK:STDOUT: %self.patt.loc13_11.2 => constants.%self.patt.03f // CHECK:STDOUT: %Transitive.lookup_impl_witness => constants.%Transitive.lookup_impl_witness -// CHECK:STDOUT: %impl.elem0.loc13_20.1 => constants.%impl.elem0 +// CHECK:STDOUT: %impl.elem0.loc13_20.1 => constants.%impl.elem0.b02 // CHECK:STDOUT: %as_type => constants.%as_type.d30 // CHECK:STDOUT: %.loc13_20.1 => constants.%.117 // CHECK:STDOUT: %pattern_type.loc13_20 => constants.%pattern_type.51a @@ -946,8 +946,8 @@ fn F[T: I(C)](t: T) { // CHECK:STDOUT: %self.param_patt.ee4: %pattern_type.f76 = value_param_pattern [symbolic] // CHECK:STDOUT: %self.patt.59e: %pattern_type.f76 = wrapper_binding_pattern self, %self.param_patt.ee4 [symbolic] // CHECK:STDOUT: %I.lookup_impl_witness: = lookup_impl_witness %Self.dca, @I, @I(%T) [symbolic] -// CHECK:STDOUT: %impl.elem0: %facet_type.208 = impl_witness_access %I.lookup_impl_witness, element0 [symbolic] -// CHECK:STDOUT: %as_type: type = facet_access_type %impl.elem0 [symbolic] +// CHECK:STDOUT: %impl.elem0.1fd: %facet_type.208 = impl_witness_access %I.lookup_impl_witness, element0 [symbolic] +// CHECK:STDOUT: %as_type: type = facet_access_type %impl.elem0.1fd [symbolic] // CHECK:STDOUT: %.344: Core.Form = init_form %as_type [symbolic] // CHECK:STDOUT: %pattern_type.079: type = pattern_type %as_type [symbolic] // CHECK:STDOUT: %return.param_patt.82c: %pattern_type.079 = out_param_pattern [symbolic] @@ -1018,8 +1018,8 @@ fn F[T: I(C)](t: T) { // CHECK:STDOUT: %return.param_patt.loc9_20.1: @I.WithSelf.GetU.%pattern_type.loc9_20 (%pattern_type.079) = out_param_pattern [symbolic = %return.param_patt.loc9_20.2 (constants.%return.param_patt.82c)] // CHECK:STDOUT: %return.patt.loc9_17.1: @I.WithSelf.GetU.%pattern_type.loc9_20 (%pattern_type.079) = return_slot_pattern %return.param_patt.loc9_20.1, %.loc9_20.2 [symbolic = %return.patt.loc9_17.2 (constants.%return.patt.4f7)] // CHECK:STDOUT: } { -// CHECK:STDOUT: %impl.elem0.loc9_20.2: %facet_type.208 = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc9_20.1 (constants.%impl.elem0)] -// CHECK:STDOUT: %U.ref: %facet_type.208 = name_ref U, %impl.elem0.loc9_20.2 [symbolic = %impl.elem0.loc9_20.1 (constants.%impl.elem0)] +// CHECK:STDOUT: %impl.elem0.loc9_20.2: %facet_type.208 = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc9_20.1 (constants.%impl.elem0.1fd)] +// CHECK:STDOUT: %U.ref: %facet_type.208 = name_ref U, %impl.elem0.loc9_20.2 [symbolic = %impl.elem0.loc9_20.1 (constants.%impl.elem0.1fd)] // CHECK:STDOUT: %U.as_type: type = facet_access_type %U.ref [symbolic = %as_type (constants.%as_type)] // CHECK:STDOUT: %.loc9_20.2: type = converted %U.ref, %U.as_type [symbolic = %as_type (constants.%as_type)] // CHECK:STDOUT: %.loc9_20.3: Core.Form = init_form %.loc9_20.2 [symbolic = %.loc9_20.1 (constants.%.344)] @@ -1059,8 +1059,8 @@ fn F[T: I(C)](t: T) { // CHECK:STDOUT: } // CHECK:STDOUT: %assoc2.loc10_24.1: @I.WithSelf.%I.assoc_type (%I.assoc_type) = assoc_entity element2, %I.WithSelf.TakesT.decl [symbolic = %assoc2.loc10_24.2 (constants.%assoc2)] // CHECK:STDOUT: %T.ref: %facet_type.8cb = name_ref T, @I.%T.loc6_14.2 [symbolic = %T (constants.%T)] -// CHECK:STDOUT: %impl.elem0.loc12_16.1: %facet_type.208 = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc12_16.2 (constants.%impl.elem0)] -// CHECK:STDOUT: %U.ref: %facet_type.208 = name_ref U, %impl.elem0.loc12_16.1 [symbolic = %impl.elem0.loc12_16.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %impl.elem0.loc12_16.1: %facet_type.208 = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc12_16.2 (constants.%impl.elem0.1fd)] +// CHECK:STDOUT: %U.ref: %facet_type.208 = name_ref U, %impl.elem0.loc12_16.1 [symbolic = %impl.elem0.loc12_16.2 (constants.%impl.elem0.1fd)] // CHECK:STDOUT: %U.as_type: type = facet_access_type %U.ref [symbolic = %as_type (constants.%as_type)] // CHECK:STDOUT: %.loc12_16: type = converted %U.ref, %U.as_type [symbolic = %as_type (constants.%as_type)] // CHECK:STDOUT: %T.as_type.loc12_11.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc12_11.2 (constants.%T.as_type)] @@ -1082,7 +1082,7 @@ fn F[T: I(C)](t: T) { // CHECK:STDOUT: // CHECK:STDOUT: !observes: // CHECK:STDOUT: @I.observe { -// CHECK:STDOUT: observe constants.%T == constants.%impl.elem0 +// CHECK:STDOUT: observe constants.%T == constants.%impl.elem0.1fd // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -1096,7 +1096,7 @@ fn F[T: I(C)](t: T) { // CHECK:STDOUT: %self.param_patt.loc9_11.2: @I.WithSelf.GetU.%pattern_type.loc9_11 (%pattern_type.f76) = value_param_pattern [symbolic = %self.param_patt.loc9_11.2 (constants.%self.param_patt.ee4)] // CHECK:STDOUT: %self.patt.loc9_11.2: @I.WithSelf.GetU.%pattern_type.loc9_11 (%pattern_type.f76) = wrapper_binding_pattern self, %self.param_patt.loc9_11.2 [symbolic = %self.patt.loc9_11.2 (constants.%self.patt.59e)] // CHECK:STDOUT: %I.lookup_impl_witness: = lookup_impl_witness %Self, @I, @I(%T) [symbolic = %I.lookup_impl_witness (constants.%I.lookup_impl_witness)] -// CHECK:STDOUT: %impl.elem0.loc9_20.1: %facet_type.208 = impl_witness_access %I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc9_20.1 (constants.%impl.elem0)] +// CHECK:STDOUT: %impl.elem0.loc9_20.1: %facet_type.208 = impl_witness_access %I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc9_20.1 (constants.%impl.elem0.1fd)] // CHECK:STDOUT: %as_type: type = facet_access_type %impl.elem0.loc9_20.1 [symbolic = %as_type (constants.%as_type)] // CHECK:STDOUT: %.loc9_20.1: Core.Form = init_form %as_type [symbolic = %.loc9_20.1 (constants.%.344)] // CHECK:STDOUT: %pattern_type.loc9_20: type = pattern_type %as_type [symbolic = %pattern_type.loc9_20 (constants.%pattern_type.079)] @@ -1138,7 +1138,7 @@ fn F[T: I(C)](t: T) { // CHECK:STDOUT: %self.param_patt.loc9_11.2 => constants.%self.param_patt.ee4 // CHECK:STDOUT: %self.patt.loc9_11.2 => constants.%self.patt.59e // CHECK:STDOUT: %I.lookup_impl_witness => constants.%I.lookup_impl_witness -// CHECK:STDOUT: %impl.elem0.loc9_20.1 => constants.%impl.elem0 +// CHECK:STDOUT: %impl.elem0.loc9_20.1 => constants.%impl.elem0.1fd // CHECK:STDOUT: %as_type => constants.%as_type // CHECK:STDOUT: %.loc9_20.1 => constants.%.344 // CHECK:STDOUT: %pattern_type.loc9_20 => constants.%pattern_type.079 diff --git a/toolchain/check/testdata/interop/cpp/basics/import/indirect.carbon b/toolchain/check/testdata/interop/cpp/basics/import/indirect.carbon index 85386f4d8f37..e8bde91ed082 100644 --- a/toolchain/check/testdata/interop/cpp/basics/import/indirect.carbon +++ b/toolchain/check/testdata/interop/cpp/basics/import/indirect.carbon @@ -154,6 +154,7 @@ fn UseZ() -> Cpp.A.Z { // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] // CHECK:STDOUT: %X: type = class_type @X [concrete] +// CHECK:STDOUT: %pattern_type.88a: type = pattern_type %X [concrete] // CHECK:STDOUT: %X.elem: type = unbound_element_type %X, %i32 [concrete] // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.type.ac8: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] @@ -165,8 +166,14 @@ fn UseZ() -> Cpp.A.Z { // CHECK:STDOUT: %Copy.WithSelf.Op.type.381: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet) [concrete] // CHECK:STDOUT: %.737: type = fn_type_with_self_type %Copy.WithSelf.Op.type.381, %Copy.facet [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.4f6, @Int.as.Copy.impl.Op(%int_32) [concrete] +// CHECK:STDOUT: %self.param_patt.d52: %pattern_type.88a = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.b78: %pattern_type.88a = wrapper_binding_pattern self, %self.param_patt.d52 [concrete] // CHECK:STDOUT: %X.cpp_destructor.type: type = fn_type @X.cpp_destructor [concrete] // CHECK:STDOUT: %X.cpp_destructor: %X.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc10 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: %X.g.cpp_overload_set.type: type = cpp_overload_set_type @X.g.cpp_overload_set [concrete] // CHECK:STDOUT: %X.g.cpp_overload_set.value: %X.g.cpp_overload_set.type = cpp_overload_set_value @X.g.cpp_overload_set [concrete] // CHECK:STDOUT: %X.g.type: type = fn_type @X.g [concrete] @@ -177,6 +184,11 @@ fn UseZ() -> Cpp.A.Z { // CHECK:STDOUT: %Main.F: %F.type = import_ref Main//direct_import, F, loaded [concrete = constants.%F] // CHECK:STDOUT: %Core.import_ref.cd6: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.ac8) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.5e0)] // CHECK:STDOUT: %Copy.impl_witness_table.8d2 = impl_witness_table (%Core.import_ref.cd6), @Int.as.Copy.impl [concrete] +// CHECK:STDOUT: %X.cpp_destructor.decl: %X.cpp_destructor.type = fn_decl @X.cpp_destructor [concrete = constants.%X.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } // CHECK:STDOUT: %X.g.cpp_overload_set.value: %X.g.cpp_overload_set.type = cpp_overload_set_value @X.g.cpp_overload_set [concrete = constants.%X.g.cpp_overload_set.value] // CHECK:STDOUT: %X.g.decl: %X.g.type = fn_decl @X.g [concrete = constants.%X.g] { // CHECK:STDOUT: @@ -185,6 +197,16 @@ fn UseZ() -> Cpp.A.Z { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc10 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.88a = ref_param_pattern [concrete = constants.%self.param_patt.d52] +// CHECK:STDOUT: %self.patt: %pattern_type.88a = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.b78] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %X = ref_param call_param0 +// CHECK:STDOUT: %self: ref %X = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @Field() -> out %return.param: %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%Main.F [concrete = constants.%F] @@ -199,11 +221,20 @@ fn UseZ() -> Cpp.A.Z { // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] // CHECK:STDOUT: %bound_method.loc10_13.2: = bound_method %.loc10_13.2, %specific_fn // CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc10_13.2(%.loc10_13.2) -// CHECK:STDOUT: %X.cpp_destructor.bound: = bound_method %.loc10_12.2, constants.%X.cpp_destructor -// CHECK:STDOUT: %X.cpp_destructor.call: init %empty_tuple.type = call %X.cpp_destructor.bound(%.loc10_12.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc10_12.2, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc10_12.2) // CHECK:STDOUT: return %Int.as.Copy.impl.Op.call // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10(%self.param: ref %X) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10(%self.param: ref %X) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param) +// CHECK:STDOUT: %X.cpp_destructor.call: init %empty_tuple.type = call imports.%X.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @Function() -> out %return.param: %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%Main.F [concrete = constants.%F] @@ -214,8 +245,8 @@ fn UseZ() -> Cpp.A.Z { // CHECK:STDOUT: %bound_method: = bound_method %.loc16_12.2, %g.ref // CHECK:STDOUT: %.loc16_12.3: %X = acquire_value %.loc16_12.2 // CHECK:STDOUT: %X.g.call: init %i32 = call imports.%X.g.decl(%.loc16_12.3) -// CHECK:STDOUT: %X.cpp_destructor.bound: = bound_method %.loc16_12.2, constants.%X.cpp_destructor -// CHECK:STDOUT: %X.cpp_destructor.call: init %empty_tuple.type = call %X.cpp_destructor.bound(%.loc16_12.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc16_12.2, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc16_12.2) // CHECK:STDOUT: return %X.g.call // CHECK:STDOUT: } // CHECK:STDOUT: @@ -253,6 +284,8 @@ fn UseZ() -> Cpp.A.Z { // CHECK:STDOUT: %int_1.0c6: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %X.g.cpp_overload_set.type: type = cpp_overload_set_type @X.g.cpp_overload_set [concrete] // CHECK:STDOUT: %X.g.cpp_overload_set.value: %X.g.cpp_overload_set.type = cpp_overload_set_value @X.g.cpp_overload_set [concrete] +// CHECK:STDOUT: %self.param_patt.d52: %pattern_type.88a = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.b78: %pattern_type.88a = wrapper_binding_pattern self, %self.param_patt.d52 [concrete] // CHECK:STDOUT: %X.g.type: type = fn_type @X.g [concrete] // CHECK:STDOUT: %X.g: %X.g.type = struct_value () [concrete] // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] @@ -267,6 +300,10 @@ fn UseZ() -> Cpp.A.Z { // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.4f6, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %X.cpp_destructor.type: type = fn_type @X.cpp_destructor [concrete] // CHECK:STDOUT: %X.cpp_destructor: %X.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -286,6 +323,21 @@ fn UseZ() -> Cpp.A.Z { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import_ref.cd6: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.ac8) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.5e0)] // CHECK:STDOUT: %Copy.impl_witness_table.8d2 = impl_witness_table (%Core.import_ref.cd6), @Int.as.Copy.impl [concrete] +// CHECK:STDOUT: %X.cpp_destructor.decl: %X.cpp_destructor.type = fn_decl @X.cpp_destructor [concrete = constants.%X.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc9 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.88a = ref_param_pattern [concrete = constants.%self.param_patt.d52] +// CHECK:STDOUT: %self.patt: %pattern_type.88a = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.b78] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %X = ref_param call_param0 +// CHECK:STDOUT: %self: ref %X = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Use() -> out %return.param: %tuple.type.e55 { @@ -331,11 +383,20 @@ fn UseZ() -> Cpp.A.Z { // CHECK:STDOUT: %.loc10_23.3: init %i32 to %tuple.elem1 = in_place_init %X.g.call // CHECK:STDOUT: %.loc10_23.4: init %tuple.type.e55 to %return.param = tuple_init (%.loc10_23.2, %.loc10_23.3) // CHECK:STDOUT: %.loc10_24: init %tuple.type.e55 = converted %.loc10_23.1, %.loc10_23.4 -// CHECK:STDOUT: %X.cpp_destructor.bound: = bound_method %ax.var, constants.%X.cpp_destructor -// CHECK:STDOUT: %X.cpp_destructor.call: init %empty_tuple.type = call %X.cpp_destructor.bound(%ax.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %ax.var, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%ax.var) // CHECK:STDOUT: return %.loc10_24 to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9(%self.param: ref %X) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9(%self.param: ref %X) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param) +// CHECK:STDOUT: %X.cpp_destructor.call: init %empty_tuple.type = call imports.%X.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- import_template.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -347,6 +408,7 @@ fn UseZ() -> Cpp.A.Z { // CHECK:STDOUT: %G.type: type = fn_type @G [concrete] // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] // CHECK:STDOUT: %Y.90c: type = class_type @Y.1 [concrete] +// CHECK:STDOUT: %pattern_type.fa7: type = pattern_type %Y.90c [concrete] // CHECK:STDOUT: %Y.elem.ab3: type = unbound_element_type %Y.90c, %i32 [concrete] // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.type.ac8: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] @@ -358,12 +420,19 @@ fn UseZ() -> Cpp.A.Z { // CHECK:STDOUT: %Copy.WithSelf.Op.type.381: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet.1e1) [concrete] // CHECK:STDOUT: %.737: type = fn_type_with_self_type %Copy.WithSelf.Op.type.381, %Copy.facet.1e1 [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.4f6, @Int.as.Copy.impl.Op(%int_32) [concrete] +// CHECK:STDOUT: %self.param_patt.770: %pattern_type.fa7 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.4ee: %pattern_type.fa7 = wrapper_binding_pattern self, %self.param_patt.770 [concrete] // CHECK:STDOUT: %Y.cpp_destructor.type.0df797.1: type = fn_type @Y.cpp_destructor.1 [concrete] // CHECK:STDOUT: %Y.cpp_destructor.be1864.1: %Y.cpp_destructor.type.0df797.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete] // CHECK:STDOUT: %Z: type = class_type @Z [concrete] // CHECK:STDOUT: %H.type: type = fn_type @H [concrete] // CHECK:STDOUT: %H: %H.type = struct_value () [concrete] // CHECK:STDOUT: %Y.e8d: type = class_type @Y.2 [concrete] +// CHECK:STDOUT: %pattern_type.586: type = pattern_type %Y.e8d [concrete] // CHECK:STDOUT: %Y.elem.9a6: type = unbound_element_type %Y.e8d, %Z [concrete] // CHECK:STDOUT: %Z.Z.type: type = fn_type @Z.Z [concrete] // CHECK:STDOUT: %Z.Z: %Z.Z.type = struct_value () [concrete] @@ -378,8 +447,14 @@ fn UseZ() -> Cpp.A.Z { // CHECK:STDOUT: %Copy.facet.ca1: %Copy.type = facet_value %Z, (%custom_witness.f88) [concrete] // CHECK:STDOUT: %Copy.WithSelf.Op.type.1ad: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet.ca1) [concrete] // CHECK:STDOUT: %.f96: type = fn_type_with_self_type %Copy.WithSelf.Op.type.1ad, %Copy.facet.ca1 [concrete] +// CHECK:STDOUT: %self.param_patt.c0b: %pattern_type.586 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.d1c: %pattern_type.586 = wrapper_binding_pattern self, %self.param_patt.c0b [concrete] // CHECK:STDOUT: %Y.cpp_destructor.type.0df797.2: type = fn_type @Y.cpp_destructor.2 [concrete] // CHECK:STDOUT: %Y.cpp_destructor.be1864.2: %Y.cpp_destructor.type.0df797.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc15 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc15 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -387,6 +462,11 @@ fn UseZ() -> Cpp.A.Z { // CHECK:STDOUT: %Main.H: %H.type = import_ref Main//direct_import, H, loaded [concrete = constants.%H] // CHECK:STDOUT: %Core.import_ref.cd6: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.ac8) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.5e0)] // CHECK:STDOUT: %Copy.impl_witness_table.8d2 = impl_witness_table (%Core.import_ref.cd6), @Int.as.Copy.impl [concrete] +// CHECK:STDOUT: %Y.cpp_destructor.decl.ab2aab.1: %Y.cpp_destructor.type.0df797.1 = fn_decl @Y.cpp_destructor.1 [concrete = constants.%Y.cpp_destructor.be1864.1] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } // CHECK:STDOUT: %Z.Z.decl: %Z.Z.type = fn_decl @Z.Z [concrete = constants.%Z.Z] { // CHECK:STDOUT: // CHECK:STDOUT: } { @@ -397,6 +477,28 @@ fn UseZ() -> Cpp.A.Z { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } +// CHECK:STDOUT: %Y.cpp_destructor.decl.ab2aab.2: %Y.cpp_destructor.type.0df797.2 = fn_decl @Y.cpp_destructor.2 [concrete = constants.%Y.cpp_destructor.be1864.2] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc9 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.fa7 = ref_param_pattern [concrete = constants.%self.param_patt.770] +// CHECK:STDOUT: %self.patt: %pattern_type.fa7 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.4ee] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Y.90c = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Y.90c = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc15 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.586 = ref_param_pattern [concrete = constants.%self.param_patt.c0b] +// CHECK:STDOUT: %self.patt: %pattern_type.586 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d1c] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Y.e8d = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Y.e8d = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Use() -> out %return.param: %i32 { @@ -413,11 +515,20 @@ fn UseZ() -> Cpp.A.Z { // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] // CHECK:STDOUT: %bound_method.loc9_13.2: = bound_method %.loc9_13.2, %specific_fn // CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc9_13.2(%.loc9_13.2) -// CHECK:STDOUT: %Y.cpp_destructor.bound: = bound_method %.loc9_12.2, constants.%Y.cpp_destructor.be1864.1 -// CHECK:STDOUT: %Y.cpp_destructor.call: init %empty_tuple.type = call %Y.cpp_destructor.bound(%.loc9_12.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc9_12.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc9_12.2) // CHECK:STDOUT: return %Int.as.Copy.impl.Op.call // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9(%self.param: ref %Y.90c) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9(%self.param: ref %Y.90c) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Y.cpp_destructor.call: init %empty_tuple.type = call imports.%Y.cpp_destructor.decl.ab2aab.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @UseZ() -> out %return.param: %Z { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %H.ref: %H.type = name_ref H, imports.%Main.H [concrete = constants.%H] @@ -440,8 +551,17 @@ fn UseZ() -> Cpp.A.Z { // CHECK:STDOUT: %addr.loc15_13.2: %ptr.df4 = addr_of %.loc13_19.1 // CHECK:STDOUT: %Z__carbon_thunk.call: init %empty_tuple.type = call imports.%Z__carbon_thunk.decl(%.loc15_13.6, %addr.loc15_13.2) // CHECK:STDOUT: %.loc15_13.7: init %Z to %.loc13_19.1 = mark_in_place_init %Z__carbon_thunk.call -// CHECK:STDOUT: %Y.cpp_destructor.bound: = bound_method %.loc15_12.2, constants.%Y.cpp_destructor.be1864.2 -// CHECK:STDOUT: %Y.cpp_destructor.call: init %empty_tuple.type = call %Y.cpp_destructor.bound(%.loc15_12.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc15_12.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc15_12.2) // CHECK:STDOUT: return %.loc15_13.7 to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc15(%self.param: ref %Y.e8d) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc15(%self.param: ref %Y.e8d) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Y.cpp_destructor.call: init %empty_tuple.type = call imports.%Y.cpp_destructor.decl.ab2aab.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/class/import/access.carbon b/toolchain/check/testdata/interop/cpp/class/import/access.carbon index adbb915bd72a..76ccd7e592d0 100644 --- a/toolchain/check/testdata/interop/cpp/class/import/access.carbon +++ b/toolchain/check/testdata/interop/cpp/class/import/access.carbon @@ -1940,16 +1940,30 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: %PublicCall: type = class_type @PublicCall [concrete] // CHECK:STDOUT: %PublicCall.PublicCall.cpp_overload_set.type: type = cpp_overload_set_type @PublicCall.PublicCall.cpp_overload_set [concrete] // CHECK:STDOUT: %PublicCall.PublicCall.cpp_overload_set.value: %PublicCall.PublicCall.cpp_overload_set.type = cpp_overload_set_value @PublicCall.PublicCall.cpp_overload_set [concrete] +// CHECK:STDOUT: %pattern_type.871: type = pattern_type %PublicCall [concrete] // CHECK:STDOUT: %ptr.d0a: type = ptr_type %PublicCall [concrete] // CHECK:STDOUT: %PublicCall__carbon_thunk.type: type = fn_type @PublicCall__carbon_thunk [concrete] // CHECK:STDOUT: %PublicCall__carbon_thunk: %PublicCall__carbon_thunk.type = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.60e: type = pattern_type %OverloadSet [concrete] // CHECK:STDOUT: %ptr.4a0: type = ptr_type %OverloadSet [concrete] // CHECK:STDOUT: %OverloadSet__carbon_thunk.type: type = fn_type @OverloadSet__carbon_thunk [concrete] // CHECK:STDOUT: %OverloadSet__carbon_thunk: %OverloadSet__carbon_thunk.type = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.add: %pattern_type.60e = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.986: %pattern_type.60e = wrapper_binding_pattern self, %self.param_patt.add [concrete] // CHECK:STDOUT: %OverloadSet.cpp_destructor.type: type = fn_type @OverloadSet.cpp_destructor [concrete] // CHECK:STDOUT: %OverloadSet.cpp_destructor: %OverloadSet.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc8_58 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8_58 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.ced: %pattern_type.871 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.d01: %pattern_type.871 = wrapper_binding_pattern self, %self.param_patt.ced [concrete] // CHECK:STDOUT: %PublicCall.cpp_destructor.type: type = fn_type @PublicCall.cpp_destructor [concrete] // CHECK:STDOUT: %PublicCall.cpp_destructor: %PublicCall.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc8_57 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8_57 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: %OverloadSet.Overload.cpp_overload_set.type: type = cpp_overload_set_type @OverloadSet.Overload.cpp_overload_set [concrete] // CHECK:STDOUT: %OverloadSet.Overload.cpp_overload_set.value: %OverloadSet.Overload.cpp_overload_set.type = cpp_overload_set_value @OverloadSet.Overload.cpp_overload_set [concrete] // CHECK:STDOUT: %Overload__carbon_thunk.type: type = fn_type @Overload__carbon_thunk [concrete] @@ -1976,6 +1990,16 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } +// CHECK:STDOUT: %OverloadSet.cpp_destructor.decl: %OverloadSet.cpp_destructor.type = fn_decl @OverloadSet.cpp_destructor [concrete = constants.%OverloadSet.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: %PublicCall.cpp_destructor.decl: %PublicCall.cpp_destructor.type = fn_decl @PublicCall.cpp_destructor [concrete = constants.%PublicCall.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } // CHECK:STDOUT: %OverloadSet.Overload.cpp_overload_set.value: %OverloadSet.Overload.cpp_overload_set.type = cpp_overload_set_value @OverloadSet.Overload.cpp_overload_set [concrete = constants.%OverloadSet.Overload.cpp_overload_set.value] // CHECK:STDOUT: %Overload__carbon_thunk.decl: %Overload__carbon_thunk.type = fn_decl @Overload__carbon_thunk [concrete = constants.%Overload__carbon_thunk] { // CHECK:STDOUT: @@ -1984,6 +2008,23 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc8_58 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.60e = ref_param_pattern [concrete = constants.%self.param_patt.add] +// CHECK:STDOUT: %self.patt: %pattern_type.60e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.986] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %OverloadSet = ref_param call_param0 +// CHECK:STDOUT: %self: ref %OverloadSet = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc8_57 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.871 = ref_param_pattern [concrete = constants.%self.param_patt.ced] +// CHECK:STDOUT: %self.patt: %pattern_type.871 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d01] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %PublicCall = ref_param call_param0 +// CHECK:STDOUT: %self: ref %PublicCall = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref.loc8_3: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -2005,10 +2046,10 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: %OverloadSet__carbon_thunk.call: init %empty_tuple.type = call imports.%OverloadSet__carbon_thunk.decl(%addr.loc8_58.1, %addr.loc8_58.2) // CHECK:STDOUT: %.loc8_58.2: init %OverloadSet to %.loc8_58.1 = mark_in_place_init %OverloadSet__carbon_thunk.call // CHECK:STDOUT: %.loc8_58.3: ref %OverloadSet = temporary %.loc8_58.1, %.loc8_58.2 -// CHECK:STDOUT: %OverloadSet.cpp_destructor.bound: = bound_method %.loc8_58.3, constants.%OverloadSet.cpp_destructor -// CHECK:STDOUT: %OverloadSet.cpp_destructor.call: init %empty_tuple.type = call %OverloadSet.cpp_destructor.bound(%.loc8_58.3) -// CHECK:STDOUT: %PublicCall.cpp_destructor.bound.loc8: = bound_method %.loc8_57.3, constants.%PublicCall.cpp_destructor -// CHECK:STDOUT: %PublicCall.cpp_destructor.call.loc8: init %empty_tuple.type = call %PublicCall.cpp_destructor.bound.loc8(%.loc8_57.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8_58: = bound_method %.loc8_58.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8_58: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8_58(%.loc8_58.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8_57: = bound_method %.loc8_57.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8_57: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8_57(%.loc8_57.3) // CHECK:STDOUT: %Cpp.ref.loc9_3: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %OverloadSet.ref.loc9: type = name_ref OverloadSet, imports.%OverloadSet.decl [concrete = constants.%OverloadSet] // CHECK:STDOUT: %Overload.ref: %OverloadSet.Overload.cpp_overload_set.type = name_ref Overload, imports.%OverloadSet.Overload.cpp_overload_set.value [concrete = constants.%OverloadSet.Overload.cpp_overload_set.value] @@ -2024,11 +2065,29 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: %.loc9_54.5: ref %PublicCall = value_as_ref %.loc9_54.4 // CHECK:STDOUT: %addr.loc9_55: %ptr.d0a = addr_of %.loc9_54.5 // CHECK:STDOUT: %Overload__carbon_thunk.call: init %empty_tuple.type = call imports.%Overload__carbon_thunk.decl(%addr.loc9_55) -// CHECK:STDOUT: %PublicCall.cpp_destructor.bound.loc9: = bound_method %.loc9_54.3, constants.%PublicCall.cpp_destructor -// CHECK:STDOUT: %PublicCall.cpp_destructor.call.loc9: init %empty_tuple.type = call %PublicCall.cpp_destructor.bound.loc9(%.loc9_54.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc9: = bound_method %.loc9_54.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc9(%.loc9_54.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_58(%self.param: ref %OverloadSet) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_58(%self.param: ref %OverloadSet) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %OverloadSet.cpp_destructor.call: init %empty_tuple.type = call imports.%OverloadSet.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_57(%self.param: ref %PublicCall) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_57(%self.param: ref %PublicCall) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %PublicCall.cpp_destructor.call: init %empty_tuple.type = call imports.%PublicCall.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- import_overload_set_protected_base.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -2042,6 +2101,7 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: %PublicCall: type = class_type @PublicCall [concrete] // CHECK:STDOUT: %PublicCall.PublicCall.cpp_overload_set.type: type = cpp_overload_set_type @PublicCall.PublicCall.cpp_overload_set [concrete] // CHECK:STDOUT: %PublicCall.PublicCall.cpp_overload_set.value: %PublicCall.PublicCall.cpp_overload_set.type = cpp_overload_set_value @PublicCall.PublicCall.cpp_overload_set [concrete] +// CHECK:STDOUT: %pattern_type.871: type = pattern_type %PublicCall [concrete] // CHECK:STDOUT: %ptr.d0a: type = ptr_type %PublicCall [concrete] // CHECK:STDOUT: %PublicCall__carbon_thunk.type: type = fn_type @PublicCall__carbon_thunk [concrete] // CHECK:STDOUT: %PublicCall__carbon_thunk: %PublicCall__carbon_thunk.type = struct_value () [concrete] @@ -2049,18 +2109,31 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: %OverloadSet__carbon_thunk.type.c7f6eb.1: type = fn_type @OverloadSet__carbon_thunk.1 [concrete] // CHECK:STDOUT: %OverloadSet__carbon_thunk.e50482.1: %OverloadSet__carbon_thunk.type.c7f6eb.1 = struct_value () [concrete] // CHECK:STDOUT: %.244: type = partial_type %OverloadSet [concrete] +// CHECK:STDOUT: %self.param_patt.ced: %pattern_type.871 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.d01: %pattern_type.871 = wrapper_binding_pattern self, %self.param_patt.ced [concrete] // CHECK:STDOUT: %PublicCall.cpp_destructor.type: type = fn_type @PublicCall.cpp_destructor [concrete] // CHECK:STDOUT: %PublicCall.cpp_destructor: %PublicCall.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc11 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc11 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete] // CHECK:STDOUT: %ProtectedCall: type = class_type @ProtectedCall [concrete] // CHECK:STDOUT: %ProtectedCall.ProtectedCall.cpp_overload_set.type: type = cpp_overload_set_type @ProtectedCall.ProtectedCall.cpp_overload_set [concrete] // CHECK:STDOUT: %ProtectedCall.ProtectedCall.cpp_overload_set.value: %ProtectedCall.ProtectedCall.cpp_overload_set.type = cpp_overload_set_value @ProtectedCall.ProtectedCall.cpp_overload_set [concrete] +// CHECK:STDOUT: %pattern_type.5fa: type = pattern_type %ProtectedCall [concrete] // CHECK:STDOUT: %ptr.bc1: type = ptr_type %ProtectedCall [concrete] // CHECK:STDOUT: %ProtectedCall__carbon_thunk.type: type = fn_type @ProtectedCall__carbon_thunk [concrete] // CHECK:STDOUT: %ProtectedCall__carbon_thunk: %ProtectedCall__carbon_thunk.type = struct_value () [concrete] // CHECK:STDOUT: %OverloadSet__carbon_thunk.type.c7f6eb.2: type = fn_type @OverloadSet__carbon_thunk.2 [concrete] // CHECK:STDOUT: %OverloadSet__carbon_thunk.e50482.2: %OverloadSet__carbon_thunk.type.c7f6eb.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.204: %pattern_type.5fa = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.47c: %pattern_type.5fa = wrapper_binding_pattern self, %self.param_patt.204 [concrete] // CHECK:STDOUT: %ProtectedCall.cpp_destructor.type: type = fn_type @ProtectedCall.cpp_destructor [concrete] // CHECK:STDOUT: %ProtectedCall.cpp_destructor: %ProtectedCall.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc17 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc17 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: %OverloadSet.Overload.cpp_overload_set.type: type = cpp_overload_set_type @OverloadSet.Overload.cpp_overload_set [concrete] // CHECK:STDOUT: %OverloadSet.Overload.cpp_overload_set.value: %OverloadSet.Overload.cpp_overload_set.type = cpp_overload_set_value @OverloadSet.Overload.cpp_overload_set [concrete] // CHECK:STDOUT: %Overload__carbon_thunk.type.3dd392.1: type = fn_type @Overload__carbon_thunk.1 [concrete] @@ -2090,6 +2163,11 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } +// CHECK:STDOUT: %PublicCall.cpp_destructor.decl: %PublicCall.cpp_destructor.type = fn_decl @PublicCall.cpp_destructor [concrete = constants.%PublicCall.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } // CHECK:STDOUT: %ProtectedCall.decl: type = class_decl @ProtectedCall [concrete = constants.%ProtectedCall] {} {} // CHECK:STDOUT: %ProtectedCall.ProtectedCall.cpp_overload_set.value: %ProtectedCall.ProtectedCall.cpp_overload_set.type = cpp_overload_set_value @ProtectedCall.ProtectedCall.cpp_overload_set [concrete = constants.%ProtectedCall.ProtectedCall.cpp_overload_set.value] // CHECK:STDOUT: %ProtectedCall__carbon_thunk.decl: %ProtectedCall__carbon_thunk.type = fn_decl @ProtectedCall__carbon_thunk [concrete = constants.%ProtectedCall__carbon_thunk] { @@ -2102,6 +2180,11 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } +// CHECK:STDOUT: %ProtectedCall.cpp_destructor.decl: %ProtectedCall.cpp_destructor.type = fn_decl @ProtectedCall.cpp_destructor [concrete = constants.%ProtectedCall.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } // CHECK:STDOUT: %OverloadSet.Overload.cpp_overload_set.value: %OverloadSet.Overload.cpp_overload_set.type = cpp_overload_set_value @OverloadSet.Overload.cpp_overload_set [concrete = constants.%OverloadSet.Overload.cpp_overload_set.value] // CHECK:STDOUT: %Overload__carbon_thunk.decl.c2f84f.1: %Overload__carbon_thunk.type.3dd392.1 = fn_decl @Overload__carbon_thunk.1 [concrete = constants.%Overload__carbon_thunk.1c804c.1] { // CHECK:STDOUT: @@ -2115,6 +2198,23 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc11 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.871 = ref_param_pattern [concrete = constants.%self.param_patt.ced] +// CHECK:STDOUT: %self.patt: %pattern_type.871 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d01] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %PublicCall = ref_param call_param0 +// CHECK:STDOUT: %self: ref %PublicCall = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc17 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.5fa = ref_param_pattern [concrete = constants.%self.param_patt.204] +// CHECK:STDOUT: %self.patt: %pattern_type.5fa = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.47c] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ProtectedCall = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ProtectedCall = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: class @D { // CHECK:STDOUT: // CHECK:STDOUT: complete_type_witness = %complete_type @@ -2156,8 +2256,8 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: %.loc11_61.5: init %OverloadSet = as_compatible %.loc11_61.4 // CHECK:STDOUT: %.loc11_61.6: init %D to %return.param = class_init (%.loc11_61.5) // CHECK:STDOUT: %.loc11_62: init %D = converted %.loc11_61.2, %.loc11_61.6 -// CHECK:STDOUT: %PublicCall.cpp_destructor.bound: = bound_method %.loc11_59.3, constants.%PublicCall.cpp_destructor -// CHECK:STDOUT: %PublicCall.cpp_destructor.call: init %empty_tuple.type = call %PublicCall.cpp_destructor.bound(%.loc11_59.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc11_59.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc11_59.3) // CHECK:STDOUT: return %.loc11_62 to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2185,8 +2285,8 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: %.loc17_67.5: init %OverloadSet = as_compatible %.loc17_67.4 // CHECK:STDOUT: %.loc17_67.6: init %D to %return.param = class_init (%.loc17_67.5) // CHECK:STDOUT: %.loc17_68: init %D = converted %.loc17_67.2, %.loc17_67.6 -// CHECK:STDOUT: %ProtectedCall.cpp_destructor.bound: = bound_method %.loc17_65.3, constants.%ProtectedCall.cpp_destructor -// CHECK:STDOUT: %ProtectedCall.cpp_destructor.call: init %empty_tuple.type = call %ProtectedCall.cpp_destructor.bound(%.loc17_65.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc17_65.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc17_65.3) // CHECK:STDOUT: return %.loc17_68 to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2205,8 +2305,8 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: %.loc23_40.5: ref %PublicCall = value_as_ref %.loc23_40.4 // CHECK:STDOUT: %addr.loc23_41: %ptr.d0a = addr_of %.loc23_40.5 // CHECK:STDOUT: %Overload__carbon_thunk.call: init %empty_tuple.type = call imports.%Overload__carbon_thunk.decl.c2f84f.1(%addr.loc23_41) -// CHECK:STDOUT: %PublicCall.cpp_destructor.bound: = bound_method %.loc23_40.3, constants.%PublicCall.cpp_destructor -// CHECK:STDOUT: %PublicCall.cpp_destructor.call: init %empty_tuple.type = call %PublicCall.cpp_destructor.bound(%.loc23_40.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc23_40.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc23_40.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2225,11 +2325,29 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: %.loc29_46.5: ref %ProtectedCall = value_as_ref %.loc29_46.4 // CHECK:STDOUT: %addr.loc29_47: %ptr.bc1 = addr_of %.loc29_46.5 // CHECK:STDOUT: %Overload__carbon_thunk.call: init %empty_tuple.type = call imports.%Overload__carbon_thunk.decl.c2f84f.2(%addr.loc29_47) -// CHECK:STDOUT: %ProtectedCall.cpp_destructor.bound: = bound_method %.loc29_46.3, constants.%ProtectedCall.cpp_destructor -// CHECK:STDOUT: %ProtectedCall.cpp_destructor.call: init %empty_tuple.type = call %ProtectedCall.cpp_destructor.bound(%.loc29_46.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc29_46.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc29_46.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11(%self.param: ref %PublicCall) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11(%self.param: ref %PublicCall) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %PublicCall.cpp_destructor.call: init %empty_tuple.type = call imports.%PublicCall.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc17(%self.param: ref %ProtectedCall) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc17(%self.param: ref %ProtectedCall) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %ProtectedCall.cpp_destructor.call: init %empty_tuple.type = call imports.%ProtectedCall.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- import_overload_set_public_base_class_call_public.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -2241,13 +2359,20 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: %PublicCall: type = class_type @PublicCall [concrete] // CHECK:STDOUT: %PublicCall.PublicCall.cpp_overload_set.type: type = cpp_overload_set_type @PublicCall.PublicCall.cpp_overload_set [concrete] // CHECK:STDOUT: %PublicCall.PublicCall.cpp_overload_set.value: %PublicCall.PublicCall.cpp_overload_set.type = cpp_overload_set_value @PublicCall.PublicCall.cpp_overload_set [concrete] +// CHECK:STDOUT: %pattern_type.871: type = pattern_type %PublicCall [concrete] // CHECK:STDOUT: %ptr.d0a: type = ptr_type %PublicCall [concrete] // CHECK:STDOUT: %PublicCall__carbon_thunk.type: type = fn_type @PublicCall__carbon_thunk [concrete] // CHECK:STDOUT: %PublicCall__carbon_thunk: %PublicCall__carbon_thunk.type = struct_value () [concrete] // CHECK:STDOUT: %Overload__carbon_thunk.type: type = fn_type @Overload__carbon_thunk [concrete] // CHECK:STDOUT: %Overload__carbon_thunk: %Overload__carbon_thunk.type = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.ced: %pattern_type.871 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.d01: %pattern_type.871 = wrapper_binding_pattern self, %self.param_patt.ced [concrete] // CHECK:STDOUT: %PublicCall.cpp_destructor.type: type = fn_type @PublicCall.cpp_destructor [concrete] // CHECK:STDOUT: %PublicCall.cpp_destructor: %PublicCall.cpp_destructor.type = struct_value () [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.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -2270,6 +2395,21 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } +// CHECK:STDOUT: %PublicCall.cpp_destructor.decl: %PublicCall.cpp_destructor.type = fn_decl @PublicCall.cpp_destructor [concrete = constants.%PublicCall.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// 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.871 = ref_param_pattern [concrete = constants.%self.param_patt.ced] +// CHECK:STDOUT: %self.patt: %pattern_type.871 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d01] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %PublicCall = ref_param call_param0 +// CHECK:STDOUT: %self: ref %PublicCall = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -2289,11 +2429,20 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: %.loc8_57.5: ref %PublicCall = value_as_ref %.loc8_57.4 // CHECK:STDOUT: %addr.loc8_58: %ptr.d0a = addr_of %.loc8_57.5 // CHECK:STDOUT: %Overload__carbon_thunk.call: init %empty_tuple.type = call imports.%Overload__carbon_thunk.decl(%addr.loc8_58) -// CHECK:STDOUT: %PublicCall.cpp_destructor.bound: = bound_method %.loc8_57.3, constants.%PublicCall.cpp_destructor -// CHECK:STDOUT: %PublicCall.cpp_destructor.call: init %empty_tuple.type = call %PublicCall.cpp_destructor.bound(%.loc8_57.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc8_57.3, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc8_57.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8(%self.param: ref %PublicCall) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8(%self.param: ref %PublicCall) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param) +// CHECK:STDOUT: %PublicCall.cpp_destructor.call: init %empty_tuple.type = call imports.%PublicCall.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- import_overload_set_public_base_class_derived_call_non_private.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -2306,23 +2455,37 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: %PublicCall: type = class_type @PublicCall [concrete] // CHECK:STDOUT: %PublicCall.PublicCall.cpp_overload_set.type: type = cpp_overload_set_type @PublicCall.PublicCall.cpp_overload_set [concrete] // CHECK:STDOUT: %PublicCall.PublicCall.cpp_overload_set.value: %PublicCall.PublicCall.cpp_overload_set.type = cpp_overload_set_value @PublicCall.PublicCall.cpp_overload_set [concrete] +// CHECK:STDOUT: %pattern_type.871: type = pattern_type %PublicCall [concrete] // CHECK:STDOUT: %ptr.d0a: type = ptr_type %PublicCall [concrete] // CHECK:STDOUT: %PublicCall__carbon_thunk.type: type = fn_type @PublicCall__carbon_thunk [concrete] // CHECK:STDOUT: %PublicCall__carbon_thunk: %PublicCall__carbon_thunk.type = struct_value () [concrete] // CHECK:STDOUT: %Overload__carbon_thunk.type.3dd392.1: type = fn_type @Overload__carbon_thunk.1 [concrete] // CHECK:STDOUT: %Overload__carbon_thunk.1c804c.1: %Overload__carbon_thunk.type.3dd392.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.ced: %pattern_type.871 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.d01: %pattern_type.871 = wrapper_binding_pattern self, %self.param_patt.ced [concrete] // CHECK:STDOUT: %PublicCall.cpp_destructor.type: type = fn_type @PublicCall.cpp_destructor [concrete] // CHECK:STDOUT: %PublicCall.cpp_destructor: %PublicCall.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc11 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc11 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete] // CHECK:STDOUT: %ProtectedCall: type = class_type @ProtectedCall [concrete] // CHECK:STDOUT: %ProtectedCall.ProtectedCall.cpp_overload_set.type: type = cpp_overload_set_type @ProtectedCall.ProtectedCall.cpp_overload_set [concrete] // CHECK:STDOUT: %ProtectedCall.ProtectedCall.cpp_overload_set.value: %ProtectedCall.ProtectedCall.cpp_overload_set.type = cpp_overload_set_value @ProtectedCall.ProtectedCall.cpp_overload_set [concrete] +// CHECK:STDOUT: %pattern_type.5fa: type = pattern_type %ProtectedCall [concrete] // CHECK:STDOUT: %ptr.bc1: type = ptr_type %ProtectedCall [concrete] // CHECK:STDOUT: %ProtectedCall__carbon_thunk.type: type = fn_type @ProtectedCall__carbon_thunk [concrete] // CHECK:STDOUT: %ProtectedCall__carbon_thunk: %ProtectedCall__carbon_thunk.type = struct_value () [concrete] // CHECK:STDOUT: %Overload__carbon_thunk.type.3dd392.2: type = fn_type @Overload__carbon_thunk.2 [concrete] // CHECK:STDOUT: %Overload__carbon_thunk.1c804c.2: %Overload__carbon_thunk.type.3dd392.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.204: %pattern_type.5fa = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.47c: %pattern_type.5fa = wrapper_binding_pattern self, %self.param_patt.204 [concrete] // CHECK:STDOUT: %ProtectedCall.cpp_destructor.type: type = fn_type @ProtectedCall.cpp_destructor [concrete] // CHECK:STDOUT: %ProtectedCall.cpp_destructor: %ProtectedCall.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc12 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc12 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -2346,6 +2509,11 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } +// CHECK:STDOUT: %PublicCall.cpp_destructor.decl: %PublicCall.cpp_destructor.type = fn_decl @PublicCall.cpp_destructor [concrete = constants.%PublicCall.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } // CHECK:STDOUT: %ProtectedCall.decl: type = class_decl @ProtectedCall [concrete = constants.%ProtectedCall] {} {} // CHECK:STDOUT: %ProtectedCall.ProtectedCall.cpp_overload_set.value: %ProtectedCall.ProtectedCall.cpp_overload_set.type = cpp_overload_set_value @ProtectedCall.ProtectedCall.cpp_overload_set [concrete = constants.%ProtectedCall.ProtectedCall.cpp_overload_set.value] // CHECK:STDOUT: %ProtectedCall__carbon_thunk.decl: %ProtectedCall__carbon_thunk.type = fn_decl @ProtectedCall__carbon_thunk [concrete = constants.%ProtectedCall__carbon_thunk] { @@ -2358,6 +2526,28 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } +// CHECK:STDOUT: %ProtectedCall.cpp_destructor.decl: %ProtectedCall.cpp_destructor.type = fn_decl @ProtectedCall.cpp_destructor [concrete = constants.%ProtectedCall.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc11 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.871 = ref_param_pattern [concrete = constants.%self.param_patt.ced] +// CHECK:STDOUT: %self.patt: %pattern_type.871 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d01] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %PublicCall = ref_param call_param0 +// CHECK:STDOUT: %self: ref %PublicCall = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc12 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.5fa = ref_param_pattern [concrete = constants.%self.param_patt.204] +// CHECK:STDOUT: %self.patt: %pattern_type.5fa = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.47c] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ProtectedCall = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ProtectedCall = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Derived { @@ -2387,8 +2577,8 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: %.loc11_40.5: ref %PublicCall = value_as_ref %.loc11_40.4 // CHECK:STDOUT: %addr.loc11_41: %ptr.d0a = addr_of %.loc11_40.5 // CHECK:STDOUT: %Overload__carbon_thunk.call.loc11: init %empty_tuple.type = call imports.%Overload__carbon_thunk.decl.c2f84f.1(%addr.loc11_41) -// CHECK:STDOUT: %PublicCall.cpp_destructor.bound: = bound_method %.loc11_40.3, constants.%PublicCall.cpp_destructor -// CHECK:STDOUT: %PublicCall.cpp_destructor.call: init %empty_tuple.type = call %PublicCall.cpp_destructor.bound(%.loc11_40.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc11: = bound_method %.loc11_40.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc11: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc11(%.loc11_40.3) // CHECK:STDOUT: %Overload.ref.loc12: %OverloadPublic.Overload.cpp_overload_set.type = name_ref Overload, imports.%OverloadPublic.Overload.cpp_overload_set.value [concrete = constants.%OverloadPublic.Overload.cpp_overload_set.value] // CHECK:STDOUT: %Cpp.ref.loc12: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %ProtectedCall.ref.loc12_17: type = name_ref ProtectedCall, imports.%ProtectedCall.decl [concrete = constants.%ProtectedCall] @@ -2402,11 +2592,29 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: %.loc12_46.5: ref %ProtectedCall = value_as_ref %.loc12_46.4 // CHECK:STDOUT: %addr.loc12_47: %ptr.bc1 = addr_of %.loc12_46.5 // CHECK:STDOUT: %Overload__carbon_thunk.call.loc12: init %empty_tuple.type = call imports.%Overload__carbon_thunk.decl.c2f84f.2(%addr.loc12_47) -// CHECK:STDOUT: %ProtectedCall.cpp_destructor.bound: = bound_method %.loc12_46.3, constants.%ProtectedCall.cpp_destructor -// CHECK:STDOUT: %ProtectedCall.cpp_destructor.call: init %empty_tuple.type = call %ProtectedCall.cpp_destructor.bound(%.loc12_46.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc12: = bound_method %.loc12_46.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc12: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc12(%.loc12_46.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11(%self.param: ref %PublicCall) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11(%self.param: ref %PublicCall) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %PublicCall.cpp_destructor.call: init %empty_tuple.type = call imports.%PublicCall.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc12(%self.param: ref %ProtectedCall) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc12(%self.param: ref %ProtectedCall) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %ProtectedCall.cpp_destructor.call: init %empty_tuple.type = call imports.%ProtectedCall.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- import_overload_set_protected_base_class_derived_call_non_private.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -2419,23 +2627,37 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: %PublicCall: type = class_type @PublicCall [concrete] // CHECK:STDOUT: %PublicCall.PublicCall.cpp_overload_set.type: type = cpp_overload_set_type @PublicCall.PublicCall.cpp_overload_set [concrete] // CHECK:STDOUT: %PublicCall.PublicCall.cpp_overload_set.value: %PublicCall.PublicCall.cpp_overload_set.type = cpp_overload_set_value @PublicCall.PublicCall.cpp_overload_set [concrete] +// CHECK:STDOUT: %pattern_type.871: type = pattern_type %PublicCall [concrete] // CHECK:STDOUT: %ptr.d0a: type = ptr_type %PublicCall [concrete] // CHECK:STDOUT: %PublicCall__carbon_thunk.type: type = fn_type @PublicCall__carbon_thunk [concrete] // CHECK:STDOUT: %PublicCall__carbon_thunk: %PublicCall__carbon_thunk.type = struct_value () [concrete] // CHECK:STDOUT: %Overload__carbon_thunk.type.3dd392.1: type = fn_type @Overload__carbon_thunk.1 [concrete] // CHECK:STDOUT: %Overload__carbon_thunk.1c804c.1: %Overload__carbon_thunk.type.3dd392.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.ced: %pattern_type.871 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.d01: %pattern_type.871 = wrapper_binding_pattern self, %self.param_patt.ced [concrete] // CHECK:STDOUT: %PublicCall.cpp_destructor.type: type = fn_type @PublicCall.cpp_destructor [concrete] // CHECK:STDOUT: %PublicCall.cpp_destructor: %PublicCall.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc11 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc11 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete] // CHECK:STDOUT: %ProtectedCall: type = class_type @ProtectedCall [concrete] // CHECK:STDOUT: %ProtectedCall.ProtectedCall.cpp_overload_set.type: type = cpp_overload_set_type @ProtectedCall.ProtectedCall.cpp_overload_set [concrete] // CHECK:STDOUT: %ProtectedCall.ProtectedCall.cpp_overload_set.value: %ProtectedCall.ProtectedCall.cpp_overload_set.type = cpp_overload_set_value @ProtectedCall.ProtectedCall.cpp_overload_set [concrete] +// CHECK:STDOUT: %pattern_type.5fa: type = pattern_type %ProtectedCall [concrete] // CHECK:STDOUT: %ptr.bc1: type = ptr_type %ProtectedCall [concrete] // CHECK:STDOUT: %ProtectedCall__carbon_thunk.type: type = fn_type @ProtectedCall__carbon_thunk [concrete] // CHECK:STDOUT: %ProtectedCall__carbon_thunk: %ProtectedCall__carbon_thunk.type = struct_value () [concrete] // CHECK:STDOUT: %Overload__carbon_thunk.type.3dd392.2: type = fn_type @Overload__carbon_thunk.2 [concrete] // CHECK:STDOUT: %Overload__carbon_thunk.1c804c.2: %Overload__carbon_thunk.type.3dd392.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.204: %pattern_type.5fa = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.47c: %pattern_type.5fa = wrapper_binding_pattern self, %self.param_patt.204 [concrete] // CHECK:STDOUT: %ProtectedCall.cpp_destructor.type: type = fn_type @ProtectedCall.cpp_destructor [concrete] // CHECK:STDOUT: %ProtectedCall.cpp_destructor: %ProtectedCall.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc12 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc12 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -2459,6 +2681,11 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } +// CHECK:STDOUT: %PublicCall.cpp_destructor.decl: %PublicCall.cpp_destructor.type = fn_decl @PublicCall.cpp_destructor [concrete = constants.%PublicCall.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } // CHECK:STDOUT: %ProtectedCall.decl: type = class_decl @ProtectedCall [concrete = constants.%ProtectedCall] {} {} // CHECK:STDOUT: %ProtectedCall.ProtectedCall.cpp_overload_set.value: %ProtectedCall.ProtectedCall.cpp_overload_set.type = cpp_overload_set_value @ProtectedCall.ProtectedCall.cpp_overload_set [concrete = constants.%ProtectedCall.ProtectedCall.cpp_overload_set.value] // CHECK:STDOUT: %ProtectedCall__carbon_thunk.decl: %ProtectedCall__carbon_thunk.type = fn_decl @ProtectedCall__carbon_thunk [concrete = constants.%ProtectedCall__carbon_thunk] { @@ -2471,6 +2698,28 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } +// CHECK:STDOUT: %ProtectedCall.cpp_destructor.decl: %ProtectedCall.cpp_destructor.type = fn_decl @ProtectedCall.cpp_destructor [concrete = constants.%ProtectedCall.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc11 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.871 = ref_param_pattern [concrete = constants.%self.param_patt.ced] +// CHECK:STDOUT: %self.patt: %pattern_type.871 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d01] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %PublicCall = ref_param call_param0 +// CHECK:STDOUT: %self: ref %PublicCall = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc12 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.5fa = ref_param_pattern [concrete = constants.%self.param_patt.204] +// CHECK:STDOUT: %self.patt: %pattern_type.5fa = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.47c] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ProtectedCall = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ProtectedCall = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Derived { @@ -2500,8 +2749,8 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: %.loc11_40.5: ref %PublicCall = value_as_ref %.loc11_40.4 // CHECK:STDOUT: %addr.loc11_41: %ptr.d0a = addr_of %.loc11_40.5 // CHECK:STDOUT: %Overload__carbon_thunk.call.loc11: init %empty_tuple.type = call imports.%Overload__carbon_thunk.decl.c2f84f.1(%addr.loc11_41) -// CHECK:STDOUT: %PublicCall.cpp_destructor.bound: = bound_method %.loc11_40.3, constants.%PublicCall.cpp_destructor -// CHECK:STDOUT: %PublicCall.cpp_destructor.call: init %empty_tuple.type = call %PublicCall.cpp_destructor.bound(%.loc11_40.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc11: = bound_method %.loc11_40.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc11: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc11(%.loc11_40.3) // CHECK:STDOUT: %Overload.ref.loc12: %OverloadProtected.Overload.cpp_overload_set.type = name_ref Overload, imports.%OverloadProtected.Overload.cpp_overload_set.value [concrete = constants.%OverloadProtected.Overload.cpp_overload_set.value] // CHECK:STDOUT: %Cpp.ref.loc12: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %ProtectedCall.ref.loc12_17: type = name_ref ProtectedCall, imports.%ProtectedCall.decl [concrete = constants.%ProtectedCall] @@ -2515,11 +2764,29 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: %.loc12_46.5: ref %ProtectedCall = value_as_ref %.loc12_46.4 // CHECK:STDOUT: %addr.loc12_47: %ptr.bc1 = addr_of %.loc12_46.5 // CHECK:STDOUT: %Overload__carbon_thunk.call.loc12: init %empty_tuple.type = call imports.%Overload__carbon_thunk.decl.c2f84f.2(%addr.loc12_47) -// CHECK:STDOUT: %ProtectedCall.cpp_destructor.bound: = bound_method %.loc12_46.3, constants.%ProtectedCall.cpp_destructor -// CHECK:STDOUT: %ProtectedCall.cpp_destructor.call: init %empty_tuple.type = call %ProtectedCall.cpp_destructor.bound(%.loc12_46.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc12: = bound_method %.loc12_46.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc12: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc12(%.loc12_46.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11(%self.param: ref %PublicCall) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11(%self.param: ref %PublicCall) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %PublicCall.cpp_destructor.call: init %empty_tuple.type = call imports.%PublicCall.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc12(%self.param: ref %ProtectedCall) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc12(%self.param: ref %ProtectedCall) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %ProtectedCall.cpp_destructor.call: init %empty_tuple.type = call imports.%ProtectedCall.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- base_class_public_access_allowed.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { diff --git a/toolchain/check/testdata/interop/cpp/class/import/constructor.carbon b/toolchain/check/testdata/interop/cpp/class/import/constructor.carbon index d196b3895184..5e92f84c2082 100644 --- a/toolchain/check/testdata/interop/cpp/class/import/constructor.carbon +++ b/toolchain/check/testdata/interop/cpp/class/import/constructor.carbon @@ -324,8 +324,14 @@ fn F() { // CHECK:STDOUT: %ptr.d69: type = ptr_type %DefaultC [concrete] // CHECK:STDOUT: %DefaultC__carbon_thunk.type: type = fn_type @DefaultC__carbon_thunk [concrete] // CHECK:STDOUT: %DefaultC__carbon_thunk: %DefaultC__carbon_thunk.type = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.950: %pattern_type.903 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.659: %pattern_type.903 = wrapper_binding_pattern self, %self.param_patt.950 [concrete] // CHECK:STDOUT: %DefaultC.cpp_destructor.type: type = fn_type @DefaultC.cpp_destructor [concrete] // CHECK:STDOUT: %DefaultC.cpp_destructor: %DefaultC.cpp_destructor.type = struct_value () [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.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -340,6 +346,21 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } +// CHECK:STDOUT: %DefaultC.cpp_destructor.decl: %DefaultC.cpp_destructor.type = fn_decl @DefaultC.cpp_destructor [concrete = constants.%DefaultC.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// 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.903 = ref_param_pattern [concrete = constants.%self.param_patt.950] +// CHECK:STDOUT: %self.patt: %pattern_type.903 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.659] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %DefaultC = ref_param call_param0 +// CHECK:STDOUT: %self: ref %DefaultC = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -361,11 +382,20 @@ fn F() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %c.patt: %pattern_type.903 = value_binding_pattern c [concrete = constants.%c.patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %DefaultC.cpp_destructor.bound: = bound_method %.loc8_54.3, constants.%DefaultC.cpp_destructor -// CHECK:STDOUT: %DefaultC.cpp_destructor.call: init %empty_tuple.type = call %DefaultC.cpp_destructor.bound(%.loc8_54.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc8_54.3, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc8_54.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8(%self.param: ref %DefaultC) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8(%self.param: ref %DefaultC) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param) +// CHECK:STDOUT: %DefaultC.cpp_destructor.call: init %empty_tuple.type = call imports.%DefaultC.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- implicit_default.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -386,8 +416,14 @@ fn F() { // CHECK:STDOUT: %Default.facet.53e: %Default.type = facet_value %DefaultC, (%custom_witness.9b4) [concrete] // CHECK:STDOUT: %DefaultOrUnformed.impl_witness.db1: = impl_witness imports.%DefaultOrUnformed.impl_witness_table.162, @T.as_type.as.DefaultOrUnformed.impl(%Default.facet.53e) [concrete] // CHECK:STDOUT: %DefaultOrUnformed.facet.898: %DefaultOrUnformed.type = facet_value %DefaultC, (%DefaultOrUnformed.impl_witness.db1) [concrete] +// CHECK:STDOUT: %self.param_patt.950: %pattern_type.903 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.659: %pattern_type.903 = wrapper_binding_pattern self, %self.param_patt.950 [concrete] // CHECK:STDOUT: %DefaultC.cpp_destructor.type: type = fn_type @DefaultC.cpp_destructor [concrete] // CHECK:STDOUT: %DefaultC.cpp_destructor: %DefaultC.cpp_destructor.type = struct_value () [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.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -398,6 +434,21 @@ fn F() { // CHECK:STDOUT: %DefaultC.decl: type = class_decl @DefaultC [concrete = constants.%DefaultC] {} {} // CHECK:STDOUT: %Core.import_ref.c2f: @T.as_type.as.DefaultOrUnformed.impl.%T.as_type.as.DefaultOrUnformed.impl.Op.type (%T.as_type.as.DefaultOrUnformed.impl.Op.type.0c9) = import_ref Core//prelude/parts/default, loc{{\d+_\d+}}, loaded [symbolic = @T.as_type.as.DefaultOrUnformed.impl.%T.as_type.as.DefaultOrUnformed.impl.Op (constants.%T.as_type.as.DefaultOrUnformed.impl.Op.cfe)] // CHECK:STDOUT: %DefaultOrUnformed.impl_witness_table.162 = impl_witness_table (%Core.import_ref.c2f), @T.as_type.as.DefaultOrUnformed.impl [concrete] +// CHECK:STDOUT: %DefaultC.cpp_destructor.decl: %DefaultC.cpp_destructor.type = fn_decl @DefaultC.cpp_destructor [concrete = constants.%DefaultC.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// 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.903 = ref_param_pattern [concrete = constants.%self.param_patt.950] +// CHECK:STDOUT: %self.patt: %pattern_type.903 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.659] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %DefaultC = ref_param call_param0 +// CHECK:STDOUT: %self: ref %DefaultC = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -420,11 +471,20 @@ fn F() { // CHECK:STDOUT: %c.patt: %pattern_type.903 = ref_binding_pattern c [concrete = constants.%c.patt] // CHECK:STDOUT: %c.var_patt: %pattern_type.903 = var_pattern %c.patt [concrete = constants.%c.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %DefaultC.cpp_destructor.bound: = bound_method %c.var, constants.%DefaultC.cpp_destructor -// CHECK:STDOUT: %DefaultC.cpp_destructor.call: init %empty_tuple.type = call %DefaultC.cpp_destructor.bound(%c.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %c.var, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%c.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8(%self.param: ref %DefaultC) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8(%self.param: ref %DefaultC) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param) +// CHECK:STDOUT: %DefaultC.cpp_destructor.call: init %empty_tuple.type = call imports.%DefaultC.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- import_non_default.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -459,8 +519,14 @@ fn F() { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.efc: = bound_method %int_456.010, %Core.IntLiteral.as.ImplicitAs.impl.Convert.e39 [concrete] // CHECK:STDOUT: %bound_method.c5c: = bound_method %int_456.010, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_456.8dd: %i32 = int_value 456 [concrete] +// CHECK:STDOUT: %self.param_patt.409: %pattern_type.714 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.f57: %pattern_type.714 = wrapper_binding_pattern self, %self.param_patt.409 [concrete] // CHECK:STDOUT: %NonDefaultC.cpp_destructor.type: type = fn_type @NonDefaultC.cpp_destructor [concrete] // CHECK:STDOUT: %NonDefaultC.cpp_destructor: %NonDefaultC.cpp_destructor.type = struct_value () [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.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -477,6 +543,21 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import_ref.edf: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e74) = 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.845)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.1aa = impl_witness_table (%Core.import_ref.edf), @Core.IntLiteral.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %NonDefaultC.cpp_destructor.decl: %NonDefaultC.cpp_destructor.type = fn_decl @NonDefaultC.cpp_destructor [concrete = constants.%NonDefaultC.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// 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.714 = ref_param_pattern [concrete = constants.%self.param_patt.409] +// CHECK:STDOUT: %self.patt: %pattern_type.714 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.f57] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %NonDefaultC = ref_param call_param0 +// CHECK:STDOUT: %self: ref %NonDefaultC = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -514,11 +595,20 @@ fn F() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %c.patt: %pattern_type.714 = value_binding_pattern c [concrete = constants.%c.patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %NonDefaultC.cpp_destructor.bound: = bound_method %.loc8_71.3, constants.%NonDefaultC.cpp_destructor -// CHECK:STDOUT: %NonDefaultC.cpp_destructor.call: init %empty_tuple.type = call %NonDefaultC.cpp_destructor.bound(%.loc8_71.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc8_71.3, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc8_71.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8(%self.param: ref %NonDefaultC) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8(%self.param: ref %NonDefaultC) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param) +// CHECK:STDOUT: %NonDefaultC.cpp_destructor.call: init %empty_tuple.type = call imports.%NonDefaultC.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- import_multiple.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -556,8 +646,14 @@ fn F() { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.efc: = bound_method %int_456.010, %Core.IntLiteral.as.ImplicitAs.impl.Convert.e39 [concrete] // CHECK:STDOUT: %bound_method.c5c: = bound_method %int_456.010, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_456.8dd: %i32 = int_value 456 [concrete] +// CHECK:STDOUT: %self.param_patt.cf3: %pattern_type.56a = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.1f8: %pattern_type.56a = wrapper_binding_pattern self, %self.param_patt.cf3 [concrete] // CHECK:STDOUT: %MultipleC.cpp_destructor.type: type = fn_type @MultipleC.cpp_destructor [concrete] // CHECK:STDOUT: %MultipleC.cpp_destructor: %MultipleC.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -579,6 +675,21 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import_ref.edf: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e74) = 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.845)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.1aa = impl_witness_table (%Core.import_ref.edf), @Core.IntLiteral.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %MultipleC.cpp_destructor.decl: %MultipleC.cpp_destructor.type = fn_decl @MultipleC.cpp_destructor [concrete = constants.%MultipleC.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc9 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.56a = ref_param_pattern [concrete = constants.%self.param_patt.cf3] +// CHECK:STDOUT: %self.patt: %pattern_type.56a = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.1f8] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %MultipleC = ref_param call_param0 +// CHECK:STDOUT: %self: ref %MultipleC = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -633,13 +744,22 @@ fn F() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %c2.patt: %pattern_type.56a = value_binding_pattern c2 [concrete = constants.%c2.patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %MultipleC.cpp_destructor.bound.loc9: = bound_method %.loc9_66.3, constants.%MultipleC.cpp_destructor -// CHECK:STDOUT: %MultipleC.cpp_destructor.call.loc9: init %empty_tuple.type = call %MultipleC.cpp_destructor.bound.loc9(%.loc9_66.3) -// CHECK:STDOUT: %MultipleC.cpp_destructor.bound.loc8: = bound_method %.loc8_58.3, constants.%MultipleC.cpp_destructor -// CHECK:STDOUT: %MultipleC.cpp_destructor.call.loc8: init %empty_tuple.type = call %MultipleC.cpp_destructor.bound.loc8(%.loc8_58.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc9: = bound_method %.loc9_66.3, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc9(%.loc9_66.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: = bound_method %.loc8_58.3, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%.loc8_58.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9(%self.param: ref %MultipleC) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9(%self.param: ref %MultipleC) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param) +// CHECK:STDOUT: %MultipleC.cpp_destructor.call: init %empty_tuple.type = call imports.%MultipleC.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- import_default_arguments.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -677,8 +797,14 @@ fn F() { // CHECK:STDOUT: %c2.patt: %pattern_type.52d = value_binding_pattern c2 [concrete] // CHECK:STDOUT: %DefaultArgsC__carbon_thunk.type.4c24d7.2: type = fn_type @DefaultArgsC__carbon_thunk.2 [concrete] // CHECK:STDOUT: %DefaultArgsC__carbon_thunk.137e61.2: %DefaultArgsC__carbon_thunk.type.4c24d7.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.32c: %pattern_type.52d = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.8dd: %pattern_type.52d = wrapper_binding_pattern self, %self.param_patt.32c [concrete] // CHECK:STDOUT: %DefaultArgsC.cpp_destructor.type: type = fn_type @DefaultArgsC.cpp_destructor [concrete] // CHECK:STDOUT: %DefaultArgsC.cpp_destructor: %DefaultArgsC.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -700,6 +826,21 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } +// CHECK:STDOUT: %DefaultArgsC.cpp_destructor.decl: %DefaultArgsC.cpp_destructor.type = fn_decl @DefaultArgsC.cpp_destructor [concrete = constants.%DefaultArgsC.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc9 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.52d = ref_param_pattern [concrete = constants.%self.param_patt.32c] +// CHECK:STDOUT: %self.patt: %pattern_type.52d = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.8dd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %DefaultArgsC = ref_param call_param0 +// CHECK:STDOUT: %self: ref %DefaultArgsC = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -762,13 +903,22 @@ fn F() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %c2.patt: %pattern_type.52d = value_binding_pattern c2 [concrete = constants.%c2.patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %DefaultArgsC.cpp_destructor.bound.loc9: = bound_method %.loc9_68.3, constants.%DefaultArgsC.cpp_destructor -// CHECK:STDOUT: %DefaultArgsC.cpp_destructor.call.loc9: init %empty_tuple.type = call %DefaultArgsC.cpp_destructor.bound.loc9(%.loc9_68.3) -// CHECK:STDOUT: %DefaultArgsC.cpp_destructor.bound.loc8: = bound_method %.loc8_71.3, constants.%DefaultArgsC.cpp_destructor -// CHECK:STDOUT: %DefaultArgsC.cpp_destructor.call.loc8: init %empty_tuple.type = call %DefaultArgsC.cpp_destructor.bound.loc8(%.loc8_71.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc9: = bound_method %.loc9_68.3, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc9(%.loc9_68.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: = bound_method %.loc8_71.3, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%.loc8_71.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9(%self.param: ref %DefaultArgsC) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9(%self.param: ref %DefaultArgsC) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param) +// CHECK:STDOUT: %DefaultArgsC.cpp_destructor.call: init %empty_tuple.type = call imports.%DefaultArgsC.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- import_template.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -803,6 +953,7 @@ fn F() { // CHECK:STDOUT: %c2.patt: %pattern_type.f20 = ref_binding_pattern c2 [concrete] // CHECK:STDOUT: %c2.var_patt: %pattern_type.f20 = var_pattern %c2.patt [concrete] // CHECK:STDOUT: %true: bool = bool_literal true [concrete] +// CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete] // CHECK:STDOUT: %ptr.bb2: type = ptr_type bool [concrete] // CHECK:STDOUT: %TemplateC__carbon_thunk.type.7462cf.2: type = fn_type @TemplateC__carbon_thunk.2 [concrete] // CHECK:STDOUT: %TemplateC__carbon_thunk.a4007a.2: %TemplateC__carbon_thunk.type.7462cf.2 = struct_value () [concrete] @@ -820,8 +971,23 @@ fn F() { // CHECK:STDOUT: %c3.var_patt: %pattern_type.f20 = var_pattern %c3.patt [concrete] // CHECK:STDOUT: %TemplateC__carbon_thunk.type.7462cf.3: type = fn_type @TemplateC__carbon_thunk.3 [concrete] // CHECK:STDOUT: %TemplateC__carbon_thunk.a4007a.3: %TemplateC__carbon_thunk.type.7462cf.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.b59: %pattern_type.f20 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.9d4: %pattern_type.f20 = wrapper_binding_pattern self, %self.param_patt.b59 [concrete] // CHECK:STDOUT: %TemplateC.cpp_destructor.type: type = fn_type @TemplateC.cpp_destructor [concrete] // CHECK:STDOUT: %TemplateC.cpp_destructor: %TemplateC.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc10 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.40d: %pattern_type.831 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.560: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt.40d [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfc: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01: %Destroy.WithSelf.SubobjectDestroy.type.dfc = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.e3b, %Destroy.WithSelf.SelfDestruct.db3fdb.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -850,6 +1016,35 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } +// CHECK:STDOUT: %TemplateC.cpp_destructor.decl: %TemplateC.cpp_destructor.type = fn_decl @TemplateC.cpp_destructor [concrete = constants.%TemplateC.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc10 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f20 = ref_param_pattern [concrete = constants.%self.param_patt.b59] +// CHECK:STDOUT: %self.patt: %pattern_type.f20 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.9d4] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %TemplateC = ref_param call_param0 +// CHECK:STDOUT: %self: ref %TemplateC = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl: %Destroy.WithSelf.SubobjectDestroy.type.dfc = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d] +// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0 +// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc9 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d] +// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0 +// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -925,17 +1120,36 @@ fn F() { // CHECK:STDOUT: %c3.patt: %pattern_type.f20 = ref_binding_pattern c3 [concrete = constants.%c3.patt] // CHECK:STDOUT: %c3.var_patt: %pattern_type.f20 = var_pattern %c3.patt [concrete = constants.%c3.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %TemplateC.cpp_destructor.bound.loc10: = bound_method %c3.var, constants.%TemplateC.cpp_destructor -// CHECK:STDOUT: %TemplateC.cpp_destructor.call.loc10: init %empty_tuple.type = call %TemplateC.cpp_destructor.bound.loc10(%c3.var) -// CHECK:STDOUT: %TemplateC.cpp_destructor.bound.loc9: = bound_method %c2.var, constants.%TemplateC.cpp_destructor -// CHECK:STDOUT: %TemplateC.cpp_destructor.call.loc9: init %empty_tuple.type = call %TemplateC.cpp_destructor.bound.loc9(%c2.var) -// CHECK:STDOUT: %TemplateC.cpp_destructor.bound.loc8: = bound_method %c1.var, constants.%TemplateC.cpp_destructor -// CHECK:STDOUT: %TemplateC.cpp_destructor.call.loc8: init %empty_tuple.type = call %TemplateC.cpp_destructor.bound.loc8(%c1.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10: = bound_method %c3.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10(%c3.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc9_58: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.e3b) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc9: = bound_method %c2.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc9_3: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc9(%c2.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: = bound_method %c1.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%c1.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10(%self.param: ref %TemplateC) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10(%self.param: ref %TemplateC) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %TemplateC.cpp_destructor.call: init %empty_tuple.type = call imports.%TemplateC.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9(%self.param: ref bool) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9(%self.param: ref bool) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9(%self.param: ref bool) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- import_implicit_single_argument.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -979,8 +1193,14 @@ fn F() { // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound: = bound_method %int_8.b85, %Core.IntLiteral.as.As.impl.Convert.8a4 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.As.impl.Convert.8a4, @Core.IntLiteral.as.As.impl.Convert(%int_32) [concrete] // CHECK:STDOUT: %bound_method.07f: = bound_method %int_8.b85, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete] +// CHECK:STDOUT: %self.param_patt.e73: %pattern_type.bac = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.a03: %pattern_type.bac = wrapper_binding_pattern self, %self.param_patt.e73 [concrete] // CHECK:STDOUT: %SingleArgC.cpp_destructor.type: type = fn_type @SingleArgC.cpp_destructor [concrete] // CHECK:STDOUT: %SingleArgC.cpp_destructor: %SingleArgC.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -999,6 +1219,21 @@ fn F() { // CHECK:STDOUT: %ImplicitAs.impl_witness_table.1aa = impl_witness_table (%Core.import_ref.edf), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: %Core.import_ref.64b: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.c5d) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.6ee)] // CHECK:STDOUT: %As.impl_witness_table.d22 = impl_witness_table (%Core.import_ref.64b), @Core.IntLiteral.as.As.impl [concrete] +// CHECK:STDOUT: %SingleArgC.cpp_destructor.decl: %SingleArgC.cpp_destructor.type = fn_decl @SingleArgC.cpp_destructor [concrete = constants.%SingleArgC.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc9 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.bac = ref_param_pattern [concrete = constants.%self.param_patt.e73] +// CHECK:STDOUT: %self.patt: %pattern_type.bac = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a03] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %SingleArgC = ref_param call_param0 +// CHECK:STDOUT: %self: ref %SingleArgC = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -1052,13 +1287,22 @@ fn F() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %c2.patt: %pattern_type.bac = value_binding_pattern c2 [concrete = constants.%c2.patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %SingleArgC.cpp_destructor.bound.loc9: = bound_method %.loc9_37.6, constants.%SingleArgC.cpp_destructor -// CHECK:STDOUT: %SingleArgC.cpp_destructor.call.loc9: init %empty_tuple.type = call %SingleArgC.cpp_destructor.bound.loc9(%.loc9_37.6) -// CHECK:STDOUT: %SingleArgC.cpp_destructor.bound.loc8: = bound_method %.loc8_62.3, constants.%SingleArgC.cpp_destructor -// CHECK:STDOUT: %SingleArgC.cpp_destructor.call.loc8: init %empty_tuple.type = call %SingleArgC.cpp_destructor.bound.loc8(%.loc8_62.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc9: = bound_method %.loc9_37.6, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc9(%.loc9_37.6) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: = bound_method %.loc8_62.3, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%.loc8_62.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9(%self.param: ref %SingleArgC) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9(%self.param: ref %SingleArgC) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param) +// CHECK:STDOUT: %SingleArgC.cpp_destructor.call: init %empty_tuple.type = call imports.%SingleArgC.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- import_implicit_multi_arguments.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -1109,8 +1353,14 @@ fn F() { // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound: = bound_method %int_8.b85, %Core.IntLiteral.as.As.impl.Convert.8a4 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.As.impl.Convert.8a4, @Core.IntLiteral.as.As.impl.Convert(%int_32) [concrete] // CHECK:STDOUT: %bound_method.07f: = bound_method %int_8.b85, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete] +// CHECK:STDOUT: %self.param_patt.fed: %pattern_type.b5c = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.585: %pattern_type.b5c = wrapper_binding_pattern self, %self.param_patt.fed [concrete] // CHECK:STDOUT: %MultiArgC.cpp_destructor.type: type = fn_type @MultiArgC.cpp_destructor [concrete] // CHECK:STDOUT: %MultiArgC.cpp_destructor: %MultiArgC.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc10 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1134,6 +1384,21 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import_ref.64b: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.c5d) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.6ee)] // CHECK:STDOUT: %As.impl_witness_table.d22 = impl_witness_table (%Core.import_ref.64b), @Core.IntLiteral.as.As.impl [concrete] +// CHECK:STDOUT: %MultiArgC.cpp_destructor.decl: %MultiArgC.cpp_destructor.type = fn_decl @MultiArgC.cpp_destructor [concrete = constants.%MultiArgC.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc10 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b5c = ref_param_pattern [concrete = constants.%self.param_patt.fed] +// CHECK:STDOUT: %self.patt: %pattern_type.b5c = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.585] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %MultiArgC = ref_param call_param0 +// CHECK:STDOUT: %self: ref %MultiArgC = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -1220,12 +1485,21 @@ fn F() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %c3.patt: %pattern_type.b5c = value_binding_pattern c3 [concrete = constants.%c3.patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %MultiArgC.cpp_destructor.bound.loc10: = bound_method %.loc10_36.6, constants.%MultiArgC.cpp_destructor -// CHECK:STDOUT: %MultiArgC.cpp_destructor.call.loc10: init %empty_tuple.type = call %MultiArgC.cpp_destructor.bound.loc10(%.loc10_36.6) -// CHECK:STDOUT: %MultiArgC.cpp_destructor.bound.loc9: = bound_method %.loc9_59.3, constants.%MultiArgC.cpp_destructor -// CHECK:STDOUT: %MultiArgC.cpp_destructor.call.loc9: init %empty_tuple.type = call %MultiArgC.cpp_destructor.bound.loc9(%.loc9_59.3) -// CHECK:STDOUT: %MultiArgC.cpp_destructor.bound.loc8: = bound_method %.loc8_62.3, constants.%MultiArgC.cpp_destructor -// CHECK:STDOUT: %MultiArgC.cpp_destructor.call.loc8: init %empty_tuple.type = call %MultiArgC.cpp_destructor.bound.loc8(%.loc8_62.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10: = bound_method %.loc10_36.6, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10(%.loc10_36.6) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc9: = bound_method %.loc9_59.3, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc9(%.loc9_59.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: = bound_method %.loc8_62.3, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%.loc8_62.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10(%self.param: ref %MultiArgC) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10(%self.param: ref %MultiArgC) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param) +// CHECK:STDOUT: %MultiArgC.cpp_destructor.call: init %empty_tuple.type = call imports.%MultiArgC.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/class/import/method.carbon b/toolchain/check/testdata/interop/cpp/class/import/method.carbon index a1f6acf79f29..58172fcda9bd 100644 --- a/toolchain/check/testdata/interop/cpp/class/import/method.carbon +++ b/toolchain/check/testdata/interop/cpp/class/import/method.carbon @@ -271,6 +271,7 @@ fn Call(e: Cpp.ExplicitObjectParamOverloaded, n: i32, a: Cpp.AnotherOverloaded) // CHECK:STDOUT: constants { // CHECK:STDOUT: type: type = facet_type [concrete] // CHECK:STDOUT: %HasQualifiers: type = class_type @HasQualifiers [concrete] +// CHECK:STDOUT: %pattern_type.933: type = pattern_type %HasQualifiers [concrete] // CHECK:STDOUT: %Make.type: type = fn_type @Make [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Make: %Make.type = struct_value () [concrete] @@ -289,6 +290,8 @@ fn Call(e: Cpp.ExplicitObjectParamOverloaded, n: i32, a: Cpp.AnotherOverloaded) // CHECK:STDOUT: %const_ref_ref_this__carbon_thunk: %const_ref_ref_this__carbon_thunk.type = struct_value () [concrete] // CHECK:STDOUT: %HasQualifiers.plain.cpp_overload_set.type: type = cpp_overload_set_type @HasQualifiers.plain.cpp_overload_set [concrete] // CHECK:STDOUT: %HasQualifiers.plain.cpp_overload_set.value: %HasQualifiers.plain.cpp_overload_set.type = cpp_overload_set_value @HasQualifiers.plain.cpp_overload_set [concrete] +// CHECK:STDOUT: %self.param_patt.64a: %pattern_type.933 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.181: %pattern_type.933 = wrapper_binding_pattern self, %self.param_patt.64a [concrete] // CHECK:STDOUT: %HasQualifiers.plain.type.99c640.1: type = fn_type @HasQualifiers.plain.1 [concrete] // CHECK:STDOUT: %HasQualifiers.plain.cdd9ec.1: %HasQualifiers.plain.type.99c640.1 = struct_value () [concrete] // CHECK:STDOUT: %HasQualifiers.ref_this.cpp_overload_set.type: type = cpp_overload_set_type @HasQualifiers.ref_this.cpp_overload_set [concrete] @@ -299,8 +302,10 @@ fn Call(e: Cpp.ExplicitObjectParamOverloaded, n: i32, a: Cpp.AnotherOverloaded) // CHECK:STDOUT: %HasQualifiers.plain.cdd9ec.2: %HasQualifiers.plain.type.99c640.2 = struct_value () [concrete] // CHECK:STDOUT: %HasQualifiers.cpp_destructor.type: type = fn_type @HasQualifiers.cpp_destructor [concrete] // CHECK:STDOUT: %HasQualifiers.cpp_destructor: %HasQualifiers.cpp_destructor.type = struct_value () [concrete] -// CHECK:STDOUT: %HasQualifiers.Op.type.83af6e.1: type = fn_type @HasQualifiers.Op.1 [concrete] -// CHECK:STDOUT: %HasQualifiers.Op.4dca31.1: %HasQualifiers.Op.type.83af6e.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc19 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc19 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: %HasQualifiers.ref_ref_this.cpp_overload_set.type: type = cpp_overload_set_type @HasQualifiers.ref_ref_this.cpp_overload_set [concrete] // CHECK:STDOUT: %HasQualifiers.ref_ref_this.cpp_overload_set.value: %HasQualifiers.ref_ref_this.cpp_overload_set.type = cpp_overload_set_value @HasQualifiers.ref_ref_this.cpp_overload_set [concrete] // CHECK:STDOUT: %ref_ref_this__carbon_thunk.type: type = fn_type @ref_ref_this__carbon_thunk [concrete] @@ -312,9 +317,9 @@ fn Call(e: Cpp.ExplicitObjectParamOverloaded, n: i32, a: Cpp.AnotherOverloaded) // CHECK:STDOUT: %ptr.e71: type = ptr_type %const.ba8 [concrete] // CHECK:STDOUT: %HasQualifiers__carbon_thunk.type: type = fn_type @HasQualifiers__carbon_thunk [concrete] // CHECK:STDOUT: %HasQualifiers__carbon_thunk: %HasQualifiers__carbon_thunk.type = struct_value () [concrete] -// CHECK:STDOUT: %HasQualifiers.Op.type.83af6e.2: type = fn_type @HasQualifiers.Op.2 [concrete] -// CHECK:STDOUT: %HasQualifiers.Op.4dca31.2: %HasQualifiers.Op.type.83af6e.2 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.d0d: = custom_witness (%HasQualifiers.Op.4dca31.2), @Copy [concrete] +// CHECK:STDOUT: %HasQualifiers.Op.type: type = fn_type @HasQualifiers.Op [concrete] +// CHECK:STDOUT: %HasQualifiers.Op: %HasQualifiers.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.d0d: = custom_witness (%HasQualifiers.Op), @Copy [concrete] // CHECK:STDOUT: %Copy.facet.11b: %Copy.type = facet_value %HasQualifiers, (%custom_witness.d0d) [concrete] // CHECK:STDOUT: %Copy.WithSelf.Op.type.033: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet.11b) [concrete] // CHECK:STDOUT: %.703: type = fn_type_with_self_type %Copy.WithSelf.Op.type.033, %Copy.facet.11b [concrete] @@ -379,6 +384,16 @@ fn Call(e: Cpp.ExplicitObjectParamOverloaded, n: i32, a: Cpp.AnotherOverloaded) // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc19 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.933 = ref_param_pattern [concrete = constants.%self.param_patt.64a] +// CHECK:STDOUT: %self.patt: %pattern_type.933 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.181] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %HasQualifiers = ref_param call_param0 +// CHECK:STDOUT: %self: ref %HasQualifiers = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F(%v.param: %HasQualifiers, %p.param: %ptr.102) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %v.ref.loc10: %HasQualifiers = name_ref v, %v @@ -424,10 +439,8 @@ fn Call(e: Cpp.ExplicitObjectParamOverloaded, n: i32, a: Cpp.AnotherOverloaded) // CHECK:STDOUT: %.loc19_8.3: %HasQualifiers = acquire_value %.loc19_8.2 // CHECK:STDOUT: %HasQualifiers.plain.call.loc19: init %empty_tuple.type = call imports.%HasQualifiers.plain.decl.3d4ba8.2(%.loc19_8.3) // CHECK:STDOUT: -// CHECK:STDOUT: %HasQualifiers.Op.bound.loc19: = bound_method %.loc19_8.2, constants.%HasQualifiers.Op.4dca31.1 -// CHECK:STDOUT: %Op.ref.loc19: %HasQualifiers.cpp_destructor.type = name_ref Op, imports.%HasQualifiers.cpp_destructor.decl [concrete = constants.%HasQualifiers.cpp_destructor] -// CHECK:STDOUT: %HasQualifiers.cpp_destructor.bound.loc19: = bound_method %.loc19_8.2, %Op.ref.loc19 -// CHECK:STDOUT: %HasQualifiers.cpp_destructor.call.loc19: init %empty_tuple.type = call %HasQualifiers.cpp_destructor.bound.loc19(%.loc19_8.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc19: = bound_method %.loc19_8.2, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc19: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc19(%.loc19_8.2) // CHECK:STDOUT: %Make.ref.loc20: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make] // CHECK:STDOUT: %.loc20_8.1: ref %HasQualifiers = temporary_storage // CHECK:STDOUT: %Make.call.loc20: init %HasQualifiers to %.loc20_8.1 = call %Make.ref.loc20() @@ -436,10 +449,8 @@ fn Call(e: Cpp.ExplicitObjectParamOverloaded, n: i32, a: Cpp.AnotherOverloaded) // CHECK:STDOUT: %bound_method.loc20: = bound_method %.loc20_8.2, %const_this.ref.loc20 // CHECK:STDOUT: %.loc20_8.3: %HasQualifiers = acquire_value %.loc20_8.2 // CHECK:STDOUT: %const_this__carbon_thunk.call.loc20: init %empty_tuple.type = call imports.%const_this__carbon_thunk.decl(%.loc20_8.3) -// CHECK:STDOUT: %HasQualifiers.Op.bound.loc20: = bound_method %.loc20_8.2, constants.%HasQualifiers.Op.4dca31.1 -// CHECK:STDOUT: %Op.ref.loc20: %HasQualifiers.cpp_destructor.type = name_ref Op, imports.%HasQualifiers.cpp_destructor.decl [concrete = constants.%HasQualifiers.cpp_destructor] -// CHECK:STDOUT: %HasQualifiers.cpp_destructor.bound.loc20: = bound_method %.loc20_8.2, %Op.ref.loc20 -// CHECK:STDOUT: %HasQualifiers.cpp_destructor.call.loc20: init %empty_tuple.type = call %HasQualifiers.cpp_destructor.bound.loc20(%.loc20_8.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc20: = bound_method %.loc20_8.2, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc20: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc20(%.loc20_8.2) // CHECK:STDOUT: %Make.ref.loc21: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make] // CHECK:STDOUT: %.loc21_8.1: ref %HasQualifiers = temporary_storage // CHECK:STDOUT: %Make.call.loc21: init %HasQualifiers to %.loc21_8.1 = call %Make.ref.loc21() @@ -448,10 +459,8 @@ fn Call(e: Cpp.ExplicitObjectParamOverloaded, n: i32, a: Cpp.AnotherOverloaded) // CHECK:STDOUT: %bound_method.loc21: = bound_method %.loc21_8.2, %const_ref_this.ref.loc21 // CHECK:STDOUT: %.loc21_8.3: %HasQualifiers = acquire_value %.loc21_8.2 // CHECK:STDOUT: %const_ref_this__carbon_thunk.call.loc21: init %empty_tuple.type = call imports.%const_ref_this__carbon_thunk.decl(%.loc21_8.3) -// CHECK:STDOUT: %HasQualifiers.Op.bound.loc21: = bound_method %.loc21_8.2, constants.%HasQualifiers.Op.4dca31.1 -// CHECK:STDOUT: %Op.ref.loc21: %HasQualifiers.cpp_destructor.type = name_ref Op, imports.%HasQualifiers.cpp_destructor.decl [concrete = constants.%HasQualifiers.cpp_destructor] -// CHECK:STDOUT: %HasQualifiers.cpp_destructor.bound.loc21: = bound_method %.loc21_8.2, %Op.ref.loc21 -// CHECK:STDOUT: %HasQualifiers.cpp_destructor.call.loc21: init %empty_tuple.type = call %HasQualifiers.cpp_destructor.bound.loc21(%.loc21_8.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc21: = bound_method %.loc21_8.2, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc21: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc21(%.loc21_8.2) // CHECK:STDOUT: %Make.ref.loc22: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make] // CHECK:STDOUT: %.loc22_8.1: ref %HasQualifiers = temporary_storage // CHECK:STDOUT: %Make.call.loc22: init %HasQualifiers to %.loc22_8.1 = call %Make.ref.loc22() @@ -460,10 +469,10 @@ fn Call(e: Cpp.ExplicitObjectParamOverloaded, n: i32, a: Cpp.AnotherOverloaded) // CHECK:STDOUT: %bound_method.loc22_9: = bound_method %.loc22_8.2, %ref_ref_this.ref // CHECK:STDOUT: %.loc22_8.3: %HasQualifiers = acquire_value %.loc22_8.2 // CHECK:STDOUT: -// CHECK:STDOUT: %impl.elem0.loc22: %.703 = impl_witness_access constants.%custom_witness.d0d, element0 [concrete = constants.%HasQualifiers.Op.4dca31.2] -// CHECK:STDOUT: %bound_method.loc22_8: = bound_method %.loc22_8.3, %impl.elem0.loc22 +// CHECK:STDOUT: %impl.elem0: %.703 = impl_witness_access constants.%custom_witness.d0d, element0 [concrete = constants.%HasQualifiers.Op] +// CHECK:STDOUT: %bound_method.loc22_8: = bound_method %.loc22_8.3, %impl.elem0 // CHECK:STDOUT: %.loc22_8.4: ref %HasQualifiers = temporary_storage -// CHECK:STDOUT: %Op.ref.loc22_8.1: %HasQualifiers.HasQualifiers.type = name_ref Op, imports.%HasQualifiers.HasQualifiers.decl [concrete = constants.%HasQualifiers.HasQualifiers] +// CHECK:STDOUT: %Op.ref: %HasQualifiers.HasQualifiers.type = name_ref Op, imports.%HasQualifiers.HasQualifiers.decl [concrete = constants.%HasQualifiers.HasQualifiers] // CHECK:STDOUT: // CHECK:STDOUT: %.loc22_8.5: ref %HasQualifiers = value_as_ref %.loc22_8.3 // CHECK:STDOUT: %addr.loc22_8.1: %ptr.102 = addr_of %.loc22_8.5 @@ -475,10 +484,8 @@ fn Call(e: Cpp.ExplicitObjectParamOverloaded, n: i32, a: Cpp.AnotherOverloaded) // CHECK:STDOUT: // CHECK:STDOUT: %ref_ref_this__carbon_thunk.call: init %empty_tuple.type = call imports.%ref_ref_this__carbon_thunk.decl(%self.var) // CHECK:STDOUT: -// CHECK:STDOUT: %HasQualifiers.Op.bound.loc22: = bound_method %.loc22_8.2, constants.%HasQualifiers.Op.4dca31.1 -// CHECK:STDOUT: %Op.ref.loc22_8.2: %HasQualifiers.cpp_destructor.type = name_ref Op, imports.%HasQualifiers.cpp_destructor.decl [concrete = constants.%HasQualifiers.cpp_destructor] -// CHECK:STDOUT: %HasQualifiers.cpp_destructor.bound.loc22: = bound_method %.loc22_8.2, %Op.ref.loc22_8.2 -// CHECK:STDOUT: %HasQualifiers.cpp_destructor.call.loc22: init %empty_tuple.type = call %HasQualifiers.cpp_destructor.bound.loc22(%.loc22_8.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc22: = bound_method %.loc22_8.2, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc22: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc22(%.loc22_8.2) // CHECK:STDOUT: %Make.ref.loc23: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make] // CHECK:STDOUT: %.loc23_8.1: ref %HasQualifiers = temporary_storage // CHECK:STDOUT: %Make.call.loc23: init %HasQualifiers to %.loc23_8.1 = call %Make.ref.loc23() @@ -487,13 +494,20 @@ fn Call(e: Cpp.ExplicitObjectParamOverloaded, n: i32, a: Cpp.AnotherOverloaded) // CHECK:STDOUT: %bound_method.loc23: = bound_method %.loc23_8.2, %const_ref_ref_this.ref.loc23 // CHECK:STDOUT: %.loc23_8.3: %HasQualifiers = acquire_value %.loc23_8.2 // CHECK:STDOUT: %const_ref_ref_this__carbon_thunk.call.loc23: init %empty_tuple.type = call imports.%const_ref_ref_this__carbon_thunk.decl(%.loc23_8.3) -// CHECK:STDOUT: %HasQualifiers.Op.bound.loc23: = bound_method %.loc23_8.2, constants.%HasQualifiers.Op.4dca31.1 -// CHECK:STDOUT: %Op.ref.loc23: %HasQualifiers.cpp_destructor.type = name_ref Op, imports.%HasQualifiers.cpp_destructor.decl [concrete = constants.%HasQualifiers.cpp_destructor] -// CHECK:STDOUT: %HasQualifiers.cpp_destructor.bound.loc23: = bound_method %.loc23_8.2, %Op.ref.loc23 -// CHECK:STDOUT: %HasQualifiers.cpp_destructor.call.loc23: init %empty_tuple.type = call %HasQualifiers.cpp_destructor.bound.loc23(%.loc23_8.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc23: = bound_method %.loc23_8.2, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc23: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc23(%.loc23_8.2) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc19(%self.param: ref %HasQualifiers) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc19(%self.param: ref %HasQualifiers) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param) +// CHECK:STDOUT: %HasQualifiers.cpp_destructor.call: init %empty_tuple.type = call imports.%HasQualifiers.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- use_object_param_qualifiers_overloaded.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -517,10 +531,29 @@ fn Call(e: Cpp.ExplicitObjectParamOverloaded, n: i32, a: Cpp.AnotherOverloaded) // CHECK:STDOUT: %b.var_patt.dede8c.1: %pattern_type.f00 = var_pattern %b.patt.9fb99a.1 [concrete] // CHECK:STDOUT: %NoRefQualifier.F.type.8b6eff.2: type = fn_type @NoRefQualifier.F.2 [concrete] // CHECK:STDOUT: %NoRefQualifier.F.dbb5f5.2: %NoRefQualifier.F.type.8b6eff.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.af0: %pattern_type.f00 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.954: %pattern_type.f00 = wrapper_binding_pattern self, %self.param_patt.af0 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc9 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc8_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc8_3.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] // CHECK:STDOUT: %WithRefQualifier: type = class_type @WithRefQualifier [concrete] // CHECK:STDOUT: %ptr.90c: type = ptr_type %WithRefQualifier [concrete] // CHECK:STDOUT: %a.patt.623a16.2: %pattern_type.6b6 = ref_binding_pattern a [concrete] @@ -560,6 +593,51 @@ fn Call(e: Cpp.ExplicitObjectParamOverloaded, n: i32, a: Cpp.AnotherOverloaded) // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f00 = ref_param_pattern [concrete = constants.%self.param_patt.af0] +// CHECK:STDOUT: %self.patt: %pattern_type.f00 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.954] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr.d08 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr.d08 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc9 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f00 = ref_param_pattern [concrete = constants.%self.param_patt.af0] +// CHECK:STDOUT: %self.patt: %pattern_type.f00 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.954] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr.d08 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr.d08 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc8_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc8_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @CallFNoRefQualifier(%v.param: %NoRefQualifier, %p.param: %ptr.f7d) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.var: ref %i32 = var_storage %a.var_patt @@ -590,19 +668,46 @@ fn Call(e: Cpp.ExplicitObjectParamOverloaded, n: i32, a: Cpp.AnotherOverloaded) // CHECK:STDOUT: %b.patt: %pattern_type.f00 = ref_binding_pattern b [concrete = constants.%b.patt.9fb99a.1] // CHECK:STDOUT: %b.var_patt: %pattern_type.f00 = var_pattern %b.patt [concrete = constants.%b.var_patt.dede8c.1] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc9: = bound_method %b.var, constants.%Destroy.WithSelf.Op.403171.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc9(%b.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc8: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc8(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc9: = bound_method %b.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc9(%b.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9(%self.param: ref %ptr.d08) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9(%self.param: ref %ptr.d08) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9(%self.param: ref %ptr.d08) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.1(%self.param: ref %i32.builtin) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -636,10 +741,10 @@ fn Call(e: Cpp.ExplicitObjectParamOverloaded, n: i32, a: Cpp.AnotherOverloaded) // CHECK:STDOUT: %b.patt: %pattern_type.f00 = ref_binding_pattern b [concrete = constants.%b.patt.9fb99a.2] // CHECK:STDOUT: %b.var_patt: %pattern_type.f00 = var_pattern %b.patt [concrete = constants.%b.var_patt.dede8c.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc16: = bound_method %b.var, constants.%Destroy.WithSelf.Op.403171.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc16: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc16(%b.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc15: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc15: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc15(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16: = bound_method %b.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16(%b.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc15: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc15: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc15(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/class/import/template.carbon b/toolchain/check/testdata/interop/cpp/class/import/template.carbon index 1755fff9fd74..4fd54af9578b 100644 --- a/toolchain/check/testdata/interop/cpp/class/import/template.carbon +++ b/toolchain/check/testdata/interop/cpp/class/import/template.carbon @@ -737,14 +737,14 @@ fn G() { // CHECK:STDOUT: %.972: %.d15 = splice_inst @F.%.loc10_3.27 [template] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %Self.0e7: %Destroy.type = symbolic_binding Self, 0 [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.d3e: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Self.0e7) [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.42b: %Destroy.WithSelf.Op.type.d3e = struct_value () [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.4e5: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Self.0e7) [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.4a0: %Destroy.WithSelf.SelfDestruct.type.4e5 = struct_value () [symbolic] // CHECK:STDOUT: %Destroy.assoc_type: type = assoc_entity_type @Destroy [concrete] -// CHECK:STDOUT: %assoc0.ae8: %Destroy.assoc_type = assoc_entity element0, imports.%Core.import_ref.918 [concrete] -// CHECK:STDOUT: %.e71: type = type_of_inst @F.%.loc10_3.29 [template] -// CHECK:STDOUT: %.1c0: %.e71 = splice_inst @F.%.loc10_3.29 [template] -// CHECK:STDOUT: %.920: type = type_of_inst @F.%.loc10_3.32 [template] -// CHECK:STDOUT: %.024: %.920 = splice_inst @F.%.loc10_3.32 [template] +// CHECK:STDOUT: %assoc2: %Destroy.assoc_type = assoc_entity element2, imports.%Core.import_ref.71d [concrete] +// CHECK:STDOUT: %.409: type = type_of_inst @F.%.loc10_3.29 [template] +// CHECK:STDOUT: %.9b8: %.409 = splice_inst @F.%.loc10_3.29 [template] +// CHECK:STDOUT: %.a75: type = type_of_inst @F.%.loc10_3.32 [template] +// CHECK:STDOUT: %.4ea: %.a75 = splice_inst @F.%.loc10_3.32 [template] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %A: type = class_type @A [concrete] @@ -792,21 +792,27 @@ fn G() { // CHECK:STDOUT: %.c3f: %.67b = splice_inst %.787 [template] // CHECK:STDOUT: %.9d9: = convert_to_category_action %.c3f, element10 [template] // CHECK:STDOUT: %.1a1: %A = splice_inst %.9d9 [template] +// CHECK:STDOUT: %self.param_patt.1f1: %pattern_type.b78 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.6db: %pattern_type.b78 = wrapper_binding_pattern self, %self.param_patt.1f1 [concrete] // CHECK:STDOUT: %A.cpp_destructor.type: type = fn_type @A.cpp_destructor [concrete] // CHECK:STDOUT: %A.cpp_destructor: %A.cpp_destructor.type = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.294: = custom_witness (%A.cpp_destructor), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.bf5: %Destroy.type = facet_value %A, (%custom_witness.294) [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.d24: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.bf5) [concrete] -// CHECK:STDOUT: %.429: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.d24, %Destroy.facet.bf5 [concrete] -// CHECK:STDOUT: %inst.splice_block.1c7: = inst_value [concrete] { -// CHECK:STDOUT: %.d1c: = splice_block %bound_method { +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc10 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.842: = custom_witness (%Destroy.WithSelf.Op.403, %A.cpp_destructor, %Destroy.WithSelf.SelfDestruct.db3), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.cd4: %Destroy.type = facet_value %A, (%custom_witness.842) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.2fb: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.cd4) [concrete] +// CHECK:STDOUT: %.758: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.2fb, %Destroy.facet.cd4 [concrete] +// CHECK:STDOUT: %inst.splice_block.df2: = inst_value [concrete] { +// CHECK:STDOUT: %.6c0: = splice_block %bound_method { // CHECK:STDOUT: %.30e: ref %A = specific_inst @F.%a.var, @F(%i32) -// CHECK:STDOUT: %impl.elem0: %.429 = impl_witness_access %custom_witness.294, element0 [concrete = %A.cpp_destructor] -// CHECK:STDOUT: %bound_method: = bound_method %.30e, %impl.elem0 +// CHECK:STDOUT: %impl.elem2: %.758 = impl_witness_access %custom_witness.842, element2 [concrete = %Destroy.WithSelf.SelfDestruct.db3] +// CHECK:STDOUT: %bound_method: = bound_method %.30e, %impl.elem2 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: %inst.call: = inst_value [concrete] { -// CHECK:STDOUT: %A.cpp_destructor.call: init %empty_tuple.type = call %.d1c(%.30e) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %.6c0(%.30e) // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -816,7 +822,7 @@ fn G() { // CHECK:STDOUT: import Cpp//... // CHECK:STDOUT: } // CHECK:STDOUT: %A.template: %A.type = struct_value () [concrete = constants.%A.template] -// CHECK:STDOUT: %Core.import_ref.918: @Destroy.WithSelf.%Destroy.WithSelf.Op.type (%Destroy.WithSelf.Op.type.d3e) = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [symbolic = @Destroy.WithSelf.%Destroy.WithSelf.Op (constants.%Destroy.WithSelf.Op.42b)] +// CHECK:STDOUT: %Core.import_ref.71d: @Destroy.WithSelf.%Destroy.WithSelf.SelfDestruct.type (%Destroy.WithSelf.SelfDestruct.type.4e5) = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [symbolic = @Destroy.WithSelf.%Destroy.WithSelf.SelfDestruct (constants.%Destroy.WithSelf.SelfDestruct.4a0)] // CHECK:STDOUT: %A.decl: type = class_decl @A [concrete = constants.%A] {} {} // CHECK:STDOUT: %A.A.cpp_overload_set.value: %A.A.cpp_overload_set.type = cpp_overload_set_value @A.A.cpp_overload_set [concrete = constants.%A.A.cpp_overload_set.value] // CHECK:STDOUT: %A__carbon_thunk.decl: %A__carbon_thunk.type = fn_decl @A__carbon_thunk [concrete = constants.%A__carbon_thunk] { @@ -824,6 +830,21 @@ fn G() { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } +// CHECK:STDOUT: %A.cpp_destructor.decl: %A.cpp_destructor.type = fn_decl @A.cpp_destructor [concrete = constants.%A.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc10 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b78 = ref_param_pattern [concrete = constants.%self.param_patt.1f1] +// CHECK:STDOUT: %self.patt: %pattern_type.b78 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.6db] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %A = ref_param call_param0 +// CHECK:STDOUT: %self: ref %A = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -876,12 +897,12 @@ fn G() { // CHECK:STDOUT: %.loc10_3.26: @F.%.loc10_3.25 (%.4d4) = splice_inst %.loc10_3.24 [template = %.loc10_3.26 (constants.%.c8d)] // CHECK:STDOUT: %.loc10_3.27: = convert_to_category_action %.loc10_3.9, element10 [template] // CHECK:STDOUT: %.loc10_3.28: @F.%.loc10_24.9 (%.d15) = splice_inst %.loc10_3.27 [template = %.loc10_3.28 (constants.%.972)] -// CHECK:STDOUT: %.loc10_3.29: = compound_member_access_action %a.var, constants.%assoc0.ae8 [template] -// CHECK:STDOUT: %.loc10_3.30: type = type_of_inst %.loc10_3.29 [template = %.loc10_3.30 (constants.%.e71)] -// CHECK:STDOUT: %.loc10_3.31: @F.%.loc10_3.30 (%.e71) = splice_inst %.loc10_3.29 [template = %.loc10_3.31 (constants.%.1c0)] +// CHECK:STDOUT: %.loc10_3.29: = compound_member_access_action %a.var, constants.%assoc2 [template] +// CHECK:STDOUT: %.loc10_3.30: type = type_of_inst %.loc10_3.29 [template = %.loc10_3.30 (constants.%.409)] +// CHECK:STDOUT: %.loc10_3.31: @F.%.loc10_3.30 (%.409) = splice_inst %.loc10_3.29 [template = %.loc10_3.31 (constants.%.9b8)] // CHECK:STDOUT: %.loc10_3.32: = call_action (%.loc10_3.12), true [template] -// CHECK:STDOUT: %.loc10_3.33: type = type_of_inst %.loc10_3.32 [template = %.loc10_3.33 (constants.%.920)] -// CHECK:STDOUT: %.loc10_3.34: @F.%.loc10_3.33 (%.920) = splice_inst %.loc10_3.32 [template = %.loc10_3.34 (constants.%.024)] +// CHECK:STDOUT: %.loc10_3.33: type = type_of_inst %.loc10_3.32 [template = %.loc10_3.33 (constants.%.a75)] +// CHECK:STDOUT: %.loc10_3.34: @F.%.loc10_3.33 (%.a75) = splice_inst %.loc10_3.32 [template = %.loc10_3.34 (constants.%.4ea)] // CHECK:STDOUT: // CHECK:STDOUT: fn() { // CHECK:STDOUT: !entry: @@ -921,14 +942,23 @@ fn G() { // CHECK:STDOUT: %a.patt.loc10_15.1: @F.%pattern_type (%pattern_type.3c1) = ref_binding_pattern a [template = %a.patt.loc10_15.2 (constants.%a.patt.b2a)] // CHECK:STDOUT: %a.var_patt.loc10_3.1: @F.%pattern_type (%pattern_type.3c1) = var_pattern %a.patt.loc10_15.1 [template = %a.var_patt.loc10_3.2 (constants.%a.var_patt.66a)] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc10_3.11: type = type_of_inst %.loc10_3.29 [template = %.loc10_3.30 (constants.%.e71)] -// CHECK:STDOUT: %.loc10_3.12: @F.%.loc10_3.30 (%.e71) = splice_inst %.loc10_3.29 [template = %.loc10_3.31 (constants.%.1c0)] -// CHECK:STDOUT: %.loc10_3.13: type = type_of_inst %.loc10_3.32 [template = %.loc10_3.33 (constants.%.920)] -// CHECK:STDOUT: %.loc10_3.14: @F.%.loc10_3.33 (%.920) = splice_inst %.loc10_3.32 [template = %.loc10_3.34 (constants.%.024)] +// CHECK:STDOUT: %.loc10_3.11: type = type_of_inst %.loc10_3.29 [template = %.loc10_3.30 (constants.%.409)] +// CHECK:STDOUT: %.loc10_3.12: @F.%.loc10_3.30 (%.409) = splice_inst %.loc10_3.29 [template = %.loc10_3.31 (constants.%.9b8)] +// CHECK:STDOUT: %.loc10_3.13: type = type_of_inst %.loc10_3.32 [template = %.loc10_3.33 (constants.%.a75)] +// CHECK:STDOUT: %.loc10_3.14: @F.%.loc10_3.33 (%.a75) = splice_inst %.loc10_3.32 [template = %.loc10_3.34 (constants.%.4ea)] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10(%self.param: ref %A) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10(%self.param: ref %A) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param) +// CHECK:STDOUT: %A.cpp_destructor.call: init %empty_tuple.type = call imports.%A.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T) { // CHECK:STDOUT: %T.patt.loc9_15.2 => constants.%T.patt // CHECK:STDOUT: %T.loc9_15.1 => constants.%T @@ -972,7 +1002,7 @@ fn G() { // CHECK:STDOUT: %.loc10_3.26 => constants.%.c3f // CHECK:STDOUT: %.loc10_3.27 => constants.%.9d9 // CHECK:STDOUT: %.loc10_3.28 => constants.%.1a1 -// CHECK:STDOUT: %.loc10_3.29 => constants.%inst.splice_block.1c7 +// CHECK:STDOUT: %.loc10_3.29 => constants.%inst.splice_block.df2 // CHECK:STDOUT: %.loc10_3.30 => // CHECK:STDOUT: %.loc10_3.31 => invalid // CHECK:STDOUT: %.loc10_3.32 => constants.%inst.call diff --git a/toolchain/check/testdata/interop/cpp/enum/anonymous.carbon b/toolchain/check/testdata/interop/cpp/enum/anonymous.carbon index 64693381405b..62ab51636324 100644 --- a/toolchain/check/testdata/interop/cpp/enum/anonymous.carbon +++ b/toolchain/check/testdata/interop/cpp/enum/anonymous.carbon @@ -53,6 +53,7 @@ fn G() { // CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %C.C.cpp_overload_set.type: type = cpp_overload_set_type @C.C.cpp_overload_set [concrete] // CHECK:STDOUT: %C.C.cpp_overload_set.value: %C.C.cpp_overload_set.type = cpp_overload_set_value @C.C.cpp_overload_set [concrete] +// CHECK:STDOUT: %pattern_type.bbc: type = pattern_type %C [concrete] // CHECK:STDOUT: %ptr.0a2: type = ptr_type %C [concrete] // CHECK:STDOUT: %C__carbon_thunk.type: type = fn_type @C__carbon_thunk [concrete] // CHECK:STDOUT: %C__carbon_thunk: %C__carbon_thunk.type = struct_value () [concrete] @@ -62,8 +63,14 @@ fn G() { // CHECK:STDOUT: %int_1.1fb: %.2b9 = int_value 1 [concrete] // CHECK:STDOUT: %C.F.type: type = fn_type @C.F [concrete] // CHECK:STDOUT: %C.F: %C.F.type = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.e2f: %pattern_type.bbc = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.790: %pattern_type.bbc = wrapper_binding_pattern self, %self.param_patt.e2f [concrete] // CHECK:STDOUT: %C.cpp_destructor.type: type = fn_type @C.cpp_destructor [concrete] // CHECK:STDOUT: %C.cpp_destructor: %C.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc10 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -94,6 +101,21 @@ fn G() { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } +// CHECK:STDOUT: %C.cpp_destructor.decl: %C.cpp_destructor.type = fn_decl @C.cpp_destructor [concrete = constants.%C.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc10 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.bbc = ref_param_pattern [concrete = constants.%self.param_patt.e2f] +// CHECK:STDOUT: %self.patt: %pattern_type.bbc = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.790] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -122,8 +144,17 @@ fn G() { // CHECK:STDOUT: %e.ref: %.2b9 = name_ref e, imports.%int_1.1fb [concrete = constants.%int_1.1fb] // CHECK:STDOUT: %.loc10_11.4: %C = acquire_value %.loc10_11.3 // CHECK:STDOUT: %C.F.call: init %empty_tuple.type = call imports.%C.F.decl(%.loc10_11.4, %e.ref) -// CHECK:STDOUT: %C.cpp_destructor.bound: = bound_method %.loc10_11.3, constants.%C.cpp_destructor -// CHECK:STDOUT: %C.cpp_destructor.call: init %empty_tuple.type = call %C.cpp_destructor.bound(%.loc10_11.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc10_11.3, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc10_11.3) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param) +// CHECK:STDOUT: %C.cpp_destructor.call: init %empty_tuple.type = call imports.%C.cpp_destructor.decl(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/enum/copy.carbon b/toolchain/check/testdata/interop/cpp/enum/copy.carbon index 6f37908edc07..67576314daef 100644 --- a/toolchain/check/testdata/interop/cpp/enum/copy.carbon +++ b/toolchain/check/testdata/interop/cpp/enum/copy.carbon @@ -50,8 +50,14 @@ fn F() { // CHECK:STDOUT: %Copy.WithSelf.Op.bound.996: = bound_method %int_0, %Copy.WithSelf.Op.416 [concrete] // CHECK:STDOUT: %int_1: %Enum = int_value 1 [concrete] // CHECK:STDOUT: %Copy.WithSelf.Op.bound.1a9: = bound_method %int_1, %Copy.WithSelf.Op.416 [concrete] +// CHECK:STDOUT: %self.param_patt.95d: %pattern_type.926 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.228: %pattern_type.926 = wrapper_binding_pattern self, %self.param_patt.95d [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.loc8 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -64,6 +70,23 @@ fn F() { // CHECK:STDOUT: %int_1: %Enum = int_value 1 [concrete = constants.%int_1] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// 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.926 = ref_param_pattern [concrete = constants.%self.param_patt.95d] +// CHECK:STDOUT: %self.patt: %pattern_type.926 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.228] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Enum = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Enum = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// 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.926 = ref_param_pattern [concrete = constants.%self.param_patt.95d] +// CHECK:STDOUT: %self.patt: %pattern_type.926 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.228] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Enum = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Enum = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {} // CHECK:STDOUT: } @@ -96,10 +119,19 @@ fn F() { // CHECK:STDOUT: %bound_method.loc10: = bound_method %b.ref, %impl.elem0.loc10 [concrete = constants.%Copy.WithSelf.Op.bound.1a9] // CHECK:STDOUT: %Copy.WithSelf.Op.call.loc10: init %Enum = call %bound_method.loc10(%b.ref) [concrete = constants.%int_1] // CHECK:STDOUT: assign %a.ref.loc10, %Copy.WithSelf.Op.call.loc10 -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%a.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8(%self.param: ref %Enum) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8(%self.param: ref %Enum) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8(%self.param: ref %Enum) { +// 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) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/function/export/generic.carbon b/toolchain/check/testdata/interop/cpp/function/export/generic.carbon index 5d32adef4a8e..deb279179f86 100644 --- a/toolchain/check/testdata/interop/cpp/function/export/generic.carbon +++ b/toolchain/check/testdata/interop/cpp/function/export/generic.carbon @@ -154,7 +154,7 @@ void CallUnsupportedF() { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %I.WithSelf.Doit.11f: %I.WithSelf.Doit.type.26f = struct_value () [symbolic] // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete] -// CHECK:STDOUT: %assoc0.628: %I.assoc_type = assoc_entity element0, @I.WithSelf.%I.WithSelf.Doit.decl [concrete] +// CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.WithSelf.%I.WithSelf.Doit.decl [concrete] // CHECK:STDOUT: %A: type = class_type @A [concrete] // CHECK:STDOUT: %.b03: = impl_self_witness %A, @I [concrete] // CHECK:STDOUT: %I.impl_witness.ca2: = impl_witness @A.as.I.impl.%I.impl_witness_table [concrete] @@ -201,28 +201,47 @@ void CallUnsupportedF() { // CHECK:STDOUT: %return.patt.2e6: %pattern_type.b3a = return_slot_pattern %return.param_patt.b82, %T.as_type [symbolic] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] -// CHECK:STDOUT: %require_complete: = require_complete_type %T.as_type [symbolic] +// CHECK:STDOUT: %require_complete.27c: = require_complete_type %T.as_type [symbolic] // CHECK:STDOUT: %I.WithSelf.Doit.type.860: type = fn_type @I.WithSelf.Doit, @I.WithSelf(%T) [symbolic] // CHECK:STDOUT: %I.WithSelf.Doit.45d: %I.WithSelf.Doit.type.860 = struct_value () [symbolic] // CHECK:STDOUT: %I.lookup_impl_witness: = lookup_impl_witness %T, @I [symbolic] // CHECK:STDOUT: %.8a9: type = fn_type_with_self_type %I.WithSelf.Doit.type.860, %T [symbolic] -// CHECK:STDOUT: %impl.elem0: %.8a9 = impl_witness_access %I.lookup_impl_witness, element0 [symbolic] +// CHECK:STDOUT: %impl.elem0.2e5: %.8a9 = impl_witness_access %I.lookup_impl_witness, element0 [symbolic] // CHECK:STDOUT: %self.param_patt.58e: %pattern_type.b3a = value_param_pattern [symbolic] // CHECK:STDOUT: %self.patt.b4c: %pattern_type.b3a = wrapper_binding_pattern self, %self.param_patt.58e [symbolic] -// CHECK:STDOUT: %specific_impl_fn: = specific_impl_function %impl.elem0, @I.WithSelf.Doit(%T) [symbolic] +// CHECK:STDOUT: %specific_impl_fn.275: = specific_impl_function %impl.elem0.2e5, @I.WithSelf.Doit(%T) [symbolic] +// CHECK:STDOUT: %self.param_patt.039: %pattern_type.e39 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.535: %pattern_type.e39 = wrapper_binding_pattern self, %self.param_patt.039 [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc16_9.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc16_9.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc16_9.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc16_9.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.6c4ec3.2: = custom_witness (%Destroy.WithSelf.Op.403171.2), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.5dd: %Destroy.type = facet_value %B, (%custom_witness.6c4ec3.2) [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.bf9: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Destroy.facet.5dd) [concrete] -// CHECK:STDOUT: %.9b8: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.bf9, %Destroy.facet.5dd [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc16_9.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f8f19d.2: = custom_witness (%Destroy.WithSelf.Op.403171.2, %Destroy.WithSelf.SubobjectDestroy.d01daf.2, %Destroy.WithSelf.SelfDestruct.db3fdb.2), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.872: %Destroy.type = facet_value %B, (%custom_witness.f8f19d.2) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.0b2: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.872) [concrete] +// CHECK:STDOUT: %.0fa: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.0b2, %Destroy.facet.872 [concrete] +// CHECK:STDOUT: %self.param_patt.8fb: %pattern_type.9ef = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.e64: %pattern_type.9ef = wrapper_binding_pattern self, %self.param_patt.8fb [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc9 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.6c4ec3.3: = custom_witness (%Destroy.WithSelf.Op.403171.3), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.288: %Destroy.type = facet_value %A, (%custom_witness.6c4ec3.3) [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.c82: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Destroy.facet.288) [concrete] -// CHECK:STDOUT: %.528: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.c82, %Destroy.facet.288 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f8f19d.3: = custom_witness (%Destroy.WithSelf.Op.403171.3, %Destroy.WithSelf.SubobjectDestroy.d01daf.3, %Destroy.WithSelf.SelfDestruct.db3fdb.3), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.61a: %Destroy.type = facet_value %A, (%custom_witness.f8f19d.3) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fb1: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.61a) [concrete] +// CHECK:STDOUT: %.353: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.fb1, %Destroy.facet.61a [concrete] // CHECK:STDOUT: %t.param_patt.169: %pattern_type.9ef = value_param_pattern [concrete] // CHECK:STDOUT: %t.patt.490: %pattern_type.9ef = wrapper_binding_pattern t, %t.param_patt.169 [concrete] // CHECK:STDOUT: %F.specific_fn.9d8: = specific_function %F, @F(%I.facet.f31) [concrete] @@ -239,6 +258,51 @@ void CallUnsupportedF() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc16_9.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc16_9.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc16_9.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e39 = ref_param_pattern [concrete = constants.%self.param_patt.039] +// CHECK:STDOUT: %self.patt: %pattern_type.e39 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.535] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %B = ref_param call_param0 +// CHECK:STDOUT: %self: ref %B = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc16_9.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e39 = ref_param_pattern [concrete = constants.%self.param_patt.039] +// CHECK:STDOUT: %self.patt: %pattern_type.e39 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.535] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %B = ref_param call_param0 +// CHECK:STDOUT: %self: ref %B = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.9ef = ref_param_pattern [concrete = constants.%self.param_patt.8fb] +// CHECK:STDOUT: %self.patt: %pattern_type.9ef = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.e64] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %A = ref_param call_param0 +// CHECK:STDOUT: %self: ref %A = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc9 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.9ef = ref_param_pattern [concrete = constants.%self.param_patt.8fb] +// CHECK:STDOUT: %self.patt: %pattern_type.9ef = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.e64] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %A = ref_param call_param0 +// CHECK:STDOUT: %self: ref %A = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {} // CHECK:STDOUT: %A.decl: type = class_decl @A [concrete = constants.%A] {} {} @@ -302,7 +366,7 @@ void CallUnsupportedF() { // CHECK:STDOUT: %return.param: ref @I.WithSelf.Doit.%Self.as_type.loc6_11.1 (%Self.as_type.c84) = out_param call_param1 // CHECK:STDOUT: %return: ref @I.WithSelf.Doit.%Self.as_type.loc6_11.1 (%Self.as_type.c84) = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, %I.WithSelf.Doit.decl [concrete = constants.%assoc0.628] +// CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, %I.WithSelf.Doit.decl [concrete = constants.%assoc0] // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self @@ -431,22 +495,22 @@ void CallUnsupportedF() { // CHECK:STDOUT: %return.patt.loc24_18.2: @F.%pattern_type (%pattern_type.b3a) = return_slot_pattern %return.param_patt.loc24_21.2, %T.as_type.loc24_15.1 [symbolic = %return.patt.loc24_18.2 (constants.%return.patt.2e6)] // CHECK:STDOUT: // CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type %T.as_type.loc24_15.1 [symbolic = %require_complete (constants.%require_complete)] +// CHECK:STDOUT: %require_complete: = require_complete_type %T.as_type.loc24_15.1 [symbolic = %require_complete (constants.%require_complete.27c)] // CHECK:STDOUT: %I.WithSelf.Doit.type: type = fn_type @I.WithSelf.Doit, @I.WithSelf(%T.loc24_7.1) [symbolic = %I.WithSelf.Doit.type (constants.%I.WithSelf.Doit.type.860)] // CHECK:STDOUT: %.loc25_11: type = fn_type_with_self_type %I.WithSelf.Doit.type, %T.loc24_7.1 [symbolic = %.loc25_11 (constants.%.8a9)] // CHECK:STDOUT: %I.lookup_impl_witness: = lookup_impl_witness %T.loc24_7.1, @I [symbolic = %I.lookup_impl_witness (constants.%I.lookup_impl_witness)] -// CHECK:STDOUT: %impl.elem0.loc25_11.2: @F.%.loc25_11 (%.8a9) = impl_witness_access %I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc25_11.2 (constants.%impl.elem0)] -// CHECK:STDOUT: %specific_impl_fn.loc25_11.2: = specific_impl_function %impl.elem0.loc25_11.2, @I.WithSelf.Doit(%T.loc24_7.1) [symbolic = %specific_impl_fn.loc25_11.2 (constants.%specific_impl_fn)] +// CHECK:STDOUT: %impl.elem0.loc25_11.2: @F.%.loc25_11 (%.8a9) = impl_witness_access %I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc25_11.2 (constants.%impl.elem0.2e5)] +// CHECK:STDOUT: %specific_impl_fn.loc25_11.2: = specific_impl_function %impl.elem0.loc25_11.2, @I.WithSelf.Doit(%T.loc24_7.1) [symbolic = %specific_impl_fn.loc25_11.2 (constants.%specific_impl_fn.275)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%t.param: @F.%T.as_type.loc24_15.1 (%T.as_type)) -> out %return.param: @F.%T.as_type.loc24_15.1 (%T.as_type) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %t.ref: @F.%T.as_type.loc24_15.1 (%T.as_type) = name_ref t, %t -// CHECK:STDOUT: %Doit.ref: %I.assoc_type = name_ref Doit, @I.WithSelf.%assoc0 [concrete = constants.%assoc0.628] -// CHECK:STDOUT: %impl.elem0.loc25_11.1: @F.%.loc25_11 (%.8a9) = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc25_11.2 (constants.%impl.elem0)] +// CHECK:STDOUT: %Doit.ref: %I.assoc_type = name_ref Doit, @I.WithSelf.%assoc0 [concrete = constants.%assoc0] +// CHECK:STDOUT: %impl.elem0.loc25_11.1: @F.%.loc25_11 (%.8a9) = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc25_11.2 (constants.%impl.elem0.2e5)] // CHECK:STDOUT: %bound_method.loc25_11: = bound_method %t.ref, %impl.elem0.loc25_11.1 // CHECK:STDOUT: %.loc25_17.1: %I.type = converted constants.%T.as_type, constants.%T [symbolic = %T.loc24_7.1 (constants.%T)] // CHECK:STDOUT: %.loc25_17.2: %I.type = converted constants.%T.as_type, constants.%T [symbolic = %T.loc24_7.1 (constants.%T)] -// CHECK:STDOUT: %specific_impl_fn.loc25_11.1: = specific_impl_function %impl.elem0.loc25_11.1, @I.WithSelf.Doit(constants.%T) [symbolic = %specific_impl_fn.loc25_11.2 (constants.%specific_impl_fn)] +// CHECK:STDOUT: %specific_impl_fn.loc25_11.1: = specific_impl_function %impl.elem0.loc25_11.1, @I.WithSelf.Doit(constants.%T) [symbolic = %specific_impl_fn.loc25_11.2 (constants.%specific_impl_fn.275)] // CHECK:STDOUT: %bound_method.loc25_17: = bound_method %t.ref, %specific_impl_fn.loc25_11.1 // CHECK:STDOUT: %.loc24_21.1: ref @F.%T.as_type.loc24_15.1 (%T.as_type) = splice_block %return.param {} // CHECK:STDOUT: %I.WithSelf.Doit.call: init @F.%T.as_type.loc24_15.1 (%T.as_type) to %.loc24_21.1 = call %bound_method.loc25_17(%t.ref) @@ -456,32 +520,59 @@ void CallUnsupportedF() { // CHECK:STDOUT: // CHECK:STDOUT: fn @B.__destroy_thunk(%self.param: ref %B) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %impl.elem0: %.9b8 = impl_witness_access constants.%custom_witness.6c4ec3.2, element0 [concrete = constants.%Destroy.WithSelf.Op.403171.2] -// CHECK:STDOUT: %bound_method: = bound_method %self.param, %impl.elem0 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method(%self.param) +// CHECK:STDOUT: %impl.elem2: %.0fa = impl_witness_access constants.%custom_witness.f8f19d.2, element2 [concrete = constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2] +// CHECK:STDOUT: %bound_method: = bound_method %self.param, %impl.elem2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %bound_method(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc16_9.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16_9.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16_9.2(%self.param: ref %B) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc16_9.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc16_9.2(%self.param: ref %B) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16_9.2(%self.param: ref %B) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc16_9.2(%self.param: ref %B) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @A.__destroy_thunk(%self.param: ref %A) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %impl.elem0: %.528 = impl_witness_access constants.%custom_witness.6c4ec3.3, element0 [concrete = constants.%Destroy.WithSelf.Op.403171.3] -// CHECK:STDOUT: %bound_method: = bound_method %self.param, %impl.elem0 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method(%self.param) +// CHECK:STDOUT: %impl.elem2: %.353 = impl_witness_access constants.%custom_witness.f8f19d.3, element2 [concrete = constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3] +// CHECK:STDOUT: %bound_method: = bound_method %self.param, %impl.elem2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %bound_method(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9(%self.param: ref %A) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9(%self.param: ref %A) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9(%self.param: ref %A) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9(%self.param: ref %A) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F__carbon_thunk.26f2099a79512a5d(%_.param.loc24_23.1: ref %A, %_.param.loc24_23.2: ref %A) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %F__carbon_thunk.26f2099a79512a5d.ref: %F.type = name_ref F__carbon_thunk.26f2099a79512a5d, file.%F.decl [concrete = constants.%F] diff --git a/toolchain/check/testdata/interop/cpp/function/import/arithmetic_types_bridged.carbon b/toolchain/check/testdata/interop/cpp/function/import/arithmetic_types_bridged.carbon index ec9484a365b7..94d1bcab6595 100644 --- a/toolchain/check/testdata/interop/cpp/function/import/arithmetic_types_bridged.carbon +++ b/toolchain/check/testdata/interop/cpp/function/import/arithmetic_types_bridged.carbon @@ -563,6 +563,7 @@ fn F() { // CHECK:STDOUT: %foo.cpp_overload_set.type: type = cpp_overload_set_type @foo.cpp_overload_set [concrete] // CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete] // CHECK:STDOUT: %true: bool = bool_literal true [concrete] +// CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete] // CHECK:STDOUT: %ptr.bb2: type = ptr_type bool [concrete] // CHECK:STDOUT: %foo__carbon_thunk.type: type = fn_type @foo__carbon_thunk [concrete] // CHECK:STDOUT: %foo__carbon_thunk: %foo__carbon_thunk.type = struct_value () [concrete] @@ -576,6 +577,15 @@ fn F() { // CHECK:STDOUT: %bool.as.Copy.impl.Op.bound: = bound_method %true, %bool.as.Copy.impl.Op [concrete] // CHECK:STDOUT: %.e3b: ref bool = temporary invalid, %true [concrete] // CHECK:STDOUT: %addr: %ptr.bb2 = addr_of %.e3b [concrete] +// CHECK:STDOUT: %self.param_patt.40d: %pattern_type.831 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.560: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt.40d [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.loc8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.e3b, %Destroy.WithSelf.SelfDestruct.db3 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -593,6 +603,23 @@ fn F() { // CHECK:STDOUT: %Copy.impl_witness_table.bda = impl_witness_table (%Core.import_ref.9c3), @bool.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// 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.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d] +// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0 +// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// 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.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d] +// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0 +// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -605,11 +632,21 @@ fn F() { // CHECK:STDOUT: %.loc8_11.2: ref bool = temporary %.loc8_11.1, %bool.as.Copy.impl.Op.call [concrete = constants.%.e3b] // CHECK:STDOUT: %addr: %ptr.bb2 = addr_of %.loc8_11.2 [concrete = constants.%addr] // CHECK:STDOUT: %foo__carbon_thunk.call: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.e3b) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8(%self.param: ref bool) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8(%self.param: ref bool) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8(%self.param: ref bool) { +// 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) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- import_bool_param_false.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -618,6 +655,7 @@ fn F() { // CHECK:STDOUT: %foo.cpp_overload_set.type: type = cpp_overload_set_type @foo.cpp_overload_set [concrete] // CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete] // CHECK:STDOUT: %false: bool = bool_literal false [concrete] +// CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete] // CHECK:STDOUT: %ptr.bb2: type = ptr_type bool [concrete] // CHECK:STDOUT: %foo__carbon_thunk.type: type = fn_type @foo__carbon_thunk [concrete] // CHECK:STDOUT: %foo__carbon_thunk: %foo__carbon_thunk.type = struct_value () [concrete] @@ -631,6 +669,15 @@ fn F() { // CHECK:STDOUT: %bool.as.Copy.impl.Op.bound: = bound_method %false, %bool.as.Copy.impl.Op [concrete] // CHECK:STDOUT: %.48c: ref bool = temporary invalid, %false [concrete] // CHECK:STDOUT: %addr: %ptr.bb2 = addr_of %.48c [concrete] +// CHECK:STDOUT: %self.param_patt.40d: %pattern_type.831 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.560: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt.40d [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.loc8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.48c, %Destroy.WithSelf.SelfDestruct.db3 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -648,6 +695,23 @@ fn F() { // CHECK:STDOUT: %Copy.impl_witness_table.bda = impl_witness_table (%Core.import_ref.9c3), @bool.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// 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.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d] +// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0 +// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// 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.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d] +// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0 +// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -660,11 +724,21 @@ fn F() { // CHECK:STDOUT: %.loc8_11.2: ref bool = temporary %.loc8_11.1, %bool.as.Copy.impl.Op.call [concrete = constants.%.48c] // CHECK:STDOUT: %addr: %ptr.bb2 = addr_of %.loc8_11.2 [concrete = constants.%addr] // CHECK:STDOUT: %foo__carbon_thunk.call: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.48c) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8(%self.param: ref bool) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8(%self.param: ref bool) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8(%self.param: ref bool) { +// 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) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- import_signed_char_param.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -685,6 +759,7 @@ fn F() { // CHECK:STDOUT: %int_8: Core.IntLiteral = int_value 8 [concrete] // CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic] // CHECK:STDOUT: %i8: type = class_type @Int, @Int(%int_8) [concrete] +// CHECK:STDOUT: %pattern_type.0cf: type = pattern_type %i8 [concrete] // CHECK:STDOUT: %ptr.de5: type = ptr_type %i8 [concrete] // CHECK:STDOUT: %foo__carbon_thunk.type: type = fn_type @foo__carbon_thunk [concrete] // CHECK:STDOUT: %foo__carbon_thunk: %foo__carbon_thunk.type = struct_value () [concrete] @@ -717,9 +792,22 @@ fn F() { // CHECK:STDOUT: %bound_method.cfe: = bound_method %int_-1.e55, %Int.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: %.309: ref %i8 = temporary invalid, %int_-1.e55 [concrete] // CHECK:STDOUT: %addr: %ptr.de5 = addr_of %.309 [concrete] +// CHECK:STDOUT: %pattern_type.b06: type = pattern_type %i8.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.133: %pattern_type.b06 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.f49: %pattern_type.b06 = wrapper_binding_pattern self, %self.param_patt.133 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_11.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc8_11.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.6c8: %pattern_type.0cf = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.136: %pattern_type.0cf = wrapper_binding_pattern self, %self.param_patt.6c8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_11.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc8_11.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.309, %Destroy.WithSelf.Op.403171.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8_11.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.309, %Destroy.WithSelf.SelfDestruct.db3fdb.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -742,6 +830,37 @@ fn F() { // CHECK:STDOUT: %Copy.impl_witness_table.8d2 = impl_witness_table (%Core.import_ref.cd6), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_11.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b06 = ref_param_pattern [concrete = constants.%self.param_patt.133] +// CHECK:STDOUT: %self.patt: %pattern_type.b06 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.f49] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i8.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i8.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc8_11.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b06 = ref_param_pattern [concrete = constants.%self.param_patt.133] +// CHECK:STDOUT: %self.patt: %pattern_type.b06 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.f49] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i8.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i8.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_11.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.0cf = ref_param_pattern [concrete = constants.%self.param_patt.6c8] +// CHECK:STDOUT: %self.patt: %pattern_type.0cf = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.136] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i8 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i8 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc8_11.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.0cf = ref_param_pattern [concrete = constants.%self.param_patt.6c8] +// CHECK:STDOUT: %self.patt: %pattern_type.0cf = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.136] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i8 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i8 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -768,14 +887,32 @@ fn F() { // CHECK:STDOUT: %.loc8_11.6: ref %i8 = temporary %.loc8_11.5, %Int.as.Copy.impl.Op.call [concrete = constants.%.309] // CHECK:STDOUT: %addr: %ptr.de5 = addr_of %.loc8_11.6 [concrete = constants.%addr] // CHECK:STDOUT: %foo__carbon_thunk.call: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.309) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.309) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_11.1(%self.param: ref %i8.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_11.1(%self.param: ref %i8.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_11.2(%self.param: ref %i8) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_11.1(%self.param: ref %i8.builtin) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_11.2(%self.param: ref %i8) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_11.2(%self.param: ref %i8) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_11.2(%self.param: ref %i8) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -790,6 +927,7 @@ fn F() { // CHECK:STDOUT: %int_8: Core.IntLiteral = int_value 8 [concrete] // CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic] // CHECK:STDOUT: %u8: type = class_type @UInt, @UInt(%int_8) [concrete] +// CHECK:STDOUT: %pattern_type.186: type = pattern_type %u8 [concrete] // CHECK:STDOUT: %ptr.093: type = ptr_type %u8 [concrete] // CHECK:STDOUT: %foo__carbon_thunk.type: type = fn_type @foo__carbon_thunk [concrete] // CHECK:STDOUT: %foo__carbon_thunk: %foo__carbon_thunk.type = struct_value () [concrete] @@ -822,9 +960,22 @@ fn F() { // CHECK:STDOUT: %bound_method.0fe: = bound_method %int_1.067, %UInt.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: %.599: ref %u8 = temporary invalid, %int_1.067 [concrete] // CHECK:STDOUT: %addr: %ptr.093 = addr_of %.599 [concrete] +// CHECK:STDOUT: %pattern_type.456: type = pattern_type %u8.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.741: %pattern_type.456 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.64d: %pattern_type.456 = wrapper_binding_pattern self, %self.param_patt.741 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_11.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc8_11.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.3d6: %pattern_type.186 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.bec: %pattern_type.186 = wrapper_binding_pattern self, %self.param_patt.3d6 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_11.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc8_11.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.599, %Destroy.WithSelf.Op.403171.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8_11.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.599, %Destroy.WithSelf.SelfDestruct.db3fdb.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -844,6 +995,37 @@ fn F() { // CHECK:STDOUT: %Copy.impl_witness_table.ae7 = impl_witness_table (%Core.import_ref.791), @UInt.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_11.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.456 = ref_param_pattern [concrete = constants.%self.param_patt.741] +// CHECK:STDOUT: %self.patt: %pattern_type.456 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.64d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %u8.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %u8.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc8_11.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.456 = ref_param_pattern [concrete = constants.%self.param_patt.741] +// CHECK:STDOUT: %self.patt: %pattern_type.456 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.64d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %u8.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %u8.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_11.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.186 = ref_param_pattern [concrete = constants.%self.param_patt.3d6] +// CHECK:STDOUT: %self.patt: %pattern_type.186 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.bec] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %u8 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %u8 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc8_11.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.186 = ref_param_pattern [concrete = constants.%self.param_patt.3d6] +// CHECK:STDOUT: %self.patt: %pattern_type.186 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.bec] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %u8 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %u8 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -865,14 +1047,32 @@ fn F() { // CHECK:STDOUT: %.loc8_11.4: ref %u8 = temporary %.loc8_11.3, %UInt.as.Copy.impl.Op.call [concrete = constants.%.599] // CHECK:STDOUT: %addr: %ptr.093 = addr_of %.loc8_11.4 [concrete = constants.%addr] // CHECK:STDOUT: %foo__carbon_thunk.call: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.599) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.599) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_11.1(%self.param: ref %u8.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_11.1(%self.param: ref %u8.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_11.2(%self.param: ref %u8) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_11.1(%self.param: ref %u8.builtin) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_11.2(%self.param: ref %u8) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_11.2(%self.param: ref %u8) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_11.2(%self.param: ref %u8) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -888,6 +1088,7 @@ fn F() { // CHECK:STDOUT: %int_8: Core.IntLiteral = int_value 8 [concrete] // CHECK:STDOUT: %u8: type = class_type @UInt, @UInt(%int_8) [concrete] // CHECK:STDOUT: %u8.builtin: type = int_type unsigned, %int_8 [concrete] +// CHECK:STDOUT: %pattern_type.2ff: type = pattern_type %char [concrete] // CHECK:STDOUT: %ptr.b46: type = ptr_type %char [concrete] // CHECK:STDOUT: %foo__carbon_thunk.type: type = fn_type @foo__carbon_thunk [concrete] // CHECK:STDOUT: %foo__carbon_thunk: %foo__carbon_thunk.type = struct_value () [concrete] @@ -910,9 +1111,29 @@ fn F() { // CHECK:STDOUT: %char.as.Copy.impl.Op.bound: = bound_method %int_88, %char.as.Copy.impl.Op [concrete] // CHECK:STDOUT: %.2ff: ref %char = temporary invalid, %int_88 [concrete] // CHECK:STDOUT: %addr: %ptr.b46 = addr_of %.2ff [concrete] +// CHECK:STDOUT: %pattern_type.456: type = pattern_type %u8.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.741: %pattern_type.456 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.64d: %pattern_type.456 = wrapper_binding_pattern self, %self.param_patt.741 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_11.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc8_11.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.186: type = pattern_type %u8 [concrete] +// CHECK:STDOUT: %self.param_patt.3d6: %pattern_type.186 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.bec: %pattern_type.186 = wrapper_binding_pattern self, %self.param_patt.3d6 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_11.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc8_11.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.fb2: %pattern_type.2ff = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.da7: %pattern_type.2ff = wrapper_binding_pattern self, %self.param_patt.fb2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_11.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc8_11.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.2ff, %Destroy.WithSelf.Op.403171.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8_11.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.2ff, %Destroy.WithSelf.SelfDestruct.db3fdb.3 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -932,6 +1153,51 @@ fn F() { // CHECK:STDOUT: %Copy.impl_witness_table.893 = impl_witness_table (%Core.import_ref.9c3), @char.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_11.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.456 = ref_param_pattern [concrete = constants.%self.param_patt.741] +// CHECK:STDOUT: %self.patt: %pattern_type.456 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.64d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %u8.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %u8.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc8_11.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.456 = ref_param_pattern [concrete = constants.%self.param_patt.741] +// CHECK:STDOUT: %self.patt: %pattern_type.456 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.64d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %u8.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %u8.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_11.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.186 = ref_param_pattern [concrete = constants.%self.param_patt.3d6] +// CHECK:STDOUT: %self.patt: %pattern_type.186 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.bec] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %u8 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %u8 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc8_11.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.186 = ref_param_pattern [concrete = constants.%self.param_patt.3d6] +// CHECK:STDOUT: %self.patt: %pattern_type.186 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.bec] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %u8 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %u8 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_11.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.2ff = ref_param_pattern [concrete = constants.%self.param_patt.fb2] +// CHECK:STDOUT: %self.patt: %pattern_type.2ff = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.da7] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %char = ref_param call_param0 +// CHECK:STDOUT: %self: ref %char = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc8_11.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.2ff = ref_param_pattern [concrete = constants.%self.param_patt.fb2] +// CHECK:STDOUT: %self.patt: %pattern_type.2ff = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.da7] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %char = ref_param call_param0 +// CHECK:STDOUT: %self: ref %char = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -949,19 +1215,46 @@ fn F() { // CHECK:STDOUT: %.loc8_11.5: ref %char = temporary %.loc8_11.4, %char.as.Copy.impl.Op.call [concrete = constants.%.2ff] // CHECK:STDOUT: %addr: %ptr.b46 = addr_of %.loc8_11.5 [concrete = constants.%addr] // CHECK:STDOUT: %foo__carbon_thunk.call: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.2ff) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.2ff) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_11.1(%self.param: ref %u8.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_11.1(%self.param: ref %u8.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_11.2(%self.param: ref %u8) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_11.1(%self.param: ref %u8.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_11.2(%self.param: ref %u8) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_11.3(%self.param: ref %char) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_11.2(%self.param: ref %u8) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_11.2(%self.param: ref %u8) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_11.3(%self.param: ref %char) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_11.3(%self.param: ref %char) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_11.3(%self.param: ref %char) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1122,6 +1415,7 @@ fn F() { // CHECK:STDOUT: %As.WithSelf.Convert.type.4ac: type = fn_type @As.WithSelf.Convert, @As.WithSelf(%i16, %As.facet) [concrete] // CHECK:STDOUT: %.45d: type = fn_type_with_self_type %As.WithSelf.Convert.type.4ac, %As.facet [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.70c [concrete] +// CHECK:STDOUT: %pattern_type.203: type = pattern_type %i16 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.As.impl.Convert.70c, @Core.IntLiteral.as.As.impl.Convert(%int_16) [concrete] // CHECK:STDOUT: %bound_method.a0f: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.d17: %i16 = int_value 1 [concrete] @@ -1142,9 +1436,22 @@ fn F() { // CHECK:STDOUT: %bound_method.47b: = bound_method %int_1.d17, %Int.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: %.597: ref %i16 = temporary invalid, %int_1.d17 [concrete] // CHECK:STDOUT: %addr: %ptr.686 = addr_of %.597 [concrete] +// CHECK:STDOUT: %pattern_type.08e: type = pattern_type %i16.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.b41: %pattern_type.08e = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.277: %pattern_type.08e = wrapper_binding_pattern self, %self.param_patt.b41 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_13.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc8_13.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.f77: %pattern_type.203 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.91f: %pattern_type.203 = wrapper_binding_pattern self, %self.param_patt.f77 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_13.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc8_13.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.597, %Destroy.WithSelf.Op.403171.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8_13.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.597, %Destroy.WithSelf.SelfDestruct.db3fdb.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1164,6 +1471,37 @@ fn F() { // CHECK:STDOUT: %Copy.impl_witness_table.8d2 = impl_witness_table (%Core.import_ref.cd6), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_13.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.08e = ref_param_pattern [concrete = constants.%self.param_patt.b41] +// CHECK:STDOUT: %self.patt: %pattern_type.08e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.277] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i16.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i16.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc8_13.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.08e = ref_param_pattern [concrete = constants.%self.param_patt.b41] +// CHECK:STDOUT: %self.patt: %pattern_type.08e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.277] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i16.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i16.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_13.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.203 = ref_param_pattern [concrete = constants.%self.param_patt.f77] +// CHECK:STDOUT: %self.patt: %pattern_type.203 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.91f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i16 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i16 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc8_13.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.203 = ref_param_pattern [concrete = constants.%self.param_patt.f77] +// CHECK:STDOUT: %self.patt: %pattern_type.203 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.91f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i16 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i16 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -1186,14 +1524,32 @@ fn F() { // CHECK:STDOUT: %.loc8_13.4: ref %i16 = temporary %.loc8_13.3, %Int.as.Copy.impl.Op.call [concrete = constants.%.597] // CHECK:STDOUT: %addr: %ptr.686 = addr_of %.loc8_13.4 [concrete = constants.%addr] // CHECK:STDOUT: %foo__carbon_thunk.call: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.597) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.597) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_13.1(%self.param: ref %i16.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_13.1(%self.param: ref %i16.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_13.2(%self.param: ref %i16) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_13.1(%self.param: ref %i16.builtin) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_13.2(%self.param: ref %i16) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_13.2(%self.param: ref %i16) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_13.2(%self.param: ref %i16) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1208,6 +1564,7 @@ fn F() { // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete] // CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic] // CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [concrete] +// CHECK:STDOUT: %pattern_type.203: type = pattern_type %i16 [concrete] // CHECK:STDOUT: %ptr.686: type = ptr_type %i16 [concrete] // CHECK:STDOUT: %foo__carbon_thunk.type: type = fn_type @foo__carbon_thunk [concrete] // CHECK:STDOUT: %foo__carbon_thunk: %foo__carbon_thunk.type = struct_value () [concrete] @@ -1240,9 +1597,22 @@ fn F() { // CHECK:STDOUT: %bound_method.647: = bound_method %int_32767.6d2, %Int.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: %.0d8: ref %i16 = temporary invalid, %int_32767.6d2 [concrete] // CHECK:STDOUT: %addr: %ptr.686 = addr_of %.0d8 [concrete] +// CHECK:STDOUT: %pattern_type.08e: type = pattern_type %i16.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.b41: %pattern_type.08e = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.277: %pattern_type.08e = wrapper_binding_pattern self, %self.param_patt.b41 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_11.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc8_11.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.f77: %pattern_type.203 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.91f: %pattern_type.203 = wrapper_binding_pattern self, %self.param_patt.f77 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_11.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc8_11.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.0d8, %Destroy.WithSelf.Op.403171.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8_11.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.0d8, %Destroy.WithSelf.SelfDestruct.db3fdb.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1262,6 +1632,37 @@ fn F() { // CHECK:STDOUT: %Copy.impl_witness_table.8d2 = impl_witness_table (%Core.import_ref.cd6), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_11.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.08e = ref_param_pattern [concrete = constants.%self.param_patt.b41] +// CHECK:STDOUT: %self.patt: %pattern_type.08e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.277] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i16.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i16.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc8_11.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.08e = ref_param_pattern [concrete = constants.%self.param_patt.b41] +// CHECK:STDOUT: %self.patt: %pattern_type.08e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.277] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i16.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i16.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_11.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.203 = ref_param_pattern [concrete = constants.%self.param_patt.f77] +// CHECK:STDOUT: %self.patt: %pattern_type.203 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.91f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i16 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i16 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc8_11.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.203 = ref_param_pattern [concrete = constants.%self.param_patt.f77] +// CHECK:STDOUT: %self.patt: %pattern_type.203 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.91f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i16 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i16 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -1283,14 +1684,32 @@ fn F() { // CHECK:STDOUT: %.loc8_11.4: ref %i16 = temporary %.loc8_11.3, %Int.as.Copy.impl.Op.call [concrete = constants.%.0d8] // CHECK:STDOUT: %addr: %ptr.686 = addr_of %.loc8_11.4 [concrete = constants.%addr] // CHECK:STDOUT: %foo__carbon_thunk.call: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.0d8) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.0d8) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_11.1(%self.param: ref %i16.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_11.1(%self.param: ref %i16.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_11.2(%self.param: ref %i16) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_11.1(%self.param: ref %i16.builtin) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_11.2(%self.param: ref %i16) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_11.2(%self.param: ref %i16) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_11.2(%self.param: ref %i16) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1314,6 +1733,7 @@ fn F() { // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete] // CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic] // CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [concrete] +// CHECK:STDOUT: %pattern_type.203: type = pattern_type %i16 [concrete] // CHECK:STDOUT: %ptr.686: type = ptr_type %i16 [concrete] // CHECK:STDOUT: %foo__carbon_thunk.type: type = fn_type @foo__carbon_thunk [concrete] // CHECK:STDOUT: %foo__carbon_thunk: %foo__carbon_thunk.type = struct_value () [concrete] @@ -1346,9 +1766,22 @@ fn F() { // CHECK:STDOUT: %bound_method.b0b: = bound_method %int_-32768.eb1, %Int.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: %.60a: ref %i16 = temporary invalid, %int_-32768.eb1 [concrete] // CHECK:STDOUT: %addr: %ptr.686 = addr_of %.60a [concrete] +// CHECK:STDOUT: %pattern_type.08e: type = pattern_type %i16.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.b41: %pattern_type.08e = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.277: %pattern_type.08e = wrapper_binding_pattern self, %self.param_patt.b41 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_11.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc8_11.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.f77: %pattern_type.203 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.91f: %pattern_type.203 = wrapper_binding_pattern self, %self.param_patt.f77 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_11.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc8_11.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.60a, %Destroy.WithSelf.Op.403171.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8_11.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.60a, %Destroy.WithSelf.SelfDestruct.db3fdb.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1371,6 +1804,37 @@ fn F() { // CHECK:STDOUT: %Copy.impl_witness_table.8d2 = impl_witness_table (%Core.import_ref.cd6), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_11.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.08e = ref_param_pattern [concrete = constants.%self.param_patt.b41] +// CHECK:STDOUT: %self.patt: %pattern_type.08e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.277] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i16.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i16.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc8_11.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.08e = ref_param_pattern [concrete = constants.%self.param_patt.b41] +// CHECK:STDOUT: %self.patt: %pattern_type.08e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.277] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i16.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i16.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_11.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.203 = ref_param_pattern [concrete = constants.%self.param_patt.f77] +// CHECK:STDOUT: %self.patt: %pattern_type.203 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.91f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i16 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i16 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc8_11.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.203 = ref_param_pattern [concrete = constants.%self.param_patt.f77] +// CHECK:STDOUT: %self.patt: %pattern_type.203 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.91f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i16 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i16 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -1397,14 +1861,32 @@ fn F() { // CHECK:STDOUT: %.loc8_11.6: ref %i16 = temporary %.loc8_11.5, %Int.as.Copy.impl.Op.call [concrete = constants.%.60a] // CHECK:STDOUT: %addr: %ptr.686 = addr_of %.loc8_11.6 [concrete = constants.%addr] // CHECK:STDOUT: %foo__carbon_thunk.call: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.60a) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.60a) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_11.1(%self.param: ref %i16.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_11.1(%self.param: ref %i16.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_11.2(%self.param: ref %i16) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_11.1(%self.param: ref %i16.builtin) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_11.2(%self.param: ref %i16) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_11.2(%self.param: ref %i16) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_11.2(%self.param: ref %i16) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1431,6 +1913,7 @@ fn F() { // CHECK:STDOUT: %As.WithSelf.Convert.type.4ac: type = fn_type @As.WithSelf.Convert, @As.WithSelf(%i16, %As.facet) [concrete] // CHECK:STDOUT: %.45d: type = fn_type_with_self_type %As.WithSelf.Convert.type.4ac, %As.facet [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.70c [concrete] +// CHECK:STDOUT: %pattern_type.203: type = pattern_type %i16 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.As.impl.Convert.70c, @Core.IntLiteral.as.As.impl.Convert(%int_16) [concrete] // CHECK:STDOUT: %bound_method.a0f: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.d17: %i16 = int_value 1 [concrete] @@ -1451,9 +1934,22 @@ fn F() { // CHECK:STDOUT: %bound_method.47b: = bound_method %int_1.d17, %Int.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: %.597: ref %i16 = temporary invalid, %int_1.d17 [concrete] // CHECK:STDOUT: %addr: %ptr.686 = addr_of %.597 [concrete] +// CHECK:STDOUT: %pattern_type.08e: type = pattern_type %i16.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.b41: %pattern_type.08e = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.277: %pattern_type.08e = wrapper_binding_pattern self, %self.param_patt.b41 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_13.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc8_13.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.f77: %pattern_type.203 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.91f: %pattern_type.203 = wrapper_binding_pattern self, %self.param_patt.f77 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_13.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc8_13.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.597, %Destroy.WithSelf.Op.403171.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8_13.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.597, %Destroy.WithSelf.SelfDestruct.db3fdb.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1473,6 +1969,37 @@ fn F() { // CHECK:STDOUT: %Copy.impl_witness_table.8d2 = impl_witness_table (%Core.import_ref.cd6), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_13.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.08e = ref_param_pattern [concrete = constants.%self.param_patt.b41] +// CHECK:STDOUT: %self.patt: %pattern_type.08e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.277] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i16.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i16.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc8_13.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.08e = ref_param_pattern [concrete = constants.%self.param_patt.b41] +// CHECK:STDOUT: %self.patt: %pattern_type.08e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.277] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i16.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i16.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_13.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.203 = ref_param_pattern [concrete = constants.%self.param_patt.f77] +// CHECK:STDOUT: %self.patt: %pattern_type.203 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.91f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i16 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i16 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc8_13.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.203 = ref_param_pattern [concrete = constants.%self.param_patt.f77] +// CHECK:STDOUT: %self.patt: %pattern_type.203 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.91f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i16 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i16 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -1495,14 +2022,32 @@ fn F() { // CHECK:STDOUT: %.loc8_13.4: ref %i16 = temporary %.loc8_13.3, %Int.as.Copy.impl.Op.call [concrete = constants.%.597] // CHECK:STDOUT: %addr: %ptr.686 = addr_of %.loc8_13.4 [concrete = constants.%addr] // CHECK:STDOUT: %foo__carbon_thunk.call: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.597) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.597) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_13.1(%self.param: ref %i16.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_13.1(%self.param: ref %i16.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_13.2(%self.param: ref %i16) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_13.1(%self.param: ref %i16.builtin) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_13.2(%self.param: ref %i16) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_13.2(%self.param: ref %i16) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_13.2(%self.param: ref %i16) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1529,6 +2074,7 @@ fn F() { // CHECK:STDOUT: %As.WithSelf.Convert.type.4ac: type = fn_type @As.WithSelf.Convert, @As.WithSelf(%i16, %As.facet) [concrete] // CHECK:STDOUT: %.45d: type = fn_type_with_self_type %As.WithSelf.Convert.type.4ac, %As.facet [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.70c [concrete] +// CHECK:STDOUT: %pattern_type.203: type = pattern_type %i16 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.As.impl.Convert.70c, @Core.IntLiteral.as.As.impl.Convert(%int_16) [concrete] // CHECK:STDOUT: %bound_method.a0f: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.d17: %i16 = int_value 1 [concrete] @@ -1549,9 +2095,22 @@ fn F() { // CHECK:STDOUT: %bound_method.47b: = bound_method %int_1.d17, %Int.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: %.597: ref %i16 = temporary invalid, %int_1.d17 [concrete] // CHECK:STDOUT: %addr: %ptr.686 = addr_of %.597 [concrete] +// CHECK:STDOUT: %pattern_type.08e: type = pattern_type %i16.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.b41: %pattern_type.08e = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.277: %pattern_type.08e = wrapper_binding_pattern self, %self.param_patt.b41 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_13.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc8_13.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.f77: %pattern_type.203 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.91f: %pattern_type.203 = wrapper_binding_pattern self, %self.param_patt.f77 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_13.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc8_13.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.597, %Destroy.WithSelf.Op.403171.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8_13.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.597, %Destroy.WithSelf.SelfDestruct.db3fdb.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1571,6 +2130,37 @@ fn F() { // CHECK:STDOUT: %Copy.impl_witness_table.8d2 = impl_witness_table (%Core.import_ref.cd6), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_13.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.08e = ref_param_pattern [concrete = constants.%self.param_patt.b41] +// CHECK:STDOUT: %self.patt: %pattern_type.08e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.277] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i16.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i16.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc8_13.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.08e = ref_param_pattern [concrete = constants.%self.param_patt.b41] +// CHECK:STDOUT: %self.patt: %pattern_type.08e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.277] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i16.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i16.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_13.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.203 = ref_param_pattern [concrete = constants.%self.param_patt.f77] +// CHECK:STDOUT: %self.patt: %pattern_type.203 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.91f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i16 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i16 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc8_13.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.203 = ref_param_pattern [concrete = constants.%self.param_patt.f77] +// CHECK:STDOUT: %self.patt: %pattern_type.203 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.91f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i16 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i16 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -1593,14 +2183,32 @@ fn F() { // CHECK:STDOUT: %.loc8_13.4: ref %i16 = temporary %.loc8_13.3, %Int.as.Copy.impl.Op.call [concrete = constants.%.597] // CHECK:STDOUT: %addr: %ptr.686 = addr_of %.loc8_13.4 [concrete = constants.%addr] // CHECK:STDOUT: %foo__carbon_thunk.call: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.597) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.597) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_13.1(%self.param: ref %i16.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_13.1(%self.param: ref %i16.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_13.2(%self.param: ref %i16) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_13.1(%self.param: ref %i16.builtin) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_13.2(%self.param: ref %i16) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_13.2(%self.param: ref %i16) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_13.2(%self.param: ref %i16) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1627,6 +2235,7 @@ fn F() { // CHECK:STDOUT: %As.WithSelf.Convert.type.4ac: type = fn_type @As.WithSelf.Convert, @As.WithSelf(%i16, %As.facet) [concrete] // CHECK:STDOUT: %.45d: type = fn_type_with_self_type %As.WithSelf.Convert.type.4ac, %As.facet [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.70c [concrete] +// CHECK:STDOUT: %pattern_type.203: type = pattern_type %i16 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.As.impl.Convert.70c, @Core.IntLiteral.as.As.impl.Convert(%int_16) [concrete] // CHECK:STDOUT: %bound_method.a0f: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.d17: %i16 = int_value 1 [concrete] @@ -1647,9 +2256,22 @@ fn F() { // CHECK:STDOUT: %bound_method.47b: = bound_method %int_1.d17, %Int.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: %.597: ref %i16 = temporary invalid, %int_1.d17 [concrete] // CHECK:STDOUT: %addr: %ptr.686 = addr_of %.597 [concrete] +// CHECK:STDOUT: %pattern_type.08e: type = pattern_type %i16.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.b41: %pattern_type.08e = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.277: %pattern_type.08e = wrapper_binding_pattern self, %self.param_patt.b41 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_13.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc8_13.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.f77: %pattern_type.203 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.91f: %pattern_type.203 = wrapper_binding_pattern self, %self.param_patt.f77 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_13.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc8_13.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.597, %Destroy.WithSelf.Op.403171.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8_13.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.597, %Destroy.WithSelf.SelfDestruct.db3fdb.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1669,6 +2291,37 @@ fn F() { // CHECK:STDOUT: %Copy.impl_witness_table.8d2 = impl_witness_table (%Core.import_ref.cd6), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_13.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.08e = ref_param_pattern [concrete = constants.%self.param_patt.b41] +// CHECK:STDOUT: %self.patt: %pattern_type.08e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.277] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i16.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i16.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc8_13.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.08e = ref_param_pattern [concrete = constants.%self.param_patt.b41] +// CHECK:STDOUT: %self.patt: %pattern_type.08e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.277] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i16.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i16.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_13.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.203 = ref_param_pattern [concrete = constants.%self.param_patt.f77] +// CHECK:STDOUT: %self.patt: %pattern_type.203 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.91f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i16 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i16 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc8_13.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.203 = ref_param_pattern [concrete = constants.%self.param_patt.f77] +// CHECK:STDOUT: %self.patt: %pattern_type.203 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.91f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i16 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i16 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -1691,14 +2344,32 @@ fn F() { // CHECK:STDOUT: %.loc8_13.4: ref %i16 = temporary %.loc8_13.3, %Int.as.Copy.impl.Op.call [concrete = constants.%.597] // CHECK:STDOUT: %addr: %ptr.686 = addr_of %.loc8_13.4 [concrete = constants.%addr] // CHECK:STDOUT: %foo__carbon_thunk.call: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.597) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.597) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_13.1(%self.param: ref %i16.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_13.1(%self.param: ref %i16.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_13.2(%self.param: ref %i16) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_13.1(%self.param: ref %i16.builtin) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_13.2(%self.param: ref %i16) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_13.2(%self.param: ref %i16) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_13.2(%self.param: ref %i16) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1725,6 +2396,7 @@ fn F() { // CHECK:STDOUT: %As.WithSelf.Convert.type.4ac: type = fn_type @As.WithSelf.Convert, @As.WithSelf(%i16, %As.facet) [concrete] // CHECK:STDOUT: %.45d: type = fn_type_with_self_type %As.WithSelf.Convert.type.4ac, %As.facet [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.70c [concrete] +// CHECK:STDOUT: %pattern_type.203: type = pattern_type %i16 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.As.impl.Convert.70c, @Core.IntLiteral.as.As.impl.Convert(%int_16) [concrete] // CHECK:STDOUT: %bound_method.a0f: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.d17: %i16 = int_value 1 [concrete] @@ -1745,9 +2417,22 @@ fn F() { // CHECK:STDOUT: %bound_method.47b: = bound_method %int_1.d17, %Int.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: %.597: ref %i16 = temporary invalid, %int_1.d17 [concrete] // CHECK:STDOUT: %addr: %ptr.686 = addr_of %.597 [concrete] +// CHECK:STDOUT: %pattern_type.08e: type = pattern_type %i16.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.b41: %pattern_type.08e = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.277: %pattern_type.08e = wrapper_binding_pattern self, %self.param_patt.b41 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_13.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc8_13.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.f77: %pattern_type.203 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.91f: %pattern_type.203 = wrapper_binding_pattern self, %self.param_patt.f77 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_13.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc8_13.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.597, %Destroy.WithSelf.Op.403171.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8_13.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.597, %Destroy.WithSelf.SelfDestruct.db3fdb.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1767,6 +2452,37 @@ fn F() { // CHECK:STDOUT: %Copy.impl_witness_table.8d2 = impl_witness_table (%Core.import_ref.cd6), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_13.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.08e = ref_param_pattern [concrete = constants.%self.param_patt.b41] +// CHECK:STDOUT: %self.patt: %pattern_type.08e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.277] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i16.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i16.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc8_13.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.08e = ref_param_pattern [concrete = constants.%self.param_patt.b41] +// CHECK:STDOUT: %self.patt: %pattern_type.08e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.277] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i16.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i16.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_13.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.203 = ref_param_pattern [concrete = constants.%self.param_patt.f77] +// CHECK:STDOUT: %self.patt: %pattern_type.203 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.91f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i16 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i16 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc8_13.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.203 = ref_param_pattern [concrete = constants.%self.param_patt.f77] +// CHECK:STDOUT: %self.patt: %pattern_type.203 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.91f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i16 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i16 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -1789,14 +2505,32 @@ fn F() { // CHECK:STDOUT: %.loc8_13.4: ref %i16 = temporary %.loc8_13.3, %Int.as.Copy.impl.Op.call [concrete = constants.%.597] // CHECK:STDOUT: %addr: %ptr.686 = addr_of %.loc8_13.4 [concrete = constants.%addr] // CHECK:STDOUT: %foo__carbon_thunk.call: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.597) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.597) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_13.1(%self.param: ref %i16.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_13.1(%self.param: ref %i16.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_13.2(%self.param: ref %i16) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_13.1(%self.param: ref %i16.builtin) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_13.2(%self.param: ref %i16) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_13.2(%self.param: ref %i16) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_13.2(%self.param: ref %i16) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1822,6 +2556,7 @@ fn F() { // CHECK:STDOUT: %As.WithSelf.Convert.type.b84: type = fn_type @As.WithSelf.Convert, @As.WithSelf(%f16.907, %As.facet) [concrete] // CHECK:STDOUT: %.300: type = fn_type_with_self_type %As.WithSelf.Convert.type.b84, %As.facet [concrete] // CHECK:STDOUT: %Core.FloatLiteral.as.As.impl.Convert.bound: = bound_method %float.96e, %Core.FloatLiteral.as.As.impl.Convert.f13 [concrete] +// CHECK:STDOUT: %pattern_type.7cc: type = pattern_type %f16.907 [concrete] // CHECK:STDOUT: %Core.FloatLiteral.as.As.impl.Convert.specific_fn: = specific_function %Core.FloatLiteral.as.As.impl.Convert.f13, @Core.FloatLiteral.as.As.impl.Convert(%int_16) [concrete] // CHECK:STDOUT: %bound_method.c4d: = bound_method %float.96e, %Core.FloatLiteral.as.As.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %float.c55: %f16.907 = float_value 0.7998 [concrete] @@ -1842,9 +2577,22 @@ fn F() { // CHECK:STDOUT: %bound_method.237: = bound_method %float.c55, %Float.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: %.b6a: ref %f16.907 = temporary invalid, %float.c55 [concrete] // CHECK:STDOUT: %addr: %ptr.8b7 = addr_of %.b6a [concrete] +// CHECK:STDOUT: %pattern_type.14a: type = pattern_type %f16.3ab [concrete] +// CHECK:STDOUT: %self.param_patt.093: %pattern_type.14a = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.2c7: %pattern_type.14a = wrapper_binding_pattern self, %self.param_patt.093 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_15.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc8_15.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.231: %pattern_type.7cc = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.792: %pattern_type.7cc = wrapper_binding_pattern self, %self.param_patt.231 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_15.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc8_15.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.b6a, %Destroy.WithSelf.Op.403171.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8_15.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.b6a, %Destroy.WithSelf.SelfDestruct.db3fdb.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1864,6 +2612,37 @@ fn F() { // CHECK:STDOUT: %Copy.impl_witness_table.8dd = impl_witness_table (%Core.import_ref.e69), @Float.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_15.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.14a = ref_param_pattern [concrete = constants.%self.param_patt.093] +// CHECK:STDOUT: %self.patt: %pattern_type.14a = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.2c7] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f16.3ab = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f16.3ab = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc8_15.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.14a = ref_param_pattern [concrete = constants.%self.param_patt.093] +// CHECK:STDOUT: %self.patt: %pattern_type.14a = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.2c7] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f16.3ab = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f16.3ab = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_15.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.7cc = ref_param_pattern [concrete = constants.%self.param_patt.231] +// CHECK:STDOUT: %self.patt: %pattern_type.7cc = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.792] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f16.907 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f16.907 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc8_15.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.7cc = ref_param_pattern [concrete = constants.%self.param_patt.231] +// CHECK:STDOUT: %self.patt: %pattern_type.7cc = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.792] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f16.907 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f16.907 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -1886,14 +2665,32 @@ fn F() { // CHECK:STDOUT: %.loc8_15.4: ref %f16.907 = temporary %.loc8_15.3, %Float.as.Copy.impl.Op.call [concrete = constants.%.b6a] // CHECK:STDOUT: %addr: %ptr.8b7 = addr_of %.loc8_15.4 [concrete = constants.%addr] // CHECK:STDOUT: %foo__carbon_thunk.call: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.b6a) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.b6a) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_15.1(%self.param: ref %f16.3ab) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_15.1(%self.param: ref %f16.3ab) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_15.2(%self.param: ref %f16.907) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_15.1(%self.param: ref %f16.3ab) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_15.2(%self.param: ref %f16.907) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_15.2(%self.param: ref %f16.907) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_15.2(%self.param: ref %f16.907) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1919,6 +2716,7 @@ fn F() { // CHECK:STDOUT: %As.WithSelf.Convert.type.7e0: type = fn_type @As.WithSelf.Convert, @As.WithSelf(%f32.c73, %As.facet) [concrete] // CHECK:STDOUT: %.32f: type = fn_type_with_self_type %As.WithSelf.Convert.type.7e0, %As.facet [concrete] // CHECK:STDOUT: %Core.FloatLiteral.as.As.impl.Convert.bound: = bound_method %float.96e, %Core.FloatLiteral.as.As.impl.Convert.49e [concrete] +// CHECK:STDOUT: %pattern_type.240: type = pattern_type %f32.c73 [concrete] // CHECK:STDOUT: %Core.FloatLiteral.as.As.impl.Convert.specific_fn: = specific_function %Core.FloatLiteral.as.As.impl.Convert.49e, @Core.FloatLiteral.as.As.impl.Convert(%int_32) [concrete] // CHECK:STDOUT: %bound_method.cc6: = bound_method %float.96e, %Core.FloatLiteral.as.As.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %float.682: %f32.c73 = float_value 0.800000011 [concrete] @@ -1939,9 +2737,22 @@ fn F() { // CHECK:STDOUT: %bound_method.89b: = bound_method %float.682, %Float.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: %.798: ref %f32.c73 = temporary invalid, %float.682 [concrete] // CHECK:STDOUT: %addr: %ptr.da4 = addr_of %.798 [concrete] +// CHECK:STDOUT: %pattern_type.945: type = pattern_type %f32.9b3 [concrete] +// CHECK:STDOUT: %self.param_patt.755: %pattern_type.945 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.17e: %pattern_type.945 = wrapper_binding_pattern self, %self.param_patt.755 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_15.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc8_15.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.c62: %pattern_type.240 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.ed0: %pattern_type.240 = wrapper_binding_pattern self, %self.param_patt.c62 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_15.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc8_15.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.798, %Destroy.WithSelf.Op.403171.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8_15.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.798, %Destroy.WithSelf.SelfDestruct.db3fdb.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1961,6 +2772,37 @@ fn F() { // CHECK:STDOUT: %Copy.impl_witness_table.8dd = impl_witness_table (%Core.import_ref.e69), @Float.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_15.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.945 = ref_param_pattern [concrete = constants.%self.param_patt.755] +// CHECK:STDOUT: %self.patt: %pattern_type.945 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.17e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.9b3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.9b3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc8_15.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.945 = ref_param_pattern [concrete = constants.%self.param_patt.755] +// CHECK:STDOUT: %self.patt: %pattern_type.945 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.17e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.9b3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.9b3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_15.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.240 = ref_param_pattern [concrete = constants.%self.param_patt.c62] +// CHECK:STDOUT: %self.patt: %pattern_type.240 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ed0] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.c73 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.c73 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc8_15.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.240 = ref_param_pattern [concrete = constants.%self.param_patt.c62] +// CHECK:STDOUT: %self.patt: %pattern_type.240 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ed0] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.c73 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.c73 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -1983,14 +2825,32 @@ fn F() { // CHECK:STDOUT: %.loc8_15.4: ref %f32.c73 = temporary %.loc8_15.3, %Float.as.Copy.impl.Op.call [concrete = constants.%.798] // CHECK:STDOUT: %addr: %ptr.da4 = addr_of %.loc8_15.4 [concrete = constants.%addr] // CHECK:STDOUT: %foo__carbon_thunk.call: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.798) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.798) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_15.1(%self.param: ref %f32.9b3) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_15.1(%self.param: ref %f32.9b3) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_15.2(%self.param: ref %f32.c73) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_15.1(%self.param: ref %f32.9b3) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_15.2(%self.param: ref %f32.c73) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_15.2(%self.param: ref %f32.c73) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_15.2(%self.param: ref %f32.c73) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2016,6 +2876,7 @@ fn F() { // CHECK:STDOUT: %As.WithSelf.Convert.type.a43: type = fn_type @As.WithSelf.Convert, @As.WithSelf(%f64.dc1, %As.facet) [concrete] // CHECK:STDOUT: %.a08: type = fn_type_with_self_type %As.WithSelf.Convert.type.a43, %As.facet [concrete] // CHECK:STDOUT: %Core.FloatLiteral.as.As.impl.Convert.bound: = bound_method %float.96e, %Core.FloatLiteral.as.As.impl.Convert.20d [concrete] +// CHECK:STDOUT: %pattern_type.fb7: type = pattern_type %f64.dc1 [concrete] // CHECK:STDOUT: %Core.FloatLiteral.as.As.impl.Convert.specific_fn: = specific_function %Core.FloatLiteral.as.As.impl.Convert.20d, @Core.FloatLiteral.as.As.impl.Convert(%int_64) [concrete] // CHECK:STDOUT: %bound_method.c90: = bound_method %float.96e, %Core.FloatLiteral.as.As.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %float.82c: %f64.dc1 = float_value 0.80000000000000004 [concrete] @@ -2036,9 +2897,22 @@ fn F() { // CHECK:STDOUT: %bound_method.994: = bound_method %float.82c, %Float.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: %.2a9: ref %f64.dc1 = temporary invalid, %float.82c [concrete] // CHECK:STDOUT: %addr: %ptr.749 = addr_of %.2a9 [concrete] +// CHECK:STDOUT: %pattern_type.79d: type = pattern_type %f64.794 [concrete] +// CHECK:STDOUT: %self.param_patt.727: %pattern_type.79d = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.141: %pattern_type.79d = wrapper_binding_pattern self, %self.param_patt.727 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_15.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc8_15.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.71c: %pattern_type.fb7 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.a1a: %pattern_type.fb7 = wrapper_binding_pattern self, %self.param_patt.71c [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_15.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc8_15.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.2a9, %Destroy.WithSelf.Op.403171.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8_15.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.2a9, %Destroy.WithSelf.SelfDestruct.db3fdb.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -2058,6 +2932,37 @@ fn F() { // CHECK:STDOUT: %Copy.impl_witness_table.8dd = impl_witness_table (%Core.import_ref.e69), @Float.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_15.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.79d = ref_param_pattern [concrete = constants.%self.param_patt.727] +// CHECK:STDOUT: %self.patt: %pattern_type.79d = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.141] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f64.794 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f64.794 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc8_15.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.79d = ref_param_pattern [concrete = constants.%self.param_patt.727] +// CHECK:STDOUT: %self.patt: %pattern_type.79d = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.141] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f64.794 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f64.794 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_15.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.fb7 = ref_param_pattern [concrete = constants.%self.param_patt.71c] +// CHECK:STDOUT: %self.patt: %pattern_type.fb7 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a1a] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f64.dc1 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f64.dc1 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc8_15.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.fb7 = ref_param_pattern [concrete = constants.%self.param_patt.71c] +// CHECK:STDOUT: %self.patt: %pattern_type.fb7 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a1a] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f64.dc1 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f64.dc1 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -2080,14 +2985,32 @@ fn F() { // CHECK:STDOUT: %.loc8_15.4: ref %f64.dc1 = temporary %.loc8_15.3, %Float.as.Copy.impl.Op.call [concrete = constants.%.2a9] // CHECK:STDOUT: %addr: %ptr.749 = addr_of %.loc8_15.4 [concrete = constants.%addr] // CHECK:STDOUT: %foo__carbon_thunk.call: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.2a9) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.2a9) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_15.1(%self.param: ref %f64.794) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_15.1(%self.param: ref %f64.794) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_15.2(%self.param: ref %f64.dc1) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_15.1(%self.param: ref %f64.794) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_15.2(%self.param: ref %f64.dc1) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_15.2(%self.param: ref %f64.dc1) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_15.2(%self.param: ref %f64.dc1) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2113,6 +3036,7 @@ fn F() { // CHECK:STDOUT: %As.WithSelf.Convert.type.96a: type = fn_type @As.WithSelf.Convert, @As.WithSelf(%f128.e39, %As.facet) [concrete] // CHECK:STDOUT: %.988: type = fn_type_with_self_type %As.WithSelf.Convert.type.96a, %As.facet [concrete] // CHECK:STDOUT: %Core.FloatLiteral.as.As.impl.Convert.bound: = bound_method %float.96e, %Core.FloatLiteral.as.As.impl.Convert.566 [concrete] +// CHECK:STDOUT: %pattern_type.847: type = pattern_type %f128.e39 [concrete] // CHECK:STDOUT: %Core.FloatLiteral.as.As.impl.Convert.specific_fn: = specific_function %Core.FloatLiteral.as.As.impl.Convert.566, @Core.FloatLiteral.as.As.impl.Convert(%int_128) [concrete] // CHECK:STDOUT: %bound_method.585: = bound_method %float.96e, %Core.FloatLiteral.as.As.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %float.ede: %f128.e39 = float_value 0.800000000000000000000000000000000039 [concrete] @@ -2133,9 +3057,22 @@ fn F() { // CHECK:STDOUT: %bound_method.64d: = bound_method %float.ede, %Float.as.Copy.impl.Op.specific_fn [concrete] // CHECK:STDOUT: %.4aa: ref %f128.e39 = temporary invalid, %float.ede [concrete] // CHECK:STDOUT: %addr: %ptr.e02 = addr_of %.4aa [concrete] +// CHECK:STDOUT: %pattern_type.4d2: type = pattern_type %f128.853 [concrete] +// CHECK:STDOUT: %self.param_patt.376: %pattern_type.4d2 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.550: %pattern_type.4d2 = wrapper_binding_pattern self, %self.param_patt.376 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_15.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc8_15.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.49e: %pattern_type.847 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.3e1: %pattern_type.847 = wrapper_binding_pattern self, %self.param_patt.49e [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_15.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc8_15.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.4aa, %Destroy.WithSelf.Op.403171.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8_15.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.4aa, %Destroy.WithSelf.SelfDestruct.db3fdb.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -2155,6 +3092,37 @@ fn F() { // CHECK:STDOUT: %Copy.impl_witness_table.8dd = impl_witness_table (%Core.import_ref.e69), @Float.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_15.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.4d2 = ref_param_pattern [concrete = constants.%self.param_patt.376] +// CHECK:STDOUT: %self.patt: %pattern_type.4d2 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.550] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f128.853 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f128.853 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc8_15.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.4d2 = ref_param_pattern [concrete = constants.%self.param_patt.376] +// CHECK:STDOUT: %self.patt: %pattern_type.4d2 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.550] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f128.853 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f128.853 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_15.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.847 = ref_param_pattern [concrete = constants.%self.param_patt.49e] +// CHECK:STDOUT: %self.patt: %pattern_type.847 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.3e1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f128.e39 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f128.e39 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc8_15.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.847 = ref_param_pattern [concrete = constants.%self.param_patt.49e] +// CHECK:STDOUT: %self.patt: %pattern_type.847 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.3e1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f128.e39 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f128.e39 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -2177,14 +3145,32 @@ fn F() { // CHECK:STDOUT: %.loc8_15.4: ref %f128.e39 = temporary %.loc8_15.3, %Float.as.Copy.impl.Op.call [concrete = constants.%.4aa] // CHECK:STDOUT: %addr: %ptr.e02 = addr_of %.loc8_15.4 [concrete = constants.%addr] // CHECK:STDOUT: %foo__carbon_thunk.call: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.4aa) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.4aa) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_15.1(%self.param: ref %f128.853) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_15.1(%self.param: ref %f128.853) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_15.2(%self.param: ref %f128.e39) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_15.1(%self.param: ref %f128.853) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_15.2(%self.param: ref %f128.e39) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_15.2(%self.param: ref %f128.e39) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_15.2(%self.param: ref %f128.e39) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2200,8 +3186,14 @@ fn F() { // CHECK:STDOUT: %ptr: type = ptr_type bool [concrete] // CHECK:STDOUT: %foo_bool__carbon_thunk.type: type = fn_type @foo_bool__carbon_thunk [concrete] // CHECK:STDOUT: %foo_bool__carbon_thunk: %foo_bool__carbon_thunk.type = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.40d: %pattern_type.831 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.560: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt.40d [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.loc8 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -2217,6 +3209,23 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// 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.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d] +// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0 +// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// 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.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d] +// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0 +// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -2232,13 +3241,22 @@ fn F() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %x.patt: %pattern_type.831 = value_binding_pattern x [concrete = constants.%x.patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.loc8_37.3, constants.%Destroy.WithSelf.Op.403 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%.loc8_37.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc8_37.3, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc8_37.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8(%self.param: ref bool) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8(%self.param: ref bool) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8(%self.param: ref bool) { +// 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) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- import_short_return.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -2254,8 +3272,21 @@ fn F() { // CHECK:STDOUT: %ptr: type = ptr_type %i16 [concrete] // CHECK:STDOUT: %foo_short__carbon_thunk.type: type = fn_type @foo_short__carbon_thunk [concrete] // CHECK:STDOUT: %foo_short__carbon_thunk: %foo_short__carbon_thunk.type = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.08e: type = pattern_type %i16.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.b41: %pattern_type.08e = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.277: %pattern_type.08e = wrapper_binding_pattern self, %self.param_patt.b41 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_37.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc8_37.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.f77: %pattern_type.203 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.91f: %pattern_type.203 = wrapper_binding_pattern self, %self.param_patt.f77 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_37.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc8_37.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8_37.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -2271,6 +3302,37 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_37.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.08e = ref_param_pattern [concrete = constants.%self.param_patt.b41] +// CHECK:STDOUT: %self.patt: %pattern_type.08e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.277] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i16.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i16.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc8_37.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.08e = ref_param_pattern [concrete = constants.%self.param_patt.b41] +// CHECK:STDOUT: %self.patt: %pattern_type.08e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.277] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i16.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i16.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_37.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.203 = ref_param_pattern [concrete = constants.%self.param_patt.f77] +// CHECK:STDOUT: %self.patt: %pattern_type.203 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.91f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i16 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i16 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc8_37.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.203 = ref_param_pattern [concrete = constants.%self.param_patt.f77] +// CHECK:STDOUT: %self.patt: %pattern_type.203 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.91f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i16 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i16 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -2286,15 +3348,33 @@ fn F() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %x.patt: %pattern_type.203 = value_binding_pattern x [concrete = constants.%x.patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.loc8_37.3, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%.loc8_37.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc8_37.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc8_37.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_37.1(%self.param: ref %i16.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_37.1(%self.param: ref %i16.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_37.2(%self.param: ref %i16) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_37.1(%self.param: ref %i16.builtin) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_37.2(%self.param: ref %i16) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_37.2(%self.param: ref %i16) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_37.2(%self.param: ref %i16) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2338,8 +3418,21 @@ fn F() { // CHECK:STDOUT: %ptr: type = ptr_type %f64.dc1 [concrete] // CHECK:STDOUT: %foo_double__carbon_thunk.type: type = fn_type @foo_double__carbon_thunk [concrete] // CHECK:STDOUT: %foo_double__carbon_thunk: %foo_double__carbon_thunk.type = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.79d: type = pattern_type %f64.794 [concrete] +// CHECK:STDOUT: %self.param_patt.727: %pattern_type.79d = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.141: %pattern_type.79d = wrapper_binding_pattern self, %self.param_patt.727 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_38.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc8_38.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.71c: %pattern_type.fb7 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.a1a: %pattern_type.fb7 = wrapper_binding_pattern self, %self.param_patt.71c [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_38.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc8_38.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8_38.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -2355,6 +3448,37 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_38.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.79d = ref_param_pattern [concrete = constants.%self.param_patt.727] +// CHECK:STDOUT: %self.patt: %pattern_type.79d = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.141] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f64.794 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f64.794 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc8_38.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.79d = ref_param_pattern [concrete = constants.%self.param_patt.727] +// CHECK:STDOUT: %self.patt: %pattern_type.79d = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.141] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f64.794 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f64.794 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_38.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.fb7 = ref_param_pattern [concrete = constants.%self.param_patt.71c] +// CHECK:STDOUT: %self.patt: %pattern_type.fb7 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a1a] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f64.dc1 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f64.dc1 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc8_38.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.fb7 = ref_param_pattern [concrete = constants.%self.param_patt.71c] +// CHECK:STDOUT: %self.patt: %pattern_type.fb7 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a1a] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f64.dc1 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f64.dc1 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -2370,15 +3494,33 @@ fn F() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %x.patt: %pattern_type.fb7 = value_binding_pattern x [concrete = constants.%x.patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.loc8_38.3, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%.loc8_38.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc8_38.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc8_38.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_38.1(%self.param: ref %f64.794) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_38.1(%self.param: ref %f64.794) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_38.2(%self.param: ref %f64.dc1) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_38.1(%self.param: ref %f64.794) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_38.2(%self.param: ref %f64.dc1) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_38.2(%self.param: ref %f64.dc1) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_38.2(%self.param: ref %f64.dc1) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/function/import/class.carbon b/toolchain/check/testdata/interop/cpp/function/import/class.carbon index 5d71af76196c..a18061a87a6b 100644 --- a/toolchain/check/testdata/interop/cpp/function/import/class.carbon +++ b/toolchain/check/testdata/interop/cpp/function/import/class.carbon @@ -827,8 +827,14 @@ fn F() { // CHECK:STDOUT: %Default.facet.9a6: %Default.type = facet_value %InNamespaceClass, (%custom_witness.85f) [concrete] // CHECK:STDOUT: %DefaultOrUnformed.impl_witness.4fe: = impl_witness imports.%DefaultOrUnformed.impl_witness_table.162, @T.as_type.as.DefaultOrUnformed.impl(%Default.facet.9a6) [concrete] // CHECK:STDOUT: %DefaultOrUnformed.facet: %DefaultOrUnformed.type = facet_value %InNamespaceClass, (%DefaultOrUnformed.impl_witness.4fe) [concrete] +// CHECK:STDOUT: %self.param_patt.5ba: %pattern_type.d8e = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.027: %pattern_type.d8e = wrapper_binding_pattern self, %self.param_patt.5ba [concrete] // CHECK:STDOUT: %InNamespaceClass.cpp_destructor.type: type = fn_type @InNamespaceClass.cpp_destructor [concrete] // CHECK:STDOUT: %InNamespaceClass.cpp_destructor: %InNamespaceClass.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc10 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -850,6 +856,21 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import_ref.c2f: @T.as_type.as.DefaultOrUnformed.impl.%T.as_type.as.DefaultOrUnformed.impl.Op.type (%T.as_type.as.DefaultOrUnformed.impl.Op.type.0c9) = import_ref Core//prelude/parts/default, loc{{\d+_\d+}}, loaded [symbolic = @T.as_type.as.DefaultOrUnformed.impl.%T.as_type.as.DefaultOrUnformed.impl.Op (constants.%T.as_type.as.DefaultOrUnformed.impl.Op.cfe)] // CHECK:STDOUT: %DefaultOrUnformed.impl_witness_table.162 = impl_witness_table (%Core.import_ref.c2f), @T.as_type.as.DefaultOrUnformed.impl [concrete] +// CHECK:STDOUT: %InNamespaceClass.cpp_destructor.decl: %InNamespaceClass.cpp_destructor.type = fn_decl @InNamespaceClass.cpp_destructor [concrete = constants.%InNamespaceClass.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc10 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.d8e = ref_param_pattern [concrete = constants.%self.param_patt.5ba] +// CHECK:STDOUT: %self.patt: %pattern_type.d8e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.027] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %InNamespaceClass = ref_param call_param0 +// CHECK:STDOUT: %self: ref %InNamespaceClass = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%c.param: %InNamespaceClass) { @@ -879,11 +900,20 @@ fn F() { // CHECK:STDOUT: %x.patt: %pattern_type.d8e = ref_binding_pattern x [concrete = constants.%x.patt] // CHECK:STDOUT: %x.var_patt: %pattern_type.d8e = var_pattern %x.patt [concrete = constants.%x.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %InNamespaceClass.cpp_destructor.bound: = bound_method %x.var, constants.%InNamespaceClass.cpp_destructor -// CHECK:STDOUT: %InNamespaceClass.cpp_destructor.call: init %empty_tuple.type = call %InNamespaceClass.cpp_destructor.bound(%x.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %x.var, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%x.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10(%self.param: ref %InNamespaceClass) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10(%self.param: ref %InNamespaceClass) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param) +// CHECK:STDOUT: %InNamespaceClass.cpp_destructor.call: init %empty_tuple.type = call imports.%InNamespaceClass.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- import_definition_in_relative_namespace_value_param_type.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -958,8 +988,14 @@ fn F() { // CHECK:STDOUT: %Default.facet.3fb: %Default.type = facet_value %OuterClass, (%custom_witness.9b4) [concrete] // CHECK:STDOUT: %DefaultOrUnformed.impl_witness.436: = impl_witness imports.%DefaultOrUnformed.impl_witness_table.162, @T.as_type.as.DefaultOrUnformed.impl(%Default.facet.3fb) [concrete] // CHECK:STDOUT: %DefaultOrUnformed.facet: %DefaultOrUnformed.type = facet_value %OuterClass, (%DefaultOrUnformed.impl_witness.436) [concrete] +// CHECK:STDOUT: %self.param_patt.46e: %pattern_type.dd5 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.360: %pattern_type.dd5 = wrapper_binding_pattern self, %self.param_patt.46e [concrete] // CHECK:STDOUT: %OuterClass.cpp_destructor.type: type = fn_type @OuterClass.cpp_destructor [concrete] // CHECK:STDOUT: %OuterClass.cpp_destructor: %OuterClass.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -977,6 +1013,21 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import_ref.c2f: @T.as_type.as.DefaultOrUnformed.impl.%T.as_type.as.DefaultOrUnformed.impl.Op.type (%T.as_type.as.DefaultOrUnformed.impl.Op.type.0c9) = import_ref Core//prelude/parts/default, loc{{\d+_\d+}}, loaded [symbolic = @T.as_type.as.DefaultOrUnformed.impl.%T.as_type.as.DefaultOrUnformed.impl.Op (constants.%T.as_type.as.DefaultOrUnformed.impl.Op.cfe)] // CHECK:STDOUT: %DefaultOrUnformed.impl_witness_table.162 = impl_witness_table (%Core.import_ref.c2f), @T.as_type.as.DefaultOrUnformed.impl [concrete] +// CHECK:STDOUT: %OuterClass.cpp_destructor.decl: %OuterClass.cpp_destructor.type = fn_decl @OuterClass.cpp_destructor [concrete = constants.%OuterClass.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc9 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.dd5 = ref_param_pattern [concrete = constants.%self.param_patt.46e] +// CHECK:STDOUT: %self.patt: %pattern_type.dd5 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.360] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %OuterClass = ref_param call_param0 +// CHECK:STDOUT: %self: ref %OuterClass = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%c.param: %InnerClass) { @@ -1005,11 +1056,20 @@ fn F() { // CHECK:STDOUT: %x.patt: %pattern_type.dd5 = ref_binding_pattern x [concrete = constants.%x.patt] // CHECK:STDOUT: %x.var_patt: %pattern_type.dd5 = var_pattern %x.patt [concrete = constants.%x.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %OuterClass.cpp_destructor.bound: = bound_method %x.var, constants.%OuterClass.cpp_destructor -// CHECK:STDOUT: %OuterClass.cpp_destructor.call: init %empty_tuple.type = call %OuterClass.cpp_destructor.bound(%x.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %x.var, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%x.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9(%self.param: ref %OuterClass) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9(%self.param: ref %OuterClass) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param) +// CHECK:STDOUT: %OuterClass.cpp_destructor.call: init %empty_tuple.type = call imports.%OuterClass.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- import_definition_and_static_method_call_before.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -1190,11 +1250,18 @@ fn F() { // CHECK:STDOUT: %foo_def_value_return.cpp_overload_set.type: type = cpp_overload_set_type @foo_def_value_return.cpp_overload_set [concrete] // CHECK:STDOUT: %foo_def_value_return.cpp_overload_set.value: %foo_def_value_return.cpp_overload_set.type = cpp_overload_set_value @foo_def_value_return.cpp_overload_set [concrete] // CHECK:STDOUT: %DefValueReturnClass: type = class_type @DefValueReturnClass [concrete] +// CHECK:STDOUT: %pattern_type.7a7: type = pattern_type %DefValueReturnClass [concrete] // CHECK:STDOUT: %ptr.8c3: type = ptr_type %DefValueReturnClass [concrete] // CHECK:STDOUT: %foo_def_value_return__carbon_thunk.type: type = fn_type @foo_def_value_return__carbon_thunk [concrete] // CHECK:STDOUT: %foo_def_value_return__carbon_thunk: %foo_def_value_return__carbon_thunk.type = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.da2: %pattern_type.7a7 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.4d6: %pattern_type.7a7 = wrapper_binding_pattern self, %self.param_patt.da2 [concrete] // CHECK:STDOUT: %DefValueReturnClass.cpp_destructor.type: type = fn_type @DefValueReturnClass.cpp_destructor [concrete] // CHECK:STDOUT: %DefValueReturnClass.cpp_destructor: %DefValueReturnClass.cpp_destructor.type = struct_value () [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.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1208,6 +1275,21 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } +// CHECK:STDOUT: %DefValueReturnClass.cpp_destructor.decl: %DefValueReturnClass.cpp_destructor.type = fn_decl @DefValueReturnClass.cpp_destructor [concrete = constants.%DefValueReturnClass.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// 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.7a7 = ref_param_pattern [concrete = constants.%self.param_patt.da2] +// CHECK:STDOUT: %self.patt: %pattern_type.7a7 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.4d6] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %DefValueReturnClass = ref_param call_param0 +// CHECK:STDOUT: %self: ref %DefValueReturnClass = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -1219,11 +1301,20 @@ fn F() { // CHECK:STDOUT: %foo_def_value_return__carbon_thunk.call: init %empty_tuple.type = call imports.%foo_def_value_return__carbon_thunk.decl(%addr) // CHECK:STDOUT: %.loc8_28.2: init %DefValueReturnClass to %.loc8_28.1 = mark_in_place_init %foo_def_value_return__carbon_thunk.call // CHECK:STDOUT: %.loc8_28.3: ref %DefValueReturnClass = temporary %.loc8_28.1, %.loc8_28.2 -// CHECK:STDOUT: %DefValueReturnClass.cpp_destructor.bound: = bound_method %.loc8_28.3, constants.%DefValueReturnClass.cpp_destructor -// CHECK:STDOUT: %DefValueReturnClass.cpp_destructor.call: init %empty_tuple.type = call %DefValueReturnClass.cpp_destructor.bound(%.loc8_28.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc8_28.3, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc8_28.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8(%self.param: ref %DefValueReturnClass) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8(%self.param: ref %DefValueReturnClass) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param) +// CHECK:STDOUT: %DefValueReturnClass.cpp_destructor.call: init %empty_tuple.type = call imports.%DefValueReturnClass.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- import_decl_pointer_return_type.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { diff --git a/toolchain/check/testdata/interop/cpp/function/import/constexpr.carbon b/toolchain/check/testdata/interop/cpp/function/import/constexpr.carbon index af94902109de..c3795de76b22 100644 --- a/toolchain/check/testdata/interop/cpp/function/import/constexpr.carbon +++ b/toolchain/check/testdata/interop/cpp/function/import/constexpr.carbon @@ -198,10 +198,14 @@ let a: array(i32, F()) = (1, 2, 3); // CHECK:STDOUT: %Copy.WithSelf.Op.type.381: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet) [concrete] // CHECK:STDOUT: %.737: type = fn_type_with_self_type %Copy.WithSelf.Op.type.381, %Copy.facet [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.4f6, @Int.as.Copy.impl.Op(%int_32) [concrete] +// CHECK:STDOUT: %self.param_patt.d94: %pattern_type.3cc = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.d4e: %pattern_type.3cc = wrapper_binding_pattern self, %self.param_patt.d94 [concrete] // CHECK:STDOUT: %ConstexprC.cpp_destructor.type: type = fn_type @ConstexprC.cpp_destructor [concrete] // CHECK:STDOUT: %ConstexprC.cpp_destructor: %ConstexprC.cpp_destructor.type = struct_value () [concrete] -// CHECK:STDOUT: %ConstexprC.Op.type: type = fn_type @ConstexprC.Op [concrete] -// CHECK:STDOUT: %ConstexprC.Op: %ConstexprC.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc19 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc19 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -226,6 +230,16 @@ let a: array(i32, F()) = (1, 2, 3); // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc19 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.3cc = ref_param_pattern [concrete = constants.%self.param_patt.d94] +// CHECK:STDOUT: %self.patt: %pattern_type.3cc = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d4e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ConstexprC = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ConstexprC = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() -> out %return.param: %i32 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba] @@ -261,13 +275,20 @@ let a: array(i32, F()) = (1, 2, 3); // CHECK:STDOUT: %bound_method.loc20_11.2: = bound_method %.loc20_11.2, %specific_fn.loc20 // CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc20_11.2(%.loc20_11.2) // CHECK:STDOUT: -// CHECK:STDOUT: %ConstexprC.Op.bound: = bound_method %.loc19_27.6, constants.%ConstexprC.Op -// CHECK:STDOUT: %Op.ref: %ConstexprC.cpp_destructor.type = name_ref Op, imports.%ConstexprC.cpp_destructor.decl [concrete = constants.%ConstexprC.cpp_destructor] -// CHECK:STDOUT: %ConstexprC.cpp_destructor.bound: = bound_method %.loc19_27.6, %Op.ref -// CHECK:STDOUT: %ConstexprC.cpp_destructor.call: init %empty_tuple.type = call %ConstexprC.cpp_destructor.bound(%.loc19_27.6) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc19_27.6, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc19_27.6) // CHECK:STDOUT: return %Int.as.Copy.impl.Op.call // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc19(%self.param: ref %ConstexprC) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc19(%self.param: ref %ConstexprC) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param) +// CHECK:STDOUT: %ConstexprC.cpp_destructor.call: init %empty_tuple.type = call imports.%ConstexprC.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/function/import/decayed_param.carbon b/toolchain/check/testdata/interop/cpp/function/import/decayed_param.carbon index e0e44f507b71..dce8e07f677d 100644 --- a/toolchain/check/testdata/interop/cpp/function/import/decayed_param.carbon +++ b/toolchain/check/testdata/interop/cpp/function/import/decayed_param.carbon @@ -82,6 +82,7 @@ fn F() { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] +// CHECK:STDOUT: %pattern_type.6b6: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %int_42: Core.IntLiteral = int_value 42 [concrete] // CHECK:STDOUT: %array_type.d58: type = array_type %int_42, %i32 [concrete] // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] @@ -124,20 +125,25 @@ fn F() { // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %Destroy.lookup_impl_witness.781: = lookup_impl_witness %ptr.e8f, @Destroy [symbolic] // CHECK:STDOUT: %Destroy.facet.e46: %Destroy.type = facet_value %ptr.e8f, (%Destroy.lookup_impl_witness.781) [symbolic] -// CHECK:STDOUT: %MaybeUnformed.ddba: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.e46) [symbolic] +// CHECK:STDOUT: %MaybeUnformed.ddb: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.e46) [symbolic] // CHECK:STDOUT: %ptr.as.OptionalStorage.impl.Some.type.71e: type = fn_type @ptr.as.OptionalStorage.impl.Some, @ptr.as.OptionalStorage.impl(%T.67d) [symbolic] // CHECK:STDOUT: %ptr.as.OptionalStorage.impl.Some.caa: %ptr.as.OptionalStorage.impl.Some.type.71e = struct_value () [symbolic] // CHECK:STDOUT: %ptr.as.OptionalStorage.impl.None.type.2a7: type = fn_type @ptr.as.OptionalStorage.impl.None, @ptr.as.OptionalStorage.impl(%T.67d) [symbolic] // CHECK:STDOUT: %ptr.as.OptionalStorage.impl.None.c23: %ptr.as.OptionalStorage.impl.None.type.2a7 = struct_value () [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.6c4ec3.1: = custom_witness (%Destroy.WithSelf.Op.403171.1), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.dfc: %Destroy.type = facet_value %ptr.d08, (%custom_witness.6c4ec3.1) [concrete] -// CHECK:STDOUT: %MaybeUnformed.620: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.dfc) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f8f19d.1: = custom_witness (%Destroy.WithSelf.Op.403171.1, %Destroy.WithSelf.SubobjectDestroy.d01daf.1, %Destroy.WithSelf.SelfDestruct.db3fdb.1), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.4ee: %Destroy.type = facet_value %ptr.d08, (%custom_witness.f8f19d.1) [concrete] +// CHECK:STDOUT: %MaybeUnformed.729: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.4ee) [concrete] // CHECK:STDOUT: %OptionalStorage.impl_witness.0ce: = impl_witness imports.%OptionalStorage.impl_witness_table.110, @ptr.as.OptionalStorage.impl(%i32) [concrete] // CHECK:STDOUT: %.0f8: type = maybe_unformed_type %ptr.d08 [concrete] // CHECK:STDOUT: %OptionalStorage.facet.f91: %OptionalStorage.type = facet_value %ptr.d08, (%OptionalStorage.impl_witness.0ce) [concrete] // CHECK:STDOUT: %Optional.5b3: type = class_type @Optional, @Optional(%OptionalStorage.facet.f91) [concrete] +// CHECK:STDOUT: %pattern_type.ef8: type = pattern_type %Optional.5b3 [concrete] // CHECK:STDOUT: %TakesArray.type: type = fn_type @TakesArray [concrete] // CHECK:STDOUT: %TakesArray: %TakesArray.type = struct_value () [concrete] // CHECK:STDOUT: %ImplicitAs.type.429: type = facet_type <@ImplicitAs, @ImplicitAs(%Optional.5b3)> [concrete] @@ -157,8 +163,28 @@ fn F() { // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.f01: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%Optional.5b3, %ImplicitAs.facet.ea2) [concrete] // CHECK:STDOUT: %.fcc: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.f01, %ImplicitAs.facet.ea2 [concrete] // CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %U.as_type.as.ImplicitAs.impl.Convert.8b6, @U.as_type.as.ImplicitAs.impl.Convert.2(%OptionalStorage.facet.f91, %OptionalAs.facet) [concrete] +// CHECK:STDOUT: %pattern_type.59d: type = pattern_type %.0f8 [concrete] +// CHECK:STDOUT: %self.param_patt.9e1: %pattern_type.59d = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.8da: %pattern_type.59d = wrapper_binding_pattern self, %self.param_patt.9e1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_18.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc11_18.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.6db: type = pattern_type %MaybeUnformed.729 [concrete] +// CHECK:STDOUT: %self.param_patt.e99: %pattern_type.6db = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.e88: %pattern_type.6db = wrapper_binding_pattern self, %self.param_patt.e99 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_18.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc11_18.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.d96: %pattern_type.ef8 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.77d: %pattern_type.ef8 = wrapper_binding_pattern self, %self.param_patt.d96 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_18.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc11_18.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc11_18.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] // CHECK:STDOUT: %Cpp.nullptr_t: type = class_type @NullptrT [concrete] // CHECK:STDOUT: %uninit: %Cpp.nullptr_t = uninitialized_value [concrete] // CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.type.1b3: type = fn_type @Cpp.nullptr_t.as.ImplicitAs.impl.Convert, @Cpp.nullptr_t.as.ImplicitAs.impl(%T.67d) [symbolic] @@ -172,8 +198,27 @@ fn F() { // CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.bound: = bound_method %uninit, %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.60f [concrete] // CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.60f, @Cpp.nullptr_t.as.ImplicitAs.impl.Convert(%i32) [concrete] // CHECK:STDOUT: %bound_method.518: = bound_method %uninit, %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.specific_fn [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.6: type = fn_type @Destroy.WithSelf.Op.loc10_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.6: %Destroy.WithSelf.Op.type.ef016f.6 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.7: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.7: type = fn_type @Destroy.WithSelf.Op.loc10_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.7: %Destroy.WithSelf.Op.type.ef016f.7 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.087: %pattern_type.c07 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.b22: %pattern_type.c07 = wrapper_binding_pattern self, %self.param_patt.087 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.8: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.8: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.8 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.8: type = fn_type @Destroy.WithSelf.Op.loc10_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.8: %Destroy.WithSelf.Op.type.ef016f.8 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.8: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.8: %Destroy.WithSelf.SelfDestruct.type.fbceb5.8 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -189,7 +234,7 @@ fn F() { // CHECK:STDOUT: %TakesArray.cpp_overload_set.value: %TakesArray.cpp_overload_set.type = cpp_overload_set_value @TakesArray.cpp_overload_set [concrete = constants.%TakesArray.cpp_overload_set.value] // CHECK:STDOUT: %Core.import_ref.edf: @Core.IntLiteral.as.ImplicitAs.impl.0e9.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e74) = import_ref Core//prelude/types/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.0e9.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.845)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.1aa = impl_witness_table (%Core.import_ref.edf), @Core.IntLiteral.as.ImplicitAs.impl.0e9 [concrete] -// CHECK:STDOUT: %Core.import_ref.509f: type = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, loaded [symbolic = @ptr.as.OptionalStorage.impl.%MaybeUnformed (constants.%MaybeUnformed.ddba)] +// CHECK:STDOUT: %Core.import_ref.509f: type = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, loaded [symbolic = @ptr.as.OptionalStorage.impl.%MaybeUnformed (constants.%MaybeUnformed.ddb)] // CHECK:STDOUT: %Core.import_ref.307: @ptr.as.OptionalStorage.impl.%ptr.as.OptionalStorage.impl.None.type (%ptr.as.OptionalStorage.impl.None.type.2a7) = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, loaded [symbolic = @ptr.as.OptionalStorage.impl.%ptr.as.OptionalStorage.impl.None (constants.%ptr.as.OptionalStorage.impl.None.c23)] // CHECK:STDOUT: %Core.import_ref.fa7: @ptr.as.OptionalStorage.impl.%ptr.as.OptionalStorage.impl.Some.type (%ptr.as.OptionalStorage.impl.Some.type.71e) = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, loaded [symbolic = @ptr.as.OptionalStorage.impl.%ptr.as.OptionalStorage.impl.Some (constants.%ptr.as.OptionalStorage.impl.Some.caa)] // CHECK:STDOUT: %Core.import_ref.a90 = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, unloaded @@ -216,6 +261,93 @@ fn F() { // CHECK:STDOUT: %ImplicitAs.impl_witness_table.898 = impl_witness_table (%Core.import_ref.49d), @Cpp.nullptr_t.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_18.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.59d = ref_param_pattern [concrete = constants.%self.param_patt.9e1] +// CHECK:STDOUT: %self.patt: %pattern_type.59d = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.8da] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %.0f8 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %.0f8 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc11_18.1 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.59d = ref_param_pattern [concrete = constants.%self.param_patt.9e1] +// CHECK:STDOUT: %self.patt: %pattern_type.59d = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.8da] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %.0f8 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %.0f8 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_18.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6db = ref_param_pattern [concrete = constants.%self.param_patt.e99] +// CHECK:STDOUT: %self.patt: %pattern_type.6db = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.e88] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %MaybeUnformed.729 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %MaybeUnformed.729 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc11_18.2 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6db = ref_param_pattern [concrete = constants.%self.param_patt.e99] +// CHECK:STDOUT: %self.patt: %pattern_type.6db = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.e88] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %MaybeUnformed.729 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %MaybeUnformed.729 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_18.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.ef8 = ref_param_pattern [concrete = constants.%self.param_patt.d96] +// CHECK:STDOUT: %self.patt: %pattern_type.ef8 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.77d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Optional.5b3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Optional.5b3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc11_18.3 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.ef8 = ref_param_pattern [concrete = constants.%self.param_patt.d96] +// CHECK:STDOUT: %self.patt: %pattern_type.ef8 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.77d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Optional.5b3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Optional.5b3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.5: %Destroy.WithSelf.Op.type.ef016f.6 = fn_decl @Destroy.WithSelf.Op.loc10_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.7] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.6: %Destroy.WithSelf.Op.type.ef016f.7 = fn_decl @Destroy.WithSelf.Op.loc10_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.7] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.7: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.8 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.8] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.c07 = ref_param_pattern [concrete = constants.%self.param_patt.087] +// CHECK:STDOUT: %self.patt: %pattern_type.c07 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.b22] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type.d58 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type.d58 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.7: %Destroy.WithSelf.Op.type.ef016f.8 = fn_decl @Destroy.WithSelf.Op.loc10_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.8] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.c07 = ref_param_pattern [concrete = constants.%self.param_patt.087] +// CHECK:STDOUT: %self.patt: %pattern_type.c07 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.b22] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type.d58 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type.d58 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %n.var: ref %array_type.d58 = var_storage %n.var_patt @@ -260,8 +392,8 @@ fn F() { // CHECK:STDOUT: %.loc11_18.3: ref %Optional.5b3 = temporary %.loc11_18.2, %.loc11_18.1 // CHECK:STDOUT: %.loc11_18.4: %Optional.5b3 = acquire_value %.loc11_18.3 // CHECK:STDOUT: %TakesArray.call.loc11: init %empty_tuple.type = call imports.%TakesArray.decl(%.loc11_18.4) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc11: = bound_method %.loc11_18.3, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc11: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc11(%.loc11_18.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc11: = bound_method %.loc11_18.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc11: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc11(%.loc11_18.3) // CHECK:STDOUT: %Cpp.ref.loc13_3: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %TakesArray.ref.loc13: %TakesArray.cpp_overload_set.type = name_ref TakesArray, imports.%TakesArray.cpp_overload_set.value [concrete = constants.%TakesArray.cpp_overload_set.value] // CHECK:STDOUT: %Cpp.ref.loc13_18: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -277,37 +409,91 @@ fn F() { // CHECK:STDOUT: %.loc13_21.3: ref %Optional.5b3 = temporary %.loc13_21.2, %.loc13_21.1 // CHECK:STDOUT: %.loc13_21.4: %Optional.5b3 = acquire_value %.loc13_21.3 // CHECK:STDOUT: %TakesArray.call.loc13: init %empty_tuple.type = call imports.%TakesArray.decl(%.loc13_21.4) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc13: = bound_method %.loc13_21.3, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc13: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc13(%.loc13_21.3) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc10: = bound_method %n.var, constants.%Destroy.WithSelf.Op.403171.8 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc10: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc10(%n.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc13: = bound_method %.loc13_21.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc13: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc13(%.loc13_21.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10: = bound_method %n.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.8 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10(%n.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_18.1(%self.param: ref %.0f8) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_18.1(%self.param: ref %.0f8) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_18.2(%self.param: ref %MaybeUnformed.620) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_18.1(%self.param: ref %.0f8) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_18.1(%self.param: ref %.0f8) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_18.2(%self.param: ref %MaybeUnformed.729) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_18.3(%self.param: ref %Optional.5b3) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_18.2(%self.param: ref %MaybeUnformed.729) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_18.2(%self.param: ref %MaybeUnformed.729) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_18.3(%self.param: ref %Optional.5b3) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_18.3(%self.param: ref %Optional.5b3) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_18.3(%self.param: ref %Optional.5b3) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_3.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_3.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.5(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.5(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_3.3(%self.param: ref %array_type.d58) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_3.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.6(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.6(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_3.3(%self.param: ref %array_type.d58) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_3.3(%self.param: ref %array_type.d58) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_3.3(%self.param: ref %array_type.d58) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.7(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.7(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -318,6 +504,7 @@ fn F() { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] +// CHECK:STDOUT: %pattern_type.6b6: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %G.type: type = fn_type @G [concrete] // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] // CHECK:STDOUT: %TakesFunction.cpp_overload_set.type: type = cpp_overload_set_type @TakesFunction.cpp_overload_set [concrete] @@ -359,8 +546,27 @@ fn F() { // CHECK:STDOUT: %ptr.d08: type = ptr_type %i32 [concrete] // CHECK:STDOUT: %Cpp.nullptr_t: type = class_type @NullptrT [concrete] // CHECK:STDOUT: %uninit: %Cpp.nullptr_t = uninitialized_value [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc22_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc22_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc22_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc22_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.087: %pattern_type.c07 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.b22: %pattern_type.c07 = wrapper_binding_pattern self, %self.param_patt.087 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc22_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc22_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc22_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -380,6 +586,51 @@ fn F() { // CHECK:STDOUT: %ImplicitAs.impl_witness_table.1aa = impl_witness_table (%Core.import_ref.edf), @Core.IntLiteral.as.ImplicitAs.impl.0e9 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc22_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc22_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc22_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc22_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc22_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.c07 = ref_param_pattern [concrete = constants.%self.param_patt.087] +// CHECK:STDOUT: %self.patt: %pattern_type.c07 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.b22] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type.d58 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type.d58 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc22_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.c07 = ref_param_pattern [concrete = constants.%self.param_patt.087] +// CHECK:STDOUT: %self.patt: %pattern_type.c07 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.b22] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type.d58 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type.d58 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref.loc14: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -426,20 +677,47 @@ fn F() { // CHECK:STDOUT: %Cpp.ref.loc37_21: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: // CHECK:STDOUT: %nullptr.ref: %Cpp.nullptr_t = name_ref nullptr, %uninit [concrete = constants.%uninit] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %n.var, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%n.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %n.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%n.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc22_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc22_3.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc22_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc22_3.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc22_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc22_3.3(%self.param: ref %array_type.d58) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc22_3.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc22_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc22_3.3(%self.param: ref %array_type.d58) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc22_3.3(%self.param: ref %array_type.d58) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc22_3.3(%self.param: ref %array_type.d58) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/function/import/default_arg.carbon b/toolchain/check/testdata/interop/cpp/function/import/default_arg.carbon index 4f76353f3964..a2567aafe1db 100644 --- a/toolchain/check/testdata/interop/cpp/function/import/default_arg.carbon +++ b/toolchain/check/testdata/interop/cpp/function/import/default_arg.carbon @@ -187,10 +187,18 @@ fn Call() { // CHECK:STDOUT: %X.B.cpp_overload_set.type: type = cpp_overload_set_type @X.B.cpp_overload_set [concrete] // CHECK:STDOUT: %X.B.cpp_overload_set.value: %X.B.cpp_overload_set.type = cpp_overload_set_value @X.B.cpp_overload_set [concrete] // CHECK:STDOUT: %bound_method.f8c: = bound_method %.414, %X.B.cpp_overload_set.value [concrete] +// CHECK:STDOUT: %pattern_type.fa7: type = pattern_type %X [concrete] // CHECK:STDOUT: %X.B.type: type = fn_type @X.B [concrete] // CHECK:STDOUT: %X.B: %X.B.type = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.a14: %pattern_type.fa7 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.3ab: %pattern_type.fa7 = wrapper_binding_pattern self, %self.param_patt.a14 [concrete] // CHECK:STDOUT: %X.cpp_destructor.type: type = fn_type @X.cpp_destructor [concrete] // CHECK:STDOUT: %X.cpp_destructor: %X.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc10 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.414, %Destroy.WithSelf.SelfDestruct.db3 [concrete] // CHECK:STDOUT: %X.C.cpp_overload_set.type: type = cpp_overload_set_type @X.C.cpp_overload_set [concrete] // CHECK:STDOUT: %X.C.cpp_overload_set.value: %X.C.cpp_overload_set.type = cpp_overload_set_value @X.C.cpp_overload_set [concrete] // CHECK:STDOUT: %X.C.type: type = fn_type @X.C [concrete] @@ -250,6 +258,16 @@ fn Call() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc10 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.fa7 = ref_param_pattern [concrete = constants.%self.param_patt.a14] +// CHECK:STDOUT: %self.patt: %pattern_type.fa7 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.3ab] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %X = ref_param call_param0 +// CHECK:STDOUT: %self: ref %X = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @Call() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref.loc8: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -357,7 +375,7 @@ fn Call() { // CHECK:STDOUT: %.loc10_22.2: %i32 = converted %int_2.loc10, %.loc10_22.1 [concrete = constants.%int_2.295] // CHECK:STDOUT: %X.B.call: init %empty_tuple.type = call imports.%X.B.decl(%.loc10_7.3, %.loc10_19.2, %.loc10_22.2) // CHECK:STDOUT: -// CHECK:STDOUT: %Op.ref.loc10: %X.cpp_destructor.type = name_ref Op, imports.%X.cpp_destructor.decl [concrete = constants.%X.cpp_destructor] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.414) // CHECK:STDOUT: %Cpp.ref.loc11: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %X.ref.loc11: type = name_ref X, imports.%X.decl [concrete = constants.%X] // CHECK:STDOUT: %C.ref: %X.C.cpp_overload_set.type = name_ref C, imports.%X.C.cpp_overload_set.value [concrete = constants.%X.C.cpp_overload_set.value] @@ -407,10 +425,19 @@ fn Call() { // CHECK:STDOUT: %.loc12_7.4: ref %X = value_as_ref %.loc12_7.3 // CHECK:STDOUT: %addr: %ptr.ca1 = addr_of %.loc12_7.4 // CHECK:STDOUT: %D__carbon_thunk.call: init %empty_tuple.type = call imports.%D__carbon_thunk.decl(%addr, %.loc12_19.2, %.loc12_22.2) -// CHECK:STDOUT: %Op.ref.loc12: %X.cpp_destructor.type = name_ref Op, imports.%X.cpp_destructor.decl [concrete = constants.%X.cpp_destructor] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc12: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.414) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10(%self.param: ref %X) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10(%self.param: ref %X) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param) +// CHECK:STDOUT: %X.cpp_destructor.call: init %empty_tuple.type = call imports.%X.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- call_with_default.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -483,16 +510,21 @@ fn Call() { // CHECK:STDOUT: %B__carbon_thunk: %B__carbon_thunk.type = struct_value () [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %Self.0e7: %Destroy.type = symbolic_binding Self, 0 [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.d3e: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Self.0e7) [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.42b: %Destroy.WithSelf.Op.type.d3e = struct_value () [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.0ce: type = fn_type @Destroy.WithSelf.SubobjectDestroy, @Destroy.WithSelf(%Self.0e7) [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.9cd: %Destroy.WithSelf.SubobjectDestroy.type.0ce = struct_value () [symbolic] // CHECK:STDOUT: %self.param_patt.a14: %pattern_type.fa7 = ref_param_pattern [concrete] // CHECK:STDOUT: %self.patt.3ab: %pattern_type.fa7 = wrapper_binding_pattern self, %self.param_patt.a14 [concrete] // CHECK:STDOUT: %X.cpp_destructor.type: type = fn_type @X.cpp_destructor [concrete] // CHECK:STDOUT: %X.cpp_destructor: %X.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc11 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc11 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.c5a: = custom_witness (), @Destroy [concrete] // CHECK:STDOUT: %Destroy.facet.761: %Destroy.type = facet_value %X, (%custom_witness.c5a) [concrete] -// CHECK:STDOUT: %X.Op.type: type = fn_type @X.Op [concrete] -// CHECK:STDOUT: %X.Op: %X.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %X.SubobjectDestroy.type: type = fn_type @X.SubobjectDestroy [concrete] +// CHECK:STDOUT: %X.SubobjectDestroy: %X.SubobjectDestroy.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.414, %Destroy.WithSelf.SelfDestruct.db3 [concrete] // CHECK:STDOUT: %X.C.cpp_overload_set.type: type = cpp_overload_set_type @X.C.cpp_overload_set [concrete] // CHECK:STDOUT: %X.C.cpp_overload_set.value: %X.C.cpp_overload_set.type = cpp_overload_set_value @X.C.cpp_overload_set [concrete] // CHECK:STDOUT: %C__carbon_thunk.type: type = fn_type @C__carbon_thunk [concrete] @@ -626,7 +658,7 @@ fn Call() { // CHECK:STDOUT: %a: %i32 = wrapper_binding a, %a.param // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] -// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.d3e = fn_decl @Destroy.WithSelf.Op [symbolic = @Destroy.WithSelf.%Destroy.WithSelf.Op (constants.%Destroy.WithSelf.Op.42b)] {} {} +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl: %Destroy.WithSelf.SubobjectDestroy.type.0ce = fn_decl @Destroy.WithSelf.SubobjectDestroy [symbolic = @Destroy.WithSelf.%Destroy.WithSelf.SubobjectDestroy (constants.%Destroy.WithSelf.SubobjectDestroy.9cd)] {} {} // CHECK:STDOUT: %X.cpp_destructor.decl: %X.cpp_destructor.type = fn_decl @X.cpp_destructor [concrete = constants.%X.cpp_destructor] { // CHECK:STDOUT: %self.param_patt: %pattern_type.fa7 = ref_param_pattern [concrete = constants.%self.param_patt.a14] // CHECK:STDOUT: %self.patt: %pattern_type.fa7 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.3ab] @@ -666,6 +698,16 @@ fn Call() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc11 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.fa7 = ref_param_pattern [concrete = constants.%self.param_patt.a14] +// CHECK:STDOUT: %self.patt: %pattern_type.fa7 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.3ab] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %X = ref_param call_param0 +// CHECK:STDOUT: %self: ref %X = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -784,14 +826,14 @@ fn Call() { // CHECK:STDOUT: %.loc11_19.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc11 [concrete = constants.%int_1.0c6] // CHECK:STDOUT: %.loc11_19.2: %i32 = converted %int_1.loc11, %.loc11_19.1 [concrete = constants.%int_1.0c6] // CHECK:STDOUT: %B__carbon_thunk.call: init %empty_tuple.type = call imports.%B__carbon_thunk.decl(%.loc11_7.3, %.loc11_19.2) -// CHECK:STDOUT: %X.Op.decl: %X.Op.type = fn_decl @X.Op [concrete = constants.%X.Op] { -// CHECK:STDOUT: %.1: %pattern_type.fa7 = specific_constant constants.%self.param_patt.a14, @Destroy.WithSelf.Op(constants.%Destroy.facet.761) [concrete = constants.%self.param_patt.a14] +// CHECK:STDOUT: %X.SubobjectDestroy.decl: %X.SubobjectDestroy.type = fn_decl @X.SubobjectDestroy [concrete = constants.%X.SubobjectDestroy] { +// CHECK:STDOUT: %.1: %pattern_type.fa7 = specific_constant constants.%self.param_patt.a14, @Destroy.WithSelf.SubobjectDestroy(constants.%Destroy.facet.761) [concrete = constants.%self.param_patt.a14] // CHECK:STDOUT: %self.patt: %pattern_type.fa7 = wrapper_binding_pattern self, %.1 [concrete = constants.%self.patt.3ab] // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param: ref %X = ref_param call_param0 // CHECK:STDOUT: %self: ref %X = wrapper_binding self, %self.param // CHECK:STDOUT: } -// CHECK:STDOUT: %Op.ref.loc11: %X.cpp_destructor.type = name_ref Op, imports.%X.cpp_destructor.decl [concrete = constants.%X.cpp_destructor] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc11: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.414) // CHECK:STDOUT: %Cpp.ref.loc12: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %X.ref.loc12: type = name_ref X, imports.%X.decl [concrete = constants.%X] // CHECK:STDOUT: %C.ref: %X.C.cpp_overload_set.type = name_ref C, imports.%X.C.cpp_overload_set.value [concrete = constants.%X.C.cpp_overload_set.value] @@ -825,7 +867,7 @@ fn Call() { // CHECK:STDOUT: %.loc13_7.4: ref %X = value_as_ref %.loc13_7.3 // CHECK:STDOUT: %addr: %ptr.ca1 = addr_of %.loc13_7.4 // CHECK:STDOUT: %D__carbon_thunk.call: init %empty_tuple.type = call imports.%D__carbon_thunk.decl(%addr, %.loc13_19.2) -// CHECK:STDOUT: %Op.ref.loc13: %X.cpp_destructor.type = name_ref Op, imports.%X.cpp_destructor.decl [concrete = constants.%X.cpp_destructor] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc13: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.414) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -847,10 +889,19 @@ fn Call() { // CHECK:STDOUT: // CHECK:STDOUT: fn @X.cpp_destructor(%self.param: ref %X) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @X.Op(%self.param: ref %X) [thunk imports.%X.cpp_destructor.decl for imports.%Destroy.WithSelf.Op.decl, @Destroy.WithSelf.Op(constants.%Destroy.facet.761)] { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11(%self.param: ref %X) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11(%self.param: ref %X) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Op.ref: %X.cpp_destructor.type = name_ref Op, imports.%X.cpp_destructor.decl [concrete = constants.%X.cpp_destructor] -// CHECK:STDOUT: %X.cpp_destructor.bound: = bound_method %self.param, %Op.ref +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param) +// CHECK:STDOUT: %X.cpp_destructor.call: init %empty_tuple.type = call imports.%X.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @X.SubobjectDestroy(%self.param: ref %X) [thunk imports.%X.cpp_destructor.decl for imports.%Destroy.WithSelf.SubobjectDestroy.decl, @Destroy.WithSelf.SubobjectDestroy(constants.%Destroy.facet.761)] { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %SubobjectDestroy.ref: %X.cpp_destructor.type = name_ref SubobjectDestroy, imports.%X.cpp_destructor.decl [concrete = constants.%X.cpp_destructor] +// CHECK:STDOUT: %X.cpp_destructor.bound: = bound_method %self.param, %SubobjectDestroy.ref // CHECK:STDOUT: %X.cpp_destructor.call: init %empty_tuple.type = call %X.cpp_destructor.bound(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -867,6 +918,7 @@ fn Call() { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: type: type = facet_type [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %GlobalNoReturn.cpp_overload_set.type: type = cpp_overload_set_type @GlobalNoReturn.cpp_overload_set [concrete] // CHECK:STDOUT: %GlobalNoReturn.cpp_overload_set.value: %GlobalNoReturn.cpp_overload_set.type = cpp_overload_set_value @GlobalNoReturn.cpp_overload_set [concrete] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete] @@ -880,8 +932,16 @@ fn Call() { // CHECK:STDOUT: %X.B.cpp_overload_set.type: type = cpp_overload_set_type @X.B.cpp_overload_set [concrete] // CHECK:STDOUT: %X.B.cpp_overload_set.value: %X.B.cpp_overload_set.type = cpp_overload_set_value @X.B.cpp_overload_set [concrete] // CHECK:STDOUT: %bound_method.f8c: = bound_method %.414, %X.B.cpp_overload_set.value [concrete] +// CHECK:STDOUT: %pattern_type.fa7: type = pattern_type %X [concrete] +// CHECK:STDOUT: %self.param_patt.a14: %pattern_type.fa7 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.3ab: %pattern_type.fa7 = wrapper_binding_pattern self, %self.param_patt.a14 [concrete] // CHECK:STDOUT: %X.cpp_destructor.type: type = fn_type @X.cpp_destructor [concrete] // CHECK:STDOUT: %X.cpp_destructor: %X.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc56 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc56 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.414, %Destroy.WithSelf.SelfDestruct.db3 [concrete] // CHECK:STDOUT: %X.C.cpp_overload_set.type: type = cpp_overload_set_type @X.C.cpp_overload_set [concrete] // CHECK:STDOUT: %X.C.cpp_overload_set.value: %X.C.cpp_overload_set.type = cpp_overload_set_value @X.C.cpp_overload_set [concrete] // CHECK:STDOUT: %X.D.cpp_overload_set.type: type = cpp_overload_set_type @X.D.cpp_overload_set [concrete] @@ -909,6 +969,16 @@ fn Call() { // CHECK:STDOUT: %X.D.cpp_overload_set.value: %X.D.cpp_overload_set.type = cpp_overload_set_value @X.D.cpp_overload_set [concrete = constants.%X.D.cpp_overload_set.value] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc56 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.fa7 = ref_param_pattern [concrete = constants.%self.param_patt.a14] +// CHECK:STDOUT: %self.patt: %pattern_type.fa7 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.3ab] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %X = ref_param call_param0 +// CHECK:STDOUT: %self: ref %X = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @Call() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref.loc16: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -931,7 +1001,7 @@ fn Call() { // CHECK:STDOUT: %B.ref: %X.B.cpp_overload_set.type = name_ref B, imports.%X.B.cpp_overload_set.value [concrete = constants.%X.B.cpp_overload_set.value] // CHECK:STDOUT: %bound_method.loc56: = bound_method %.loc56_7.2, %B.ref [concrete = constants.%bound_method.f8c] // CHECK:STDOUT: -// CHECK:STDOUT: %Op.ref.loc56: %X.cpp_destructor.type = name_ref Op, imports.%X.cpp_destructor.decl [concrete = constants.%X.cpp_destructor] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc56: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.414) // CHECK:STDOUT: %Cpp.ref.loc66: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %X.ref.loc66: type = name_ref X, imports.%X.decl [concrete = constants.%X] // CHECK:STDOUT: %C.ref: %X.C.cpp_overload_set.type = name_ref C, imports.%X.C.cpp_overload_set.value [concrete = constants.%X.C.cpp_overload_set.value] @@ -944,7 +1014,16 @@ fn Call() { // CHECK:STDOUT: %.loc76_7.2: ref %X = temporary %.loc76_5.2, %.loc76_7.1 [concrete = constants.%.414] // CHECK:STDOUT: %D.ref: %X.D.cpp_overload_set.type = name_ref D, imports.%X.D.cpp_overload_set.value [concrete = constants.%X.D.cpp_overload_set.value] // CHECK:STDOUT: %bound_method.loc76: = bound_method %.loc76_7.2, %D.ref [concrete = constants.%bound_method.9a8] -// CHECK:STDOUT: %Op.ref.loc76: %X.cpp_destructor.type = name_ref Op, imports.%X.cpp_destructor.decl [concrete = constants.%X.cpp_destructor] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc76: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.414) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc56(%self.param: ref %X) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc56(%self.param: ref %X) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param) +// CHECK:STDOUT: %X.cpp_destructor.call: init %empty_tuple.type = call imports.%X.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/function/import/full_semir.carbon b/toolchain/check/testdata/interop/cpp/function/import/full_semir.carbon index 9646950bf8c6..95e2682a69fc 100644 --- a/toolchain/check/testdata/interop/cpp/function/import/full_semir.carbon +++ b/toolchain/check/testdata/interop/cpp/function/import/full_semir.carbon @@ -94,6 +94,7 @@ fn F() { // CHECK:STDOUT: %As.WithSelf.Convert.type.4ac: type = fn_type @As.WithSelf.Convert, @As.WithSelf(%i16, %As.facet) [concrete] // CHECK:STDOUT: %.45d: type = fn_type_with_self_type %As.WithSelf.Convert.type.4ac, %As.facet [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.70c [concrete] +// CHECK:STDOUT: %pattern_type.203: type = pattern_type %i16 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.As.impl.Convert.70c, @Core.IntLiteral.as.As.impl.Convert(%int_16) [concrete] // CHECK:STDOUT: %bound_method.a0f: = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.d17: %i16 = int_value 1 [concrete] @@ -118,9 +119,22 @@ fn F() { // CHECK:STDOUT: %.597: ref %i16 = temporary invalid, %int_1.d17 [concrete] // CHECK:STDOUT: %addr: %ptr.686 = addr_of %.597 [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.08e: type = pattern_type %i16.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.b41: %pattern_type.08e = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.277: %pattern_type.08e = wrapper_binding_pattern self, %self.param_patt.b41 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc7_13.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc7_13.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.f77: %pattern_type.203 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.91f: %pattern_type.203 = wrapper_binding_pattern self, %self.param_patt.f77 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc7_13.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc7_13.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.597, %Destroy.WithSelf.Op.403171.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc7_13.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.597, %Destroy.WithSelf.SelfDestruct.db3fdb.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -159,6 +173,37 @@ fn F() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc7_13.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.08e = ref_param_pattern [concrete = constants.%self.param_patt.b41] +// CHECK:STDOUT: %self.patt: %pattern_type.08e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.277] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i16.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i16.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc7_13.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.08e = ref_param_pattern [concrete = constants.%self.param_patt.b41] +// CHECK:STDOUT: %self.patt: %pattern_type.08e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.277] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i16.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i16.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc7_13.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.203 = ref_param_pattern [concrete = constants.%self.param_patt.f77] +// CHECK:STDOUT: %self.patt: %pattern_type.203 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.91f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i16 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i16 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc7_13.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.203 = ref_param_pattern [concrete = constants.%self.param_patt.f77] +// CHECK:STDOUT: %self.patt: %pattern_type.203 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.91f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i16 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i16 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -194,7 +239,7 @@ fn F() { // CHECK:STDOUT: %.loc7_13.4: ref %i16 = temporary %.loc7_13.3, %Int.as.Copy.impl.Op.call [concrete = constants.%.597] // CHECK:STDOUT: %addr: %ptr.686 = addr_of %.loc7_13.4 [concrete = constants.%addr] // CHECK:STDOUT: %foo__carbon_thunk.call: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.597) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.597) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -202,10 +247,28 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: fn @foo__carbon_thunk(%a.param: %ptr.686); // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc7_13.1(%self.param: ref %i16.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_13.1(%self.param: ref %i16.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_13.2(%self.param: ref %i16) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc7_13.1(%self.param: ref %i16.builtin) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc7_13.2(%self.param: ref %i16) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_13.2(%self.param: ref %i16) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc7_13.2(%self.param: ref %i16) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -330,8 +393,21 @@ fn F() { // CHECK:STDOUT: %foo_short__carbon_thunk.type: type = fn_type @foo_short__carbon_thunk [concrete] // CHECK:STDOUT: %foo_short__carbon_thunk: %foo_short__carbon_thunk.type = struct_value () [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.08e: type = pattern_type %i16.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.b41: %pattern_type.08e = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.277: %pattern_type.08e = wrapper_binding_pattern self, %self.param_patt.b41 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc7_37.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc7_37.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.f77: %pattern_type.203 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.91f: %pattern_type.203 = wrapper_binding_pattern self, %self.param_patt.f77 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc7_37.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc7_37.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc7_37.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -362,6 +438,37 @@ fn F() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc7_37.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.08e = ref_param_pattern [concrete = constants.%self.param_patt.b41] +// CHECK:STDOUT: %self.patt: %pattern_type.08e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.277] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i16.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i16.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc7_37.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.08e = ref_param_pattern [concrete = constants.%self.param_patt.b41] +// CHECK:STDOUT: %self.patt: %pattern_type.08e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.277] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i16.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i16.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc7_37.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.203 = ref_param_pattern [concrete = constants.%self.param_patt.f77] +// CHECK:STDOUT: %self.patt: %pattern_type.203 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.91f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i16 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i16 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc7_37.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.203 = ref_param_pattern [concrete = constants.%self.param_patt.f77] +// CHECK:STDOUT: %self.patt: %pattern_type.203 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.91f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i16 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i16 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -390,8 +497,8 @@ fn F() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %x.patt: %pattern_type.203 = value_binding_pattern x [concrete = constants.%x.patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.loc7_37.3, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%.loc7_37.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc7_37.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc7_37.3) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -399,10 +506,28 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: fn @foo_short__carbon_thunk(%return.param: %ptr); // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc7_37.1(%self.param: ref %i16.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_37.1(%self.param: ref %i16.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_37.2(%self.param: ref %i16) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc7_37.1(%self.param: ref %i16.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc7_37.2(%self.param: ref %i16) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_37.2(%self.param: ref %i16) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc7_37.2(%self.param: ref %i16) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/function/import/inline.carbon b/toolchain/check/testdata/interop/cpp/function/import/inline.carbon index cbc2be3df99c..9769e8bfba51 100644 --- a/toolchain/check/testdata/interop/cpp/function/import/inline.carbon +++ b/toolchain/check/testdata/interop/cpp/function/import/inline.carbon @@ -218,9 +218,22 @@ fn MyF() { // CHECK:STDOUT: %ThunkOnBoth.cpp_overload_set.value: %ThunkOnBoth.cpp_overload_set.type = cpp_overload_set_value @ThunkOnBoth.cpp_overload_set [concrete] // CHECK:STDOUT: %ThunkOnBoth__carbon_thunk.type: type = fn_type @ThunkOnBoth__carbon_thunk [concrete] // CHECK:STDOUT: %ThunkOnBoth__carbon_thunk: %ThunkOnBoth__carbon_thunk.type = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.08e: type = pattern_type %i16.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.b41: %pattern_type.08e = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.277: %pattern_type.08e = wrapper_binding_pattern self, %self.param_patt.b41 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc16_41.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc16_41.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.f77: %pattern_type.203 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.91f: %pattern_type.203 = wrapper_binding_pattern self, %self.param_patt.f77 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc16_41.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc16_41.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.597, %Destroy.WithSelf.Op.403171.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc16_41.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.597, %Destroy.WithSelf.SelfDestruct.db3fdb.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -261,6 +274,37 @@ fn MyF() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc16_41.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.08e = ref_param_pattern [concrete = constants.%self.param_patt.b41] +// CHECK:STDOUT: %self.patt: %pattern_type.08e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.277] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i16.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i16.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc16_41.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.08e = ref_param_pattern [concrete = constants.%self.param_patt.b41] +// CHECK:STDOUT: %self.patt: %pattern_type.08e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.277] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i16.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i16.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc16_41.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.203 = ref_param_pattern [concrete = constants.%self.param_patt.f77] +// CHECK:STDOUT: %self.patt: %pattern_type.203 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.91f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i16 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i16 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc16_41.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.203 = ref_param_pattern [concrete = constants.%self.param_patt.f77] +// CHECK:STDOUT: %self.patt: %pattern_type.203 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.91f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i16 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i16 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @MyF() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref.loc13: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -357,19 +401,37 @@ fn MyF() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %r4.patt: %pattern_type.203 = value_binding_pattern r4 [concrete = constants.%r4.patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc16: = bound_method %.loc16_41.3, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc16_41: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc16(%.loc16_41.3) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc16_40: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.597) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc15: = bound_method %.loc15_43.3, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc15: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc15(%.loc15_43.3) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc14: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.597) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16: = bound_method %.loc16_41.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_41: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16(%.loc16_41.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_40: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.597) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc15: = bound_method %.loc15_43.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc15: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc15(%.loc15_43.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.597) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc16_41.1(%self.param: ref %i16.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16_41.1(%self.param: ref %i16.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16_41.2(%self.param: ref %i16) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc16_41.1(%self.param: ref %i16.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc16_41.2(%self.param: ref %i16) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16_41.2(%self.param: ref %i16) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc16_41.2(%self.param: ref %i16) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/function/import/pointer.carbon b/toolchain/check/testdata/interop/cpp/function/import/pointer.carbon index 63a9742f4333..b6d86bf5b614 100644 --- a/toolchain/check/testdata/interop/cpp/function/import/pointer.carbon +++ b/toolchain/check/testdata/interop/cpp/function/import/pointer.carbon @@ -444,8 +444,14 @@ fn F() { // CHECK:STDOUT: %ptr.1dc: type = ptr_type %NonNullableParamS [concrete] // CHECK:STDOUT: %non_nullable_param_foo.type: type = fn_type @non_nullable_param_foo [concrete] // CHECK:STDOUT: %non_nullable_param_foo: %non_nullable_param_foo.type = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.4d7: %pattern_type.3b5 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.667: %pattern_type.3b5 = wrapper_binding_pattern self, %self.param_patt.4d7 [concrete] // CHECK:STDOUT: %NonNullableParamS.cpp_destructor.type: type = fn_type @NonNullableParamS.cpp_destructor [concrete] // CHECK:STDOUT: %NonNullableParamS.cpp_destructor: %NonNullableParamS.cpp_destructor.type = struct_value () [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.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -461,6 +467,21 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } +// CHECK:STDOUT: %NonNullableParamS.cpp_destructor.decl: %NonNullableParamS.cpp_destructor.type = fn_decl @NonNullableParamS.cpp_destructor [concrete = constants.%NonNullableParamS.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// 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.3b5 = ref_param_pattern [concrete = constants.%self.param_patt.4d7] +// CHECK:STDOUT: %self.patt: %pattern_type.3b5 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.667] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %NonNullableParamS = ref_param call_param0 +// CHECK:STDOUT: %self: ref %NonNullableParamS = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -484,11 +505,20 @@ fn F() { // CHECK:STDOUT: %s.ref: ref %NonNullableParamS = name_ref s, %s // CHECK:STDOUT: %addr: %ptr.1dc = addr_of %s.ref // CHECK:STDOUT: %non_nullable_param_foo.call: init %empty_tuple.type = call imports.%non_nullable_param_foo.decl(%addr) -// CHECK:STDOUT: %NonNullableParamS.cpp_destructor.bound: = bound_method %s.var, constants.%NonNullableParamS.cpp_destructor -// CHECK:STDOUT: %NonNullableParamS.cpp_destructor.call: init %empty_tuple.type = call %NonNullableParamS.cpp_destructor.bound(%s.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %s.var, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%s.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8(%self.param: ref %NonNullableParamS) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8(%self.param: ref %NonNullableParamS) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param) +// CHECK:STDOUT: %NonNullableParamS.cpp_destructor.call: init %empty_tuple.type = call imports.%NonNullableParamS.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- import_non_nullable_pointer_param_using_const_pointer.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -504,10 +534,23 @@ fn F() { // CHECK:STDOUT: %p.var_patt: %pattern_type.937 = var_pattern %p.patt [concrete] // CHECK:STDOUT: %non_nullable_param_foo.cpp_overload_set.type: type = cpp_overload_set_type @non_nullable_param_foo.cpp_overload_set [concrete] // CHECK:STDOUT: %non_nullable_param_foo.cpp_overload_set.value: %non_nullable_param_foo.cpp_overload_set.type = cpp_overload_set_value @non_nullable_param_foo.cpp_overload_set [concrete] +// CHECK:STDOUT: %pattern_type.2d9: type = pattern_type %ptr [concrete] // CHECK:STDOUT: %non_nullable_param_foo.type: type = fn_type @non_nullable_param_foo [concrete] // CHECK:STDOUT: %non_nullable_param_foo: %non_nullable_param_foo.type = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.5ee: %pattern_type.2d9 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.f71: %pattern_type.2d9 = wrapper_binding_pattern self, %self.param_patt.5ee [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc10_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.ed3: %pattern_type.937 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.6ce: %pattern_type.937 = wrapper_binding_pattern self, %self.param_patt.ed3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc10_3.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -525,6 +568,37 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.2d9 = ref_param_pattern [concrete = constants.%self.param_patt.5ee] +// CHECK:STDOUT: %self.patt: %pattern_type.2d9 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.f71] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc10_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.2d9 = ref_param_pattern [concrete = constants.%self.param_patt.5ee] +// CHECK:STDOUT: %self.patt: %pattern_type.2d9 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.f71] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.937 = ref_param_pattern [concrete = constants.%self.param_patt.ed3] +// CHECK:STDOUT: %self.patt: %pattern_type.937 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.6ce] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %const = ref_param call_param0 +// CHECK:STDOUT: %self: ref %const = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc10_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.937 = ref_param_pattern [concrete = constants.%self.param_patt.ed3] +// CHECK:STDOUT: %self.patt: %pattern_type.937 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.6ce] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %const = ref_param call_param0 +// CHECK:STDOUT: %self: ref %const = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.var: ref %const = var_storage %p.var_patt @@ -549,15 +623,33 @@ fn F() { // CHECK:STDOUT: %.loc11_30.2: ref %ptr = converted %p.ref, %.loc11_30.1 // CHECK:STDOUT: %.loc11_30.3: %ptr = acquire_value %.loc11_30.2 // CHECK:STDOUT: %non_nullable_param_foo.call: init %empty_tuple.type = call imports.%non_nullable_param_foo.decl(%.loc11_30.3) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %p.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%p.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %p.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%p.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_3.1(%self.param: ref %ptr) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_3.1(%self.param: ref %ptr) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_3.2(%self.param: ref %const) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_3.1(%self.param: ref %ptr) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_3.2(%self.param: ref %const) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_3.2(%self.param: ref %const) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_3.2(%self.param: ref %const) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -593,10 +685,22 @@ fn F() { // CHECK:STDOUT: %ptr.2a5: type = ptr_type %ptr.40d [concrete] // CHECK:STDOUT: %double_non_nullable_param_foo.type: type = fn_type @double_non_nullable_param_foo [concrete] // CHECK:STDOUT: %double_non_nullable_param_foo: %double_non_nullable_param_foo.type = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc9 [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.8a2: %pattern_type.4da = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.401: %pattern_type.4da = wrapper_binding_pattern self, %self.param_patt.8a2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfc: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01: %Destroy.WithSelf.SubobjectDestroy.type.dfc = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.e94: %pattern_type.cb1 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.ec6: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt.e94 [concrete] // CHECK:STDOUT: %DoubleNonNullableParamS.cpp_destructor.type: type = fn_type @DoubleNonNullableParamS.cpp_destructor [concrete] // CHECK:STDOUT: %DoubleNonNullableParamS.cpp_destructor: %DoubleNonNullableParamS.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -614,6 +718,35 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } +// CHECK:STDOUT: %DoubleNonNullableParamS.cpp_destructor.decl: %DoubleNonNullableParamS.cpp_destructor.type = fn_decl @DoubleNonNullableParamS.cpp_destructor [concrete = constants.%DoubleNonNullableParamS.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl: %Destroy.WithSelf.SubobjectDestroy.type.dfc = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.4da = ref_param_pattern [concrete = constants.%self.param_patt.8a2] +// CHECK:STDOUT: %self.patt: %pattern_type.4da = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.401] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr.40d = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr.40d = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc9 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.4da = ref_param_pattern [concrete = constants.%self.param_patt.8a2] +// CHECK:STDOUT: %self.patt: %pattern_type.4da = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.401] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr.40d = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr.40d = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc8 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.e94] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ec6] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %DoubleNonNullableParamS = ref_param call_param0 +// CHECK:STDOUT: %self: ref %DoubleNonNullableParamS = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -656,15 +789,33 @@ fn F() { // CHECK:STDOUT: %p.ref: ref %ptr.40d = name_ref p, %p // CHECK:STDOUT: %addr.loc10: %ptr.2a5 = addr_of %p.ref // CHECK:STDOUT: %double_non_nullable_param_foo.call: init %empty_tuple.type = call imports.%double_non_nullable_param_foo.decl(%addr.loc10) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %p.var, constants.%Destroy.WithSelf.Op.403 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%p.var) -// CHECK:STDOUT: %DoubleNonNullableParamS.cpp_destructor.bound: = bound_method %s.var, constants.%DoubleNonNullableParamS.cpp_destructor -// CHECK:STDOUT: %DoubleNonNullableParamS.cpp_destructor.call: init %empty_tuple.type = call %DoubleNonNullableParamS.cpp_destructor.bound(%s.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc9: = bound_method %p.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc9(%p.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: = bound_method %s.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%s.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9(%self.param: ref %ptr.40d) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9(%self.param: ref %ptr.40d) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9(%self.param: ref %ptr.40d) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8(%self.param: ref %DoubleNonNullableParamS) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8(%self.param: ref %DoubleNonNullableParamS) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %DoubleNonNullableParamS.cpp_destructor.call: init %empty_tuple.type = call imports.%DoubleNonNullableParamS.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- import_non_nullable_pointer_to_const_param_using_const.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -682,8 +833,21 @@ fn F() { // CHECK:STDOUT: %ptr.62c: type = ptr_type %const [concrete] // CHECK:STDOUT: %non_nullable_to_const_foo.type: type = fn_type @non_nullable_to_const_foo [concrete] // CHECK:STDOUT: %non_nullable_to_const_foo: %non_nullable_to_const_foo.type = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc10 [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.2f7: type = pattern_type %NonNullablePointerToConstParamS [concrete] +// CHECK:STDOUT: %self.param_patt.c8e: %pattern_type.2f7 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.852: %pattern_type.2f7 = wrapper_binding_pattern self, %self.param_patt.c8e [concrete] +// CHECK:STDOUT: %NonNullablePointerToConstParamS.cpp_destructor.type: type = fn_type @NonNullablePointerToConstParamS.cpp_destructor [concrete] +// CHECK:STDOUT: %NonNullablePointerToConstParamS.cpp_destructor: %NonNullablePointerToConstParamS.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc10_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.61c: %pattern_type.291 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.79a: %pattern_type.291 = wrapper_binding_pattern self, %self.param_patt.61c [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfc: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01: %Destroy.WithSelf.SubobjectDestroy.type.dfc = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc10_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -699,6 +863,35 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } +// CHECK:STDOUT: %NonNullablePointerToConstParamS.cpp_destructor.decl: %NonNullablePointerToConstParamS.cpp_destructor.type = fn_decl @NonNullablePointerToConstParamS.cpp_destructor [concrete = constants.%NonNullablePointerToConstParamS.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc10_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.2f7 = ref_param_pattern [concrete = constants.%self.param_patt.c8e] +// CHECK:STDOUT: %self.patt: %pattern_type.2f7 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.852] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %NonNullablePointerToConstParamS = ref_param call_param0 +// CHECK:STDOUT: %self: ref %NonNullablePointerToConstParamS = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl: %Destroy.WithSelf.SubobjectDestroy.type.dfc = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.291 = ref_param_pattern [concrete = constants.%self.param_patt.61c] +// CHECK:STDOUT: %self.patt: %pattern_type.291 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.79a] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %const = ref_param call_param0 +// CHECK:STDOUT: %self: ref %const = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc10_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.291 = ref_param_pattern [concrete = constants.%self.param_patt.61c] +// CHECK:STDOUT: %self.patt: %pattern_type.291 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.79a] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %const = ref_param call_param0 +// CHECK:STDOUT: %self: ref %const = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -723,13 +916,31 @@ fn F() { // CHECK:STDOUT: %s.ref: ref %const = name_ref s, %s // CHECK:STDOUT: %addr: %ptr.62c = addr_of %s.ref // CHECK:STDOUT: %non_nullable_to_const_foo.call: init %empty_tuple.type = call imports.%non_nullable_to_const_foo.decl(%addr) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %s.var, constants.%Destroy.WithSelf.Op.403 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%s.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %s.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%s.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10(%self.param: ref %const) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_3.1(%self.param: ref %NonNullablePointerToConstParamS) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_3.1(%self.param: ref %NonNullablePointerToConstParamS) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %NonNullablePointerToConstParamS.cpp_destructor.call: init %empty_tuple.type = call imports.%NonNullablePointerToConstParamS.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10(%self.param: ref %const) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_3.2(%self.param: ref %const) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_3.2(%self.param: ref %const) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -751,8 +962,14 @@ fn F() { // CHECK:STDOUT: %ptr.62c: type = ptr_type %const [concrete] // CHECK:STDOUT: %non_nullable_to_const_foo.type: type = fn_type @non_nullable_to_const_foo [concrete] // CHECK:STDOUT: %non_nullable_to_const_foo: %non_nullable_to_const_foo.type = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.c8e: %pattern_type.2f7 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.852: %pattern_type.2f7 = wrapper_binding_pattern self, %self.param_patt.c8e [concrete] // CHECK:STDOUT: %NonNullablePointerToConstParamS.cpp_destructor.type: type = fn_type @NonNullablePointerToConstParamS.cpp_destructor [concrete] // CHECK:STDOUT: %NonNullablePointerToConstParamS.cpp_destructor: %NonNullablePointerToConstParamS.cpp_destructor.type = struct_value () [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.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -768,6 +985,21 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } +// CHECK:STDOUT: %NonNullablePointerToConstParamS.cpp_destructor.decl: %NonNullablePointerToConstParamS.cpp_destructor.type = fn_decl @NonNullablePointerToConstParamS.cpp_destructor [concrete = constants.%NonNullablePointerToConstParamS.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// 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.2f7 = ref_param_pattern [concrete = constants.%self.param_patt.c8e] +// CHECK:STDOUT: %self.patt: %pattern_type.2f7 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.852] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %NonNullablePointerToConstParamS = ref_param call_param0 +// CHECK:STDOUT: %self: ref %NonNullablePointerToConstParamS = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -793,11 +1025,20 @@ fn F() { // CHECK:STDOUT: %.loc9_33.1: %ptr.62c = as_compatible %addr // CHECK:STDOUT: %.loc9_33.2: %ptr.62c = converted %addr, %.loc9_33.1 // CHECK:STDOUT: %non_nullable_to_const_foo.call: init %empty_tuple.type = call imports.%non_nullable_to_const_foo.decl(%.loc9_33.2) -// CHECK:STDOUT: %NonNullablePointerToConstParamS.cpp_destructor.bound: = bound_method %s.var, constants.%NonNullablePointerToConstParamS.cpp_destructor -// CHECK:STDOUT: %NonNullablePointerToConstParamS.cpp_destructor.call: init %empty_tuple.type = call %NonNullablePointerToConstParamS.cpp_destructor.bound(%s.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %s.var, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%s.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8(%self.param: ref %NonNullablePointerToConstParamS) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8(%self.param: ref %NonNullablePointerToConstParamS) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param) +// CHECK:STDOUT: %NonNullablePointerToConstParamS.cpp_destructor.call: init %empty_tuple.type = call imports.%NonNullablePointerToConstParamS.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- import_const_non_nullable_pointer_param_using_const.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -813,10 +1054,23 @@ fn F() { // CHECK:STDOUT: %p.var_patt: %pattern_type.6b4 = var_pattern %p.patt [concrete] // CHECK:STDOUT: %const_non_nullable_foo.cpp_overload_set.type: type = cpp_overload_set_type @const_non_nullable_foo.cpp_overload_set [concrete] // CHECK:STDOUT: %const_non_nullable_foo.cpp_overload_set.value: %const_non_nullable_foo.cpp_overload_set.type = cpp_overload_set_value @const_non_nullable_foo.cpp_overload_set [concrete] +// CHECK:STDOUT: %pattern_type.c28: type = pattern_type %ptr [concrete] // CHECK:STDOUT: %const_non_nullable_foo.type: type = fn_type @const_non_nullable_foo [concrete] // CHECK:STDOUT: %const_non_nullable_foo: %const_non_nullable_foo.type = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.d88: %pattern_type.c28 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.7b2: %pattern_type.c28 = wrapper_binding_pattern self, %self.param_patt.d88 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc10_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.d3f: %pattern_type.6b4 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.738: %pattern_type.6b4 = wrapper_binding_pattern self, %self.param_patt.d3f [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc10_3.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -834,6 +1088,37 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.c28 = ref_param_pattern [concrete = constants.%self.param_patt.d88] +// CHECK:STDOUT: %self.patt: %pattern_type.c28 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.7b2] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc10_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.c28 = ref_param_pattern [concrete = constants.%self.param_patt.d88] +// CHECK:STDOUT: %self.patt: %pattern_type.c28 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.7b2] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b4 = ref_param_pattern [concrete = constants.%self.param_patt.d3f] +// CHECK:STDOUT: %self.patt: %pattern_type.6b4 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.738] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %const = ref_param call_param0 +// CHECK:STDOUT: %self: ref %const = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc10_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b4 = ref_param_pattern [concrete = constants.%self.param_patt.d3f] +// CHECK:STDOUT: %self.patt: %pattern_type.6b4 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.738] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %const = ref_param call_param0 +// CHECK:STDOUT: %self: ref %const = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.var: ref %const = var_storage %p.var_patt @@ -858,15 +1143,33 @@ fn F() { // CHECK:STDOUT: %.loc11_30.2: ref %ptr = converted %p.ref, %.loc11_30.1 // CHECK:STDOUT: %.loc11_30.3: %ptr = acquire_value %.loc11_30.2 // CHECK:STDOUT: %const_non_nullable_foo.call: init %empty_tuple.type = call imports.%const_non_nullable_foo.decl(%.loc11_30.3) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %p.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%p.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %p.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%p.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_3.1(%self.param: ref %ptr) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_3.1(%self.param: ref %ptr) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_3.2(%self.param: ref %const) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_3.1(%self.param: ref %ptr) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_3.2(%self.param: ref %const) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_3.2(%self.param: ref %const) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_3.2(%self.param: ref %const) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -886,8 +1189,14 @@ fn F() { // CHECK:STDOUT: %const_non_nullable_foo.cpp_overload_set.value: %const_non_nullable_foo.cpp_overload_set.type = cpp_overload_set_value @const_non_nullable_foo.cpp_overload_set [concrete] // CHECK:STDOUT: %const_non_nullable_foo.type: type = fn_type @const_non_nullable_foo [concrete] // CHECK:STDOUT: %const_non_nullable_foo: %const_non_nullable_foo.type = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.d88: %pattern_type.c28 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.7b2: %pattern_type.c28 = wrapper_binding_pattern self, %self.param_patt.d88 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfc: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10 [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.loc10 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -905,6 +1214,23 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl: %Destroy.WithSelf.SubobjectDestroy.type.dfc = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.c28 = ref_param_pattern [concrete = constants.%self.param_patt.d88] +// CHECK:STDOUT: %self.patt: %pattern_type.c28 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.7b2] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc10 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.c28 = ref_param_pattern [concrete = constants.%self.param_patt.d88] +// CHECK:STDOUT: %self.patt: %pattern_type.c28 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.7b2] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.var: ref %ptr = var_storage %p.var_patt @@ -926,13 +1252,22 @@ fn F() { // CHECK:STDOUT: %p.ref: ref %ptr = name_ref p, %p // CHECK:STDOUT: %.loc11: %ptr = acquire_value %p.ref // CHECK:STDOUT: %const_non_nullable_foo.call: init %empty_tuple.type = call imports.%const_non_nullable_foo.decl(%.loc11) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %p.var, constants.%Destroy.WithSelf.Op.403 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%p.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %p.var, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%p.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10(%self.param: ref %ptr) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10(%self.param: ref %ptr) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10(%self.param: ref %ptr) { +// 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) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- import_const_nullable_pointer_param_using_const.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -958,15 +1293,20 @@ fn F() { // CHECK:STDOUT: %MaybeUnformed.ddb: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.e46) [symbolic] // CHECK:STDOUT: %ptr.as.OptionalStorage.impl.Some.type.71e: type = fn_type @ptr.as.OptionalStorage.impl.Some, @ptr.as.OptionalStorage.impl(%T.67d) [symbolic] // CHECK:STDOUT: %ptr.as.OptionalStorage.impl.Some.caa: %ptr.as.OptionalStorage.impl.Some.type.71e = struct_value () [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.6c4ec3.1: = custom_witness (%Destroy.WithSelf.Op.403171.1), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.147: %Destroy.type = facet_value %ptr.13b, (%custom_witness.6c4ec3.1) [concrete] -// CHECK:STDOUT: %MaybeUnformed.9d6: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.147) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f8f19d.1: = custom_witness (%Destroy.WithSelf.Op.403171.1, %Destroy.WithSelf.SubobjectDestroy.d01daf.1, %Destroy.WithSelf.SelfDestruct.db3fdb.1), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.1a9: %Destroy.type = facet_value %ptr.13b, (%custom_witness.f8f19d.1) [concrete] +// CHECK:STDOUT: %MaybeUnformed.9ee: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.1a9) [concrete] // CHECK:STDOUT: %OptionalStorage.impl_witness.cb6: = impl_witness imports.%OptionalStorage.impl_witness_table.110, @ptr.as.OptionalStorage.impl(%ConstNullableParamS) [concrete] // CHECK:STDOUT: %.c5e2: type = maybe_unformed_type %ptr.13b [concrete] // CHECK:STDOUT: %OptionalStorage.facet.f04: %OptionalStorage.type = facet_value %ptr.13b, (%OptionalStorage.impl_witness.cb6) [concrete] // CHECK:STDOUT: %Optional.7c0: type = class_type @Optional, @Optional(%OptionalStorage.facet.f04) [concrete] +// CHECK:STDOUT: %pattern_type.567: type = pattern_type %Optional.7c0 [concrete] // CHECK:STDOUT: %const_nullable_foo.type: type = fn_type @const_nullable_foo [concrete] // CHECK:STDOUT: %const_nullable_foo: %const_nullable_foo.type = struct_value () [concrete] // CHECK:STDOUT: %ImplicitAs.type.3dc: type = facet_type <@ImplicitAs, @ImplicitAs(%Optional.7c0)> [concrete] @@ -992,10 +1332,36 @@ fn F() { // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.25f: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%Optional.7c0, %ImplicitAs.facet.7f0) [concrete] // CHECK:STDOUT: %.a05: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.25f, %ImplicitAs.facet.7f0 [concrete] // CHECK:STDOUT: %const.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %const.as.ImplicitAs.impl.Convert.7ef, @const.as.ImplicitAs.impl.Convert(%Optional.7c0, %ImplicitAs.facet.464) [concrete] +// CHECK:STDOUT: %pattern_type.07f: type = pattern_type %.c5e2 [concrete] +// CHECK:STDOUT: %self.param_patt.be1: %pattern_type.07f = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.b05: %pattern_type.07f = wrapper_binding_pattern self, %self.param_patt.be1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_26.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc11_26.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.5f4: type = pattern_type %MaybeUnformed.9ee [concrete] +// CHECK:STDOUT: %self.param_patt.815: %pattern_type.5f4 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.7da: %pattern_type.5f4 = wrapper_binding_pattern self, %self.param_patt.815 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_26.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc11_26.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.93b: %pattern_type.567 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.86d: %pattern_type.567 = wrapper_binding_pattern self, %self.param_patt.93b [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_26.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc11_26.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc11_26.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.004: %pattern_type.170 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.927: %pattern_type.170 = wrapper_binding_pattern self, %self.param_patt.004 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.5: type = fn_type @Destroy.WithSelf.Op.loc10 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.5: %Destroy.WithSelf.Op.type.ef016f.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.5: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1032,6 +1398,65 @@ fn F() { // CHECK:STDOUT: %OptionalAs.impl_witness_table.2e9 = impl_witness_table (%Core.import_ref.017d8), @T.as_type.as.OptionalAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_26.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.07f = ref_param_pattern [concrete = constants.%self.param_patt.be1] +// CHECK:STDOUT: %self.patt: %pattern_type.07f = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.b05] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %.c5e2 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %.c5e2 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc11_26.1 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.07f = ref_param_pattern [concrete = constants.%self.param_patt.be1] +// CHECK:STDOUT: %self.patt: %pattern_type.07f = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.b05] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %.c5e2 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %.c5e2 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_26.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.5f4 = ref_param_pattern [concrete = constants.%self.param_patt.815] +// CHECK:STDOUT: %self.patt: %pattern_type.5f4 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.7da] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %MaybeUnformed.9ee = ref_param call_param0 +// CHECK:STDOUT: %self: ref %MaybeUnformed.9ee = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc11_26.2 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.5f4 = ref_param_pattern [concrete = constants.%self.param_patt.815] +// CHECK:STDOUT: %self.patt: %pattern_type.5f4 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.7da] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %MaybeUnformed.9ee = ref_param call_param0 +// CHECK:STDOUT: %self: ref %MaybeUnformed.9ee = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_26.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.567 = ref_param_pattern [concrete = constants.%self.param_patt.93b] +// CHECK:STDOUT: %self.patt: %pattern_type.567 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.86d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Optional.7c0 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Optional.7c0 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc11_26.3 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.567 = ref_param_pattern [concrete = constants.%self.param_patt.93b] +// CHECK:STDOUT: %self.patt: %pattern_type.567 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.86d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Optional.7c0 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Optional.7c0 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.170 = ref_param_pattern [concrete = constants.%self.param_patt.004] +// CHECK:STDOUT: %self.patt: %pattern_type.170 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.927] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %const.2f4 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %const.2f4 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.5: %Destroy.WithSelf.Op.type.ef016f.5 = fn_decl @Destroy.WithSelf.Op.loc10 [concrete = constants.%Destroy.WithSelf.Op.403171.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.170 = ref_param_pattern [concrete = constants.%self.param_patt.004] +// CHECK:STDOUT: %self.patt: %pattern_type.170 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.927] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %const.2f4 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %const.2f4 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.var: ref %const.2f4 = var_storage %p.var_patt @@ -1063,30 +1488,66 @@ fn F() { // CHECK:STDOUT: %.loc11_26.4: ref %Optional.7c0 = temporary %.loc11_26.3, %.loc11_26.2 // CHECK:STDOUT: %.loc11_26.5: %Optional.7c0 = acquire_value %.loc11_26.4 // CHECK:STDOUT: %const_nullable_foo.call: init %empty_tuple.type = call imports.%const_nullable_foo.decl(%.loc11_26.5) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc11: = bound_method %.loc11_26.4, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc11: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc11(%.loc11_26.4) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc10: = bound_method %p.var, constants.%Destroy.WithSelf.Op.403171.5 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc10: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc10(%p.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc11: = bound_method %.loc11_26.4, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc11: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc11(%.loc11_26.4) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10: = bound_method %p.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10(%p.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_26.1(%self.param: ref %.c5e2) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_26.1(%self.param: ref %.c5e2) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_26.2(%self.param: ref %MaybeUnformed.9d6) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_26.1(%self.param: ref %.c5e2) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_26.1(%self.param: ref %.c5e2) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_26.2(%self.param: ref %MaybeUnformed.9ee) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_26.3(%self.param: ref %Optional.7c0) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_26.2(%self.param: ref %MaybeUnformed.9ee) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_26.2(%self.param: ref %MaybeUnformed.9ee) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_26.3(%self.param: ref %Optional.7c0) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10(%self.param: ref %const.2f4) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_26.3(%self.param: ref %Optional.7c0) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_26.3(%self.param: ref %Optional.7c0) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10(%self.param: ref %const.2f4) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10(%self.param: ref %const.2f4) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10(%self.param: ref %const.2f4) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.5(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.5(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1114,15 +1575,20 @@ fn F() { // CHECK:STDOUT: %MaybeUnformed.ddb: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.e46) [symbolic] // CHECK:STDOUT: %ptr.as.OptionalStorage.impl.Some.type.71e: type = fn_type @ptr.as.OptionalStorage.impl.Some, @ptr.as.OptionalStorage.impl(%T.67d) [symbolic] // CHECK:STDOUT: %ptr.as.OptionalStorage.impl.Some.caa: %ptr.as.OptionalStorage.impl.Some.type.71e = struct_value () [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.6c4ec3.1: = custom_witness (%Destroy.WithSelf.Op.403171.1), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.147: %Destroy.type = facet_value %ptr.13b, (%custom_witness.6c4ec3.1) [concrete] -// CHECK:STDOUT: %MaybeUnformed.9d6: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.147) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f8f19d.1: = custom_witness (%Destroy.WithSelf.Op.403171.1, %Destroy.WithSelf.SubobjectDestroy.d01daf.1, %Destroy.WithSelf.SelfDestruct.db3fdb.1), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.1a9: %Destroy.type = facet_value %ptr.13b, (%custom_witness.f8f19d.1) [concrete] +// CHECK:STDOUT: %MaybeUnformed.9ee: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.1a9) [concrete] // CHECK:STDOUT: %OptionalStorage.impl_witness.cb6: = impl_witness imports.%OptionalStorage.impl_witness_table.110, @ptr.as.OptionalStorage.impl(%ConstNullableParamS) [concrete] // CHECK:STDOUT: %.c5e2: type = maybe_unformed_type %ptr.13b [concrete] // CHECK:STDOUT: %OptionalStorage.facet.f04: %OptionalStorage.type = facet_value %ptr.13b, (%OptionalStorage.impl_witness.cb6) [concrete] // CHECK:STDOUT: %Optional.7c0: type = class_type @Optional, @Optional(%OptionalStorage.facet.f04) [concrete] +// CHECK:STDOUT: %pattern_type.567: type = pattern_type %Optional.7c0 [concrete] // CHECK:STDOUT: %const_nullable_foo.type: type = fn_type @const_nullable_foo [concrete] // CHECK:STDOUT: %const_nullable_foo: %const_nullable_foo.type = struct_value () [concrete] // CHECK:STDOUT: %ImplicitAs.type.3dc: type = facet_type <@ImplicitAs, @ImplicitAs(%Optional.7c0)> [concrete] @@ -1142,8 +1608,28 @@ fn F() { // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.34b: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%Optional.7c0, %ImplicitAs.facet.464) [concrete] // CHECK:STDOUT: %.f82: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.34b, %ImplicitAs.facet.464 [concrete] // CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %U.as_type.as.ImplicitAs.impl.Convert.a46, @U.as_type.as.ImplicitAs.impl.Convert.2(%OptionalStorage.facet.f04, %OptionalAs.facet) [concrete] +// CHECK:STDOUT: %pattern_type.07f: type = pattern_type %.c5e2 [concrete] +// CHECK:STDOUT: %self.param_patt.be1: %pattern_type.07f = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.b05: %pattern_type.07f = wrapper_binding_pattern self, %self.param_patt.be1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_26.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc11_26.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.5f4: type = pattern_type %MaybeUnformed.9ee [concrete] +// CHECK:STDOUT: %self.param_patt.815: %pattern_type.5f4 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.7da: %pattern_type.5f4 = wrapper_binding_pattern self, %self.param_patt.815 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_26.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc11_26.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.93b: %pattern_type.567 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.86d: %pattern_type.567 = wrapper_binding_pattern self, %self.param_patt.93b [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_26.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc11_26.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc11_26.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1178,6 +1664,51 @@ fn F() { // CHECK:STDOUT: %OptionalAs.impl_witness_table.2e9 = impl_witness_table (%Core.import_ref.017d8), @T.as_type.as.OptionalAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_26.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.07f = ref_param_pattern [concrete = constants.%self.param_patt.be1] +// CHECK:STDOUT: %self.patt: %pattern_type.07f = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.b05] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %.c5e2 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %.c5e2 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc11_26.1 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.07f = ref_param_pattern [concrete = constants.%self.param_patt.be1] +// CHECK:STDOUT: %self.patt: %pattern_type.07f = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.b05] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %.c5e2 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %.c5e2 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_26.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.5f4 = ref_param_pattern [concrete = constants.%self.param_patt.815] +// CHECK:STDOUT: %self.patt: %pattern_type.5f4 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.7da] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %MaybeUnformed.9ee = ref_param call_param0 +// CHECK:STDOUT: %self: ref %MaybeUnformed.9ee = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc11_26.2 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.5f4 = ref_param_pattern [concrete = constants.%self.param_patt.815] +// CHECK:STDOUT: %self.patt: %pattern_type.5f4 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.7da] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %MaybeUnformed.9ee = ref_param call_param0 +// CHECK:STDOUT: %self: ref %MaybeUnformed.9ee = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_26.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.567 = ref_param_pattern [concrete = constants.%self.param_patt.93b] +// CHECK:STDOUT: %self.patt: %pattern_type.567 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.86d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Optional.7c0 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Optional.7c0 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc11_26.3 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.567 = ref_param_pattern [concrete = constants.%self.param_patt.93b] +// CHECK:STDOUT: %self.patt: %pattern_type.567 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.86d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Optional.7c0 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Optional.7c0 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %p.var: ref %ptr.13b = var_storage %p.var_patt @@ -1208,25 +1739,52 @@ fn F() { // CHECK:STDOUT: %.loc11_26.4: ref %Optional.7c0 = temporary %.loc11_26.3, %.loc11_26.2 // CHECK:STDOUT: %.loc11_26.5: %Optional.7c0 = acquire_value %.loc11_26.4 // CHECK:STDOUT: %const_nullable_foo.call: init %empty_tuple.type = call imports.%const_nullable_foo.decl(%.loc11_26.5) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc11: = bound_method %.loc11_26.4, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc11: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc11(%.loc11_26.4) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc10: = bound_method %p.var, constants.%Destroy.WithSelf.Op.403171.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc10: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc10(%p.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc11: = bound_method %.loc11_26.4, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc11: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc11(%.loc11_26.4) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10: = bound_method %p.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10(%p.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_26.1(%self.param: ref %.c5e2) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_26.1(%self.param: ref %.c5e2) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_26.2(%self.param: ref %MaybeUnformed.9d6) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_26.1(%self.param: ref %.c5e2) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_26.1(%self.param: ref %.c5e2) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_26.2(%self.param: ref %MaybeUnformed.9ee) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_26.3(%self.param: ref %Optional.7c0) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_26.2(%self.param: ref %MaybeUnformed.9ee) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_26.2(%self.param: ref %MaybeUnformed.9ee) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_26.3(%self.param: ref %Optional.7c0) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_26.3(%self.param: ref %Optional.7c0) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_26.3(%self.param: ref %Optional.7c0) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1392,15 +1950,20 @@ fn F() { // CHECK:STDOUT: %MaybeUnformed.ddb: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.e46) [symbolic] // CHECK:STDOUT: %ptr.as.OptionalStorage.impl.Some.type.71e: type = fn_type @ptr.as.OptionalStorage.impl.Some, @ptr.as.OptionalStorage.impl(%T.67d) [symbolic] // CHECK:STDOUT: %ptr.as.OptionalStorage.impl.Some.caa: %ptr.as.OptionalStorage.impl.Some.type.71e = struct_value () [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.6c4ec3.1: = custom_witness (%Destroy.WithSelf.Op.403171.1), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.ce0: %Destroy.type = facet_value %ptr.1f0, (%custom_witness.6c4ec3.1) [concrete] -// CHECK:STDOUT: %MaybeUnformed.724: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.ce0) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f8f19d.1: = custom_witness (%Destroy.WithSelf.Op.403171.1, %Destroy.WithSelf.SubobjectDestroy.d01daf.1, %Destroy.WithSelf.SelfDestruct.db3fdb.1), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.78f: %Destroy.type = facet_value %ptr.1f0, (%custom_witness.f8f19d.1) [concrete] +// CHECK:STDOUT: %MaybeUnformed.839: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.78f) [concrete] // CHECK:STDOUT: %OptionalStorage.impl_witness.0df: = impl_witness imports.%OptionalStorage.impl_witness_table.110, @ptr.as.OptionalStorage.impl(%NullableParamS) [concrete] // CHECK:STDOUT: %.280: type = maybe_unformed_type %ptr.1f0 [concrete] // CHECK:STDOUT: %OptionalStorage.facet.8bf: %OptionalStorage.type = facet_value %ptr.1f0, (%OptionalStorage.impl_witness.0df) [concrete] // CHECK:STDOUT: %Optional.e08: type = class_type @Optional, @Optional(%OptionalStorage.facet.8bf) [concrete] +// CHECK:STDOUT: %pattern_type.f29: type = pattern_type %Optional.e08 [concrete] // CHECK:STDOUT: %nullable_param_foo.type: type = fn_type @nullable_param_foo [concrete] // CHECK:STDOUT: %nullable_param_foo: %nullable_param_foo.type = struct_value () [concrete] // CHECK:STDOUT: %ImplicitAs.type.f6b: type = facet_type <@ImplicitAs, @ImplicitAs(%Optional.e08)> [concrete] @@ -1420,10 +1983,36 @@ fn F() { // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.767: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%Optional.e08, %ImplicitAs.facet.2d4) [concrete] // CHECK:STDOUT: %.642: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.767, %ImplicitAs.facet.2d4 [concrete] // CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %U.as_type.as.ImplicitAs.impl.Convert.2e2, @U.as_type.as.ImplicitAs.impl.Convert.2(%OptionalStorage.facet.8bf, %OptionalAs.facet) [concrete] +// CHECK:STDOUT: %pattern_type.1cc: type = pattern_type %.280 [concrete] +// CHECK:STDOUT: %self.param_patt.01a: %pattern_type.1cc = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.44d: %pattern_type.1cc = wrapper_binding_pattern self, %self.param_patt.01a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_26.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc9_26.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.f71: type = pattern_type %MaybeUnformed.839 [concrete] +// CHECK:STDOUT: %self.param_patt.741: %pattern_type.f71 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.a46: %pattern_type.f71 = wrapper_binding_pattern self, %self.param_patt.741 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_26.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc9_26.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.085: %pattern_type.f29 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.d95: %pattern_type.f29 = wrapper_binding_pattern self, %self.param_patt.085 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_26.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc9_26.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9_26.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.f51: %pattern_type.c3f = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.bc4: %pattern_type.c3f = wrapper_binding_pattern self, %self.param_patt.f51 [concrete] // CHECK:STDOUT: %NullableParamS.cpp_destructor.type: type = fn_type @NullableParamS.cpp_destructor [concrete] // CHECK:STDOUT: %NullableParamS.cpp_destructor: %NullableParamS.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.5: type = fn_type @Destroy.WithSelf.Op.loc8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.5: %Destroy.WithSelf.Op.type.ef016f.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.5: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1456,6 +2045,63 @@ fn F() { // CHECK:STDOUT: %ImplicitAs.impl_witness_table.bb5 = impl_witness_table (%Core.import_ref.eb9), @U.as_type.as.ImplicitAs.impl.167 [concrete] // CHECK:STDOUT: %Core.import_ref.017d8: @T.as_type.as.OptionalAs.impl.%T.as_type.as.OptionalAs.impl.Convert.type (%T.as_type.as.OptionalAs.impl.Convert.type.774) = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, loaded [symbolic = @T.as_type.as.OptionalAs.impl.%T.as_type.as.OptionalAs.impl.Convert (constants.%T.as_type.as.OptionalAs.impl.Convert.5f9)] // CHECK:STDOUT: %OptionalAs.impl_witness_table.2e9 = impl_witness_table (%Core.import_ref.017d8), @T.as_type.as.OptionalAs.impl [concrete] +// CHECK:STDOUT: %NullableParamS.cpp_destructor.decl: %NullableParamS.cpp_destructor.type = fn_decl @NullableParamS.cpp_destructor [concrete = constants.%NullableParamS.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_26.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.1cc = ref_param_pattern [concrete = constants.%self.param_patt.01a] +// CHECK:STDOUT: %self.patt: %pattern_type.1cc = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.44d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %.280 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %.280 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc9_26.1 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.1cc = ref_param_pattern [concrete = constants.%self.param_patt.01a] +// CHECK:STDOUT: %self.patt: %pattern_type.1cc = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.44d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %.280 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %.280 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_26.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f71 = ref_param_pattern [concrete = constants.%self.param_patt.741] +// CHECK:STDOUT: %self.patt: %pattern_type.f71 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a46] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %MaybeUnformed.839 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %MaybeUnformed.839 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc9_26.2 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f71 = ref_param_pattern [concrete = constants.%self.param_patt.741] +// CHECK:STDOUT: %self.patt: %pattern_type.f71 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a46] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %MaybeUnformed.839 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %MaybeUnformed.839 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_26.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f29 = ref_param_pattern [concrete = constants.%self.param_patt.085] +// CHECK:STDOUT: %self.patt: %pattern_type.f29 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d95] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Optional.e08 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Optional.e08 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc9_26.3 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f29 = ref_param_pattern [concrete = constants.%self.param_patt.085] +// CHECK:STDOUT: %self.patt: %pattern_type.f29 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d95] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Optional.e08 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Optional.e08 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.5: %Destroy.WithSelf.Op.type.ef016f.5 = fn_decl @Destroy.WithSelf.Op.loc8 [concrete = constants.%Destroy.WithSelf.Op.403171.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.c3f = ref_param_pattern [concrete = constants.%self.param_patt.f51] +// CHECK:STDOUT: %self.patt: %pattern_type.c3f = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.bc4] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %NullableParamS = ref_param call_param0 +// CHECK:STDOUT: %self: ref %NullableParamS = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -1488,25 +2134,61 @@ fn F() { // CHECK:STDOUT: %.loc9_26.3: ref %Optional.e08 = temporary %.loc9_26.2, %.loc9_26.1 // CHECK:STDOUT: %.loc9_26.4: %Optional.e08 = acquire_value %.loc9_26.3 // CHECK:STDOUT: %nullable_param_foo.call: init %empty_tuple.type = call imports.%nullable_param_foo.decl(%.loc9_26.4) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.loc9_26.3, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%.loc9_26.3) -// CHECK:STDOUT: %NullableParamS.cpp_destructor.bound: = bound_method %s.var, constants.%NullableParamS.cpp_destructor -// CHECK:STDOUT: %NullableParamS.cpp_destructor.call: init %empty_tuple.type = call %NullableParamS.cpp_destructor.bound(%s.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc9: = bound_method %.loc9_26.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc9(%.loc9_26.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: = bound_method %s.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%s.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_26.1(%self.param: ref %.280) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_26.1(%self.param: ref %.280) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_26.2(%self.param: ref %MaybeUnformed.724) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_26.1(%self.param: ref %.280) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_26.1(%self.param: ref %.280) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_26.2(%self.param: ref %MaybeUnformed.839) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_26.3(%self.param: ref %Optional.e08) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_26.2(%self.param: ref %MaybeUnformed.839) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_26.2(%self.param: ref %MaybeUnformed.839) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_26.3(%self.param: ref %Optional.e08) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_26.3(%self.param: ref %Optional.e08) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_26.3(%self.param: ref %Optional.e08) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8(%self.param: ref %NullableParamS) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8(%self.param: ref %NullableParamS) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.5(%self.param) +// CHECK:STDOUT: %NullableParamS.cpp_destructor.call: init %empty_tuple.type = call imports.%NullableParamS.cpp_destructor.decl(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1533,22 +2215,47 @@ fn F() { // CHECK:STDOUT: %MaybeUnformed.ddb: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.e46) [symbolic] // CHECK:STDOUT: %ptr.as.OptionalStorage.impl.None.type.2a7: type = fn_type @ptr.as.OptionalStorage.impl.None, @ptr.as.OptionalStorage.impl(%T.67d) [symbolic] // CHECK:STDOUT: %ptr.as.OptionalStorage.impl.None.c23: %ptr.as.OptionalStorage.impl.None.type.2a7 = struct_value () [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.6c4ec3.1: = custom_witness (%Destroy.WithSelf.Op.403171.1), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.ce0: %Destroy.type = facet_value %ptr.1f0, (%custom_witness.6c4ec3.1) [concrete] -// CHECK:STDOUT: %MaybeUnformed.724: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.ce0) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f8f19d.1: = custom_witness (%Destroy.WithSelf.Op.403171.1, %Destroy.WithSelf.SubobjectDestroy.d01daf.1, %Destroy.WithSelf.SelfDestruct.db3fdb.1), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.78f: %Destroy.type = facet_value %ptr.1f0, (%custom_witness.f8f19d.1) [concrete] +// CHECK:STDOUT: %MaybeUnformed.839: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.78f) [concrete] // CHECK:STDOUT: %OptionalStorage.impl_witness.0df: = impl_witness imports.%OptionalStorage.impl_witness_table.110, @ptr.as.OptionalStorage.impl(%NullableParamS) [concrete] // CHECK:STDOUT: %.280: type = maybe_unformed_type %ptr.1f0 [concrete] // CHECK:STDOUT: %OptionalStorage.facet: %OptionalStorage.type = facet_value %ptr.1f0, (%OptionalStorage.impl_witness.0df) [concrete] // CHECK:STDOUT: %Optional.e08: type = class_type @Optional, @Optional(%OptionalStorage.facet) [concrete] // CHECK:STDOUT: %Optional.None.type.12d: type = fn_type @Optional.None, @Optional(%OptionalStorage.facet) [concrete] // CHECK:STDOUT: %Optional.None.82d: %Optional.None.type.12d = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.f29: type = pattern_type %Optional.e08 [concrete] // CHECK:STDOUT: %Optional.None.specific_fn: = specific_function %Optional.None.82d, @Optional.None(%OptionalStorage.facet) [concrete] // CHECK:STDOUT: %nullable_param_foo.type: type = fn_type @nullable_param_foo [concrete] // CHECK:STDOUT: %nullable_param_foo: %nullable_param_foo.type = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.1cc: type = pattern_type %.280 [concrete] +// CHECK:STDOUT: %self.param_patt.01a: %pattern_type.1cc = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.44d: %pattern_type.1cc = wrapper_binding_pattern self, %self.param_patt.01a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_66.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc8_66.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.f71: type = pattern_type %MaybeUnformed.839 [concrete] +// CHECK:STDOUT: %self.param_patt.741: %pattern_type.f71 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.a46: %pattern_type.f71 = wrapper_binding_pattern self, %self.param_patt.741 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_66.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc8_66.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.085: %pattern_type.f29 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.d95: %pattern_type.f29 = wrapper_binding_pattern self, %self.param_patt.085 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_66.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc8_66.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8_66.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1588,6 +2295,51 @@ fn F() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_66.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.1cc = ref_param_pattern [concrete = constants.%self.param_patt.01a] +// CHECK:STDOUT: %self.patt: %pattern_type.1cc = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.44d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %.280 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %.280 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc8_66.1 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.1cc = ref_param_pattern [concrete = constants.%self.param_patt.01a] +// CHECK:STDOUT: %self.patt: %pattern_type.1cc = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.44d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %.280 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %.280 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_66.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f71 = ref_param_pattern [concrete = constants.%self.param_patt.741] +// CHECK:STDOUT: %self.patt: %pattern_type.f71 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a46] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %MaybeUnformed.839 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %MaybeUnformed.839 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc8_66.2 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f71 = ref_param_pattern [concrete = constants.%self.param_patt.741] +// CHECK:STDOUT: %self.patt: %pattern_type.f71 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a46] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %MaybeUnformed.839 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %MaybeUnformed.839 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_66.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f29 = ref_param_pattern [concrete = constants.%self.param_patt.085] +// CHECK:STDOUT: %self.patt: %pattern_type.f29 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d95] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Optional.e08 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Optional.e08 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc8_66.3 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f29 = ref_param_pattern [concrete = constants.%self.param_patt.085] +// CHECK:STDOUT: %self.patt: %pattern_type.f29 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d95] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Optional.e08 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Optional.e08 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref.loc8_3: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -1608,23 +2360,50 @@ fn F() { // CHECK:STDOUT: %.loc8_66.2: ref %Optional.e08 = temporary %.loc8_66.1, %Optional.None.call // CHECK:STDOUT: %.loc8_66.3: %Optional.e08 = acquire_value %.loc8_66.2 // CHECK:STDOUT: %nullable_param_foo.call: init %empty_tuple.type = call imports.%nullable_param_foo.decl(%.loc8_66.3) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.loc8_66.2, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%.loc8_66.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc8_66.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc8_66.2) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_66.1(%self.param: ref %.280) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_66.1(%self.param: ref %.280) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_66.2(%self.param: ref %MaybeUnformed.724) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_66.1(%self.param: ref %.280) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_66.1(%self.param: ref %.280) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_66.2(%self.param: ref %MaybeUnformed.839) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_66.3(%self.param: ref %Optional.e08) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_66.2(%self.param: ref %MaybeUnformed.839) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_66.2(%self.param: ref %MaybeUnformed.839) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_66.3(%self.param: ref %Optional.e08) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_66.3(%self.param: ref %Optional.e08) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_66.3(%self.param: ref %Optional.e08) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1657,24 +2436,55 @@ fn F() { // CHECK:STDOUT: %MaybeUnformed.ddb: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.e46) [symbolic] // CHECK:STDOUT: %ptr.as.OptionalStorage.impl.Some.type.71e: type = fn_type @ptr.as.OptionalStorage.impl.Some, @ptr.as.OptionalStorage.impl(%T.67d) [symbolic] // CHECK:STDOUT: %ptr.as.OptionalStorage.impl.Some.caa: %ptr.as.OptionalStorage.impl.Some.type.71e = struct_value () [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.6c4ec3.1: = custom_witness (%Destroy.WithSelf.Op.403171.1), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.ce0: %Destroy.type = facet_value %ptr.1f0, (%custom_witness.6c4ec3.1) [concrete] -// CHECK:STDOUT: %MaybeUnformed.724: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.ce0) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f8f19d.1: = custom_witness (%Destroy.WithSelf.Op.403171.1, %Destroy.WithSelf.SubobjectDestroy.d01daf.1, %Destroy.WithSelf.SelfDestruct.db3fdb.1), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.78f: %Destroy.type = facet_value %ptr.1f0, (%custom_witness.f8f19d.1) [concrete] +// CHECK:STDOUT: %MaybeUnformed.839: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.78f) [concrete] // CHECK:STDOUT: %OptionalStorage.impl_witness.0df: = impl_witness imports.%OptionalStorage.impl_witness_table.110, @ptr.as.OptionalStorage.impl(%NullableParamS) [concrete] // CHECK:STDOUT: %.280: type = maybe_unformed_type %ptr.1f0 [concrete] // CHECK:STDOUT: %OptionalStorage.facet: %OptionalStorage.type = facet_value %ptr.1f0, (%OptionalStorage.impl_witness.0df) [concrete] // CHECK:STDOUT: %Optional.e08: type = class_type @Optional, @Optional(%OptionalStorage.facet) [concrete] // CHECK:STDOUT: %Optional.Some.type.129: type = fn_type @Optional.Some, @Optional(%OptionalStorage.facet) [concrete] // CHECK:STDOUT: %Optional.Some.399: %Optional.Some.type.129 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.f29: type = pattern_type %Optional.e08 [concrete] // CHECK:STDOUT: %Optional.Some.specific_fn: = specific_function %Optional.Some.399, @Optional.Some(%OptionalStorage.facet) [concrete] // CHECK:STDOUT: %nullable_param_foo.type: type = fn_type @nullable_param_foo [concrete] // CHECK:STDOUT: %nullable_param_foo: %nullable_param_foo.type = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.1cc: type = pattern_type %.280 [concrete] +// CHECK:STDOUT: %self.param_patt.01a: %pattern_type.1cc = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.44d: %pattern_type.1cc = wrapper_binding_pattern self, %self.param_patt.01a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_68.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc9_68.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.f71: type = pattern_type %MaybeUnformed.839 [concrete] +// CHECK:STDOUT: %self.param_patt.741: %pattern_type.f71 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.a46: %pattern_type.f71 = wrapper_binding_pattern self, %self.param_patt.741 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_68.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc9_68.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.085: %pattern_type.f29 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.d95: %pattern_type.f29 = wrapper_binding_pattern self, %self.param_patt.085 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_68.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc9_68.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9_68.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.f51: %pattern_type.c3f = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.bc4: %pattern_type.c3f = wrapper_binding_pattern self, %self.param_patt.f51 [concrete] // CHECK:STDOUT: %NullableParamS.cpp_destructor.type: type = fn_type @NullableParamS.cpp_destructor [concrete] // CHECK:STDOUT: %NullableParamS.cpp_destructor: %NullableParamS.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.5: type = fn_type @Destroy.WithSelf.Op.loc8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.5: %Destroy.WithSelf.Op.type.ef016f.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.5: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1712,6 +2522,63 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/destroy, Destroy, loaded [concrete = constants.%Destroy.type] +// CHECK:STDOUT: %NullableParamS.cpp_destructor.decl: %NullableParamS.cpp_destructor.type = fn_decl @NullableParamS.cpp_destructor [concrete = constants.%NullableParamS.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_68.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.1cc = ref_param_pattern [concrete = constants.%self.param_patt.01a] +// CHECK:STDOUT: %self.patt: %pattern_type.1cc = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.44d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %.280 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %.280 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc9_68.1 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.1cc = ref_param_pattern [concrete = constants.%self.param_patt.01a] +// CHECK:STDOUT: %self.patt: %pattern_type.1cc = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.44d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %.280 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %.280 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_68.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f71 = ref_param_pattern [concrete = constants.%self.param_patt.741] +// CHECK:STDOUT: %self.patt: %pattern_type.f71 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a46] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %MaybeUnformed.839 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %MaybeUnformed.839 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc9_68.2 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f71 = ref_param_pattern [concrete = constants.%self.param_patt.741] +// CHECK:STDOUT: %self.patt: %pattern_type.f71 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a46] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %MaybeUnformed.839 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %MaybeUnformed.839 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_68.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f29 = ref_param_pattern [concrete = constants.%self.param_patt.085] +// CHECK:STDOUT: %self.patt: %pattern_type.f29 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d95] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Optional.e08 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Optional.e08 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc9_68.3 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f29 = ref_param_pattern [concrete = constants.%self.param_patt.085] +// CHECK:STDOUT: %self.patt: %pattern_type.f29 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d95] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Optional.e08 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Optional.e08 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.5: %Destroy.WithSelf.Op.type.ef016f.5 = fn_decl @Destroy.WithSelf.Op.loc8 [concrete = constants.%Destroy.WithSelf.Op.403171.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.c3f = ref_param_pattern [concrete = constants.%self.param_patt.f51] +// CHECK:STDOUT: %self.patt: %pattern_type.c3f = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.bc4] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %NullableParamS = ref_param call_param0 +// CHECK:STDOUT: %self: ref %NullableParamS = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -1754,25 +2621,61 @@ fn F() { // CHECK:STDOUT: %.loc9_68.4: ref %Optional.e08 = temporary %.loc9_68.3, %Optional.Some.call // CHECK:STDOUT: %.loc9_68.5: %Optional.e08 = acquire_value %.loc9_68.4 // CHECK:STDOUT: %nullable_param_foo.call: init %empty_tuple.type = call imports.%nullable_param_foo.decl(%.loc9_68.5) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.loc9_68.4, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%.loc9_68.4) -// CHECK:STDOUT: %NullableParamS.cpp_destructor.bound: = bound_method %s.var, constants.%NullableParamS.cpp_destructor -// CHECK:STDOUT: %NullableParamS.cpp_destructor.call: init %empty_tuple.type = call %NullableParamS.cpp_destructor.bound(%s.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc9: = bound_method %.loc9_68.4, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc9(%.loc9_68.4) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: = bound_method %s.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%s.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_68.1(%self.param: ref %.280) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_68.1(%self.param: ref %.280) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_68.2(%self.param: ref %MaybeUnformed.724) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_68.1(%self.param: ref %.280) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_68.1(%self.param: ref %.280) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_68.2(%self.param: ref %MaybeUnformed.839) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_68.3(%self.param: ref %Optional.e08) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_68.2(%self.param: ref %MaybeUnformed.839) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_68.2(%self.param: ref %MaybeUnformed.839) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_68.3(%self.param: ref %Optional.e08) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_68.3(%self.param: ref %Optional.e08) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_68.3(%self.param: ref %Optional.e08) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8(%self.param: ref %NullableParamS) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8(%self.param: ref %NullableParamS) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.5(%self.param) +// CHECK:STDOUT: %NullableParamS.cpp_destructor.call: init %empty_tuple.type = call imports.%NullableParamS.cpp_destructor.decl(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1794,21 +2697,46 @@ fn F() { // CHECK:STDOUT: %Destroy.lookup_impl_witness.781: = lookup_impl_witness %ptr.e8f, @Destroy [symbolic] // CHECK:STDOUT: %Destroy.facet.e46: %Destroy.type = facet_value %ptr.e8f, (%Destroy.lookup_impl_witness.781) [symbolic] // CHECK:STDOUT: %MaybeUnformed.ddb: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.e46) [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.6c4ec3.1: = custom_witness (%Destroy.WithSelf.Op.403171.1), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.ce0: %Destroy.type = facet_value %ptr.1f0, (%custom_witness.6c4ec3.1) [concrete] -// CHECK:STDOUT: %MaybeUnformed.724: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.ce0) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f8f19d.1: = custom_witness (%Destroy.WithSelf.Op.403171.1, %Destroy.WithSelf.SubobjectDestroy.d01daf.1, %Destroy.WithSelf.SelfDestruct.db3fdb.1), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.78f: %Destroy.type = facet_value %ptr.1f0, (%custom_witness.f8f19d.1) [concrete] +// CHECK:STDOUT: %MaybeUnformed.839: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.78f) [concrete] // CHECK:STDOUT: %OptionalStorage.impl_witness.0df: = impl_witness imports.%OptionalStorage.impl_witness_table.110, @ptr.as.OptionalStorage.impl(%NullableParamS) [concrete] // CHECK:STDOUT: %.280: type = maybe_unformed_type %ptr.1f0 [concrete] // CHECK:STDOUT: %OptionalStorage.facet: %OptionalStorage.type = facet_value %ptr.1f0, (%OptionalStorage.impl_witness.0df) [concrete] // CHECK:STDOUT: %Optional.e08: type = class_type @Optional, @Optional(%OptionalStorage.facet) [concrete] +// CHECK:STDOUT: %pattern_type.f29: type = pattern_type %Optional.e08 [concrete] // CHECK:STDOUT: %nullable_param_get.type: type = fn_type @nullable_param_get [concrete] // CHECK:STDOUT: %nullable_param_get: %nullable_param_get.type = struct_value () [concrete] // CHECK:STDOUT: %nullable_param_foo.type: type = fn_type @nullable_param_foo [concrete] // CHECK:STDOUT: %nullable_param_foo: %nullable_param_foo.type = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.1cc: type = pattern_type %.280 [concrete] +// CHECK:STDOUT: %self.param_patt.01a: %pattern_type.1cc = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.44d: %pattern_type.1cc = wrapper_binding_pattern self, %self.param_patt.01a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_49.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc8_49.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.f71: type = pattern_type %MaybeUnformed.839 [concrete] +// CHECK:STDOUT: %self.param_patt.741: %pattern_type.f71 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.a46: %pattern_type.f71 = wrapper_binding_pattern self, %self.param_patt.741 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_49.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc8_49.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.085: %pattern_type.f29 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.d95: %pattern_type.f29 = wrapper_binding_pattern self, %self.param_patt.085 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_49.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc8_49.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8_49.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1847,6 +2775,51 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_49.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.1cc = ref_param_pattern [concrete = constants.%self.param_patt.01a] +// CHECK:STDOUT: %self.patt: %pattern_type.1cc = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.44d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %.280 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %.280 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc8_49.1 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.1cc = ref_param_pattern [concrete = constants.%self.param_patt.01a] +// CHECK:STDOUT: %self.patt: %pattern_type.1cc = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.44d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %.280 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %.280 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_49.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f71 = ref_param_pattern [concrete = constants.%self.param_patt.741] +// CHECK:STDOUT: %self.patt: %pattern_type.f71 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a46] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %MaybeUnformed.839 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %MaybeUnformed.839 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc8_49.2 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f71 = ref_param_pattern [concrete = constants.%self.param_patt.741] +// CHECK:STDOUT: %self.patt: %pattern_type.f71 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a46] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %MaybeUnformed.839 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %MaybeUnformed.839 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_49.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f29 = ref_param_pattern [concrete = constants.%self.param_patt.085] +// CHECK:STDOUT: %self.patt: %pattern_type.f29 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d95] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Optional.e08 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Optional.e08 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc8_49.3 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f29 = ref_param_pattern [concrete = constants.%self.param_patt.085] +// CHECK:STDOUT: %self.patt: %pattern_type.f29 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d95] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Optional.e08 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Optional.e08 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref.loc8_3: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -1858,23 +2831,50 @@ fn F() { // CHECK:STDOUT: %.loc8_49.2: ref %Optional.e08 = temporary %.loc8_49.1, %nullable_param_get.call // CHECK:STDOUT: %.loc8_49.3: %Optional.e08 = acquire_value %.loc8_49.2 // CHECK:STDOUT: %nullable_param_foo.call: init %empty_tuple.type = call imports.%nullable_param_foo.decl(%.loc8_49.3) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.loc8_49.2, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%.loc8_49.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc8_49.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc8_49.2) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_49.1(%self.param: ref %.280) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_49.1(%self.param: ref %.280) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_49.2(%self.param: ref %MaybeUnformed.724) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_49.1(%self.param: ref %.280) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_49.1(%self.param: ref %.280) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_49.2(%self.param: ref %MaybeUnformed.839) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_49.3(%self.param: ref %Optional.e08) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_49.2(%self.param: ref %MaybeUnformed.839) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_49.2(%self.param: ref %MaybeUnformed.839) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_49.3(%self.param: ref %Optional.e08) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_49.3(%self.param: ref %Optional.e08) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_49.3(%self.param: ref %Optional.e08) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1897,8 +2897,14 @@ fn F() { // CHECK:STDOUT: %deduced_any_foo.cpp_overload_set.value: %deduced_any_foo.cpp_overload_set.type = cpp_overload_set_value @deduced_any_foo.cpp_overload_set [concrete] // CHECK:STDOUT: %deduced_any_foo.type: type = fn_type @deduced_any_foo [concrete] // CHECK:STDOUT: %deduced_any_foo: %deduced_any_foo.type = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.77c: %pattern_type.1ad = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.9c7: %pattern_type.1ad = wrapper_binding_pattern self, %self.param_patt.77c [concrete] // CHECK:STDOUT: %DeducedAnyS.cpp_destructor.type: type = fn_type @DeducedAnyS.cpp_destructor [concrete] // CHECK:STDOUT: %DeducedAnyS.cpp_destructor: %DeducedAnyS.cpp_destructor.type = struct_value () [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.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1914,6 +2920,21 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } +// CHECK:STDOUT: %DeducedAnyS.cpp_destructor.decl: %DeducedAnyS.cpp_destructor.type = fn_decl @DeducedAnyS.cpp_destructor [concrete = constants.%DeducedAnyS.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// 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.1ad = ref_param_pattern [concrete = constants.%self.param_patt.77c] +// CHECK:STDOUT: %self.patt: %pattern_type.1ad = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.9c7] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %DeducedAnyS = ref_param call_param0 +// CHECK:STDOUT: %self: ref %DeducedAnyS = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -1948,11 +2969,20 @@ fn F() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %p.patt: %pattern_type.060 = value_binding_pattern p [concrete = constants.%p.patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %DeducedAnyS.cpp_destructor.bound: = bound_method %s.var, constants.%DeducedAnyS.cpp_destructor -// CHECK:STDOUT: %DeducedAnyS.cpp_destructor.call: init %empty_tuple.type = call %DeducedAnyS.cpp_destructor.bound(%s.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %s.var, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%s.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8(%self.param: ref %DeducedAnyS) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8(%self.param: ref %DeducedAnyS) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param) +// CHECK:STDOUT: %DeducedAnyS.cpp_destructor.call: init %empty_tuple.type = call imports.%DeducedAnyS.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- import_deduced_pointer_param_as_pointer.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -1980,11 +3010,15 @@ fn F() { // CHECK:STDOUT: %MaybeUnformed.ddb: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.e46) [symbolic] // CHECK:STDOUT: %ptr.as.OptionalStorage.impl.Some.type.71e: type = fn_type @ptr.as.OptionalStorage.impl.Some, @ptr.as.OptionalStorage.impl(%T.67d) [symbolic] // CHECK:STDOUT: %ptr.as.OptionalStorage.impl.Some.caa: %ptr.as.OptionalStorage.impl.Some.type.71e = struct_value () [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.6c4ec3.1: = custom_witness (%Destroy.WithSelf.Op.403171.1), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.0ae: %Destroy.type = facet_value %ptr.6cb, (%custom_witness.6c4ec3.1) [concrete] -// CHECK:STDOUT: %MaybeUnformed.115: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.0ae) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f8f19d.1: = custom_witness (%Destroy.WithSelf.Op.403171.1, %Destroy.WithSelf.SubobjectDestroy.d01daf.1, %Destroy.WithSelf.SelfDestruct.db3fdb.1), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.26b: %Destroy.type = facet_value %ptr.6cb, (%custom_witness.f8f19d.1) [concrete] +// CHECK:STDOUT: %MaybeUnformed.f45: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.26b) [concrete] // CHECK:STDOUT: %OptionalStorage.impl_witness.5d7: = impl_witness imports.%OptionalStorage.impl_witness_table.110, @ptr.as.OptionalStorage.impl(%DeducedPointerS) [concrete] // CHECK:STDOUT: %.fb1: type = maybe_unformed_type %ptr.6cb [concrete] // CHECK:STDOUT: %OptionalStorage.facet.822: %OptionalStorage.type = facet_value %ptr.6cb, (%OptionalStorage.impl_witness.5d7) [concrete] @@ -2011,16 +3045,43 @@ fn F() { // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.8a9: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%Optional.1ac, %ImplicitAs.facet.032) [concrete] // CHECK:STDOUT: %.96f: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.8a9, %ImplicitAs.facet.032 [concrete] // CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %U.as_type.as.ImplicitAs.impl.Convert.8c6, @U.as_type.as.ImplicitAs.impl.Convert.2(%OptionalStorage.facet.822, %OptionalAs.facet) [concrete] +// CHECK:STDOUT: %pattern_type.50c: type = pattern_type %.fb1 [concrete] +// CHECK:STDOUT: %self.param_patt.919: %pattern_type.50c = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.02a: %pattern_type.50c = wrapper_binding_pattern self, %self.param_patt.919 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_14.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc11_14.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.30e: type = pattern_type %MaybeUnformed.f45 [concrete] +// CHECK:STDOUT: %self.param_patt.d68: %pattern_type.30e = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.c9e: %pattern_type.30e = wrapper_binding_pattern self, %self.param_patt.d68 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_14.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc11_14.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.db8: %pattern_type.548 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.09e: %pattern_type.548 = wrapper_binding_pattern self, %self.param_patt.db8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_14.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc11_14.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc11_14.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] // CHECK:STDOUT: %a.patt: %pattern_type.548 = value_binding_pattern a [concrete] // CHECK:STDOUT: %Indirect.cpp_overload_set.type: type = cpp_overload_set_type @Indirect.cpp_overload_set [concrete] // CHECK:STDOUT: %Indirect.cpp_overload_set.value: %Indirect.cpp_overload_set.type = cpp_overload_set_value @Indirect.cpp_overload_set [concrete] // CHECK:STDOUT: %Indirect__carbon_thunk.type: type = fn_type @Indirect__carbon_thunk [concrete] // CHECK:STDOUT: %Indirect__carbon_thunk: %Indirect__carbon_thunk.type = struct_value () [concrete] // CHECK:STDOUT: %.dc4: ref %DeducedPointerS = temporary invalid, %DeducedPointerS.val [concrete] +// CHECK:STDOUT: %self.param_patt.5f8: %pattern_type.36d = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.a59: %pattern_type.36d = wrapper_binding_pattern self, %self.param_patt.5f8 [concrete] // CHECK:STDOUT: %DeducedPointerS.cpp_destructor.type: type = fn_type @DeducedPointerS.cpp_destructor [concrete] // CHECK:STDOUT: %DeducedPointerS.cpp_destructor: %DeducedPointerS.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.5: type = fn_type @Destroy.WithSelf.Op.loc13 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.5: %Destroy.WithSelf.Op.type.ef016f.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5: type = fn_type @Destroy.WithSelf.SelfDestruct.loc13 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.5: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.dc4, %Destroy.WithSelf.SelfDestruct.db3fdb.5 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -2076,6 +3137,63 @@ fn F() { // CHECK:STDOUT: %Optional: type = class_type @Optional, @Optional(constants.%OptionalStorage.facet.822) [concrete = constants.%Optional.1ac] // CHECK:STDOUT: // CHECK:STDOUT: } +// CHECK:STDOUT: %DeducedPointerS.cpp_destructor.decl: %DeducedPointerS.cpp_destructor.type = fn_decl @DeducedPointerS.cpp_destructor [concrete = constants.%DeducedPointerS.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_14.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.50c = ref_param_pattern [concrete = constants.%self.param_patt.919] +// CHECK:STDOUT: %self.patt: %pattern_type.50c = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.02a] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %.fb1 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %.fb1 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc11_14.1 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.50c = ref_param_pattern [concrete = constants.%self.param_patt.919] +// CHECK:STDOUT: %self.patt: %pattern_type.50c = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.02a] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %.fb1 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %.fb1 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_14.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.30e = ref_param_pattern [concrete = constants.%self.param_patt.d68] +// CHECK:STDOUT: %self.patt: %pattern_type.30e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.c9e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %MaybeUnformed.f45 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %MaybeUnformed.f45 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc11_14.2 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.30e = ref_param_pattern [concrete = constants.%self.param_patt.d68] +// CHECK:STDOUT: %self.patt: %pattern_type.30e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.c9e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %MaybeUnformed.f45 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %MaybeUnformed.f45 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_14.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.548 = ref_param_pattern [concrete = constants.%self.param_patt.db8] +// CHECK:STDOUT: %self.patt: %pattern_type.548 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.09e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Optional.1ac = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Optional.1ac = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc11_14.3 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.548 = ref_param_pattern [concrete = constants.%self.param_patt.db8] +// CHECK:STDOUT: %self.patt: %pattern_type.548 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.09e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Optional.1ac = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Optional.1ac = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.5: %Destroy.WithSelf.Op.type.ef016f.5 = fn_decl @Destroy.WithSelf.Op.loc13 [concrete = constants.%Destroy.WithSelf.Op.403171.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.36d = ref_param_pattern [concrete = constants.%self.param_patt.5f8] +// CHECK:STDOUT: %self.patt: %pattern_type.36d = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a59] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %DeducedPointerS = ref_param call_param0 +// CHECK:STDOUT: %self: ref %DeducedPointerS = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -2108,8 +3226,8 @@ fn F() { // CHECK:STDOUT: %.loc11_14.3: ref %Optional.1ac = temporary %.loc11_14.2, %.loc11_14.1 // CHECK:STDOUT: %.loc11_14.4: %Optional.1ac = acquire_value %.loc11_14.3 // CHECK:STDOUT: %Direct.call: init %Optional.1ac = call imports.%Direct.decl(%.loc11_14.4) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc11: = bound_method %.loc11_14.3, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc11: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc11(%.loc11_14.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc11: = bound_method %.loc11_14.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc11: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc11(%.loc11_14.3) // CHECK:STDOUT: %Cpp.ref.loc13_55: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %Indirect.ref: %Indirect.cpp_overload_set.type = name_ref Indirect, imports.%Indirect.cpp_overload_set.value [concrete = constants.%Indirect.cpp_overload_set.value] // CHECK:STDOUT: %.loc13_69.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] @@ -2140,25 +3258,62 @@ fn F() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %a.patt: %pattern_type.548 = value_binding_pattern a [concrete = constants.%a.patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc13: = bound_method %.loc13_93.2, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc13: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc13(%.loc13_93.2) -// CHECK:STDOUT: %DeducedPointerS.cpp_destructor.bound: = bound_method %s.var, constants.%DeducedPointerS.cpp_destructor -// CHECK:STDOUT: %DeducedPointerS.cpp_destructor.call: init %empty_tuple.type = call %DeducedPointerS.cpp_destructor.bound(%s.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc13: = bound_method %.loc13_93.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc13_93: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc13(%.loc13_93.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc13_71: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.dc4) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10: = bound_method %s.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10(%s.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_14.1(%self.param: ref %.fb1) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_14.1(%self.param: ref %.fb1) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_14.2(%self.param: ref %MaybeUnformed.115) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_14.1(%self.param: ref %.fb1) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_14.1(%self.param: ref %.fb1) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_14.2(%self.param: ref %MaybeUnformed.f45) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_14.3(%self.param: ref %Optional.1ac) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_14.2(%self.param: ref %MaybeUnformed.f45) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_14.2(%self.param: ref %MaybeUnformed.f45) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_14.3(%self.param: ref %Optional.1ac) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_14.3(%self.param: ref %Optional.1ac) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_14.3(%self.param: ref %Optional.1ac) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc13(%self.param: ref %DeducedPointerS) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc13(%self.param: ref %DeducedPointerS) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.5(%self.param) +// CHECK:STDOUT: %DeducedPointerS.cpp_destructor.call: init %empty_tuple.type = call imports.%DeducedPointerS.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/function/import/qualified_param.carbon b/toolchain/check/testdata/interop/cpp/function/import/qualified_param.carbon index 7ccd59b67198..e501380ea119 100644 --- a/toolchain/check/testdata/interop/cpp/function/import/qualified_param.carbon +++ b/toolchain/check/testdata/interop/cpp/function/import/qualified_param.carbon @@ -73,8 +73,14 @@ fn F() { // CHECK:STDOUT: %TakesConstS__carbon_thunk.type: type = fn_type @TakesConstS__carbon_thunk [concrete] // CHECK:STDOUT: %TakesConstS__carbon_thunk: %TakesConstS__carbon_thunk.type = struct_value () [concrete] // CHECK:STDOUT: %ptr.037: type = ptr_type %S [concrete] +// CHECK:STDOUT: %self.param_patt.63c: %pattern_type.0f5 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.a18: %pattern_type.0f5 = wrapper_binding_pattern self, %self.param_patt.63c [concrete] // CHECK:STDOUT: %S.cpp_destructor.type: type = fn_type @S.cpp_destructor [concrete] // CHECK:STDOUT: %S.cpp_destructor: %S.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc10 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -99,6 +105,21 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } +// CHECK:STDOUT: %S.cpp_destructor.decl: %S.cpp_destructor.type = fn_decl @S.cpp_destructor [concrete = constants.%S.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc10 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.0f5 = ref_param_pattern [concrete = constants.%self.param_patt.63c] +// CHECK:STDOUT: %self.patt: %pattern_type.0f5 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a18] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %S = ref_param call_param0 +// CHECK:STDOUT: %self: ref %S = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -137,8 +158,17 @@ fn F() { // CHECK:STDOUT: %.loc11_20.1: %ptr.711 = as_compatible %addr // CHECK:STDOUT: %.loc11_20.2: %ptr.711 = converted %addr, %.loc11_20.1 // CHECK:STDOUT: %TakesConstS__carbon_thunk.call: init %empty_tuple.type = call imports.%TakesConstS__carbon_thunk.decl(%.loc11_20.2) -// CHECK:STDOUT: %S.cpp_destructor.bound: = bound_method %s.var, constants.%S.cpp_destructor -// CHECK:STDOUT: %S.cpp_destructor.call: init %empty_tuple.type = call %S.cpp_destructor.bound(%s.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %s.var, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%s.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10(%self.param: ref %S) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10(%self.param: ref %S) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param) +// CHECK:STDOUT: %S.cpp_destructor.call: init %empty_tuple.type = call imports.%S.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/function/import/reference.carbon b/toolchain/check/testdata/interop/cpp/function/import/reference.carbon index 205471af5991..8282f159f522 100644 --- a/toolchain/check/testdata/interop/cpp/function/import/reference.carbon +++ b/toolchain/check/testdata/interop/cpp/function/import/reference.carbon @@ -498,8 +498,14 @@ fn PassConstRef(ref x: const XByRef) { // CHECK:STDOUT: %TakesLValue.cpp_overload_set.value: %TakesLValue.cpp_overload_set.type = cpp_overload_set_value @TakesLValue.cpp_overload_set [concrete] // CHECK:STDOUT: %TakesLValue.type: type = fn_type @TakesLValue [concrete] // CHECK:STDOUT: %TakesLValue: %TakesLValue.type = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.63c: %pattern_type.0f5 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.a18: %pattern_type.0f5 = wrapper_binding_pattern self, %self.param_patt.63c [concrete] // CHECK:STDOUT: %S.cpp_destructor.type: type = fn_type @S.cpp_destructor [concrete] // CHECK:STDOUT: %S.cpp_destructor: %S.cpp_destructor.type = struct_value () [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.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -515,6 +521,21 @@ fn PassConstRef(ref x: const XByRef) { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } +// CHECK:STDOUT: %S.cpp_destructor.decl: %S.cpp_destructor.type = fn_decl @S.cpp_destructor [concrete = constants.%S.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// 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.0f5 = ref_param_pattern [concrete = constants.%self.param_patt.63c] +// CHECK:STDOUT: %self.patt: %pattern_type.0f5 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a18] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %S = ref_param call_param0 +// CHECK:STDOUT: %self: ref %S = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -538,11 +559,20 @@ fn PassConstRef(ref x: const XByRef) { // CHECK:STDOUT: %s.ref: ref %S = name_ref s, %s // CHECK:STDOUT: %.loc9: %S = ref_tag %s.ref // CHECK:STDOUT: %TakesLValue.call: init %empty_tuple.type = call imports.%TakesLValue.decl(%s.ref) -// CHECK:STDOUT: %S.cpp_destructor.bound: = bound_method %s.var, constants.%S.cpp_destructor -// CHECK:STDOUT: %S.cpp_destructor.call: init %empty_tuple.type = call %S.cpp_destructor.bound(%s.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %s.var, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%s.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8(%self.param: ref %S) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8(%self.param: ref %S) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param) +// CHECK:STDOUT: %S.cpp_destructor.call: init %empty_tuple.type = call imports.%S.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_param_lvalue_ref.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -579,10 +609,22 @@ fn PassConstRef(ref x: const XByRef) { // CHECK:STDOUT: %DefaultOrUnformed.facet.0be: %DefaultOrUnformed.type = facet_value %T.ed0, (%DefaultOrUnformed.impl_witness.8f2) [concrete] // CHECK:STDOUT: %u.patt: %pattern_type.0f5 = ref_binding_pattern u [concrete] // CHECK:STDOUT: %u.var_patt: %pattern_type.0f5 = var_pattern %u.patt [concrete] +// CHECK:STDOUT: %self.param_patt.63c: %pattern_type.0f5 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.a18: %pattern_type.0f5 = wrapper_binding_pattern self, %self.param_patt.63c [concrete] // CHECK:STDOUT: %S.cpp_destructor.type: type = fn_type @S.cpp_destructor [concrete] // CHECK:STDOUT: %S.cpp_destructor: %S.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc41 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc41 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.0e6: %pattern_type.5f6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.eb3: %pattern_type.5f6 = wrapper_binding_pattern self, %self.param_patt.0e6 [concrete] // CHECK:STDOUT: %T.cpp_destructor.type: type = fn_type @T.cpp_destructor [concrete] // CHECK:STDOUT: %T.cpp_destructor: %T.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc30 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc30 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -597,6 +639,33 @@ fn PassConstRef(ref x: const XByRef) { // CHECK:STDOUT: %DefaultOrUnformed.impl_witness_table.162 = impl_witness_table (%Core.import_ref.c2f), @T.as_type.as.DefaultOrUnformed.impl [concrete] // CHECK:STDOUT: %TakesLValue.cpp_overload_set.value: %TakesLValue.cpp_overload_set.type = cpp_overload_set_value @TakesLValue.cpp_overload_set [concrete = constants.%TakesLValue.cpp_overload_set.value] // CHECK:STDOUT: %T.decl: type = class_decl @T [concrete = constants.%T.ed0] {} {} +// CHECK:STDOUT: %S.cpp_destructor.decl: %S.cpp_destructor.type = fn_decl @S.cpp_destructor [concrete = constants.%S.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: %T.cpp_destructor.decl: %T.cpp_destructor.type = fn_decl @T.cpp_destructor [concrete = constants.%T.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc41 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.0f5 = ref_param_pattern [concrete = constants.%self.param_patt.63c] +// CHECK:STDOUT: %self.patt: %pattern_type.0f5 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a18] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %S = ref_param call_param0 +// CHECK:STDOUT: %self: ref %S = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc30 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.5f6 = ref_param_pattern [concrete = constants.%self.param_patt.0e6] +// CHECK:STDOUT: %self.patt: %pattern_type.5f6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.eb3] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %T.ed0 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %T.ed0 = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -687,15 +756,33 @@ fn PassConstRef(ref x: const XByRef) { // CHECK:STDOUT: %const.loc50: type = const_type %S.ref.loc50 [concrete = constants.%const] // CHECK:STDOUT: %.loc50_21.1: ref %const = as_compatible %u.ref // CHECK:STDOUT: %.loc50_21.2: ref %const = converted %u.ref, %.loc50_21.1 -// CHECK:STDOUT: %S.cpp_destructor.bound.loc41: = bound_method %u.var, constants.%S.cpp_destructor -// CHECK:STDOUT: %S.cpp_destructor.call.loc41: init %empty_tuple.type = call %S.cpp_destructor.bound.loc41(%u.var) -// CHECK:STDOUT: %T.cpp_destructor.bound: = bound_method %t.var, constants.%T.cpp_destructor -// CHECK:STDOUT: %T.cpp_destructor.call: init %empty_tuple.type = call %T.cpp_destructor.bound(%t.var) -// CHECK:STDOUT: %S.cpp_destructor.bound.loc8: = bound_method %v.var, constants.%S.cpp_destructor -// CHECK:STDOUT: %S.cpp_destructor.call.loc8: init %empty_tuple.type = call %S.cpp_destructor.bound.loc8(%v.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc41: = bound_method %u.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc41: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc41(%u.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc30: = bound_method %t.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc30: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc30(%t.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: = bound_method %v.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%v.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc41(%self.param: ref %S) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc41(%self.param: ref %S) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %S.cpp_destructor.call: init %empty_tuple.type = call imports.%S.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc30(%self.param: ref %T.ed0) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc30(%self.param: ref %T.ed0) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %T.cpp_destructor.call: init %empty_tuple.type = call imports.%T.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- call_param_rvalue_ref.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -780,10 +867,22 @@ fn PassConstRef(ref x: const XByRef) { // CHECK:STDOUT: %S.val: %S = struct_value () [concrete] // CHECK:STDOUT: %const: type = const_type %S [concrete] // CHECK:STDOUT: %empty_struct.674: %const = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.0e6: %pattern_type.5f6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.eb3: %pattern_type.5f6 = wrapper_binding_pattern self, %self.param_patt.0e6 [concrete] // CHECK:STDOUT: %T.cpp_destructor.type: type = fn_type @T.cpp_destructor [concrete] // CHECK:STDOUT: %T.cpp_destructor: %T.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc19 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc19 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.63c: %pattern_type.0f5 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.a18: %pattern_type.0f5 = wrapper_binding_pattern self, %self.param_patt.63c [concrete] // CHECK:STDOUT: %S.cpp_destructor.type: type = fn_type @S.cpp_destructor [concrete] // CHECK:STDOUT: %S.cpp_destructor: %S.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -798,6 +897,33 @@ fn PassConstRef(ref x: const XByRef) { // CHECK:STDOUT: %DefaultOrUnformed.impl_witness_table.162 = impl_witness_table (%Core.import_ref.c2f), @T.as_type.as.DefaultOrUnformed.impl [concrete] // CHECK:STDOUT: %TakesRValue.cpp_overload_set.value: %TakesRValue.cpp_overload_set.type = cpp_overload_set_value @TakesRValue.cpp_overload_set [concrete = constants.%TakesRValue.cpp_overload_set.value] // CHECK:STDOUT: %T.decl: type = class_decl @T [concrete = constants.%T.ed0] {} {} +// CHECK:STDOUT: %T.cpp_destructor.decl: %T.cpp_destructor.type = fn_decl @T.cpp_destructor [concrete = constants.%T.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: %S.cpp_destructor.decl: %S.cpp_destructor.type = fn_decl @S.cpp_destructor [concrete = constants.%S.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc19 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.5f6 = ref_param_pattern [concrete = constants.%self.param_patt.0e6] +// CHECK:STDOUT: %self.patt: %pattern_type.5f6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.eb3] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %T.ed0 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %T.ed0 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc8 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.0f5 = ref_param_pattern [concrete = constants.%self.param_patt.63c] +// CHECK:STDOUT: %self.patt: %pattern_type.0f5 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a18] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %S = ref_param call_param0 +// CHECK:STDOUT: %self: ref %S = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -857,13 +983,31 @@ fn PassConstRef(ref x: const XByRef) { // CHECK:STDOUT: %const: type = const_type %S.ref.loc38_45 [concrete = constants.%const] // CHECK:STDOUT: %.loc38_33.1: init %const = as_compatible %.loc38_23 [concrete = constants.%empty_struct.674] // CHECK:STDOUT: %.loc38_33.2: init %const = converted %.loc38_23, %.loc38_33.1 [concrete = constants.%empty_struct.674] -// CHECK:STDOUT: %T.cpp_destructor.bound: = bound_method %t.var, constants.%T.cpp_destructor -// CHECK:STDOUT: %T.cpp_destructor.call: init %empty_tuple.type = call %T.cpp_destructor.bound(%t.var) -// CHECK:STDOUT: %S.cpp_destructor.bound: = bound_method %s.var, constants.%S.cpp_destructor -// CHECK:STDOUT: %S.cpp_destructor.call: init %empty_tuple.type = call %S.cpp_destructor.bound(%s.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc19: = bound_method %t.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc19: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc19(%t.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: = bound_method %s.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%s.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc19(%self.param: ref %T.ed0) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc19(%self.param: ref %T.ed0) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %T.cpp_destructor.call: init %empty_tuple.type = call imports.%T.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8(%self.param: ref %S) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8(%self.param: ref %S) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %S.cpp_destructor.call: init %empty_tuple.type = call imports.%S.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- call_param_const_lvalue_ref_with_ref.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -883,8 +1027,14 @@ fn PassConstRef(ref x: const XByRef) { // CHECK:STDOUT: %TakesConstLValue__carbon_thunk.type: type = fn_type @TakesConstLValue__carbon_thunk [concrete] // CHECK:STDOUT: %TakesConstLValue__carbon_thunk: %TakesConstLValue__carbon_thunk.type = struct_value () [concrete] // CHECK:STDOUT: %ptr.037: type = ptr_type %S [concrete] +// CHECK:STDOUT: %self.param_patt.63c: %pattern_type.0f5 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.a18: %pattern_type.0f5 = wrapper_binding_pattern self, %self.param_patt.63c [concrete] // CHECK:STDOUT: %S.cpp_destructor.type: type = fn_type @S.cpp_destructor [concrete] // CHECK:STDOUT: %S.cpp_destructor: %S.cpp_destructor.type = struct_value () [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.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -900,6 +1050,21 @@ fn PassConstRef(ref x: const XByRef) { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } +// CHECK:STDOUT: %S.cpp_destructor.decl: %S.cpp_destructor.type = fn_decl @S.cpp_destructor [concrete = constants.%S.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// 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.0f5 = ref_param_pattern [concrete = constants.%self.param_patt.63c] +// CHECK:STDOUT: %self.patt: %pattern_type.0f5 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a18] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %S = ref_param call_param0 +// CHECK:STDOUT: %self: ref %S = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -943,11 +1108,20 @@ fn PassConstRef(ref x: const XByRef) { // CHECK:STDOUT: %.loc11_25.1: %ptr.711 = as_compatible %addr.loc11 // CHECK:STDOUT: %.loc11_25.2: %ptr.711 = converted %addr.loc11, %.loc11_25.1 // CHECK:STDOUT: %TakesConstLValue__carbon_thunk.call.loc11: init %empty_tuple.type = call imports.%TakesConstLValue__carbon_thunk.decl(%.loc11_25.2) -// CHECK:STDOUT: %S.cpp_destructor.bound: = bound_method %s.var, constants.%S.cpp_destructor -// CHECK:STDOUT: %S.cpp_destructor.call: init %empty_tuple.type = call %S.cpp_destructor.bound(%s.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %s.var, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%s.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8(%self.param: ref %S) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8(%self.param: ref %S) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param) +// CHECK:STDOUT: %S.cpp_destructor.call: init %empty_tuple.type = call imports.%S.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- call_param_const_lvalue_ref_with_value.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -967,6 +1141,15 @@ fn PassConstRef(ref x: const XByRef) { // CHECK:STDOUT: %TakesConstLValue__carbon_thunk.type: type = fn_type @TakesConstLValue__carbon_thunk [concrete] // CHECK:STDOUT: %TakesConstLValue__carbon_thunk: %TakesConstLValue__carbon_thunk.type = struct_value () [concrete] // CHECK:STDOUT: %ptr.037: type = ptr_type %S [concrete] +// CHECK:STDOUT: %self.param_patt.63c: %pattern_type.0f5 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.a18: %pattern_type.0f5 = wrapper_binding_pattern self, %self.param_patt.63c [concrete] +// CHECK:STDOUT: %S.cpp_destructor.type: type = fn_type @S.cpp_destructor [concrete] +// CHECK:STDOUT: %S.cpp_destructor: %S.cpp_destructor.type = struct_value () [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.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.a94, %Destroy.WithSelf.SelfDestruct.db3 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -982,6 +1165,21 @@ fn PassConstRef(ref x: const XByRef) { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } +// CHECK:STDOUT: %S.cpp_destructor.decl: %S.cpp_destructor.type = fn_decl @S.cpp_destructor [concrete = constants.%S.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// 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.0f5 = ref_param_pattern [concrete = constants.%self.param_patt.63c] +// CHECK:STDOUT: %self.patt: %pattern_type.0f5 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a18] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %S = ref_param call_param0 +// CHECK:STDOUT: %self: ref %S = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -1023,9 +1221,19 @@ fn PassConstRef(ref x: const XByRef) { // CHECK:STDOUT: %.loc11_40.1: %ptr.711 = as_compatible %addr.loc11 // CHECK:STDOUT: %.loc11_40.2: %ptr.711 = converted %addr.loc11, %.loc11_40.1 // CHECK:STDOUT: %TakesConstLValue__carbon_thunk.call.loc11: init %empty_tuple.type = call imports.%TakesConstLValue__carbon_thunk.decl(%.loc11_40.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.a94) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8(%self.param: ref %S) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8(%self.param: ref %S) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param) +// CHECK:STDOUT: %S.cpp_destructor.call: init %empty_tuple.type = call imports.%S.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- param_value_arg_for_const_rvalue_ref.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -1111,10 +1319,22 @@ fn PassConstRef(ref x: const XByRef) { // CHECK:STDOUT: %Default.facet.d67: %Default.type = facet_value %T.ed0, (%custom_witness.9b40fb.2) [concrete] // CHECK:STDOUT: %DefaultOrUnformed.impl_witness.8f2: = impl_witness imports.%DefaultOrUnformed.impl_witness_table.162, @T.as_type.as.DefaultOrUnformed.impl(%Default.facet.d67) [concrete] // CHECK:STDOUT: %DefaultOrUnformed.facet.0be: %DefaultOrUnformed.type = facet_value %T.ed0, (%DefaultOrUnformed.impl_witness.8f2) [concrete] +// CHECK:STDOUT: %self.param_patt.0e6: %pattern_type.5f6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.eb3: %pattern_type.5f6 = wrapper_binding_pattern self, %self.param_patt.0e6 [concrete] // CHECK:STDOUT: %T.cpp_destructor.type: type = fn_type @T.cpp_destructor [concrete] // CHECK:STDOUT: %T.cpp_destructor: %T.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc19 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc19 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.63c: %pattern_type.0f5 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.a18: %pattern_type.0f5 = wrapper_binding_pattern self, %self.param_patt.63c [concrete] // CHECK:STDOUT: %S.cpp_destructor.type: type = fn_type @S.cpp_destructor [concrete] // CHECK:STDOUT: %S.cpp_destructor: %S.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1129,6 +1349,33 @@ fn PassConstRef(ref x: const XByRef) { // CHECK:STDOUT: %DefaultOrUnformed.impl_witness_table.162 = impl_witness_table (%Core.import_ref.c2f), @T.as_type.as.DefaultOrUnformed.impl [concrete] // CHECK:STDOUT: %TakesConstRValue.cpp_overload_set.value: %TakesConstRValue.cpp_overload_set.type = cpp_overload_set_value @TakesConstRValue.cpp_overload_set [concrete = constants.%TakesConstRValue.cpp_overload_set.value] // CHECK:STDOUT: %T.decl: type = class_decl @T [concrete = constants.%T.ed0] {} {} +// CHECK:STDOUT: %T.cpp_destructor.decl: %T.cpp_destructor.type = fn_decl @T.cpp_destructor [concrete = constants.%T.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: %S.cpp_destructor.decl: %S.cpp_destructor.type = fn_decl @S.cpp_destructor [concrete = constants.%S.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc19 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.5f6 = ref_param_pattern [concrete = constants.%self.param_patt.0e6] +// CHECK:STDOUT: %self.patt: %pattern_type.5f6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.eb3] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %T.ed0 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %T.ed0 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc8 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.0f5 = ref_param_pattern [concrete = constants.%self.param_patt.63c] +// CHECK:STDOUT: %self.patt: %pattern_type.0f5 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a18] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %S = ref_param call_param0 +// CHECK:STDOUT: %self: ref %S = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -1175,13 +1422,31 @@ fn PassConstRef(ref x: const XByRef) { // CHECK:STDOUT: %Cpp.ref.loc28: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %TakesConstRValue.ref.loc28: %TakesConstRValue.cpp_overload_set.type = name_ref TakesConstRValue, imports.%TakesConstRValue.cpp_overload_set.value [concrete = constants.%TakesConstRValue.cpp_overload_set.value] // CHECK:STDOUT: %t.ref: ref %T.ed0 = name_ref t, %t -// CHECK:STDOUT: %T.cpp_destructor.bound: = bound_method %t.var, constants.%T.cpp_destructor -// CHECK:STDOUT: %T.cpp_destructor.call: init %empty_tuple.type = call %T.cpp_destructor.bound(%t.var) -// CHECK:STDOUT: %S.cpp_destructor.bound: = bound_method %s.var, constants.%S.cpp_destructor -// CHECK:STDOUT: %S.cpp_destructor.call: init %empty_tuple.type = call %S.cpp_destructor.bound(%s.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc19: = bound_method %t.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc19: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc19(%t.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: = bound_method %s.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%s.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc19(%self.param: ref %T.ed0) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc19(%self.param: ref %T.ed0) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %T.cpp_destructor.call: init %empty_tuple.type = call imports.%T.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8(%self.param: ref %S) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8(%self.param: ref %S) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %S.cpp_destructor.call: init %empty_tuple.type = call imports.%S.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- call_return_lvalue_ref.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { diff --git a/toolchain/check/testdata/interop/cpp/function/import/return.carbon b/toolchain/check/testdata/interop/cpp/function/import/return.carbon index fc9e9f043a92..42ebbcadae98 100644 --- a/toolchain/check/testdata/interop/cpp/function/import/return.carbon +++ b/toolchain/check/testdata/interop/cpp/function/import/return.carbon @@ -111,6 +111,7 @@ fn Var() { // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [concrete] +// CHECK:STDOUT: %pattern_type.203: type = pattern_type %i16 [concrete] // CHECK:STDOUT: %IngestI16.type: type = fn_type @IngestI16 [concrete] // CHECK:STDOUT: %IngestI16: %IngestI16.type = struct_value () [concrete] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] @@ -123,8 +124,21 @@ fn Var() { // CHECK:STDOUT: %foo1__carbon_thunk.type: type = fn_type @foo1__carbon_thunk [concrete] // CHECK:STDOUT: %foo1__carbon_thunk: %foo1__carbon_thunk.type = struct_value () [concrete] // CHECK:STDOUT: %i16.builtin: type = int_type signed, %int_16 [concrete] +// CHECK:STDOUT: %pattern_type.08e: type = pattern_type %i16.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.b41: %pattern_type.08e = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.277: %pattern_type.08e = wrapper_binding_pattern self, %self.param_patt.b41 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_22.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc11_22.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.f77: %pattern_type.203 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.91f: %pattern_type.203 = wrapper_binding_pattern self, %self.param_patt.f77 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_22.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc11_22.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc11_22.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: %foo2.cpp_overload_set.type: type = cpp_overload_set_type @foo2.cpp_overload_set [concrete] // CHECK:STDOUT: %foo2.cpp_overload_set.value: %foo2.cpp_overload_set.type = cpp_overload_set_value @foo2.cpp_overload_set [concrete] // CHECK:STDOUT: %foo2.type: type = fn_type @foo2 [concrete] @@ -151,6 +165,37 @@ fn Var() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_22.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.08e = ref_param_pattern [concrete = constants.%self.param_patt.b41] +// CHECK:STDOUT: %self.patt: %pattern_type.08e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.277] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i16.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i16.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc11_22.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.08e = ref_param_pattern [concrete = constants.%self.param_patt.b41] +// CHECK:STDOUT: %self.patt: %pattern_type.08e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.277] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i16.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i16.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_22.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.203 = ref_param_pattern [concrete = constants.%self.param_patt.f77] +// CHECK:STDOUT: %self.patt: %pattern_type.203 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.91f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i16 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i16 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc11_22.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.203 = ref_param_pattern [concrete = constants.%self.param_patt.f77] +// CHECK:STDOUT: %self.patt: %pattern_type.203 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.91f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i16 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i16 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %IngestI16.ref: %IngestI16.type = name_ref IngestI16, file.%IngestI16.decl [concrete = constants.%IngestI16] @@ -163,8 +208,8 @@ fn Var() { // CHECK:STDOUT: %.loc11_22.3: ref %i16 = temporary %.loc11_22.1, %.loc11_22.2 // CHECK:STDOUT: %.loc11_22.4: %i16 = acquire_value %.loc11_22.3 // CHECK:STDOUT: %IngestI16.call: init %empty_tuple.type = call %IngestI16.ref(%.loc11_22.4) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.loc11_22.3, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%.loc11_22.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc11_22.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc11_22.3) // CHECK:STDOUT: %IngestI32.ref: %IngestI32.type = name_ref IngestI32, file.%IngestI32.decl [concrete = constants.%IngestI32] // CHECK:STDOUT: %Cpp.ref.loc12: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %foo2.ref: %foo2.cpp_overload_set.type = name_ref foo2, imports.%foo2.cpp_overload_set.value [concrete = constants.%foo2.cpp_overload_set.value] @@ -175,10 +220,28 @@ fn Var() { // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_22.1(%self.param: ref %i16.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_22.1(%self.param: ref %i16.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_22.2(%self.param: ref %i16) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_22.1(%self.param: ref %i16.builtin) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_22.2(%self.param: ref %i16) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_22.2(%self.param: ref %i16) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_22.2(%self.param: ref %i16) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -191,11 +254,15 @@ fn Var() { // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %Cpp.void: type = class_type @VoidBase [concrete] // CHECK:STDOUT: %ptr.00a: type = ptr_type %Cpp.void [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.6c4ec3.1: = custom_witness (%Destroy.WithSelf.Op.403171.1), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.fd7: %Destroy.type = facet_value %ptr.00a, (%custom_witness.6c4ec3.1) [concrete] -// CHECK:STDOUT: %MaybeUnformed.ddb: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.fd7) [concrete] +// CHECK:STDOUT: %custom_witness.f8f19d.1: = custom_witness (%Destroy.WithSelf.Op.403171.1, %Destroy.WithSelf.SubobjectDestroy.d01daf.1, %Destroy.WithSelf.SelfDestruct.db3fdb.1), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.f20: %Destroy.type = facet_value %ptr.00a, (%custom_witness.f8f19d.1) [concrete] +// CHECK:STDOUT: %MaybeUnformed.174: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.f20) [concrete] // CHECK:STDOUT: %.a7d: type = maybe_unformed_type %ptr.00a [concrete] // CHECK:STDOUT: %pattern_type.af6: type = pattern_type %Cpp.nullptr_t [concrete] // CHECK:STDOUT: %c.patt: %pattern_type.af6 = ref_binding_pattern c [concrete] @@ -205,8 +272,28 @@ fn Var() { // CHECK:STDOUT: %ptr.ab6: type = ptr_type %Cpp.nullptr_t [concrete] // CHECK:STDOUT: %ReturnNullPtr__carbon_thunk.type: type = fn_type @ReturnNullPtr__carbon_thunk [concrete] // CHECK:STDOUT: %ReturnNullPtr__carbon_thunk: %ReturnNullPtr__carbon_thunk.type = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.651: type = pattern_type %.a7d [concrete] +// CHECK:STDOUT: %self.param_patt.c89: %pattern_type.651 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.2bb: %pattern_type.651 = wrapper_binding_pattern self, %self.param_patt.c89 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc11_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.d25: type = pattern_type %MaybeUnformed.174 [concrete] +// CHECK:STDOUT: %self.param_patt.22a: %pattern_type.d25 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.000: %pattern_type.d25 = wrapper_binding_pattern self, %self.param_patt.22a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc11_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.c86: %pattern_type.af6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.b2c: %pattern_type.af6 = wrapper_binding_pattern self, %self.param_patt.c86 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc11_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc11_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -223,6 +310,51 @@ fn Var() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.651 = ref_param_pattern [concrete = constants.%self.param_patt.c89] +// CHECK:STDOUT: %self.patt: %pattern_type.651 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.2bb] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %.a7d = ref_param call_param0 +// CHECK:STDOUT: %self: ref %.a7d = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc11_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.651 = ref_param_pattern [concrete = constants.%self.param_patt.c89] +// CHECK:STDOUT: %self.patt: %pattern_type.651 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.2bb] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %.a7d = ref_param call_param0 +// CHECK:STDOUT: %self: ref %.a7d = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.d25 = ref_param_pattern [concrete = constants.%self.param_patt.22a] +// CHECK:STDOUT: %self.patt: %pattern_type.d25 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.000] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %MaybeUnformed.174 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %MaybeUnformed.174 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc11_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.d25 = ref_param_pattern [concrete = constants.%self.param_patt.22a] +// CHECK:STDOUT: %self.patt: %pattern_type.d25 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.000] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %MaybeUnformed.174 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %MaybeUnformed.174 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.af6 = ref_param_pattern [concrete = constants.%self.param_patt.c86] +// CHECK:STDOUT: %self.patt: %pattern_type.af6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.b2c] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Cpp.nullptr_t = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Cpp.nullptr_t = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc11_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.af6 = ref_param_pattern [concrete = constants.%self.param_patt.c86] +// CHECK:STDOUT: %self.patt: %pattern_type.af6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.b2c] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Cpp.nullptr_t = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Cpp.nullptr_t = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @InitializeFromReturn() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c.var: ref %Cpp.nullptr_t = var_storage %c.var_patt @@ -242,23 +374,50 @@ fn Var() { // CHECK:STDOUT: %c.patt: %pattern_type.af6 = ref_binding_pattern c [concrete = constants.%c.patt] // CHECK:STDOUT: %c.var_patt: %pattern_type.af6 = var_pattern %c.patt [concrete = constants.%c.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %c.var, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%c.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %c.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%c.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_3.1(%self.param: ref %.a7d) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_3.1(%self.param: ref %.a7d) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_3.2(%self.param: ref %MaybeUnformed.ddb) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_3.1(%self.param: ref %.a7d) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_3.1(%self.param: ref %.a7d) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_3.2(%self.param: ref %MaybeUnformed.174) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_3.3(%self.param: ref %Cpp.nullptr_t) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_3.2(%self.param: ref %MaybeUnformed.174) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_3.2(%self.param: ref %MaybeUnformed.174) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_3.3(%self.param: ref %Cpp.nullptr_t) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_3.3(%self.param: ref %Cpp.nullptr_t) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_3.3(%self.param: ref %Cpp.nullptr_t) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -371,8 +530,21 @@ fn Var() { // CHECK:STDOUT: %ReturnU32.type: type = fn_type @ReturnU32 [concrete] // CHECK:STDOUT: %ReturnU32: %ReturnU32.type = struct_value () [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.b1b: type = pattern_type %u32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.a81: %pattern_type.b1b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.095: %pattern_type.b1b = wrapper_binding_pattern self, %self.param_patt.a81 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc9_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.e4c: %pattern_type.668 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.77f: %pattern_type.668 = wrapper_binding_pattern self, %self.param_patt.e4c [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc9_3.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -401,6 +573,37 @@ fn Var() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b1b = ref_param_pattern [concrete = constants.%self.param_patt.a81] +// CHECK:STDOUT: %self.patt: %pattern_type.b1b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.095] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %u32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %u32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc9_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b1b = ref_param_pattern [concrete = constants.%self.param_patt.a81] +// CHECK:STDOUT: %self.patt: %pattern_type.b1b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.095] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %u32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %u32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.668 = ref_param_pattern [concrete = constants.%self.param_patt.e4c] +// CHECK:STDOUT: %self.patt: %pattern_type.668 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.77f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %u32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %u32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc9_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.668 = ref_param_pattern [concrete = constants.%self.param_patt.e4c] +// CHECK:STDOUT: %self.patt: %pattern_type.668 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.77f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %u32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %u32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -427,17 +630,35 @@ fn Var() { // CHECK:STDOUT: %my_u32.patt: %pattern_type.668 = ref_binding_pattern my_u32 [concrete = constants.%my_u32.patt] // CHECK:STDOUT: %my_u32.var_patt: %pattern_type.668 = var_pattern %my_u32.patt [concrete = constants.%my_u32.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %my_u32.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%my_u32.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %my_u32.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%my_u32.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @ReturnU32() -> out %return.param: %u32; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.1(%self.param: ref %u32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.1(%self.param: ref %u32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.2(%self.param: ref %u32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.1(%self.param: ref %u32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.2(%self.param: ref %u32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.2(%self.param: ref %u32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.2(%self.param: ref %u32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/function/import/struct.carbon b/toolchain/check/testdata/interop/cpp/function/import/struct.carbon index ec713c8c4e0d..53765a46dd6e 100644 --- a/toolchain/check/testdata/interop/cpp/function/import/struct.carbon +++ b/toolchain/check/testdata/interop/cpp/function/import/struct.carbon @@ -669,8 +669,14 @@ fn F() { // CHECK:STDOUT: %Default.facet.598: %Default.type = facet_value %InNamespaceStruct, (%custom_witness.85f) [concrete] // CHECK:STDOUT: %DefaultOrUnformed.impl_witness.d48: = impl_witness imports.%DefaultOrUnformed.impl_witness_table.162, @T.as_type.as.DefaultOrUnformed.impl(%Default.facet.598) [concrete] // CHECK:STDOUT: %DefaultOrUnformed.facet: %DefaultOrUnformed.type = facet_value %InNamespaceStruct, (%DefaultOrUnformed.impl_witness.d48) [concrete] +// CHECK:STDOUT: %self.param_patt.75b: %pattern_type.d3e = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.b0d: %pattern_type.d3e = wrapper_binding_pattern self, %self.param_patt.75b [concrete] // CHECK:STDOUT: %InNamespaceStruct.cpp_destructor.type: type = fn_type @InNamespaceStruct.cpp_destructor [concrete] // CHECK:STDOUT: %InNamespaceStruct.cpp_destructor: %InNamespaceStruct.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc10 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -692,6 +698,21 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import_ref.c2f: @T.as_type.as.DefaultOrUnformed.impl.%T.as_type.as.DefaultOrUnformed.impl.Op.type (%T.as_type.as.DefaultOrUnformed.impl.Op.type.0c9) = import_ref Core//prelude/parts/default, loc{{\d+_\d+}}, loaded [symbolic = @T.as_type.as.DefaultOrUnformed.impl.%T.as_type.as.DefaultOrUnformed.impl.Op (constants.%T.as_type.as.DefaultOrUnformed.impl.Op.cfe)] // CHECK:STDOUT: %DefaultOrUnformed.impl_witness_table.162 = impl_witness_table (%Core.import_ref.c2f), @T.as_type.as.DefaultOrUnformed.impl [concrete] +// CHECK:STDOUT: %InNamespaceStruct.cpp_destructor.decl: %InNamespaceStruct.cpp_destructor.type = fn_decl @InNamespaceStruct.cpp_destructor [concrete = constants.%InNamespaceStruct.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc10 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.d3e = ref_param_pattern [concrete = constants.%self.param_patt.75b] +// CHECK:STDOUT: %self.patt: %pattern_type.d3e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.b0d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %InNamespaceStruct = ref_param call_param0 +// CHECK:STDOUT: %self: ref %InNamespaceStruct = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%s.param: %InNamespaceStruct) { @@ -721,11 +742,20 @@ fn F() { // CHECK:STDOUT: %x.patt: %pattern_type.d3e = ref_binding_pattern x [concrete = constants.%x.patt] // CHECK:STDOUT: %x.var_patt: %pattern_type.d3e = var_pattern %x.patt [concrete = constants.%x.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %InNamespaceStruct.cpp_destructor.bound: = bound_method %x.var, constants.%InNamespaceStruct.cpp_destructor -// CHECK:STDOUT: %InNamespaceStruct.cpp_destructor.call: init %empty_tuple.type = call %InNamespaceStruct.cpp_destructor.bound(%x.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %x.var, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%x.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10(%self.param: ref %InNamespaceStruct) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10(%self.param: ref %InNamespaceStruct) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param) +// CHECK:STDOUT: %InNamespaceStruct.cpp_destructor.call: init %empty_tuple.type = call imports.%InNamespaceStruct.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- import_definition_in_relative_namespace_value_param_type.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -800,8 +830,14 @@ fn F() { // CHECK:STDOUT: %Default.facet.e09: %Default.type = facet_value %OuterStruct, (%custom_witness.9b4) [concrete] // CHECK:STDOUT: %DefaultOrUnformed.impl_witness.219: = impl_witness imports.%DefaultOrUnformed.impl_witness_table.162, @T.as_type.as.DefaultOrUnformed.impl(%Default.facet.e09) [concrete] // CHECK:STDOUT: %DefaultOrUnformed.facet: %DefaultOrUnformed.type = facet_value %OuterStruct, (%DefaultOrUnformed.impl_witness.219) [concrete] +// CHECK:STDOUT: %self.param_patt.e6d: %pattern_type.e34 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.f0c: %pattern_type.e34 = wrapper_binding_pattern self, %self.param_patt.e6d [concrete] // CHECK:STDOUT: %OuterStruct.cpp_destructor.type: type = fn_type @OuterStruct.cpp_destructor [concrete] // CHECK:STDOUT: %OuterStruct.cpp_destructor: %OuterStruct.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -819,6 +855,21 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import_ref.c2f: @T.as_type.as.DefaultOrUnformed.impl.%T.as_type.as.DefaultOrUnformed.impl.Op.type (%T.as_type.as.DefaultOrUnformed.impl.Op.type.0c9) = import_ref Core//prelude/parts/default, loc{{\d+_\d+}}, loaded [symbolic = @T.as_type.as.DefaultOrUnformed.impl.%T.as_type.as.DefaultOrUnformed.impl.Op (constants.%T.as_type.as.DefaultOrUnformed.impl.Op.cfe)] // CHECK:STDOUT: %DefaultOrUnformed.impl_witness_table.162 = impl_witness_table (%Core.import_ref.c2f), @T.as_type.as.DefaultOrUnformed.impl [concrete] +// CHECK:STDOUT: %OuterStruct.cpp_destructor.decl: %OuterStruct.cpp_destructor.type = fn_decl @OuterStruct.cpp_destructor [concrete = constants.%OuterStruct.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc9 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e34 = ref_param_pattern [concrete = constants.%self.param_patt.e6d] +// CHECK:STDOUT: %self.patt: %pattern_type.e34 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.f0c] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %OuterStruct = ref_param call_param0 +// CHECK:STDOUT: %self: ref %OuterStruct = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%s.param: %InnerStruct) { @@ -847,11 +898,20 @@ fn F() { // CHECK:STDOUT: %x.patt: %pattern_type.e34 = ref_binding_pattern x [concrete = constants.%x.patt] // CHECK:STDOUT: %x.var_patt: %pattern_type.e34 = var_pattern %x.patt [concrete = constants.%x.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %OuterStruct.cpp_destructor.bound: = bound_method %x.var, constants.%OuterStruct.cpp_destructor -// CHECK:STDOUT: %OuterStruct.cpp_destructor.call: init %empty_tuple.type = call %OuterStruct.cpp_destructor.bound(%x.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %x.var, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%x.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9(%self.param: ref %OuterStruct) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9(%self.param: ref %OuterStruct) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param) +// CHECK:STDOUT: %OuterStruct.cpp_destructor.call: init %empty_tuple.type = call imports.%OuterStruct.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- import_definition_and_static_method_call_before.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -1032,11 +1092,18 @@ fn F() { // CHECK:STDOUT: %foo_def_value_return.cpp_overload_set.type: type = cpp_overload_set_type @foo_def_value_return.cpp_overload_set [concrete] // CHECK:STDOUT: %foo_def_value_return.cpp_overload_set.value: %foo_def_value_return.cpp_overload_set.type = cpp_overload_set_value @foo_def_value_return.cpp_overload_set [concrete] // CHECK:STDOUT: %DefValueReturnStruct: type = class_type @DefValueReturnStruct [concrete] +// CHECK:STDOUT: %pattern_type.f0a: type = pattern_type %DefValueReturnStruct [concrete] // CHECK:STDOUT: %ptr.b68: type = ptr_type %DefValueReturnStruct [concrete] // CHECK:STDOUT: %foo_def_value_return__carbon_thunk.type: type = fn_type @foo_def_value_return__carbon_thunk [concrete] // CHECK:STDOUT: %foo_def_value_return__carbon_thunk: %foo_def_value_return__carbon_thunk.type = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.850: %pattern_type.f0a = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.de2: %pattern_type.f0a = wrapper_binding_pattern self, %self.param_patt.850 [concrete] // CHECK:STDOUT: %DefValueReturnStruct.cpp_destructor.type: type = fn_type @DefValueReturnStruct.cpp_destructor [concrete] // CHECK:STDOUT: %DefValueReturnStruct.cpp_destructor: %DefValueReturnStruct.cpp_destructor.type = struct_value () [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.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1050,6 +1117,21 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } +// CHECK:STDOUT: %DefValueReturnStruct.cpp_destructor.decl: %DefValueReturnStruct.cpp_destructor.type = fn_decl @DefValueReturnStruct.cpp_destructor [concrete = constants.%DefValueReturnStruct.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// 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.f0a = ref_param_pattern [concrete = constants.%self.param_patt.850] +// CHECK:STDOUT: %self.patt: %pattern_type.f0a = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.de2] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %DefValueReturnStruct = ref_param call_param0 +// CHECK:STDOUT: %self: ref %DefValueReturnStruct = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -1061,11 +1143,20 @@ fn F() { // CHECK:STDOUT: %foo_def_value_return__carbon_thunk.call: init %empty_tuple.type = call imports.%foo_def_value_return__carbon_thunk.decl(%addr) // CHECK:STDOUT: %.loc8_28.2: init %DefValueReturnStruct to %.loc8_28.1 = mark_in_place_init %foo_def_value_return__carbon_thunk.call // CHECK:STDOUT: %.loc8_28.3: ref %DefValueReturnStruct = temporary %.loc8_28.1, %.loc8_28.2 -// CHECK:STDOUT: %DefValueReturnStruct.cpp_destructor.bound: = bound_method %.loc8_28.3, constants.%DefValueReturnStruct.cpp_destructor -// CHECK:STDOUT: %DefValueReturnStruct.cpp_destructor.call: init %empty_tuple.type = call %DefValueReturnStruct.cpp_destructor.bound(%.loc8_28.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc8_28.3, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc8_28.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8(%self.param: ref %DefValueReturnStruct) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8(%self.param: ref %DefValueReturnStruct) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param) +// CHECK:STDOUT: %DefValueReturnStruct.cpp_destructor.call: init %empty_tuple.type = call imports.%DefValueReturnStruct.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- import_decl_pointer_return_type.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { diff --git a/toolchain/check/testdata/interop/cpp/function/import/union.carbon b/toolchain/check/testdata/interop/cpp/function/import/union.carbon index c7573441aeb6..b4d9eafb95d1 100644 --- a/toolchain/check/testdata/interop/cpp/function/import/union.carbon +++ b/toolchain/check/testdata/interop/cpp/function/import/union.carbon @@ -593,8 +593,14 @@ fn F() { // CHECK:STDOUT: %Default.facet.c4a: %Default.type = facet_value %InNamespaceUnion, (%custom_witness.85f) [concrete] // CHECK:STDOUT: %DefaultOrUnformed.impl_witness.ee1: = impl_witness imports.%DefaultOrUnformed.impl_witness_table.162, @T.as_type.as.DefaultOrUnformed.impl(%Default.facet.c4a) [concrete] // CHECK:STDOUT: %DefaultOrUnformed.facet: %DefaultOrUnformed.type = facet_value %InNamespaceUnion, (%DefaultOrUnformed.impl_witness.ee1) [concrete] +// CHECK:STDOUT: %self.param_patt.ef9: %pattern_type.007 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.0ed: %pattern_type.007 = wrapper_binding_pattern self, %self.param_patt.ef9 [concrete] // CHECK:STDOUT: %InNamespaceUnion.cpp_destructor.type: type = fn_type @InNamespaceUnion.cpp_destructor [concrete] // CHECK:STDOUT: %InNamespaceUnion.cpp_destructor: %InNamespaceUnion.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc10 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -616,6 +622,21 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import_ref.c2f: @T.as_type.as.DefaultOrUnformed.impl.%T.as_type.as.DefaultOrUnformed.impl.Op.type (%T.as_type.as.DefaultOrUnformed.impl.Op.type.0c9) = import_ref Core//prelude/parts/default, loc{{\d+_\d+}}, loaded [symbolic = @T.as_type.as.DefaultOrUnformed.impl.%T.as_type.as.DefaultOrUnformed.impl.Op (constants.%T.as_type.as.DefaultOrUnformed.impl.Op.cfe)] // CHECK:STDOUT: %DefaultOrUnformed.impl_witness_table.162 = impl_witness_table (%Core.import_ref.c2f), @T.as_type.as.DefaultOrUnformed.impl [concrete] +// CHECK:STDOUT: %InNamespaceUnion.cpp_destructor.decl: %InNamespaceUnion.cpp_destructor.type = fn_decl @InNamespaceUnion.cpp_destructor [concrete = constants.%InNamespaceUnion.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc10 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.007 = ref_param_pattern [concrete = constants.%self.param_patt.ef9] +// CHECK:STDOUT: %self.patt: %pattern_type.007 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.0ed] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %InNamespaceUnion = ref_param call_param0 +// CHECK:STDOUT: %self: ref %InNamespaceUnion = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%u.param: %InNamespaceUnion) { @@ -645,11 +666,20 @@ fn F() { // CHECK:STDOUT: %x.patt: %pattern_type.007 = ref_binding_pattern x [concrete = constants.%x.patt] // CHECK:STDOUT: %x.var_patt: %pattern_type.007 = var_pattern %x.patt [concrete = constants.%x.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %InNamespaceUnion.cpp_destructor.bound: = bound_method %x.var, constants.%InNamespaceUnion.cpp_destructor -// CHECK:STDOUT: %InNamespaceUnion.cpp_destructor.call: init %empty_tuple.type = call %InNamespaceUnion.cpp_destructor.bound(%x.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %x.var, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%x.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10(%self.param: ref %InNamespaceUnion) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10(%self.param: ref %InNamespaceUnion) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param) +// CHECK:STDOUT: %InNamespaceUnion.cpp_destructor.call: init %empty_tuple.type = call imports.%InNamespaceUnion.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- import_definition_in_relative_namespace_value_param_type.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -724,8 +754,14 @@ fn F() { // CHECK:STDOUT: %Default.facet.a9b: %Default.type = facet_value %OuterUnion, (%custom_witness.9b4) [concrete] // CHECK:STDOUT: %DefaultOrUnformed.impl_witness.661: = impl_witness imports.%DefaultOrUnformed.impl_witness_table.162, @T.as_type.as.DefaultOrUnformed.impl(%Default.facet.a9b) [concrete] // CHECK:STDOUT: %DefaultOrUnformed.facet: %DefaultOrUnformed.type = facet_value %OuterUnion, (%DefaultOrUnformed.impl_witness.661) [concrete] +// CHECK:STDOUT: %self.param_patt.47b: %pattern_type.89d = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.67b: %pattern_type.89d = wrapper_binding_pattern self, %self.param_patt.47b [concrete] // CHECK:STDOUT: %OuterUnion.cpp_destructor.type: type = fn_type @OuterUnion.cpp_destructor [concrete] // CHECK:STDOUT: %OuterUnion.cpp_destructor: %OuterUnion.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -743,6 +779,21 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import_ref.c2f: @T.as_type.as.DefaultOrUnformed.impl.%T.as_type.as.DefaultOrUnformed.impl.Op.type (%T.as_type.as.DefaultOrUnformed.impl.Op.type.0c9) = import_ref Core//prelude/parts/default, loc{{\d+_\d+}}, loaded [symbolic = @T.as_type.as.DefaultOrUnformed.impl.%T.as_type.as.DefaultOrUnformed.impl.Op (constants.%T.as_type.as.DefaultOrUnformed.impl.Op.cfe)] // CHECK:STDOUT: %DefaultOrUnformed.impl_witness_table.162 = impl_witness_table (%Core.import_ref.c2f), @T.as_type.as.DefaultOrUnformed.impl [concrete] +// CHECK:STDOUT: %OuterUnion.cpp_destructor.decl: %OuterUnion.cpp_destructor.type = fn_decl @OuterUnion.cpp_destructor [concrete = constants.%OuterUnion.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc9 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.89d = ref_param_pattern [concrete = constants.%self.param_patt.47b] +// CHECK:STDOUT: %self.patt: %pattern_type.89d = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.67b] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %OuterUnion = ref_param call_param0 +// CHECK:STDOUT: %self: ref %OuterUnion = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%u.param: %InnerUnion) { @@ -771,11 +822,20 @@ fn F() { // CHECK:STDOUT: %x.patt: %pattern_type.89d = ref_binding_pattern x [concrete = constants.%x.patt] // CHECK:STDOUT: %x.var_patt: %pattern_type.89d = var_pattern %x.patt [concrete = constants.%x.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %OuterUnion.cpp_destructor.bound: = bound_method %x.var, constants.%OuterUnion.cpp_destructor -// CHECK:STDOUT: %OuterUnion.cpp_destructor.call: init %empty_tuple.type = call %OuterUnion.cpp_destructor.bound(%x.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %x.var, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%x.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9(%self.param: ref %OuterUnion) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9(%self.param: ref %OuterUnion) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param) +// CHECK:STDOUT: %OuterUnion.cpp_destructor.call: init %empty_tuple.type = call imports.%OuterUnion.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- import_definition_and_static_method_call_before.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -956,11 +1016,18 @@ fn F() { // CHECK:STDOUT: %foo_def_value_return.cpp_overload_set.type: type = cpp_overload_set_type @foo_def_value_return.cpp_overload_set [concrete] // CHECK:STDOUT: %foo_def_value_return.cpp_overload_set.value: %foo_def_value_return.cpp_overload_set.type = cpp_overload_set_value @foo_def_value_return.cpp_overload_set [concrete] // CHECK:STDOUT: %DefValueReturnUnion: type = class_type @DefValueReturnUnion [concrete] +// CHECK:STDOUT: %pattern_type.133: type = pattern_type %DefValueReturnUnion [concrete] // CHECK:STDOUT: %ptr.5e5: type = ptr_type %DefValueReturnUnion [concrete] // CHECK:STDOUT: %foo_def_value_return__carbon_thunk.type: type = fn_type @foo_def_value_return__carbon_thunk [concrete] // CHECK:STDOUT: %foo_def_value_return__carbon_thunk: %foo_def_value_return__carbon_thunk.type = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.0ca: %pattern_type.133 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.00d: %pattern_type.133 = wrapper_binding_pattern self, %self.param_patt.0ca [concrete] // CHECK:STDOUT: %DefValueReturnUnion.cpp_destructor.type: type = fn_type @DefValueReturnUnion.cpp_destructor [concrete] // CHECK:STDOUT: %DefValueReturnUnion.cpp_destructor: %DefValueReturnUnion.cpp_destructor.type = struct_value () [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.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -974,6 +1041,21 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } +// CHECK:STDOUT: %DefValueReturnUnion.cpp_destructor.decl: %DefValueReturnUnion.cpp_destructor.type = fn_decl @DefValueReturnUnion.cpp_destructor [concrete = constants.%DefValueReturnUnion.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// 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.133 = ref_param_pattern [concrete = constants.%self.param_patt.0ca] +// CHECK:STDOUT: %self.patt: %pattern_type.133 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.00d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %DefValueReturnUnion = ref_param call_param0 +// CHECK:STDOUT: %self: ref %DefValueReturnUnion = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -985,11 +1067,20 @@ fn F() { // CHECK:STDOUT: %foo_def_value_return__carbon_thunk.call: init %empty_tuple.type = call imports.%foo_def_value_return__carbon_thunk.decl(%addr) // CHECK:STDOUT: %.loc8_28.2: init %DefValueReturnUnion to %.loc8_28.1 = mark_in_place_init %foo_def_value_return__carbon_thunk.call // CHECK:STDOUT: %.loc8_28.3: ref %DefValueReturnUnion = temporary %.loc8_28.1, %.loc8_28.2 -// CHECK:STDOUT: %DefValueReturnUnion.cpp_destructor.bound: = bound_method %.loc8_28.3, constants.%DefValueReturnUnion.cpp_destructor -// CHECK:STDOUT: %DefValueReturnUnion.cpp_destructor.call: init %empty_tuple.type = call %DefValueReturnUnion.cpp_destructor.bound(%.loc8_28.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc8_28.3, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc8_28.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8(%self.param: ref %DefValueReturnUnion) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8(%self.param: ref %DefValueReturnUnion) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param) +// CHECK:STDOUT: %DefValueReturnUnion.cpp_destructor.call: init %empty_tuple.type = call imports.%DefValueReturnUnion.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- import_decl_pointer_return_type.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { diff --git a/toolchain/check/testdata/interop/cpp/function/import/void_pointer.carbon b/toolchain/check/testdata/interop/cpp/function/import/void_pointer.carbon index d74ffa4f4653..9de35fd7da45 100644 --- a/toolchain/check/testdata/interop/cpp/function/import/void_pointer.carbon +++ b/toolchain/check/testdata/interop/cpp/function/import/void_pointer.carbon @@ -211,18 +211,23 @@ fn F() { // CHECK:STDOUT: %ptr.e8f: type = ptr_type %T.67d [symbolic] // CHECK:STDOUT: %Destroy.lookup_impl_witness.781: = lookup_impl_witness %ptr.e8f, @Destroy [symbolic] // CHECK:STDOUT: %Destroy.facet.e46: %Destroy.type = facet_value %ptr.e8f, (%Destroy.lookup_impl_witness.781) [symbolic] -// CHECK:STDOUT: %MaybeUnformed.ddba: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.e46) [symbolic] +// CHECK:STDOUT: %MaybeUnformed.ddb: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.e46) [symbolic] // CHECK:STDOUT: %ptr.as.OptionalStorage.impl.Some.type.71e: type = fn_type @ptr.as.OptionalStorage.impl.Some, @ptr.as.OptionalStorage.impl(%T.67d) [symbolic] // CHECK:STDOUT: %ptr.as.OptionalStorage.impl.Some.caa: %ptr.as.OptionalStorage.impl.Some.type.71e = struct_value () [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.6c4ec3.1: = custom_witness (%Destroy.WithSelf.Op.403171.1), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.fd7: %Destroy.type = facet_value %ptr.00a, (%custom_witness.6c4ec3.1) [concrete] -// CHECK:STDOUT: %MaybeUnformed.ddbd: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.fd7) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f8f19d.1: = custom_witness (%Destroy.WithSelf.Op.403171.1, %Destroy.WithSelf.SubobjectDestroy.d01daf.1, %Destroy.WithSelf.SelfDestruct.db3fdb.1), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.f20: %Destroy.type = facet_value %ptr.00a, (%custom_witness.f8f19d.1) [concrete] +// CHECK:STDOUT: %MaybeUnformed.174: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.f20) [concrete] // CHECK:STDOUT: %OptionalStorage.impl_witness.d51: = impl_witness imports.%OptionalStorage.impl_witness_table.110, @ptr.as.OptionalStorage.impl(%Cpp.void) [concrete] // CHECK:STDOUT: %.a7d: type = maybe_unformed_type %ptr.00a [concrete] // CHECK:STDOUT: %OptionalStorage.facet.427: %OptionalStorage.type = facet_value %ptr.00a, (%OptionalStorage.impl_witness.d51) [concrete] // CHECK:STDOUT: %Optional.14b: type = class_type @Optional, @Optional(%OptionalStorage.facet.427) [concrete] +// CHECK:STDOUT: %pattern_type.65e: type = pattern_type %Optional.14b [concrete] // CHECK:STDOUT: %foo_nullable_param.type: type = fn_type @foo_nullable_param [concrete] // CHECK:STDOUT: %foo_nullable_param: %foo_nullable_param.type = struct_value () [concrete] // CHECK:STDOUT: %ImplicitAs.type.8e0: type = facet_type <@ImplicitAs, @ImplicitAs(%Optional.14b)> [concrete] @@ -242,8 +247,28 @@ fn F() { // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.002: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%Optional.14b, %ImplicitAs.facet.3be) [concrete] // CHECK:STDOUT: %.fde: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.002, %ImplicitAs.facet.3be [concrete] // CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %U.as_type.as.ImplicitAs.impl.Convert.f63, @U.as_type.as.ImplicitAs.impl.Convert.2(%OptionalStorage.facet.427, %OptionalAs.facet) [concrete] +// CHECK:STDOUT: %pattern_type.651: type = pattern_type %.a7d [concrete] +// CHECK:STDOUT: %self.param_patt.c89: %pattern_type.651 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.2bb: %pattern_type.651 = wrapper_binding_pattern self, %self.param_patt.c89 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_26.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc10_26.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.d25: type = pattern_type %MaybeUnformed.174 [concrete] +// CHECK:STDOUT: %self.param_patt.22a: %pattern_type.d25 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.000: %pattern_type.d25 = wrapper_binding_pattern self, %self.param_patt.22a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_26.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc10_26.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.a69: %pattern_type.65e = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.ab1: %pattern_type.65e = wrapper_binding_pattern self, %self.param_patt.a69 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_26.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc10_26.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10_26.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -253,7 +278,7 @@ fn F() { // CHECK:STDOUT: import Cpp//... // CHECK:STDOUT: } // CHECK:STDOUT: %foo_nullable_param.cpp_overload_set.value: %foo_nullable_param.cpp_overload_set.type = cpp_overload_set_value @foo_nullable_param.cpp_overload_set [concrete = constants.%foo_nullable_param.cpp_overload_set.value] -// CHECK:STDOUT: %Core.import_ref.509: type = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, loaded [symbolic = @ptr.as.OptionalStorage.impl.%MaybeUnformed (constants.%MaybeUnformed.ddba)] +// CHECK:STDOUT: %Core.import_ref.509: type = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, loaded [symbolic = @ptr.as.OptionalStorage.impl.%MaybeUnformed (constants.%MaybeUnformed.ddb)] // CHECK:STDOUT: %Core.import_ref.105 = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, unloaded // CHECK:STDOUT: %Core.import_ref.fa7: @ptr.as.OptionalStorage.impl.%ptr.as.OptionalStorage.impl.Some.type (%ptr.as.OptionalStorage.impl.Some.type.71e) = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, loaded [symbolic = @ptr.as.OptionalStorage.impl.%ptr.as.OptionalStorage.impl.Some (constants.%ptr.as.OptionalStorage.impl.Some.caa)] // CHECK:STDOUT: %Core.import_ref.a90 = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, unloaded @@ -277,6 +302,51 @@ fn F() { // CHECK:STDOUT: %OptionalAs.impl_witness_table.2e9 = impl_witness_table (%Core.import_ref.017d8), @T.as_type.as.OptionalAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_26.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.651 = ref_param_pattern [concrete = constants.%self.param_patt.c89] +// CHECK:STDOUT: %self.patt: %pattern_type.651 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.2bb] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %.a7d = ref_param call_param0 +// CHECK:STDOUT: %self: ref %.a7d = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc10_26.1 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.651 = ref_param_pattern [concrete = constants.%self.param_patt.c89] +// CHECK:STDOUT: %self.patt: %pattern_type.651 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.2bb] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %.a7d = ref_param call_param0 +// CHECK:STDOUT: %self: ref %.a7d = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_26.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.d25 = ref_param_pattern [concrete = constants.%self.param_patt.22a] +// CHECK:STDOUT: %self.patt: %pattern_type.d25 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.000] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %MaybeUnformed.174 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %MaybeUnformed.174 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc10_26.2 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.d25 = ref_param_pattern [concrete = constants.%self.param_patt.22a] +// CHECK:STDOUT: %self.patt: %pattern_type.d25 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.000] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %MaybeUnformed.174 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %MaybeUnformed.174 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_26.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.65e = ref_param_pattern [concrete = constants.%self.param_patt.a69] +// CHECK:STDOUT: %self.patt: %pattern_type.65e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ab1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Optional.14b = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Optional.14b = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc10_26.3 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.65e = ref_param_pattern [concrete = constants.%self.param_patt.a69] +// CHECK:STDOUT: %self.patt: %pattern_type.65e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ab1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Optional.14b = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Optional.14b = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F(%input.param: %ptr.00a) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref.loc10: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -292,23 +362,50 @@ fn F() { // CHECK:STDOUT: %.loc10_26.3: ref %Optional.14b = temporary %.loc10_26.2, %.loc10_26.1 // CHECK:STDOUT: %.loc10_26.4: %Optional.14b = acquire_value %.loc10_26.3 // CHECK:STDOUT: %foo_nullable_param.call: init %empty_tuple.type = call imports.%foo_nullable_param.decl(%.loc10_26.4) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.loc10_26.3, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%.loc10_26.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc10_26.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc10_26.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_26.1(%self.param: ref %.a7d) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_26.1(%self.param: ref %.a7d) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_26.2(%self.param: ref %MaybeUnformed.ddbd) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_26.1(%self.param: ref %.a7d) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_26.1(%self.param: ref %.a7d) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_26.2(%self.param: ref %MaybeUnformed.174) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_26.3(%self.param: ref %Optional.14b) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_26.2(%self.param: ref %MaybeUnformed.174) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_26.2(%self.param: ref %MaybeUnformed.174) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_26.3(%self.param: ref %Optional.14b) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_26.3(%self.param: ref %Optional.14b) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_26.3(%self.param: ref %Optional.14b) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -332,25 +429,50 @@ fn F() { // CHECK:STDOUT: %ptr.e8f: type = ptr_type %T.67d [symbolic] // CHECK:STDOUT: %Destroy.lookup_impl_witness.781: = lookup_impl_witness %ptr.e8f, @Destroy [symbolic] // CHECK:STDOUT: %Destroy.facet.e46: %Destroy.type = facet_value %ptr.e8f, (%Destroy.lookup_impl_witness.781) [symbolic] -// CHECK:STDOUT: %MaybeUnformed.ddba: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.e46) [symbolic] +// CHECK:STDOUT: %MaybeUnformed.ddb: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.e46) [symbolic] // CHECK:STDOUT: %ptr.as.OptionalStorage.impl.None.type.2a7: type = fn_type @ptr.as.OptionalStorage.impl.None, @ptr.as.OptionalStorage.impl(%T.67d) [symbolic] // CHECK:STDOUT: %ptr.as.OptionalStorage.impl.None.c23: %ptr.as.OptionalStorage.impl.None.type.2a7 = struct_value () [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.6c4ec3.1: = custom_witness (%Destroy.WithSelf.Op.403171.1), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.fd7: %Destroy.type = facet_value %ptr.00a, (%custom_witness.6c4ec3.1) [concrete] -// CHECK:STDOUT: %MaybeUnformed.ddbd: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.fd7) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f8f19d.1: = custom_witness (%Destroy.WithSelf.Op.403171.1, %Destroy.WithSelf.SubobjectDestroy.d01daf.1, %Destroy.WithSelf.SelfDestruct.db3fdb.1), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.f20: %Destroy.type = facet_value %ptr.00a, (%custom_witness.f8f19d.1) [concrete] +// CHECK:STDOUT: %MaybeUnformed.174: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.f20) [concrete] // CHECK:STDOUT: %OptionalStorage.impl_witness.d51: = impl_witness imports.%OptionalStorage.impl_witness_table.110, @ptr.as.OptionalStorage.impl(%Cpp.void) [concrete] // CHECK:STDOUT: %.a7d: type = maybe_unformed_type %ptr.00a [concrete] // CHECK:STDOUT: %OptionalStorage.facet: %OptionalStorage.type = facet_value %ptr.00a, (%OptionalStorage.impl_witness.d51) [concrete] // CHECK:STDOUT: %Optional.14b: type = class_type @Optional, @Optional(%OptionalStorage.facet) [concrete] // CHECK:STDOUT: %Optional.None.type.18e: type = fn_type @Optional.None, @Optional(%OptionalStorage.facet) [concrete] // CHECK:STDOUT: %Optional.None.aa9: %Optional.None.type.18e = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.65e: type = pattern_type %Optional.14b [concrete] // CHECK:STDOUT: %Optional.None.specific_fn: = specific_function %Optional.None.aa9, @Optional.None(%OptionalStorage.facet) [concrete] // CHECK:STDOUT: %foo_null_param.type: type = fn_type @foo_null_param [concrete] // CHECK:STDOUT: %foo_null_param: %foo_null_param.type = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.651: type = pattern_type %.a7d [concrete] +// CHECK:STDOUT: %self.param_patt.c89: %pattern_type.651 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.2bb: %pattern_type.651 = wrapper_binding_pattern self, %self.param_patt.c89 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_52.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc10_52.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.d25: type = pattern_type %MaybeUnformed.174 [concrete] +// CHECK:STDOUT: %self.param_patt.22a: %pattern_type.d25 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.000: %pattern_type.d25 = wrapper_binding_pattern self, %self.param_patt.22a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_52.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc10_52.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.a69: %pattern_type.65e = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.ab1: %pattern_type.65e = wrapper_binding_pattern self, %self.param_patt.a69 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_52.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc10_52.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10_52.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -376,7 +498,7 @@ fn F() { // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.VoidBase: type = import_ref Core//prelude/types/cpp/void, VoidBase, loaded [concrete = constants.%Cpp.void] -// CHECK:STDOUT: %Core.import_ref.509: type = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, loaded [symbolic = @ptr.as.OptionalStorage.impl.%MaybeUnformed (constants.%MaybeUnformed.ddba)] +// CHECK:STDOUT: %Core.import_ref.509: type = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, loaded [symbolic = @ptr.as.OptionalStorage.impl.%MaybeUnformed (constants.%MaybeUnformed.ddb)] // CHECK:STDOUT: %Core.import_ref.307: @ptr.as.OptionalStorage.impl.%ptr.as.OptionalStorage.impl.None.type (%ptr.as.OptionalStorage.impl.None.type.2a7) = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, loaded [symbolic = @ptr.as.OptionalStorage.impl.%ptr.as.OptionalStorage.impl.None (constants.%ptr.as.OptionalStorage.impl.None.c23)] // CHECK:STDOUT: %Core.import_ref.c9a = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, unloaded // CHECK:STDOUT: %Core.import_ref.a90 = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, unloaded @@ -397,6 +519,51 @@ fn F() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_52.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.651 = ref_param_pattern [concrete = constants.%self.param_patt.c89] +// CHECK:STDOUT: %self.patt: %pattern_type.651 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.2bb] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %.a7d = ref_param call_param0 +// CHECK:STDOUT: %self: ref %.a7d = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc10_52.1 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.651 = ref_param_pattern [concrete = constants.%self.param_patt.c89] +// CHECK:STDOUT: %self.patt: %pattern_type.651 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.2bb] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %.a7d = ref_param call_param0 +// CHECK:STDOUT: %self: ref %.a7d = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_52.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.d25 = ref_param_pattern [concrete = constants.%self.param_patt.22a] +// CHECK:STDOUT: %self.patt: %pattern_type.d25 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.000] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %MaybeUnformed.174 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %MaybeUnformed.174 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc10_52.2 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.d25 = ref_param_pattern [concrete = constants.%self.param_patt.22a] +// CHECK:STDOUT: %self.patt: %pattern_type.d25 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.000] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %MaybeUnformed.174 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %MaybeUnformed.174 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_52.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.65e = ref_param_pattern [concrete = constants.%self.param_patt.a69] +// CHECK:STDOUT: %self.patt: %pattern_type.65e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ab1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Optional.14b = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Optional.14b = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc10_52.3 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.65e = ref_param_pattern [concrete = constants.%self.param_patt.a69] +// CHECK:STDOUT: %self.patt: %pattern_type.65e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ab1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Optional.14b = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Optional.14b = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref.loc10_3: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -417,23 +584,50 @@ fn F() { // CHECK:STDOUT: %.loc10_52.2: ref %Optional.14b = temporary %.loc10_52.1, %Optional.None.call // CHECK:STDOUT: %.loc10_52.3: %Optional.14b = acquire_value %.loc10_52.2 // CHECK:STDOUT: %foo_null_param.call: init %empty_tuple.type = call imports.%foo_null_param.decl(%.loc10_52.3) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.loc10_52.2, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%.loc10_52.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc10_52.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc10_52.2) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_52.1(%self.param: ref %.a7d) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_52.1(%self.param: ref %.a7d) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_52.2(%self.param: ref %MaybeUnformed.ddbd) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_52.1(%self.param: ref %.a7d) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_52.1(%self.param: ref %.a7d) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_52.2(%self.param: ref %MaybeUnformed.174) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_52.3(%self.param: ref %Optional.14b) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_52.2(%self.param: ref %MaybeUnformed.174) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_52.2(%self.param: ref %MaybeUnformed.174) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_52.3(%self.param: ref %Optional.14b) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_52.3(%self.param: ref %Optional.14b) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_52.3(%self.param: ref %Optional.14b) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -452,12 +646,16 @@ fn F() { // CHECK:STDOUT: %ptr.e8f: type = ptr_type %T.67d [symbolic] // CHECK:STDOUT: %Destroy.lookup_impl_witness.781: = lookup_impl_witness %ptr.e8f, @Destroy [symbolic] // CHECK:STDOUT: %Destroy.facet.e46: %Destroy.type = facet_value %ptr.e8f, (%Destroy.lookup_impl_witness.781) [symbolic] -// CHECK:STDOUT: %MaybeUnformed.ddba: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.e46) [symbolic] +// CHECK:STDOUT: %MaybeUnformed.ddb: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.e46) [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.6c4ec3.1: = custom_witness (%Destroy.WithSelf.Op.403171.1), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.fd7: %Destroy.type = facet_value %ptr.00a, (%custom_witness.6c4ec3.1) [concrete] -// CHECK:STDOUT: %MaybeUnformed.ddbd: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.fd7) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f8f19d.1: = custom_witness (%Destroy.WithSelf.Op.403171.1, %Destroy.WithSelf.SubobjectDestroy.d01daf.1, %Destroy.WithSelf.SelfDestruct.db3fdb.1), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.f20: %Destroy.type = facet_value %ptr.00a, (%custom_witness.f8f19d.1) [concrete] +// CHECK:STDOUT: %MaybeUnformed.174: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.f20) [concrete] // CHECK:STDOUT: %OptionalStorage.impl_witness.d51: = impl_witness imports.%OptionalStorage.impl_witness_table.110, @ptr.as.OptionalStorage.impl(%Cpp.void) [concrete] // CHECK:STDOUT: %.a7d: type = maybe_unformed_type %ptr.00a [concrete] // CHECK:STDOUT: %OptionalStorage.facet: %OptionalStorage.type = facet_value %ptr.00a, (%OptionalStorage.impl_witness.d51) [concrete] @@ -468,8 +666,28 @@ fn F() { // CHECK:STDOUT: %foo_nullable_return.cpp_overload_set.value: %foo_nullable_return.cpp_overload_set.type = cpp_overload_set_value @foo_nullable_return.cpp_overload_set [concrete] // CHECK:STDOUT: %foo_nullable_return.type: type = fn_type @foo_nullable_return [concrete] // CHECK:STDOUT: %foo_nullable_return: %foo_nullable_return.type = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.651: type = pattern_type %.a7d [concrete] +// CHECK:STDOUT: %self.param_patt.c89: %pattern_type.651 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.2bb: %pattern_type.651 = wrapper_binding_pattern self, %self.param_patt.c89 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_73.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc10_73.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.d25: type = pattern_type %MaybeUnformed.174 [concrete] +// CHECK:STDOUT: %self.param_patt.22a: %pattern_type.d25 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.000: %pattern_type.d25 = wrapper_binding_pattern self, %self.param_patt.22a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_73.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc10_73.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.a69: %pattern_type.65e = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.ab1: %pattern_type.65e = wrapper_binding_pattern self, %self.param_patt.a69 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_73.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc10_73.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10_73.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -493,7 +711,7 @@ fn F() { // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } // CHECK:STDOUT: %Core.VoidBase: type = import_ref Core//prelude/types/cpp/void, VoidBase, loaded [concrete = constants.%Cpp.void] -// CHECK:STDOUT: %Core.import_ref.509: type = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, loaded [symbolic = @ptr.as.OptionalStorage.impl.%MaybeUnformed (constants.%MaybeUnformed.ddba)] +// CHECK:STDOUT: %Core.import_ref.509: type = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, loaded [symbolic = @ptr.as.OptionalStorage.impl.%MaybeUnformed (constants.%MaybeUnformed.ddb)] // CHECK:STDOUT: %Core.import_ref.105 = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, unloaded // CHECK:STDOUT: %Core.import_ref.c9a = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, unloaded // CHECK:STDOUT: %Core.import_ref.a90 = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, unloaded @@ -512,6 +730,51 @@ fn F() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_73.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.651 = ref_param_pattern [concrete = constants.%self.param_patt.c89] +// CHECK:STDOUT: %self.patt: %pattern_type.651 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.2bb] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %.a7d = ref_param call_param0 +// CHECK:STDOUT: %self: ref %.a7d = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc10_73.1 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.651 = ref_param_pattern [concrete = constants.%self.param_patt.c89] +// CHECK:STDOUT: %self.patt: %pattern_type.651 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.2bb] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %.a7d = ref_param call_param0 +// CHECK:STDOUT: %self: ref %.a7d = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_73.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.d25 = ref_param_pattern [concrete = constants.%self.param_patt.22a] +// CHECK:STDOUT: %self.patt: %pattern_type.d25 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.000] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %MaybeUnformed.174 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %MaybeUnformed.174 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc10_73.2 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.d25 = ref_param_pattern [concrete = constants.%self.param_patt.22a] +// CHECK:STDOUT: %self.patt: %pattern_type.d25 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.000] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %MaybeUnformed.174 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %MaybeUnformed.174 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_73.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.65e = ref_param_pattern [concrete = constants.%self.param_patt.a69] +// CHECK:STDOUT: %self.patt: %pattern_type.65e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ab1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Optional.14b = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Optional.14b = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc10_73.3 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.65e = ref_param_pattern [concrete = constants.%self.param_patt.a69] +// CHECK:STDOUT: %self.patt: %pattern_type.65e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ab1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Optional.14b = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Optional.14b = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref.loc10_49: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -534,23 +797,50 @@ fn F() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %output.patt: %pattern_type.65e = value_binding_pattern output [concrete = constants.%output.patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.loc10_73.2, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%.loc10_73.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc10_73.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc10_73.2) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_73.1(%self.param: ref %.a7d) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_73.1(%self.param: ref %.a7d) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_73.2(%self.param: ref %MaybeUnformed.ddbd) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_73.1(%self.param: ref %.a7d) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_73.1(%self.param: ref %.a7d) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_73.2(%self.param: ref %MaybeUnformed.174) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_73.3(%self.param: ref %Optional.14b) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_73.2(%self.param: ref %MaybeUnformed.174) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_73.2(%self.param: ref %MaybeUnformed.174) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_73.3(%self.param: ref %Optional.14b) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_73.3(%self.param: ref %Optional.14b) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_73.3(%self.param: ref %Optional.14b) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -573,8 +863,14 @@ fn F() { // CHECK:STDOUT: %Invoke_pointer.cpp_overload_set.value: %Invoke_pointer.cpp_overload_set.type = cpp_overload_set_value @Invoke_pointer.cpp_overload_set [concrete] // CHECK:STDOUT: %Invoke_pointer.type: type = fn_type @Invoke_pointer [concrete] // CHECK:STDOUT: %Invoke_pointer: %Invoke_pointer.type = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.e2c: %pattern_type.c1e = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.1b9: %pattern_type.c1e = wrapper_binding_pattern self, %self.param_patt.e2c [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfc: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11 [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.loc11 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc11 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -598,6 +894,23 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl: %Destroy.WithSelf.SubobjectDestroy.type.dfc = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.c1e = ref_param_pattern [concrete = constants.%self.param_patt.e2c] +// CHECK:STDOUT: %self.patt: %pattern_type.c1e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.1b9] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr.6f9 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr.6f9 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc11 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.c1e = ref_param_pattern [concrete = constants.%self.param_patt.e2c] +// CHECK:STDOUT: %self.patt: %pattern_type.c1e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.1b9] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr.6f9 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr.6f9 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %non_nullable_pointer.var: ref %ptr.6f9 = var_storage %non_nullable_pointer.var_patt @@ -621,13 +934,22 @@ fn F() { // CHECK:STDOUT: %non_nullable_pointer.ref: ref %ptr.6f9 = name_ref non_nullable_pointer, %non_nullable_pointer // CHECK:STDOUT: %.loc12: %ptr.6f9 = acquire_value %non_nullable_pointer.ref // CHECK:STDOUT: %Invoke_pointer.call: init %empty_tuple.type = call imports.%Invoke_pointer.decl(%.loc12) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %non_nullable_pointer.var, constants.%Destroy.WithSelf.Op.403 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%non_nullable_pointer.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %non_nullable_pointer.var, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%non_nullable_pointer.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11(%self.param: ref %ptr.6f9) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11(%self.param: ref %ptr.6f9) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11(%self.param: ref %ptr.6f9) { +// 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) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- non_nullable_const.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -647,8 +969,14 @@ fn F() { // CHECK:STDOUT: %Invoke_const.cpp_overload_set.value: %Invoke_const.cpp_overload_set.type = cpp_overload_set_value @Invoke_const.cpp_overload_set [concrete] // CHECK:STDOUT: %Invoke_const.type: type = fn_type @Invoke_const [concrete] // CHECK:STDOUT: %Invoke_const: %Invoke_const.type = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.486: %pattern_type.c83 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.9b8: %pattern_type.c83 = wrapper_binding_pattern self, %self.param_patt.486 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfc: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11 [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.loc11 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc11 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -672,6 +1000,23 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl: %Destroy.WithSelf.SubobjectDestroy.type.dfc = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.c83 = ref_param_pattern [concrete = constants.%self.param_patt.486] +// CHECK:STDOUT: %self.patt: %pattern_type.c83 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.9b8] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc11 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.c83 = ref_param_pattern [concrete = constants.%self.param_patt.486] +// CHECK:STDOUT: %self.patt: %pattern_type.c83 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.9b8] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %const_void_pointer.var: ref %ptr = var_storage %const_void_pointer.var_patt @@ -695,10 +1040,19 @@ fn F() { // CHECK:STDOUT: %const_void_pointer.ref: ref %ptr = name_ref const_void_pointer, %const_void_pointer // CHECK:STDOUT: %.loc12: %ptr = acquire_value %const_void_pointer.ref // CHECK:STDOUT: %Invoke_const.call: init %empty_tuple.type = call imports.%Invoke_const.decl(%.loc12) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %const_void_pointer.var, constants.%Destroy.WithSelf.Op.403 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%const_void_pointer.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %const_void_pointer.var, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%const_void_pointer.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11(%self.param: ref %ptr) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11(%self.param: ref %ptr) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11(%self.param: ref %ptr) { +// 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) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/impls/as.carbon b/toolchain/check/testdata/interop/cpp/impls/as.carbon index 5bb8ddc1e414..55900ccd858a 100644 --- a/toolchain/check/testdata/interop/cpp/impls/as.carbon +++ b/toolchain/check/testdata/interop/cpp/impls/as.carbon @@ -136,32 +136,47 @@ fn ConversionExplicit(s: Cpp.ConditionallyExplicitFalse) { // CHECK:STDOUT: %Source: type = class_type @Source [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Dest: type = class_type @Dest [concrete] +// CHECK:STDOUT: %pattern_type.b72: type = pattern_type %Dest [concrete] // CHECK:STDOUT: %ptr.ca8: type = ptr_type %Dest [concrete] // CHECK:STDOUT: %Dest__carbon_thunk.type.eb4c5e.1: type = fn_type @Dest__carbon_thunk.1 [concrete] // CHECK:STDOUT: %Dest__carbon_thunk.c8e433.1: %Dest__carbon_thunk.type.eb4c5e.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.581: %pattern_type.b72 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.48a: %pattern_type.b72 = wrapper_binding_pattern self, %self.param_patt.581 [concrete] // CHECK:STDOUT: %Dest.cpp_destructor.type: type = fn_type @Dest.cpp_destructor [concrete] // CHECK:STDOUT: %Dest.cpp_destructor: %Dest.cpp_destructor.type = struct_value () [concrete] -// CHECK:STDOUT: %Dest.Op.type: type = fn_type @Dest.Op [concrete] -// CHECK:STDOUT: %Dest.Op: %Dest.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete] // CHECK:STDOUT: %Source2: type = class_type @Source2 [concrete] // CHECK:STDOUT: %Dest2: type = class_type @Dest2 [concrete] +// CHECK:STDOUT: %pattern_type.a68: type = pattern_type %Dest2 [concrete] // CHECK:STDOUT: %ptr.0db: type = ptr_type %Source2 [concrete] // CHECK:STDOUT: %ptr.802: type = ptr_type %Dest2 [concrete] // CHECK:STDOUT: %Dest2__carbon_thunk.type: type = fn_type @Dest2__carbon_thunk [concrete] // CHECK:STDOUT: %Dest2__carbon_thunk: %Dest2__carbon_thunk.type = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.2f7: %pattern_type.a68 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.7db: %pattern_type.a68 = wrapper_binding_pattern self, %self.param_patt.2f7 [concrete] // CHECK:STDOUT: %Dest2.cpp_destructor.type: type = fn_type @Dest2.cpp_destructor [concrete] // CHECK:STDOUT: %Dest2.cpp_destructor: %Dest2.cpp_destructor.type = struct_value () [concrete] -// CHECK:STDOUT: %Dest2.Op.type: type = fn_type @Dest2.Op [concrete] -// CHECK:STDOUT: %Dest2.Op: %Dest2.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc14 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc14 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: %ExplicitConstructor: type = class_type @ExplicitConstructor [concrete] +// CHECK:STDOUT: %pattern_type.eae: type = pattern_type %ExplicitConstructor [concrete] // CHECK:STDOUT: %ptr.5f6: type = ptr_type %Source [concrete] // CHECK:STDOUT: %ptr.44f: type = ptr_type %ExplicitConstructor [concrete] // CHECK:STDOUT: %ExplicitConstructor__carbon_thunk.type: type = fn_type @ExplicitConstructor__carbon_thunk [concrete] // CHECK:STDOUT: %ExplicitConstructor__carbon_thunk: %ExplicitConstructor__carbon_thunk.type = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.d18: %pattern_type.eae = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.94a: %pattern_type.eae = wrapper_binding_pattern self, %self.param_patt.d18 [concrete] // CHECK:STDOUT: %ExplicitConstructor.cpp_destructor.type: type = fn_type @ExplicitConstructor.cpp_destructor [concrete] // CHECK:STDOUT: %ExplicitConstructor.cpp_destructor: %ExplicitConstructor.cpp_destructor.type = struct_value () [concrete] -// CHECK:STDOUT: %ExplicitConstructor.Op.type: type = fn_type @ExplicitConstructor.Op [concrete] -// CHECK:STDOUT: %ExplicitConstructor.Op: %ExplicitConstructor.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc20 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc20 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] // CHECK:STDOUT: %ExplicitConversion: type = class_type @ExplicitConversion [concrete] // CHECK:STDOUT: %Dest__carbon_thunk.type.eb4c5e.2: type = fn_type @Dest__carbon_thunk.2 [concrete] // CHECK:STDOUT: %Dest__carbon_thunk.c8e433.2: %Dest__carbon_thunk.type.eb4c5e.2 = struct_value () [concrete] @@ -220,6 +235,30 @@ fn ConversionExplicit(s: Cpp.ConditionallyExplicitFalse) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc8 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b72 = ref_param_pattern [concrete = constants.%self.param_patt.581] +// CHECK:STDOUT: %self.patt: %pattern_type.b72 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.48a] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Dest = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Dest = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc14 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.a68 = ref_param_pattern [concrete = constants.%self.param_patt.2f7] +// CHECK:STDOUT: %self.patt: %pattern_type.a68 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.7db] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Dest2 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Dest2 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc20 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.eae = ref_param_pattern [concrete = constants.%self.param_patt.d18] +// CHECK:STDOUT: %self.patt: %pattern_type.eae = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.94a] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ExplicitConstructor = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ExplicitConstructor = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @UserConversion(%s.param: %Source) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %s.ref: %Source = name_ref s, %s @@ -232,13 +271,20 @@ fn ConversionExplicit(s: Cpp.ConditionallyExplicitFalse) { // CHECK:STDOUT: %.loc8_5.3: init %Dest = converted %s.ref, %.loc8_5.2 // CHECK:STDOUT: %.loc8_5.4: ref %Dest = temporary %.loc8_5.1, %.loc8_5.3 // CHECK:STDOUT: -// CHECK:STDOUT: %Dest.Op.bound: = bound_method %.loc8_5.4, constants.%Dest.Op -// CHECK:STDOUT: %Op.ref: %Dest.cpp_destructor.type = name_ref Op, imports.%Dest.cpp_destructor.decl [concrete = constants.%Dest.cpp_destructor] -// CHECK:STDOUT: %Dest.cpp_destructor.bound: = bound_method %.loc8_5.4, %Op.ref -// CHECK:STDOUT: %Dest.cpp_destructor.call: init %empty_tuple.type = call %Dest.cpp_destructor.bound(%.loc8_5.4) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc8_5.4, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc8_5.4) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8(%self.param: ref %Dest) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8(%self.param: ref %Dest) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Dest.cpp_destructor.call: init %empty_tuple.type = call imports.%Dest.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @ConstructorConversion(%s.param: %Source2) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %s.ref: %Source2 = name_ref s, %s @@ -253,13 +299,20 @@ fn ConversionExplicit(s: Cpp.ConditionallyExplicitFalse) { // CHECK:STDOUT: %.loc14_5.3: init %Dest2 = converted %s.ref, %.loc14_5.2 // CHECK:STDOUT: %.loc14_5.4: ref %Dest2 = temporary %.loc14_5.1, %.loc14_5.3 // CHECK:STDOUT: -// CHECK:STDOUT: %Dest2.Op.bound: = bound_method %.loc14_5.4, constants.%Dest2.Op -// CHECK:STDOUT: %Op.ref: %Dest2.cpp_destructor.type = name_ref Op, imports.%Dest2.cpp_destructor.decl [concrete = constants.%Dest2.cpp_destructor] -// CHECK:STDOUT: %Dest2.cpp_destructor.bound: = bound_method %.loc14_5.4, %Op.ref -// CHECK:STDOUT: %Dest2.cpp_destructor.call: init %empty_tuple.type = call %Dest2.cpp_destructor.bound(%.loc14_5.4) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc14_5.4, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc14_5.4) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc14(%self.param: ref %Dest2) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc14(%self.param: ref %Dest2) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Dest2.cpp_destructor.call: init %empty_tuple.type = call imports.%Dest2.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @ExplicitConstructorTest(%s.param: %Source) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %s.ref: %Source = name_ref s, %s @@ -274,13 +327,20 @@ fn ConversionExplicit(s: Cpp.ConditionallyExplicitFalse) { // CHECK:STDOUT: %.loc20_5.3: init %ExplicitConstructor = converted %s.ref, %.loc20_5.2 // CHECK:STDOUT: %.loc20_5.4: ref %ExplicitConstructor = temporary %.loc20_5.1, %.loc20_5.3 // CHECK:STDOUT: -// CHECK:STDOUT: %ExplicitConstructor.Op.bound: = bound_method %.loc20_5.4, constants.%ExplicitConstructor.Op -// CHECK:STDOUT: %Op.ref: %ExplicitConstructor.cpp_destructor.type = name_ref Op, imports.%ExplicitConstructor.cpp_destructor.decl [concrete = constants.%ExplicitConstructor.cpp_destructor] -// CHECK:STDOUT: %ExplicitConstructor.cpp_destructor.bound: = bound_method %.loc20_5.4, %Op.ref -// CHECK:STDOUT: %ExplicitConstructor.cpp_destructor.call: init %empty_tuple.type = call %ExplicitConstructor.cpp_destructor.bound(%.loc20_5.4) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc20_5.4, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc20_5.4) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc20(%self.param: ref %ExplicitConstructor) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc20(%self.param: ref %ExplicitConstructor) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %ExplicitConstructor.cpp_destructor.call: init %empty_tuple.type = call imports.%ExplicitConstructor.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @ExplicitConversionTest(%s.param: %ExplicitConversion) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %s.ref: %ExplicitConversion = name_ref s, %s @@ -292,10 +352,8 @@ fn ConversionExplicit(s: Cpp.ConditionallyExplicitFalse) { // CHECK:STDOUT: %.loc26_5.2: init %Dest to %.loc26_5.1 = mark_in_place_init %Dest__carbon_thunk.call // CHECK:STDOUT: %.loc26_5.3: init %Dest = converted %s.ref, %.loc26_5.2 // CHECK:STDOUT: %.loc26_5.4: ref %Dest = temporary %.loc26_5.1, %.loc26_5.3 -// CHECK:STDOUT: %Dest.Op.bound: = bound_method %.loc26_5.4, constants.%Dest.Op -// CHECK:STDOUT: %Op.ref: %Dest.cpp_destructor.type = name_ref Op, imports.%Dest.cpp_destructor.decl [concrete = constants.%Dest.cpp_destructor] -// CHECK:STDOUT: %Dest.cpp_destructor.bound: = bound_method %.loc26_5.4, %Op.ref -// CHECK:STDOUT: %Dest.cpp_destructor.call: init %empty_tuple.type = call %Dest.cpp_destructor.bound(%.loc26_5.4) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc26_5.4, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc26_5.4) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -312,28 +370,41 @@ fn ConversionExplicit(s: Cpp.ConditionallyExplicitFalse) { // CHECK:STDOUT: %ptr.bb5: type = ptr_type %ConditionallyExplicit.3cd [concrete] // CHECK:STDOUT: %ConditionallyExplicit__carbon_thunk.type.c9ab94.1: type = fn_type @ConditionallyExplicit__carbon_thunk.1 [concrete] // CHECK:STDOUT: %ConditionallyExplicit__carbon_thunk.924633.1: %ConditionallyExplicit__carbon_thunk.type.c9ab94.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.ece: %pattern_type.be2 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.ba3: %pattern_type.be2 = wrapper_binding_pattern self, %self.param_patt.ece [concrete] // CHECK:STDOUT: %ConditionallyExplicit.cpp_destructor.type.634098.1: type = fn_type @ConditionallyExplicit.cpp_destructor.1 [concrete] // CHECK:STDOUT: %ConditionallyExplicit.cpp_destructor.5dc792.1: %ConditionallyExplicit.cpp_destructor.type.634098.1 = struct_value () [concrete] -// CHECK:STDOUT: %ConditionallyExplicit.Op.type.83af6e.1: type = fn_type @ConditionallyExplicit.Op.1 [concrete] -// CHECK:STDOUT: %ConditionallyExplicit.Op.4dca31.1: %ConditionallyExplicit.Op.type.83af6e.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete] // CHECK:STDOUT: %ConditionallyExplicit.9d4: type = class_type @ConditionallyExplicit.2 [concrete] +// CHECK:STDOUT: %pattern_type.04c: type = pattern_type %ConditionallyExplicit.9d4 [concrete] // CHECK:STDOUT: %ptr.4c0: type = ptr_type %ConditionallyExplicit.9d4 [concrete] // CHECK:STDOUT: %ConditionallyExplicit__carbon_thunk.type.c9ab94.2: type = fn_type @ConditionallyExplicit__carbon_thunk.2 [concrete] // CHECK:STDOUT: %ConditionallyExplicit__carbon_thunk.924633.2: %ConditionallyExplicit__carbon_thunk.type.c9ab94.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.9a8: %pattern_type.04c = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.012: %pattern_type.04c = wrapper_binding_pattern self, %self.param_patt.9a8 [concrete] // CHECK:STDOUT: %ConditionallyExplicit.cpp_destructor.type.634098.2: type = fn_type @ConditionallyExplicit.cpp_destructor.2 [concrete] // CHECK:STDOUT: %ConditionallyExplicit.cpp_destructor.5dc792.2: %ConditionallyExplicit.cpp_destructor.type.634098.2 = struct_value () [concrete] -// CHECK:STDOUT: %ConditionallyExplicit.Op.type.83af6e.2: type = fn_type @ConditionallyExplicit.Op.2 [concrete] -// CHECK:STDOUT: %ConditionallyExplicit.Op.4dca31.2: %ConditionallyExplicit.Op.type.83af6e.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc15 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc15 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: %Dest: type = class_type @Dest [concrete] // CHECK:STDOUT: %pattern_type.b72: type = pattern_type %Dest [concrete] // CHECK:STDOUT: %_.patt.664: %pattern_type.b72 = value_binding_pattern _ [concrete] // CHECK:STDOUT: %ptr.ca8: type = ptr_type %Dest [concrete] // CHECK:STDOUT: %Dest__carbon_thunk.type: type = fn_type @Dest__carbon_thunk [concrete] // CHECK:STDOUT: %Dest__carbon_thunk: %Dest__carbon_thunk.type = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.581: %pattern_type.b72 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.48a: %pattern_type.b72 = wrapper_binding_pattern self, %self.param_patt.581 [concrete] // CHECK:STDOUT: %Dest.cpp_destructor.type: type = fn_type @Dest.cpp_destructor [concrete] // CHECK:STDOUT: %Dest.cpp_destructor: %Dest.cpp_destructor.type = struct_value () [concrete] -// CHECK:STDOUT: %Dest.Op.type: type = fn_type @Dest.Op [concrete] -// CHECK:STDOUT: %Dest.Op: %Dest.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc22 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc22 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -380,6 +451,30 @@ fn ConversionExplicit(s: Cpp.ConditionallyExplicitFalse) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc9 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.be2 = ref_param_pattern [concrete = constants.%self.param_patt.ece] +// CHECK:STDOUT: %self.patt: %pattern_type.be2 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ba3] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ConditionallyExplicit.3cd = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ConditionallyExplicit.3cd = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc15 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.04c = ref_param_pattern [concrete = constants.%self.param_patt.9a8] +// CHECK:STDOUT: %self.patt: %pattern_type.04c = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.012] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ConditionallyExplicit.9d4 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ConditionallyExplicit.9d4 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc22 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b72 = ref_param_pattern [concrete = constants.%self.param_patt.581] +// CHECK:STDOUT: %self.patt: %pattern_type.b72 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.48a] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Dest = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Dest = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @ConstructorNotExplicit(%s.param: %Source) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %s.ref.loc8: %Source = name_ref s, %s @@ -412,17 +507,22 @@ fn ConversionExplicit(s: Cpp.ConditionallyExplicitFalse) { // CHECK:STDOUT: %.loc9_5.3: init %ConditionallyExplicit.3cd = converted %s.ref.loc9, %.loc9_5.2 // CHECK:STDOUT: %.loc9_5.4: ref %ConditionallyExplicit.3cd = temporary %.loc9_5.1, %.loc9_5.3 // CHECK:STDOUT: -// CHECK:STDOUT: %ConditionallyExplicit.Op.bound.loc9: = bound_method %.loc9_5.4, constants.%ConditionallyExplicit.Op.4dca31.1 -// CHECK:STDOUT: %Op.ref.loc9: %ConditionallyExplicit.cpp_destructor.type.634098.1 = name_ref Op, imports.%ConditionallyExplicit.cpp_destructor.decl.a7962a.1 [concrete = constants.%ConditionallyExplicit.cpp_destructor.5dc792.1] -// CHECK:STDOUT: %ConditionallyExplicit.cpp_destructor.bound.loc9: = bound_method %.loc9_5.4, %Op.ref.loc9 -// CHECK:STDOUT: %ConditionallyExplicit.cpp_destructor.call.loc9: init %empty_tuple.type = call %ConditionallyExplicit.cpp_destructor.bound.loc9(%.loc9_5.4) -// CHECK:STDOUT: %ConditionallyExplicit.Op.bound.loc8: = bound_method %.loc8_43.5, constants.%ConditionallyExplicit.Op.4dca31.1 -// CHECK:STDOUT: %Op.ref.loc8: %ConditionallyExplicit.cpp_destructor.type.634098.1 = name_ref Op, imports.%ConditionallyExplicit.cpp_destructor.decl.a7962a.1 [concrete = constants.%ConditionallyExplicit.cpp_destructor.5dc792.1] -// CHECK:STDOUT: %ConditionallyExplicit.cpp_destructor.bound.loc8: = bound_method %.loc8_43.5, %Op.ref.loc8 -// CHECK:STDOUT: %ConditionallyExplicit.cpp_destructor.call.loc8: init %empty_tuple.type = call %ConditionallyExplicit.cpp_destructor.bound.loc8(%.loc8_43.5) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc9: = bound_method %.loc9_5.4, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc9(%.loc9_5.4) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: = bound_method %.loc8_43.5, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%.loc8_43.5) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9(%self.param: ref %ConditionallyExplicit.3cd) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9(%self.param: ref %ConditionallyExplicit.3cd) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %ConditionallyExplicit.cpp_destructor.call: init %empty_tuple.type = call imports.%ConditionallyExplicit.cpp_destructor.decl.a7962a.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @ConstructorExplicit(%s.param: %Source) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %s.ref: %Source = name_ref s, %s @@ -437,13 +537,20 @@ fn ConversionExplicit(s: Cpp.ConditionallyExplicitFalse) { // CHECK:STDOUT: %.loc15_5.3: init %ConditionallyExplicit.9d4 = converted %s.ref, %.loc15_5.2 // CHECK:STDOUT: %.loc15_5.4: ref %ConditionallyExplicit.9d4 = temporary %.loc15_5.1, %.loc15_5.3 // CHECK:STDOUT: -// CHECK:STDOUT: %ConditionallyExplicit.Op.bound: = bound_method %.loc15_5.4, constants.%ConditionallyExplicit.Op.4dca31.2 -// CHECK:STDOUT: %Op.ref: %ConditionallyExplicit.cpp_destructor.type.634098.2 = name_ref Op, imports.%ConditionallyExplicit.cpp_destructor.decl.a7962a.2 [concrete = constants.%ConditionallyExplicit.cpp_destructor.5dc792.2] -// CHECK:STDOUT: %ConditionallyExplicit.cpp_destructor.bound: = bound_method %.loc15_5.4, %Op.ref -// CHECK:STDOUT: %ConditionallyExplicit.cpp_destructor.call: init %empty_tuple.type = call %ConditionallyExplicit.cpp_destructor.bound(%.loc15_5.4) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc15_5.4, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc15_5.4) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc15(%self.param: ref %ConditionallyExplicit.9d4) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc15(%self.param: ref %ConditionallyExplicit.9d4) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %ConditionallyExplicit.cpp_destructor.call: init %empty_tuple.type = call imports.%ConditionallyExplicit.cpp_destructor.decl.a7962a.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @ConversionNotExplicit(%s.param: %ConditionallyExplicit.3cd) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %s.ref.loc21: %ConditionallyExplicit.3cd = name_ref s, %s @@ -472,17 +579,22 @@ fn ConversionExplicit(s: Cpp.ConditionallyExplicitFalse) { // CHECK:STDOUT: %.loc22_5.3: init %Dest = converted %s.ref.loc22, %.loc22_5.2 // CHECK:STDOUT: %.loc22_5.4: ref %Dest = temporary %.loc22_5.1, %.loc22_5.3 // CHECK:STDOUT: -// CHECK:STDOUT: %Dest.Op.bound.loc22: = bound_method %.loc22_5.4, constants.%Dest.Op -// CHECK:STDOUT: %Op.ref.loc22: %Dest.cpp_destructor.type = name_ref Op, imports.%Dest.cpp_destructor.decl [concrete = constants.%Dest.cpp_destructor] -// CHECK:STDOUT: %Dest.cpp_destructor.bound.loc22: = bound_method %.loc22_5.4, %Op.ref.loc22 -// CHECK:STDOUT: %Dest.cpp_destructor.call.loc22: init %empty_tuple.type = call %Dest.cpp_destructor.bound.loc22(%.loc22_5.4) -// CHECK:STDOUT: %Dest.Op.bound.loc21: = bound_method %.loc21_21.4, constants.%Dest.Op -// CHECK:STDOUT: %Op.ref.loc21: %Dest.cpp_destructor.type = name_ref Op, imports.%Dest.cpp_destructor.decl [concrete = constants.%Dest.cpp_destructor] -// CHECK:STDOUT: %Dest.cpp_destructor.bound.loc21: = bound_method %.loc21_21.4, %Op.ref.loc21 -// CHECK:STDOUT: %Dest.cpp_destructor.call.loc21: init %empty_tuple.type = call %Dest.cpp_destructor.bound.loc21(%.loc21_21.4) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc22: = bound_method %.loc22_5.4, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc22: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc22(%.loc22_5.4) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc21: = bound_method %.loc21_21.4, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc21: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc21(%.loc21_21.4) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc22(%self.param: ref %Dest) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc22(%self.param: ref %Dest) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Dest.cpp_destructor.call: init %empty_tuple.type = call imports.%Dest.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @ConversionExplicit(%s.param: %ConditionallyExplicit.3cd) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %s.ref: %ConditionallyExplicit.3cd = name_ref s, %s @@ -494,10 +606,8 @@ fn ConversionExplicit(s: Cpp.ConditionallyExplicitFalse) { // CHECK:STDOUT: %.loc28_5.2: init %Dest to %.loc28_5.1 = mark_in_place_init %Dest__carbon_thunk.call // CHECK:STDOUT: %.loc28_5.3: init %Dest = converted %s.ref, %.loc28_5.2 // CHECK:STDOUT: %.loc28_5.4: ref %Dest = temporary %.loc28_5.1, %.loc28_5.3 -// CHECK:STDOUT: %Dest.Op.bound: = bound_method %.loc28_5.4, constants.%Dest.Op -// CHECK:STDOUT: %Op.ref: %Dest.cpp_destructor.type = name_ref Op, imports.%Dest.cpp_destructor.decl [concrete = constants.%Dest.cpp_destructor] -// CHECK:STDOUT: %Dest.cpp_destructor.bound: = bound_method %.loc28_5.4, %Op.ref -// CHECK:STDOUT: %Dest.cpp_destructor.call: init %empty_tuple.type = call %Dest.cpp_destructor.bound(%.loc28_5.4) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc28_5.4, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc28_5.4) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -517,10 +627,14 @@ fn ConversionExplicit(s: Cpp.ConditionallyExplicitFalse) { // CHECK:STDOUT: %ptr.ca8: type = ptr_type %Dest.980 [concrete] // CHECK:STDOUT: %Dest__carbon_thunk.type: type = fn_type @Dest__carbon_thunk [concrete] // CHECK:STDOUT: %Dest__carbon_thunk: %Dest__carbon_thunk.type = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.581: %pattern_type.b72 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.48a: %pattern_type.b72 = wrapper_binding_pattern self, %self.param_patt.581 [concrete] // CHECK:STDOUT: %Dest.cpp_destructor.type: type = fn_type @Dest.cpp_destructor [concrete] // CHECK:STDOUT: %Dest.cpp_destructor: %Dest.cpp_destructor.type = struct_value () [concrete] -// CHECK:STDOUT: %Dest.Op.type: type = fn_type @Dest.Op [concrete] -// CHECK:STDOUT: %Dest.Op: %Dest.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc21 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc21 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -547,6 +661,16 @@ fn ConversionExplicit(s: Cpp.ConditionallyExplicitFalse) { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc21 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b72 = ref_param_pattern [concrete = constants.%self.param_patt.581] +// CHECK:STDOUT: %self.patt: %pattern_type.b72 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.48a] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Dest.980 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Dest.980 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @ConstructorExplicit(%s.param: %Source) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %s.ref: %Source = name_ref s, %s @@ -581,10 +705,17 @@ fn ConversionExplicit(s: Cpp.ConditionallyExplicitFalse) { // CHECK:STDOUT: %_.patt: %pattern_type.b72 = value_binding_pattern _ [concrete = constants.%_.patt.664] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: %Dest.Op.bound: = bound_method %.loc21_21.4, constants.%Dest.Op -// CHECK:STDOUT: %Op.ref: %Dest.cpp_destructor.type = name_ref Op, imports.%Dest.cpp_destructor.decl [concrete = constants.%Dest.cpp_destructor] -// CHECK:STDOUT: %Dest.cpp_destructor.bound: = bound_method %.loc21_21.4, %Op.ref -// CHECK:STDOUT: %Dest.cpp_destructor.call: init %empty_tuple.type = call %Dest.cpp_destructor.bound(%.loc21_21.4) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc21_21.4, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc21_21.4) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc21(%self.param: ref %Dest.980) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc21(%self.param: ref %Dest.980) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param) +// CHECK:STDOUT: %Dest.cpp_destructor.call: init %empty_tuple.type = call imports.%Dest.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/impls/destroy.carbon b/toolchain/check/testdata/interop/cpp/impls/destroy.carbon index e4578a0b9438..5011b5d94ffa 100644 --- a/toolchain/check/testdata/interop/cpp/impls/destroy.carbon +++ b/toolchain/check/testdata/interop/cpp/impls/destroy.carbon @@ -241,10 +241,16 @@ fn F() { // CHECK:STDOUT: %PublicDestructor.val: %PublicDestructor = struct_value () [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %Self: %Destroy.type = symbolic_binding Self, 0 [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.d3e: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Self) [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.42b: %Destroy.WithSelf.Op.type.d3e = struct_value () [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.0ce: type = fn_type @Destroy.WithSelf.SubobjectDestroy, @Destroy.WithSelf(%Self) [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.9cd: %Destroy.WithSelf.SubobjectDestroy.type.0ce = struct_value () [symbolic] +// CHECK:STDOUT: %self.param_patt.5ea: %pattern_type.bdc = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.81d: %pattern_type.bdc = wrapper_binding_pattern self, %self.param_patt.5ea [concrete] // CHECK:STDOUT: %PublicDestructor.cpp_destructor.type: type = fn_type @PublicDestructor.cpp_destructor [concrete] // CHECK:STDOUT: %PublicDestructor.cpp_destructor: %PublicDestructor.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc11 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc11 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.c5a: = custom_witness (), @Destroy [concrete] // CHECK:STDOUT: %TrivialDestroy.type: type = fn_type @TrivialDestroy [concrete] // CHECK:STDOUT: %TrivialDestroy: %TrivialDestroy.type = struct_value () [concrete] @@ -257,9 +263,13 @@ fn F() { // CHECK:STDOUT: %self.patt.01e: %pattern_type.a12 = wrapper_binding_pattern self, %self.param_patt.e73 [concrete] // CHECK:STDOUT: %TrivialDestructor.cpp_destructor.type: type = fn_type @TrivialDestructor.cpp_destructor [concrete] // CHECK:STDOUT: %TrivialDestructor.cpp_destructor: %TrivialDestructor.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc15 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc15 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.facet.c09: %Destroy.type = facet_value %TrivialDestructor, (%custom_witness.c5a) [concrete] -// CHECK:STDOUT: %TrivialDestructor.Op.type: type = fn_type @TrivialDestructor.Op [concrete] -// CHECK:STDOUT: %TrivialDestructor.Op: %TrivialDestructor.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %TrivialDestructor.SubobjectDestroy.type: type = fn_type @TrivialDestructor.SubobjectDestroy [concrete] +// CHECK:STDOUT: %TrivialDestructor.SubobjectDestroy: %TrivialDestructor.SubobjectDestroy.type = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -275,7 +285,14 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %PublicDestructor.decl: type = class_decl @PublicDestructor [concrete = constants.%PublicDestructor] {} {} // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] -// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.d3e = fn_decl @Destroy.WithSelf.Op [symbolic = @Destroy.WithSelf.%Destroy.WithSelf.Op (constants.%Destroy.WithSelf.Op.42b)] {} {} +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl: %Destroy.WithSelf.SubobjectDestroy.type.0ce = fn_decl @Destroy.WithSelf.SubobjectDestroy [symbolic = @Destroy.WithSelf.%Destroy.WithSelf.SubobjectDestroy (constants.%Destroy.WithSelf.SubobjectDestroy.9cd)] {} {} +// CHECK:STDOUT: %PublicDestructor.cpp_destructor.decl: %PublicDestructor.cpp_destructor.type = fn_decl @PublicDestructor.cpp_destructor [concrete = constants.%PublicDestructor.cpp_destructor] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.bdc = ref_param_pattern [concrete = constants.%self.param_patt.5ea] +// CHECK:STDOUT: %self.patt: %pattern_type.bdc = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.81d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %PublicDestructor = ref_param call_param0 +// CHECK:STDOUT: %self: ref %PublicDestructor = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: %TrivialDestructor.decl: type = class_decl @TrivialDestructor [concrete = constants.%TrivialDestructor] {} {} // CHECK:STDOUT: %TrivialDestructor.cpp_destructor.decl: %TrivialDestructor.cpp_destructor.type = fn_decl @TrivialDestructor.cpp_destructor [concrete = constants.%TrivialDestructor.cpp_destructor] { // CHECK:STDOUT: %self.param_patt: %pattern_type.a12 = ref_param_pattern [concrete = constants.%self.param_patt.e73] @@ -286,6 +303,23 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc11 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.bdc = ref_param_pattern [concrete = constants.%self.param_patt.5ea] +// CHECK:STDOUT: %self.patt: %pattern_type.bdc = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.81d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %PublicDestructor = ref_param call_param0 +// CHECK:STDOUT: %self: ref %PublicDestructor = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc15 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.a12 = ref_param_pattern [concrete = constants.%self.param_patt.e73] +// CHECK:STDOUT: %self.patt: %pattern_type.a12 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.01e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %TrivialDestructor = ref_param call_param0 +// CHECK:STDOUT: %self: ref %TrivialDestructor = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -335,13 +369,22 @@ fn F() { // CHECK:STDOUT: %a.patt: %pattern_type.bdc = ref_binding_pattern a [concrete = constants.%a.patt.e26] // CHECK:STDOUT: %a.var_patt: %pattern_type.bdc = var_pattern %a.patt [concrete = constants.%a.var_patt.17b] // CHECK:STDOUT: } -// CHECK:STDOUT: %PublicDestructor.cpp_destructor.bound: = bound_method %a.var, constants.%PublicDestructor.cpp_destructor -// CHECK:STDOUT: %PublicDestructor.cpp_destructor.call: init %empty_tuple.type = call %PublicDestructor.cpp_destructor.bound(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%a.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @PublicDestructor.cpp_destructor(%self.param: ref %PublicDestructor); // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11(%self.param: ref %PublicDestructor) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11(%self.param: ref %PublicDestructor) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %PublicDestructor.cpp_destructor.call: init %empty_tuple.type = call imports.%PublicDestructor.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @TrivialDestroy() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.var: ref %TrivialDestructor = var_storage %a.var_patt @@ -358,26 +401,33 @@ fn F() { // CHECK:STDOUT: %a.patt: %pattern_type.a12 = ref_binding_pattern a [concrete = constants.%a.patt.b64] // CHECK:STDOUT: %a.var_patt: %pattern_type.a12 = var_pattern %a.patt [concrete = constants.%a.var_patt.d25] // CHECK:STDOUT: } -// CHECK:STDOUT: %TrivialDestructor.Op.decl: %TrivialDestructor.Op.type = fn_decl @TrivialDestructor.Op [concrete = constants.%TrivialDestructor.Op] { -// CHECK:STDOUT: %.1: %pattern_type.a12 = specific_constant constants.%self.param_patt.e73, @Destroy.WithSelf.Op(constants.%Destroy.facet.c09) [concrete = constants.%self.param_patt.e73] +// CHECK:STDOUT: %TrivialDestructor.SubobjectDestroy.decl: %TrivialDestructor.SubobjectDestroy.type = fn_decl @TrivialDestructor.SubobjectDestroy [concrete = constants.%TrivialDestructor.SubobjectDestroy] { +// CHECK:STDOUT: %.1: %pattern_type.a12 = specific_constant constants.%self.param_patt.e73, @Destroy.WithSelf.SubobjectDestroy(constants.%Destroy.facet.c09) [concrete = constants.%self.param_patt.e73] // CHECK:STDOUT: %self.patt: %pattern_type.a12 = wrapper_binding_pattern self, %.1 [concrete = constants.%self.patt.01e] // CHECK:STDOUT: } { // CHECK:STDOUT: %self.param: ref %TrivialDestructor = ref_param call_param0 // CHECK:STDOUT: %self: ref %TrivialDestructor = wrapper_binding self, %self.param // CHECK:STDOUT: } -// CHECK:STDOUT: %TrivialDestructor.Op.bound: = bound_method %a.var, constants.%TrivialDestructor.Op -// CHECK:STDOUT: %Op.ref: %TrivialDestructor.cpp_destructor.type = name_ref Op, imports.%TrivialDestructor.cpp_destructor.decl [concrete = constants.%TrivialDestructor.cpp_destructor] -// CHECK:STDOUT: %TrivialDestructor.cpp_destructor.bound: = bound_method %a.var, %Op.ref -// CHECK:STDOUT: %TrivialDestructor.cpp_destructor.call: init %empty_tuple.type = call %TrivialDestructor.cpp_destructor.bound(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%a.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @TrivialDestructor.cpp_destructor(%self.param: ref %TrivialDestructor) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @TrivialDestructor.Op(%self.param: ref %TrivialDestructor) [thunk imports.%TrivialDestructor.cpp_destructor.decl for imports.%Destroy.WithSelf.Op.decl, @Destroy.WithSelf.Op(constants.%Destroy.facet.c09)] { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc15(%self.param: ref %TrivialDestructor) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc15(%self.param: ref %TrivialDestructor) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Op.ref: %TrivialDestructor.cpp_destructor.type = name_ref Op, imports.%TrivialDestructor.cpp_destructor.decl [concrete = constants.%TrivialDestructor.cpp_destructor] -// CHECK:STDOUT: %TrivialDestructor.cpp_destructor.bound: = bound_method %self.param, %Op.ref +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %TrivialDestructor.cpp_destructor.call: init %empty_tuple.type = call imports.%TrivialDestructor.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @TrivialDestructor.SubobjectDestroy(%self.param: ref %TrivialDestructor) [thunk imports.%TrivialDestructor.cpp_destructor.decl for imports.%Destroy.WithSelf.SubobjectDestroy.decl, @Destroy.WithSelf.SubobjectDestroy(constants.%Destroy.facet.c09)] { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %SubobjectDestroy.ref: %TrivialDestructor.cpp_destructor.type = name_ref SubobjectDestroy, imports.%TrivialDestructor.cpp_destructor.decl [concrete = constants.%TrivialDestructor.cpp_destructor] +// CHECK:STDOUT: %TrivialDestructor.cpp_destructor.bound: = bound_method %self.param, %SubobjectDestroy.ref // CHECK:STDOUT: %TrivialDestructor.cpp_destructor.call: init %empty_tuple.type = call %TrivialDestructor.cpp_destructor.bound(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -401,8 +451,74 @@ fn F() { // CHECK:STDOUT: %empty_struct.ec1: %.a6c = struct_value () [concrete] // CHECK:STDOUT: %ProtectedDestructor.val: %ProtectedDestructor = struct_value () [concrete] // CHECK:STDOUT: %Derived.val: %Derived = struct_value (%ProtectedDestructor.val) [concrete] +// CHECK:STDOUT: %pattern_type.b4a: type = pattern_type %ProtectedDestructor [concrete] +// CHECK:STDOUT: %self.param_patt.446: %pattern_type.b4a = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.26a: %pattern_type.b4a = wrapper_binding_pattern self, %self.param_patt.446 [concrete] +// CHECK:STDOUT: %ProtectedDestructor.cpp_destructor.type: type = fn_type @ProtectedDestructor.cpp_destructor [concrete] +// CHECK:STDOUT: %ProtectedDestructor.cpp_destructor: %ProtectedDestructor.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc20_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.237: type = pattern_type %struct_type.base.454 [concrete] +// CHECK:STDOUT: %self.param_patt.2b9: %pattern_type.237 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.caa: %pattern_type.237 = wrapper_binding_pattern self, %self.param_patt.2b9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc20_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc20_3.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.a2b: %pattern_type.746 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.d8a: %pattern_type.746 = wrapper_binding_pattern self, %self.param_patt.a2b [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc20_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc20_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc20_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %ProtectedDestructor.cpp_destructor.decl: %ProtectedDestructor.cpp_destructor.type = fn_decl @ProtectedDestructor.cpp_destructor [concrete = constants.%ProtectedDestructor.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc20_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b4a = ref_param_pattern [concrete = constants.%self.param_patt.446] +// CHECK:STDOUT: %self.patt: %pattern_type.b4a = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.26a] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ProtectedDestructor = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ProtectedDestructor = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc20_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.237 = ref_param_pattern [concrete = constants.%self.param_patt.2b9] +// CHECK:STDOUT: %self.patt: %pattern_type.237 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.caa] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.base.454 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.base.454 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc20_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.237 = ref_param_pattern [concrete = constants.%self.param_patt.2b9] +// CHECK:STDOUT: %self.patt: %pattern_type.237 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.caa] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.base.454 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.base.454 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc20_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.746 = ref_param_pattern [concrete = constants.%self.param_patt.a2b] +// CHECK:STDOUT: %self.patt: %pattern_type.746 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d8a] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Derived = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Derived = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc20_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.746 = ref_param_pattern [concrete = constants.%self.param_patt.a2b] +// CHECK:STDOUT: %self.patt: %pattern_type.746 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d8a] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Derived = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Derived = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @DestroyClassWithProtectedBaseDestructor() { @@ -423,18 +539,45 @@ fn F() { // CHECK:STDOUT: %a.patt: %pattern_type.746 = ref_binding_pattern a [concrete = constants.%a.patt] // CHECK:STDOUT: %a.var_patt: %pattern_type.746 = var_pattern %a.patt [concrete = constants.%a.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc20_3.1(%self.param: ref %struct_type.base.454) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc20_3.1(%self.param: ref %ProtectedDestructor) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc20_3.1(%self.param: ref %ProtectedDestructor) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %ProtectedDestructor.cpp_destructor.call: init %empty_tuple.type = call imports.%ProtectedDestructor.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc20_3.1(%self.param: ref %struct_type.base.454) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc20_3.2(%self.param: ref %Derived) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc20_3.2(%self.param: ref %struct_type.base.454) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc20_3.2(%self.param: ref %struct_type.base.454) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc20_3.2(%self.param: ref %Derived) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc20_3.3(%self.param: ref %Derived) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc20_3.3(%self.param: ref %Derived) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -457,8 +600,74 @@ fn F() { // CHECK:STDOUT: %empty_struct.d8b: %.c73 = struct_value () [concrete] // CHECK:STDOUT: %PrivateDestructor.val: %PrivateDestructor = struct_value () [concrete] // CHECK:STDOUT: %Derived.val: %Derived = struct_value (%PrivateDestructor.val) [concrete] +// CHECK:STDOUT: %pattern_type.af2: type = pattern_type %PrivateDestructor [concrete] +// CHECK:STDOUT: %self.param_patt.bd1: %pattern_type.af2 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.7ec: %pattern_type.af2 = wrapper_binding_pattern self, %self.param_patt.bd1 [concrete] +// CHECK:STDOUT: %PrivateDestructor.cpp_destructor.type: type = fn_type @PrivateDestructor.cpp_destructor [concrete] +// CHECK:STDOUT: %PrivateDestructor.cpp_destructor: %PrivateDestructor.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc21_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.9c9: type = pattern_type %struct_type.base.9aa [concrete] +// CHECK:STDOUT: %self.param_patt.a59: %pattern_type.9c9 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.078: %pattern_type.9c9 = wrapper_binding_pattern self, %self.param_patt.a59 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc21_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc21_3.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.a2b: %pattern_type.746 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.d8a: %pattern_type.746 = wrapper_binding_pattern self, %self.param_patt.a2b [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc21_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc21_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc21_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %PrivateDestructor.cpp_destructor.decl: %PrivateDestructor.cpp_destructor.type = fn_decl @PrivateDestructor.cpp_destructor [concrete = constants.%PrivateDestructor.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc21_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.af2 = ref_param_pattern [concrete = constants.%self.param_patt.bd1] +// CHECK:STDOUT: %self.patt: %pattern_type.af2 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.7ec] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %PrivateDestructor = ref_param call_param0 +// CHECK:STDOUT: %self: ref %PrivateDestructor = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc21_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.9c9 = ref_param_pattern [concrete = constants.%self.param_patt.a59] +// CHECK:STDOUT: %self.patt: %pattern_type.9c9 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.078] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.base.9aa = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.base.9aa = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc21_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.9c9 = ref_param_pattern [concrete = constants.%self.param_patt.a59] +// CHECK:STDOUT: %self.patt: %pattern_type.9c9 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.078] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.base.9aa = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.base.9aa = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc21_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.746 = ref_param_pattern [concrete = constants.%self.param_patt.a2b] +// CHECK:STDOUT: %self.patt: %pattern_type.746 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d8a] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Derived = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Derived = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc21_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.746 = ref_param_pattern [concrete = constants.%self.param_patt.a2b] +// CHECK:STDOUT: %self.patt: %pattern_type.746 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d8a] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Derived = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Derived = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @DestroyClassWithPrivateBaseDestructor() { @@ -479,18 +688,45 @@ fn F() { // CHECK:STDOUT: %a.patt: %pattern_type.746 = ref_binding_pattern a [concrete = constants.%a.patt] // CHECK:STDOUT: %a.var_patt: %pattern_type.746 = var_pattern %a.patt [concrete = constants.%a.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc21_3.1(%self.param: ref %struct_type.base.9aa) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc21_3.1(%self.param: ref %PrivateDestructor) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc21_3.1(%self.param: ref %PrivateDestructor) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %PrivateDestructor.cpp_destructor.call: init %empty_tuple.type = call imports.%PrivateDestructor.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc21_3.1(%self.param: ref %struct_type.base.9aa) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc21_3.2(%self.param: ref %Derived) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc21_3.2(%self.param: ref %struct_type.base.9aa) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc21_3.2(%self.param: ref %struct_type.base.9aa) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc21_3.2(%self.param: ref %Derived) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc21_3.3(%self.param: ref %Derived) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc21_3.3(%self.param: ref %Derived) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/impls/implicit_as.carbon b/toolchain/check/testdata/interop/cpp/impls/implicit_as.carbon index 11cefc6860e9..829fb39f3e45 100644 --- a/toolchain/check/testdata/interop/cpp/impls/implicit_as.carbon +++ b/toolchain/check/testdata/interop/cpp/impls/implicit_as.carbon @@ -423,10 +423,14 @@ fn InitFromStruct() { // CHECK:STDOUT: %ptr.ca8: type = ptr_type %Dest [concrete] // CHECK:STDOUT: %Dest__carbon_thunk.type.eb4c5e.1: type = fn_type @Dest__carbon_thunk.1 [concrete] // CHECK:STDOUT: %Dest__carbon_thunk.c8e433.1: %Dest__carbon_thunk.type.eb4c5e.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.581: %pattern_type.b72 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.48a: %pattern_type.b72 = wrapper_binding_pattern self, %self.param_patt.581 [concrete] // CHECK:STDOUT: %Dest.cpp_destructor.type: type = fn_type @Dest.cpp_destructor [concrete] // CHECK:STDOUT: %Dest.cpp_destructor: %Dest.cpp_destructor.type = struct_value () [concrete] -// CHECK:STDOUT: %Dest.Op.type: type = fn_type @Dest.Op [concrete] -// CHECK:STDOUT: %Dest.Op: %Dest.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete] // CHECK:STDOUT: %NonConstConversion.689: type = class_type @NonConstConversion.1 [concrete] // CHECK:STDOUT: %Dest__carbon_thunk.type.eb4c5e.2: type = fn_type @Dest__carbon_thunk.2 [concrete] // CHECK:STDOUT: %Dest__carbon_thunk.c8e433.2: %Dest__carbon_thunk.type.eb4c5e.2 = struct_value () [concrete] @@ -438,10 +442,14 @@ fn InitFromStruct() { // CHECK:STDOUT: %ptr.802: type = ptr_type %Dest2 [concrete] // CHECK:STDOUT: %Dest2__carbon_thunk.type: type = fn_type @Dest2__carbon_thunk [concrete] // CHECK:STDOUT: %Dest2__carbon_thunk: %Dest2__carbon_thunk.type = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.2f7: %pattern_type.a68 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.7db: %pattern_type.a68 = wrapper_binding_pattern self, %self.param_patt.2f7 [concrete] // CHECK:STDOUT: %Dest2.cpp_destructor.type: type = fn_type @Dest2.cpp_destructor [concrete] // CHECK:STDOUT: %Dest2.cpp_destructor: %Dest2.cpp_destructor.type = struct_value () [concrete] -// CHECK:STDOUT: %Dest2.Op.type: type = fn_type @Dest2.Op [concrete] -// CHECK:STDOUT: %Dest2.Op: %Dest2.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc20 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc20 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -485,6 +493,23 @@ fn InitFromStruct() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc8 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b72 = ref_param_pattern [concrete = constants.%self.param_patt.581] +// CHECK:STDOUT: %self.patt: %pattern_type.b72 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.48a] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Dest = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Dest = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc20 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.a68 = ref_param_pattern [concrete = constants.%self.param_patt.2f7] +// CHECK:STDOUT: %self.patt: %pattern_type.a68 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.7db] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Dest2 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Dest2 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @UserConversion(%s.param: %Source) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %s.ref: %Source = name_ref s, %s @@ -504,13 +529,20 @@ fn InitFromStruct() { // CHECK:STDOUT: %_.patt: %pattern_type.b72 = value_binding_pattern _ [concrete = constants.%_.patt.664] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: %Dest.Op.bound: = bound_method %.loc8_21.4, constants.%Dest.Op -// CHECK:STDOUT: %Op.ref: %Dest.cpp_destructor.type = name_ref Op, imports.%Dest.cpp_destructor.decl [concrete = constants.%Dest.cpp_destructor] -// CHECK:STDOUT: %Dest.cpp_destructor.bound: = bound_method %.loc8_21.4, %Op.ref -// CHECK:STDOUT: %Dest.cpp_destructor.call: init %empty_tuple.type = call %Dest.cpp_destructor.bound(%.loc8_21.4) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc8_21.4, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc8_21.4) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8(%self.param: ref %Dest) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8(%self.param: ref %Dest) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Dest.cpp_destructor.call: init %empty_tuple.type = call imports.%Dest.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @NonConstConversion.loc12(%s.param: ref %NonConstConversion.689) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %s.ref: ref %NonConstConversion.689 = name_ref s, %s @@ -529,10 +561,8 @@ fn InitFromStruct() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %_.patt: %pattern_type.b72 = value_binding_pattern _ [concrete = constants.%_.patt.664] // CHECK:STDOUT: } -// CHECK:STDOUT: %Dest.Op.bound: = bound_method %.loc14_21.4, constants.%Dest.Op -// CHECK:STDOUT: %Op.ref: %Dest.cpp_destructor.type = name_ref Op, imports.%Dest.cpp_destructor.decl [concrete = constants.%Dest.cpp_destructor] -// CHECK:STDOUT: %Dest.cpp_destructor.bound: = bound_method %.loc14_21.4, %Op.ref -// CHECK:STDOUT: %Dest.cpp_destructor.call: init %empty_tuple.type = call %Dest.cpp_destructor.bound(%.loc14_21.4) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc14_21.4, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc14_21.4) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -557,13 +587,20 @@ fn InitFromStruct() { // CHECK:STDOUT: %_.patt: %pattern_type.a68 = value_binding_pattern _ [concrete = constants.%_.patt.ff1] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: %Dest2.Op.bound: = bound_method %.loc20_22.5, constants.%Dest2.Op -// CHECK:STDOUT: %Op.ref: %Dest2.cpp_destructor.type = name_ref Op, imports.%Dest2.cpp_destructor.decl [concrete = constants.%Dest2.cpp_destructor] -// CHECK:STDOUT: %Dest2.cpp_destructor.bound: = bound_method %.loc20_22.5, %Op.ref -// CHECK:STDOUT: %Dest2.cpp_destructor.call: init %empty_tuple.type = call %Dest2.cpp_destructor.bound(%.loc20_22.5) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc20_22.5, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc20_22.5) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc20(%self.param: ref %Dest2) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc20(%self.param: ref %Dest2) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Dest2.cpp_destructor.call: init %empty_tuple.type = call imports.%Dest2.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_expr_category.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -612,10 +649,14 @@ fn InitFromStruct() { // CHECK:STDOUT: %ptr.859: type = ptr_type %InaccessibleConstructor [concrete] // CHECK:STDOUT: %InaccessibleConstructor__carbon_thunk.type: type = fn_type @InaccessibleConstructor__carbon_thunk [concrete] // CHECK:STDOUT: %InaccessibleConstructor__carbon_thunk: %InaccessibleConstructor__carbon_thunk.type = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.244: %pattern_type.824 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.2ae: %pattern_type.824 = wrapper_binding_pattern self, %self.param_patt.244 [concrete] // CHECK:STDOUT: %InaccessibleConstructor.cpp_destructor.type: type = fn_type @InaccessibleConstructor.cpp_destructor [concrete] // CHECK:STDOUT: %InaccessibleConstructor.cpp_destructor: %InaccessibleConstructor.cpp_destructor.type = struct_value () [concrete] -// CHECK:STDOUT: %InaccessibleConstructor.Op.type: type = fn_type @InaccessibleConstructor.Op [concrete] -// CHECK:STDOUT: %InaccessibleConstructor.Op: %InaccessibleConstructor.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc16 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc16 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete] // CHECK:STDOUT: %InaccessibleConversion: type = class_type @InaccessibleConversion [concrete] // CHECK:STDOUT: %Dest: type = class_type @Dest [concrete] // CHECK:STDOUT: %pattern_type.b72: type = pattern_type %Dest [concrete] @@ -623,10 +664,14 @@ fn InitFromStruct() { // CHECK:STDOUT: %ptr.ca8: type = ptr_type %Dest [concrete] // CHECK:STDOUT: %Dest__carbon_thunk.type: type = fn_type @Dest__carbon_thunk [concrete] // CHECK:STDOUT: %Dest__carbon_thunk: %Dest__carbon_thunk.type = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.581: %pattern_type.b72 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.48a: %pattern_type.b72 = wrapper_binding_pattern self, %self.param_patt.581 [concrete] // CHECK:STDOUT: %Dest.cpp_destructor.type: type = fn_type @Dest.cpp_destructor [concrete] // CHECK:STDOUT: %Dest.cpp_destructor: %Dest.cpp_destructor.type = struct_value () [concrete] -// CHECK:STDOUT: %Dest.Op.type: type = fn_type @Dest.Op [concrete] -// CHECK:STDOUT: %Dest.Op: %Dest.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc30 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc30 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -663,6 +708,23 @@ fn InitFromStruct() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc16 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.824 = ref_param_pattern [concrete = constants.%self.param_patt.244] +// CHECK:STDOUT: %self.patt: %pattern_type.824 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.2ae] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %InaccessibleConstructor = ref_param call_param0 +// CHECK:STDOUT: %self: ref %InaccessibleConstructor = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc30 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b72 = ref_param_pattern [concrete = constants.%self.param_patt.581] +// CHECK:STDOUT: %self.patt: %pattern_type.b72 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.48a] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Dest = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Dest = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @InaccessibleConstructorTest(%s.param: %Source) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %s.ref: %Source = name_ref s, %s @@ -684,13 +746,20 @@ fn InitFromStruct() { // CHECK:STDOUT: %_.patt: %pattern_type.824 = value_binding_pattern _ [concrete = constants.%_.patt.f1f] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: %InaccessibleConstructor.Op.bound: = bound_method %.loc16_40.5, constants.%InaccessibleConstructor.Op -// CHECK:STDOUT: %Op.ref: %InaccessibleConstructor.cpp_destructor.type = name_ref Op, imports.%InaccessibleConstructor.cpp_destructor.decl [concrete = constants.%InaccessibleConstructor.cpp_destructor] -// CHECK:STDOUT: %InaccessibleConstructor.cpp_destructor.bound: = bound_method %.loc16_40.5, %Op.ref -// CHECK:STDOUT: %InaccessibleConstructor.cpp_destructor.call: init %empty_tuple.type = call %InaccessibleConstructor.cpp_destructor.bound(%.loc16_40.5) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc16_40.5, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc16_40.5) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16(%self.param: ref %InaccessibleConstructor) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc16(%self.param: ref %InaccessibleConstructor) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %InaccessibleConstructor.cpp_destructor.call: init %empty_tuple.type = call imports.%InaccessibleConstructor.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @InaccessibleConversionTest(%s.param: %InaccessibleConversion) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %s.ref: %InaccessibleConversion = name_ref s, %s @@ -710,13 +779,20 @@ fn InitFromStruct() { // CHECK:STDOUT: %_.patt: %pattern_type.b72 = value_binding_pattern _ [concrete = constants.%_.patt.664] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: %Dest.Op.bound: = bound_method %.loc30_21.4, constants.%Dest.Op -// CHECK:STDOUT: %Op.ref: %Dest.cpp_destructor.type = name_ref Op, imports.%Dest.cpp_destructor.decl [concrete = constants.%Dest.cpp_destructor] -// CHECK:STDOUT: %Dest.cpp_destructor.bound: = bound_method %.loc30_21.4, %Op.ref -// CHECK:STDOUT: %Dest.cpp_destructor.call: init %empty_tuple.type = call %Dest.cpp_destructor.bound(%.loc30_21.4) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc30_21.4, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc30_21.4) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc30(%self.param: ref %Dest) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc30(%self.param: ref %Dest) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Dest.cpp_destructor.call: init %empty_tuple.type = call imports.%Dest.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_deleted.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -846,10 +922,14 @@ fn InitFromStruct() { // CHECK:STDOUT: %ptr.100: type = ptr_type %IntConstructor.372 [concrete] // CHECK:STDOUT: %IntConstructor__carbon_thunk.type: type = fn_type @IntConstructor__carbon_thunk [concrete] // CHECK:STDOUT: %IntConstructor__carbon_thunk: %IntConstructor__carbon_thunk.type = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.ab8: %pattern_type.c4e = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.f11: %pattern_type.c4e = wrapper_binding_pattern self, %self.param_patt.ab8 [concrete] // CHECK:STDOUT: %IntConstructor.cpp_destructor.type: type = fn_type @IntConstructor.cpp_destructor [concrete] // CHECK:STDOUT: %IntConstructor.cpp_destructor: %IntConstructor.cpp_destructor.type = struct_value () [concrete] -// CHECK:STDOUT: %IntConstructor.Op.type: type = fn_type @IntConstructor.Op [concrete] -// CHECK:STDOUT: %IntConstructor.Op: %IntConstructor.Op.type = struct_value () [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.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -870,6 +950,16 @@ fn InitFromStruct() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// 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.c4e = ref_param_pattern [concrete = constants.%self.param_patt.ab8] +// CHECK:STDOUT: %self.patt: %pattern_type.c4e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.f11] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %IntConstructor.372 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %IntConstructor.372 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @IntConstructor.loc6(%i.param: %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %i.ref: %i32 = name_ref i, %i @@ -889,13 +979,20 @@ fn InitFromStruct() { // CHECK:STDOUT: %_.patt: %pattern_type.c4e = value_binding_pattern _ [concrete = constants.%_.patt.151] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: %IntConstructor.Op.bound: = bound_method %.loc8_31.4, constants.%IntConstructor.Op -// CHECK:STDOUT: %Op.ref: %IntConstructor.cpp_destructor.type = name_ref Op, imports.%IntConstructor.cpp_destructor.decl [concrete = constants.%IntConstructor.cpp_destructor] -// CHECK:STDOUT: %IntConstructor.cpp_destructor.bound: = bound_method %.loc8_31.4, %Op.ref -// CHECK:STDOUT: %IntConstructor.cpp_destructor.call: init %empty_tuple.type = call %IntConstructor.cpp_destructor.bound(%.loc8_31.4) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc8_31.4, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc8_31.4) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8(%self.param: ref %IntConstructor.372) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8(%self.param: ref %IntConstructor.372) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param) +// CHECK:STDOUT: %IntConstructor.cpp_destructor.call: init %empty_tuple.type = call imports.%IntConstructor.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_no_u32_to_int_conversion_in_carbon.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -910,10 +1007,14 @@ fn InitFromStruct() { // CHECK:STDOUT: %ptr.100: type = ptr_type %IntConstructor [concrete] // CHECK:STDOUT: %IntConstructor__carbon_thunk.type: type = fn_type @IntConstructor__carbon_thunk [concrete] // CHECK:STDOUT: %IntConstructor__carbon_thunk: %IntConstructor__carbon_thunk.type = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.ab8: %pattern_type.c4e = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.f11: %pattern_type.c4e = wrapper_binding_pattern self, %self.param_patt.ab8 [concrete] // CHECK:STDOUT: %IntConstructor.cpp_destructor.type: type = fn_type @IntConstructor.cpp_destructor [concrete] // CHECK:STDOUT: %IntConstructor.cpp_destructor: %IntConstructor.cpp_destructor.type = struct_value () [concrete] -// CHECK:STDOUT: %IntConstructor.Op.type: type = fn_type @IntConstructor.Op [concrete] -// CHECK:STDOUT: %IntConstructor.Op: %IntConstructor.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc19 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc19 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -934,6 +1035,16 @@ fn InitFromStruct() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc19 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.c4e = ref_param_pattern [concrete = constants.%self.param_patt.ab8] +// CHECK:STDOUT: %self.patt: %pattern_type.c4e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.f11] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %IntConstructor = ref_param call_param0 +// CHECK:STDOUT: %self: ref %IntConstructor = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @IntConstructorTest(%u.param: %u32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %u.ref: %u32 = name_ref u, %u @@ -954,13 +1065,20 @@ fn InitFromStruct() { // CHECK:STDOUT: %_.patt: %pattern_type.c4e = value_binding_pattern _ [concrete = constants.%_.patt.151] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: %IntConstructor.Op.bound: = bound_method %.loc19_31.5, constants.%IntConstructor.Op -// CHECK:STDOUT: %Op.ref: %IntConstructor.cpp_destructor.type = name_ref Op, imports.%IntConstructor.cpp_destructor.decl [concrete = constants.%IntConstructor.cpp_destructor] -// CHECK:STDOUT: %IntConstructor.cpp_destructor.bound: = bound_method %.loc19_31.5, %Op.ref -// CHECK:STDOUT: %IntConstructor.cpp_destructor.call: init %empty_tuple.type = call %IntConstructor.cpp_destructor.bound(%.loc19_31.5) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc19_31.5, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc19_31.5) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc19(%self.param: ref %IntConstructor) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc19(%self.param: ref %IntConstructor) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param) +// CHECK:STDOUT: %IntConstructor.cpp_destructor.call: init %empty_tuple.type = call imports.%IntConstructor.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- default_constructor.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -973,10 +1091,14 @@ fn InitFromStruct() { // CHECK:STDOUT: %ptr.c09: type = ptr_type %DefaultConstructor [concrete] // CHECK:STDOUT: %DefaultConstructor__carbon_thunk.type: type = fn_type @DefaultConstructor__carbon_thunk [concrete] // CHECK:STDOUT: %DefaultConstructor__carbon_thunk: %DefaultConstructor__carbon_thunk.type = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.91e: %pattern_type.be4 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.221: %pattern_type.be4 = wrapper_binding_pattern self, %self.param_patt.91e [concrete] // CHECK:STDOUT: %DefaultConstructor.cpp_destructor.type: type = fn_type @DefaultConstructor.cpp_destructor [concrete] // CHECK:STDOUT: %DefaultConstructor.cpp_destructor: %DefaultConstructor.cpp_destructor.type = struct_value () [concrete] -// CHECK:STDOUT: %DefaultConstructor.Op.type: type = fn_type @DefaultConstructor.Op [concrete] -// CHECK:STDOUT: %DefaultConstructor.Op: %DefaultConstructor.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -997,6 +1119,16 @@ fn InitFromStruct() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc9 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.be4 = ref_param_pattern [concrete = constants.%self.param_patt.91e] +// CHECK:STDOUT: %self.patt: %pattern_type.be4 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.221] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %DefaultConstructor = ref_param call_param0 +// CHECK:STDOUT: %self: ref %DefaultConstructor = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @DefaultConstructorTest() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc9_36.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] @@ -1016,13 +1148,20 @@ fn InitFromStruct() { // CHECK:STDOUT: %_.patt: %pattern_type.be4 = value_binding_pattern _ [concrete = constants.%_.patt] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: %DefaultConstructor.Op.bound: = bound_method %.loc9_36.5, constants.%DefaultConstructor.Op -// CHECK:STDOUT: %Op.ref: %DefaultConstructor.cpp_destructor.type = name_ref Op, imports.%DefaultConstructor.cpp_destructor.decl [concrete = constants.%DefaultConstructor.cpp_destructor] -// CHECK:STDOUT: %DefaultConstructor.cpp_destructor.bound: = bound_method %.loc9_36.5, %Op.ref -// CHECK:STDOUT: %DefaultConstructor.cpp_destructor.call: init %empty_tuple.type = call %DefaultConstructor.cpp_destructor.bound(%.loc9_36.5) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc9_36.5, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc9_36.5) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9(%self.param: ref %DefaultConstructor) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9(%self.param: ref %DefaultConstructor) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param) +// CHECK:STDOUT: %DefaultConstructor.cpp_destructor.call: init %empty_tuple.type = call imports.%DefaultConstructor.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- construct_multi_argument.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -1071,14 +1210,22 @@ fn InitFromStruct() { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.485: = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert.e39 [concrete] // CHECK:STDOUT: %bound_method.763: = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_3.410: %i32 = int_value 3 [concrete] +// CHECK:STDOUT: %self.param_patt.ed0: %pattern_type.248 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.dca: %pattern_type.248 = wrapper_binding_pattern self, %self.param_patt.ed0 [concrete] // CHECK:STDOUT: %ThreeWithDefault.cpp_destructor.type: type = fn_type @ThreeWithDefault.cpp_destructor [concrete] // CHECK:STDOUT: %ThreeWithDefault.cpp_destructor: %ThreeWithDefault.cpp_destructor.type = struct_value () [concrete] -// CHECK:STDOUT: %ThreeWithDefault.Op.type: type = fn_type @ThreeWithDefault.Op [concrete] -// CHECK:STDOUT: %ThreeWithDefault.Op: %ThreeWithDefault.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc12 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc12 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.df5: %pattern_type.586 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.e0a: %pattern_type.586 = wrapper_binding_pattern self, %self.param_patt.df5 [concrete] // CHECK:STDOUT: %Two.cpp_destructor.type: type = fn_type @Two.cpp_destructor [concrete] // CHECK:STDOUT: %Two.cpp_destructor: %Two.cpp_destructor.type = struct_value () [concrete] -// CHECK:STDOUT: %Two.Op.type: type = fn_type @Two.Op [concrete] -// CHECK:STDOUT: %Two.Op: %Two.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1118,6 +1265,23 @@ fn InitFromStruct() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc12 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.248 = ref_param_pattern [concrete = constants.%self.param_patt.ed0] +// CHECK:STDOUT: %self.patt: %pattern_type.248 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.dca] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ThreeWithDefault = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ThreeWithDefault = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc8 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.586 = ref_param_pattern [concrete = constants.%self.param_patt.df5] +// CHECK:STDOUT: %self.patt: %pattern_type.586 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.e0a] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Two = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Two = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @ImplicitConvert() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1.loc8: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] @@ -1225,22 +1389,34 @@ fn InitFromStruct() { // CHECK:STDOUT: %_.patt.loc12: %pattern_type.248 = value_binding_pattern _ [concrete = constants.%_.patt.368] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: %ThreeWithDefault.Op.bound.loc12: = bound_method %.loc12_41.5, constants.%ThreeWithDefault.Op -// CHECK:STDOUT: %Op.ref.loc12: %ThreeWithDefault.cpp_destructor.type = name_ref Op, imports.%ThreeWithDefault.cpp_destructor.decl [concrete = constants.%ThreeWithDefault.cpp_destructor] -// CHECK:STDOUT: %ThreeWithDefault.cpp_destructor.bound.loc12: = bound_method %.loc12_41.5, %Op.ref.loc12 -// CHECK:STDOUT: %ThreeWithDefault.cpp_destructor.call.loc12: init %empty_tuple.type = call %ThreeWithDefault.cpp_destructor.bound.loc12(%.loc12_41.5) -// CHECK:STDOUT: %ThreeWithDefault.Op.bound.loc10: = bound_method %.loc10_38.5, constants.%ThreeWithDefault.Op -// CHECK:STDOUT: %Op.ref.loc10: %ThreeWithDefault.cpp_destructor.type = name_ref Op, imports.%ThreeWithDefault.cpp_destructor.decl [concrete = constants.%ThreeWithDefault.cpp_destructor] -// CHECK:STDOUT: %ThreeWithDefault.cpp_destructor.bound.loc10: = bound_method %.loc10_38.5, %Op.ref.loc10 -// CHECK:STDOUT: %ThreeWithDefault.cpp_destructor.call.loc10: init %empty_tuple.type = call %ThreeWithDefault.cpp_destructor.bound.loc10(%.loc10_38.5) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc12: = bound_method %.loc12_41.5, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc12: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc12(%.loc12_41.5) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10: = bound_method %.loc10_38.5, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10(%.loc10_38.5) // CHECK:STDOUT: -// CHECK:STDOUT: %Two.Op.bound: = bound_method %.loc8_25.5, constants.%Two.Op -// CHECK:STDOUT: %Op.ref.loc8: %Two.cpp_destructor.type = name_ref Op, imports.%Two.cpp_destructor.decl [concrete = constants.%Two.cpp_destructor] -// CHECK:STDOUT: %Two.cpp_destructor.bound: = bound_method %.loc8_25.5, %Op.ref.loc8 -// CHECK:STDOUT: %Two.cpp_destructor.call: init %empty_tuple.type = call %Two.cpp_destructor.bound(%.loc8_25.5) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: = bound_method %.loc8_25.5, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%.loc8_25.5) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc12(%self.param: ref %ThreeWithDefault) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc12(%self.param: ref %ThreeWithDefault) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %ThreeWithDefault.cpp_destructor.call: init %empty_tuple.type = call imports.%ThreeWithDefault.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8(%self.param: ref %Two) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8(%self.param: ref %Two) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Two.cpp_destructor.call: init %empty_tuple.type = call imports.%Two.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_aggregate_from_tuple.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -1408,10 +1584,14 @@ fn InitFromStruct() { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.9f3: = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.e39 [concrete] // CHECK:STDOUT: %bound_method.3cb: = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.295: %i32 = int_value 2 [concrete] +// CHECK:STDOUT: %self.param_patt.06a: %pattern_type.273 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.968: %pattern_type.273 = wrapper_binding_pattern self, %self.param_patt.06a [concrete] // CHECK:STDOUT: %NonAggregate.cpp_destructor.type: type = fn_type @NonAggregate.cpp_destructor [concrete] // CHECK:STDOUT: %NonAggregate.cpp_destructor: %NonAggregate.cpp_destructor.type = struct_value () [concrete] -// CHECK:STDOUT: %NonAggregate.Op.type: type = fn_type @NonAggregate.Op [concrete] -// CHECK:STDOUT: %NonAggregate.Op: %NonAggregate.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc10 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1444,6 +1624,16 @@ fn InitFromStruct() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc10 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.273 = ref_param_pattern [concrete = constants.%self.param_patt.06a] +// CHECK:STDOUT: %self.patt: %pattern_type.273 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.968] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %NonAggregate = ref_param call_param0 +// CHECK:STDOUT: %self: ref %NonAggregate = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @InitFromStruct() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc8_30.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] @@ -1519,21 +1709,24 @@ fn InitFromStruct() { // CHECK:STDOUT: %_.patt.loc10: %pattern_type.273 = value_binding_pattern _ [concrete = constants.%_.patt] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: %NonAggregate.Op.bound.loc10: = bound_method %.loc10_34.5, constants.%NonAggregate.Op -// CHECK:STDOUT: %Op.ref.loc10: %NonAggregate.cpp_destructor.type = name_ref Op, imports.%NonAggregate.cpp_destructor.decl [concrete = constants.%NonAggregate.cpp_destructor] -// CHECK:STDOUT: %NonAggregate.cpp_destructor.bound.loc10: = bound_method %.loc10_34.5, %Op.ref.loc10 -// CHECK:STDOUT: %NonAggregate.cpp_destructor.call.loc10: init %empty_tuple.type = call %NonAggregate.cpp_destructor.bound.loc10(%.loc10_34.5) -// CHECK:STDOUT: %NonAggregate.Op.bound.loc9: = bound_method %.loc9_32.5, constants.%NonAggregate.Op -// CHECK:STDOUT: %Op.ref.loc9: %NonAggregate.cpp_destructor.type = name_ref Op, imports.%NonAggregate.cpp_destructor.decl [concrete = constants.%NonAggregate.cpp_destructor] -// CHECK:STDOUT: %NonAggregate.cpp_destructor.bound.loc9: = bound_method %.loc9_32.5, %Op.ref.loc9 -// CHECK:STDOUT: %NonAggregate.cpp_destructor.call.loc9: init %empty_tuple.type = call %NonAggregate.cpp_destructor.bound.loc9(%.loc9_32.5) -// CHECK:STDOUT: %NonAggregate.Op.bound.loc8: = bound_method %.loc8_30.5, constants.%NonAggregate.Op -// CHECK:STDOUT: %Op.ref.loc8: %NonAggregate.cpp_destructor.type = name_ref Op, imports.%NonAggregate.cpp_destructor.decl [concrete = constants.%NonAggregate.cpp_destructor] -// CHECK:STDOUT: %NonAggregate.cpp_destructor.bound.loc8: = bound_method %.loc8_30.5, %Op.ref.loc8 -// CHECK:STDOUT: %NonAggregate.cpp_destructor.call.loc8: init %empty_tuple.type = call %NonAggregate.cpp_destructor.bound.loc8(%.loc8_30.5) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10: = bound_method %.loc10_34.5, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10(%.loc10_34.5) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc9: = bound_method %.loc9_32.5, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc9(%.loc9_32.5) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: = bound_method %.loc8_30.5, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%.loc8_30.5) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10(%self.param: ref %NonAggregate) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10(%self.param: ref %NonAggregate) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param) +// CHECK:STDOUT: %NonAggregate.cpp_destructor.call: init %empty_tuple.type = call imports.%NonAggregate.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_non_aggregate_from_struct.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { diff --git a/toolchain/check/testdata/interop/cpp/macros/macros.carbon b/toolchain/check/testdata/interop/cpp/macros/macros.carbon index ce2c33dabc11..3fc63accc626 100644 --- a/toolchain/check/testdata/interop/cpp/macros/macros.carbon +++ b/toolchain/check/testdata/interop/cpp/macros/macros.carbon @@ -1131,8 +1131,27 @@ let _: C(1) = {} as C(Cpp.COUNT); // CHECK:STDOUT: %b.patt: %pattern_type.240 = value_binding_pattern b [concrete] // CHECK:STDOUT: %n.patt: %pattern_type.240 = ref_binding_pattern n [concrete] // CHECK:STDOUT: %n.var_patt: %pattern_type.240 = var_pattern %n.patt [concrete] +// CHECK:STDOUT: %pattern_type.945: type = pattern_type %f32.9b3 [concrete] +// CHECK:STDOUT: %self.param_patt.755: %pattern_type.945 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.17e: %pattern_type.945 = wrapper_binding_pattern self, %self.param_patt.755 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc10_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.c62: %pattern_type.240 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.ed0: %pattern_type.240 = wrapper_binding_pattern self, %self.param_patt.c62 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc10_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.c06: %pattern_type.18b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.a67: %pattern_type.18b = wrapper_binding_pattern self, %self.param_patt.c06 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc10_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1154,6 +1173,51 @@ let _: C(1) = {} as C(Cpp.COUNT); // CHECK:STDOUT: %n.var: ref %f32.c73 = var_storage %n.var_patt [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.945 = ref_param_pattern [concrete = constants.%self.param_patt.755] +// CHECK:STDOUT: %self.patt: %pattern_type.945 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.17e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.9b3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.9b3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc10_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.945 = ref_param_pattern [concrete = constants.%self.param_patt.755] +// CHECK:STDOUT: %self.patt: %pattern_type.945 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.17e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.9b3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.9b3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.240 = ref_param_pattern [concrete = constants.%self.param_patt.c62] +// CHECK:STDOUT: %self.patt: %pattern_type.240 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ed0] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.c73 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.c73 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc10_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.240 = ref_param_pattern [concrete = constants.%self.param_patt.c62] +// CHECK:STDOUT: %self.patt: %pattern_type.240 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ed0] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.c73 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.c73 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.18b = ref_param_pattern [concrete = constants.%self.param_patt.c06] +// CHECK:STDOUT: %self.patt: %pattern_type.18b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a67] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc10_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.18b = ref_param_pattern [concrete = constants.%self.param_patt.c06] +// CHECK:STDOUT: %self.patt: %pattern_type.18b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a67] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.var: ref %array_type = var_storage %a.var_patt @@ -1200,20 +1264,47 @@ let _: C(1) = {} as C(Cpp.COUNT); // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %b.patt: %pattern_type.240 = value_binding_pattern b [concrete = constants.%b.patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_3.1(%self.param: ref %f32.9b3) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_3.1(%self.param: ref %f32.9b3) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_3.2(%self.param: ref %f32.c73) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_3.1(%self.param: ref %f32.9b3) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_3.2(%self.param: ref %f32.c73) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_3.2(%self.param: ref %f32.c73) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_3.2(%self.param: ref %f32.c73) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_3.3(%self.param: ref %array_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1828,18 +1919,23 @@ let _: C(1) = {} as C(Cpp.COUNT); // CHECK:STDOUT: %ptr.e8f: type = ptr_type %T.67d [symbolic] // CHECK:STDOUT: %Destroy.lookup_impl_witness.781: = lookup_impl_witness %ptr.e8f, @Destroy [symbolic] // CHECK:STDOUT: %Destroy.facet.e46: %Destroy.type = facet_value %ptr.e8f, (%Destroy.lookup_impl_witness.781) [symbolic] -// CHECK:STDOUT: %MaybeUnformed.ddba: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.e46) [symbolic] +// CHECK:STDOUT: %MaybeUnformed.ddb: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.e46) [symbolic] // CHECK:STDOUT: %ptr.as.OptionalStorage.impl.None.type.2a7: type = fn_type @ptr.as.OptionalStorage.impl.None, @ptr.as.OptionalStorage.impl(%T.67d) [symbolic] // CHECK:STDOUT: %ptr.as.OptionalStorage.impl.None.c23: %ptr.as.OptionalStorage.impl.None.type.2a7 = struct_value () [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.6c4ec3.2: = custom_witness (%Destroy.WithSelf.Op.403171.2), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.dfc: %Destroy.type = facet_value %ptr.d08, (%custom_witness.6c4ec3.2) [concrete] -// CHECK:STDOUT: %MaybeUnformed.620: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.dfc) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f8f19d.2: = custom_witness (%Destroy.WithSelf.Op.403171.2, %Destroy.WithSelf.SubobjectDestroy.d01daf.2, %Destroy.WithSelf.SelfDestruct.db3fdb.2), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.4ee: %Destroy.type = facet_value %ptr.d08, (%custom_witness.f8f19d.2) [concrete] +// CHECK:STDOUT: %MaybeUnformed.729: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.4ee) [concrete] // CHECK:STDOUT: %OptionalStorage.impl_witness.0ce: = impl_witness imports.%OptionalStorage.impl_witness_table.110, @ptr.as.OptionalStorage.impl(%i32) [concrete] // CHECK:STDOUT: %.0f8: type = maybe_unformed_type %ptr.d08 [concrete] // CHECK:STDOUT: %OptionalStorage.facet.f91: %OptionalStorage.type = facet_value %ptr.d08, (%OptionalStorage.impl_witness.0ce) [concrete] // CHECK:STDOUT: %Optional.5b3: type = class_type @Optional, @Optional(%OptionalStorage.facet.f91) [concrete] +// CHECK:STDOUT: %pattern_type.ef8: type = pattern_type %Optional.5b3 [concrete] // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete] // CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete] // CHECK:STDOUT: %ImplicitAs.type.429: type = facet_type <@ImplicitAs, @ImplicitAs(%Optional.5b3)> [concrete] @@ -1854,8 +1950,28 @@ let _: C(1) = {} as C(Cpp.COUNT); // CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.bound: = bound_method %uninit, %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.60f [concrete] // CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.60f, @Cpp.nullptr_t.as.ImplicitAs.impl.Convert(%i32) [concrete] // CHECK:STDOUT: %bound_method: = bound_method %uninit, %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.specific_fn [concrete] +// CHECK:STDOUT: %pattern_type.59d: type = pattern_type %.0f8 [concrete] +// CHECK:STDOUT: %self.param_patt.9e1: %pattern_type.59d = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.8da: %pattern_type.59d = wrapper_binding_pattern self, %self.param_patt.9e1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_14.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc11_14.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.6db: type = pattern_type %MaybeUnformed.729 [concrete] +// CHECK:STDOUT: %self.param_patt.e99: %pattern_type.6db = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.e88: %pattern_type.6db = wrapper_binding_pattern self, %self.param_patt.e99 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_14.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc11_14.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.d96: %pattern_type.ef8 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.77d: %pattern_type.ef8 = wrapper_binding_pattern self, %self.param_patt.d96 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_14.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.5: type = fn_type @Destroy.WithSelf.Op.loc11_14.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.5: %Destroy.WithSelf.Op.type.ef016f.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5: type = fn_type @Destroy.WithSelf.SelfDestruct.loc11_14.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.5: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1865,7 +1981,7 @@ let _: C(1) = {} as C(Cpp.COUNT); // CHECK:STDOUT: import Cpp//... // CHECK:STDOUT: } // CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete = constants.%foo.cpp_overload_set.value] -// CHECK:STDOUT: %Core.import_ref.509: type = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, loaded [symbolic = @ptr.as.OptionalStorage.impl.%MaybeUnformed (constants.%MaybeUnformed.ddba)] +// CHECK:STDOUT: %Core.import_ref.509: type = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, loaded [symbolic = @ptr.as.OptionalStorage.impl.%MaybeUnformed (constants.%MaybeUnformed.ddb)] // CHECK:STDOUT: %Core.import_ref.307: @ptr.as.OptionalStorage.impl.%ptr.as.OptionalStorage.impl.None.type (%ptr.as.OptionalStorage.impl.None.type.2a7) = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, loaded [symbolic = @ptr.as.OptionalStorage.impl.%ptr.as.OptionalStorage.impl.None (constants.%ptr.as.OptionalStorage.impl.None.c23)] // CHECK:STDOUT: %Core.import_ref.c9a = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, unloaded // CHECK:STDOUT: %Core.import_ref.a90 = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, unloaded @@ -1888,6 +2004,51 @@ let _: C(1) = {} as C(Cpp.COUNT); // CHECK:STDOUT: %ImplicitAs.impl_witness_table.898 = impl_witness_table (%Core.import_ref.49d), @Cpp.nullptr_t.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_14.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.59d = ref_param_pattern [concrete = constants.%self.param_patt.9e1] +// CHECK:STDOUT: %self.patt: %pattern_type.59d = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.8da] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %.0f8 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %.0f8 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc11_14.1 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.59d = ref_param_pattern [concrete = constants.%self.param_patt.9e1] +// CHECK:STDOUT: %self.patt: %pattern_type.59d = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.8da] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %.0f8 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %.0f8 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_14.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6db = ref_param_pattern [concrete = constants.%self.param_patt.e99] +// CHECK:STDOUT: %self.patt: %pattern_type.6db = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.e88] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %MaybeUnformed.729 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %MaybeUnformed.729 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc11_14.2 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6db = ref_param_pattern [concrete = constants.%self.param_patt.e99] +// CHECK:STDOUT: %self.patt: %pattern_type.6db = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.e88] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %MaybeUnformed.729 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %MaybeUnformed.729 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_14.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.ef8 = ref_param_pattern [concrete = constants.%self.param_patt.d96] +// CHECK:STDOUT: %self.patt: %pattern_type.ef8 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.77d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Optional.5b3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Optional.5b3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.5 = fn_decl @Destroy.WithSelf.Op.loc11_14.3 [concrete = constants.%Destroy.WithSelf.Op.403171.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.ef8 = ref_param_pattern [concrete = constants.%self.param_patt.d96] +// CHECK:STDOUT: %self.patt: %pattern_type.ef8 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.77d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Optional.5b3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Optional.5b3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref.loc11_3: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -1905,23 +2066,50 @@ let _: C(1) = {} as C(Cpp.COUNT); // CHECK:STDOUT: %.loc11_14.3: ref %Optional.5b3 = temporary %.loc11_14.2, %.loc11_14.1 // CHECK:STDOUT: %.loc11_14.4: %Optional.5b3 = acquire_value %.loc11_14.3 // CHECK:STDOUT: %foo.call: init %empty_tuple.type = call imports.%foo.decl(%.loc11_14.4) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.loc11_14.3, constants.%Destroy.WithSelf.Op.403171.5 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%.loc11_14.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc11_14.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc11_14.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_14.1(%self.param: ref %.0f8) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_14.1(%self.param: ref %.0f8) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_14.2(%self.param: ref %MaybeUnformed.620) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_14.1(%self.param: ref %.0f8) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_14.1(%self.param: ref %.0f8) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_14.2(%self.param: ref %MaybeUnformed.729) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_14.3(%self.param: ref %Optional.5b3) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_14.2(%self.param: ref %MaybeUnformed.729) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_14.2(%self.param: ref %MaybeUnformed.729) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_14.3(%self.param: ref %Optional.5b3) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_14.3(%self.param: ref %Optional.5b3) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_14.3(%self.param: ref %Optional.5b3) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/namespace/import.carbon b/toolchain/check/testdata/interop/cpp/namespace/import.carbon index 87d6df1aba9a..d408fc25bda3 100644 --- a/toolchain/check/testdata/interop/cpp/namespace/import.carbon +++ b/toolchain/check/testdata/interop/cpp/namespace/import.carbon @@ -505,11 +505,18 @@ fn F() { // CHECK:STDOUT: %foo.cpp_overload_set.type: type = cpp_overload_set_type @foo.cpp_overload_set [concrete] // CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete] // CHECK:STDOUT: %X: type = class_type @X [concrete] +// CHECK:STDOUT: %pattern_type.b98: type = pattern_type %X [concrete] // CHECK:STDOUT: %ptr.614: type = ptr_type %X [concrete] // CHECK:STDOUT: %foo__carbon_thunk.type: type = fn_type @foo__carbon_thunk [concrete] // CHECK:STDOUT: %foo__carbon_thunk: %foo__carbon_thunk.type = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.3ec: %pattern_type.b98 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.200: %pattern_type.b98 = wrapper_binding_pattern self, %self.param_patt.3ec [concrete] // CHECK:STDOUT: %X.cpp_destructor.type: type = fn_type @X.cpp_destructor [concrete] // CHECK:STDOUT: %X.cpp_destructor: %X.cpp_destructor.type = struct_value () [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.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -523,6 +530,21 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } +// CHECK:STDOUT: %X.cpp_destructor.decl: %X.cpp_destructor.type = fn_decl @X.cpp_destructor [concrete = constants.%X.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// 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.b98 = ref_param_pattern [concrete = constants.%self.param_patt.3ec] +// CHECK:STDOUT: %self.patt: %pattern_type.b98 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.200] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %X = ref_param call_param0 +// CHECK:STDOUT: %self: ref %X = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @MyF() { @@ -534,11 +556,20 @@ fn F() { // CHECK:STDOUT: %foo__carbon_thunk.call: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr) // CHECK:STDOUT: %.loc8_11.2: init %X to %.loc8_11.1 = mark_in_place_init %foo__carbon_thunk.call // CHECK:STDOUT: %.loc8_11.3: ref %X = temporary %.loc8_11.1, %.loc8_11.2 -// CHECK:STDOUT: %X.cpp_destructor.bound: = bound_method %.loc8_11.3, constants.%X.cpp_destructor -// CHECK:STDOUT: %X.cpp_destructor.call: init %empty_tuple.type = call %X.cpp_destructor.bound(%.loc8_11.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc8_11.3, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc8_11.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8(%self.param: ref %X) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8(%self.param: ref %X) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param) +// CHECK:STDOUT: %X.cpp_destructor.call: init %empty_tuple.type = call imports.%X.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- import_special_name_call_escpaed.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { diff --git a/toolchain/check/testdata/interop/cpp/operators/arithmetic_operators.carbon b/toolchain/check/testdata/interop/cpp/operators/arithmetic_operators.carbon index 0eede99ecd7a..bfc8d374a578 100644 --- a/toolchain/check/testdata/interop/cpp/operators/arithmetic_operators.carbon +++ b/toolchain/check/testdata/interop/cpp/operators/arithmetic_operators.carbon @@ -361,11 +361,11 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %.a30: type = fn_type_with_self_type %AddWith.WithSelf.Op.type.977, %AddWith.facet.fea [symbolic] // CHECK:STDOUT: %impl.elem1.b05: %.a30 = impl_witness_access %AddWith.lookup_impl_witness.2b1, element1 [symbolic] // CHECK:STDOUT: %specific_impl_fn.78d: = specific_impl_function %impl.elem1.b05, @AddWith.WithSelf.Op(%U.as_type.b61, %AddWith.facet.fea) [symbolic] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %Result, @Destroy [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.d3ece9.2: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Result) [symbolic] -// CHECK:STDOUT: %.53a: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.d3ece9.2, %Result [symbolic] -// CHECK:STDOUT: %impl.elem0.0f9: %.53a = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.afc: = specific_impl_function %impl.elem0.0f9, @Destroy.WithSelf.Op.1(%Result) [symbolic] +// CHECK:STDOUT: %Destroy.lookup_impl_witness.dfb4c4.2: = lookup_impl_witness %Result, @Destroy [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.4e5869.2: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Result) [symbolic] +// CHECK:STDOUT: %.ec8: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.4e5869.2, %Result [symbolic] +// CHECK:STDOUT: %impl.elem2: %.ec8 = impl_witness_access %Destroy.lookup_impl_witness.dfb4c4.2, element2 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.448: = specific_impl_function %impl.elem2, @Destroy.WithSelf.SelfDestruct.1(%Result) [symbolic] // CHECK:STDOUT: %SubWith.type.ddc: type = facet_type <@SubWith.1, @SubWith.1(%Other)> [symbolic] // CHECK:STDOUT: %Self.d6b: %SubWith.type.ddc = symbolic_binding Self, 1 [symbolic] // CHECK:STDOUT: %SubWith.assoc_type.b0b: type = assoc_entity_type @SubWith.1, @SubWith.1(%Other) [symbolic] @@ -517,27 +517,35 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %i16.builtin: type = int_type signed, %int_16 [concrete] // CHECK:STDOUT: %complete_type.2da: = complete_type_witness %i16.builtin [concrete] -// CHECK:STDOUT: %Int16.Op.type.83af6e.1: type = fn_type @Int16.Op.1 [concrete] -// CHECK:STDOUT: %Int16.Op.4dca31.1: %Int16.Op.type.83af6e.1 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.e7a31c.1: = custom_witness (%Int16.Op.4dca31.1), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.2cc: %Destroy.type = facet_value %Int16, (%custom_witness.e7a31c.1) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc176_34.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc176_34.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete] +// CHECK:STDOUT: %Int16.SubobjectDestroy.type: type = fn_type @Int16.SubobjectDestroy [concrete] +// CHECK:STDOUT: %Int16.SubobjectDestroy: %Int16.SubobjectDestroy.type = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.1bfa2a.1: = custom_witness (%Destroy.WithSelf.Op.403171.1, %Int16.SubobjectDestroy, %Destroy.WithSelf.SelfDestruct.db3fdb.1), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.f58: %Destroy.type = facet_value %Int16, (%custom_witness.1bfa2a.1) [concrete] // CHECK:STDOUT: %facet_type.297: type = facet_type <@Destroy & @AddWith.1, @AddWith.1(%Int16)> [concrete] // CHECK:STDOUT: %.Self.45a: %facet_type.297 = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %AddWith.lookup_impl_witness.131: = lookup_impl_witness %.Self.45a, @AddWith.1, @AddWith.1(%Int16) [symbolic_self] // CHECK:STDOUT: %impl.elem0.28c: type = impl_witness_access %AddWith.lookup_impl_witness.131, element0 [symbolic_self] // CHECK:STDOUT: %facet_type.225: type = facet_type <@Destroy & @AddWith.1, @AddWith.1(%Int16) where %impl.elem0.28c = %Int16> [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc176_34.2 [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.6c4ec3.2: = custom_witness (%Destroy.WithSelf.Op.403171.2), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc176_34.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc176_34.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc176_34.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f8f19d.2: = custom_witness (%Destroy.WithSelf.Op.403171.3, %Destroy.WithSelf.SubobjectDestroy.d01daf.2, %Destroy.WithSelf.SelfDestruct.db3fdb.3), @Destroy [concrete] // CHECK:STDOUT: %AddWith.type.b62: type = facet_type <@AddWith.1, @AddWith.1(%Int16)> [concrete] // CHECK:STDOUT: %AddWith.assoc_type.c72: type = assoc_entity_type @AddWith.1, @AddWith.1(%Int16) [concrete] // CHECK:STDOUT: %assoc0.261: %AddWith.assoc_type.c72 = assoc_entity element0, imports.%Core.import_ref.91f8 [concrete] // CHECK:STDOUT: %assoc1.006: %AddWith.assoc_type.c72 = assoc_entity element1, imports.%Core.import_ref.3cf [concrete] // CHECK:STDOUT: %Op.type.442b68.1: type = fn_type @Op.1 [concrete] // CHECK:STDOUT: %Op.72717c.1: %Op.type.442b68.1 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.facet.9a3: %Destroy.type = facet_value %i16, (%custom_witness.6c4ec3.2) [concrete] +// CHECK:STDOUT: %Destroy.facet.231: %Destroy.type = facet_value %i16, (%custom_witness.f8f19d.2) [concrete] // CHECK:STDOUT: %custom_witness.248: = custom_witness (%Int16, %Op.72717c.1), @AddWith.1, @AddWith.1(%Int16) [concrete] -// CHECK:STDOUT: %facet_value.1dc: %facet_type.225 = facet_value %i16, (%custom_witness.6c4ec3.2, %custom_witness.248) [concrete] +// CHECK:STDOUT: %facet_value.a37: %facet_type.225 = facet_value %i16, (%custom_witness.f8f19d.2, %custom_witness.248) [concrete] // CHECK:STDOUT: %.Self.frozen.7e3: %facet_type.297 = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %complete_type.a82: = complete_type_witness %facet_type.297 [concrete] // CHECK:STDOUT: %.Self.frozen.as_type.85e: type = facet_access_type %.Self.frozen.7e3 [symbolic_self] @@ -549,8 +557,8 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %result.patt.a31: %pattern_type.785 = wrapper_binding_pattern result, %result.param_patt.be6 [concrete] // CHECK:STDOUT: %y.param_patt.418: %pattern_type.785 = value_param_pattern [concrete] // CHECK:STDOUT: %y.patt.890: %pattern_type.785 = wrapper_binding_pattern y, %y.param_patt.418 [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.9d5: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Destroy.facet.2cc) [concrete] -// CHECK:STDOUT: %.6da: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.9d5, %Destroy.facet.2cc [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.2a7: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.f58) [concrete] +// CHECK:STDOUT: %.4d6: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.2a7, %Destroy.facet.f58 [concrete] // CHECK:STDOUT: %facet_type.b15: type = facet_type <@Destroy & @SubWith.1, @SubWith.1(%Int16)> [concrete] // CHECK:STDOUT: %.Self.415: %facet_type.b15 = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %SubWith.lookup_impl_witness.266: = lookup_impl_witness %.Self.415, @SubWith.1, @SubWith.1(%Int16) [symbolic_self] @@ -563,7 +571,7 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %Op.type.442b68.2: type = fn_type @Op.2 [concrete] // CHECK:STDOUT: %Op.72717c.2: %Op.type.442b68.2 = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.f14: = custom_witness (%Int16, %Op.72717c.2), @SubWith.1, @SubWith.1(%Int16) [concrete] -// CHECK:STDOUT: %facet_value.a29: %facet_type.b71 = facet_value %i16, (%custom_witness.6c4ec3.2, %custom_witness.f14) [concrete] +// CHECK:STDOUT: %facet_value.0ee5e: %facet_type.b71 = facet_value %i16, (%custom_witness.f8f19d.2, %custom_witness.f14) [concrete] // CHECK:STDOUT: %.Self.frozen.581: %facet_type.b15 = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %complete_type.647: = complete_type_witness %facet_type.b15 [concrete] // CHECK:STDOUT: %.Self.frozen.as_type.092: type = facet_access_type %.Self.frozen.581 [symbolic_self] @@ -583,7 +591,7 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %Op.type.442b68.3: type = fn_type @Op.3 [concrete] // CHECK:STDOUT: %Op.72717c.3: %Op.type.442b68.3 = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.6bd: = custom_witness (%Int16, %Op.72717c.3), @MulWith.1, @MulWith.1(%Int16) [concrete] -// CHECK:STDOUT: %facet_value.ba0: %facet_type.662 = facet_value %i16, (%custom_witness.6c4ec3.2, %custom_witness.6bd) [concrete] +// CHECK:STDOUT: %facet_value.58f: %facet_type.662 = facet_value %i16, (%custom_witness.f8f19d.2, %custom_witness.6bd) [concrete] // CHECK:STDOUT: %.Self.frozen.05e: %facet_type.a64 = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %complete_type.4d3: = complete_type_witness %facet_type.a64 [concrete] // CHECK:STDOUT: %.Self.frozen.as_type.2d1: type = facet_access_type %.Self.frozen.05e [symbolic_self] @@ -603,7 +611,7 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %Op.type.442b68.4: type = fn_type @Op.4 [concrete] // CHECK:STDOUT: %Op.72717c.4: %Op.type.442b68.4 = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.22c: = custom_witness (%Int16, %Op.72717c.4), @DivWith.1, @DivWith.1(%Int16) [concrete] -// CHECK:STDOUT: %facet_value.de3: %facet_type.bd6 = facet_value %i16, (%custom_witness.6c4ec3.2, %custom_witness.22c) [concrete] +// CHECK:STDOUT: %facet_value.b41: %facet_type.bd6 = facet_value %i16, (%custom_witness.f8f19d.2, %custom_witness.22c) [concrete] // CHECK:STDOUT: %.Self.frozen.ecc: %facet_type.0b4 = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %complete_type.acc: = complete_type_witness %facet_type.0b4 [concrete] // CHECK:STDOUT: %.Self.frozen.as_type.851: type = facet_access_type %.Self.frozen.ecc [symbolic_self] @@ -623,7 +631,7 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %Op.type.442b68.5: type = fn_type @Op.5 [concrete] // CHECK:STDOUT: %Op.72717c.5: %Op.type.442b68.5 = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.9e6: = custom_witness (%Int16, %Op.72717c.5), @ModWith.1, @ModWith.1(%Int16) [concrete] -// CHECK:STDOUT: %facet_value.718: %facet_type.a2b = facet_value %i16, (%custom_witness.6c4ec3.2, %custom_witness.9e6) [concrete] +// CHECK:STDOUT: %facet_value.b6e: %facet_type.a2b = facet_value %i16, (%custom_witness.f8f19d.2, %custom_witness.9e6) [concrete] // CHECK:STDOUT: %.Self.frozen.9a7: %facet_type.ee8 = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %complete_type.8fc: = complete_type_witness %facet_type.ee8 [concrete] // CHECK:STDOUT: %.Self.frozen.as_type.954: type = facet_access_type %.Self.frozen.9a7 [symbolic_self] @@ -640,10 +648,10 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %AddWith.assoc_type.6bf: type = assoc_entity_type @AddWith.1, @AddWith.1(%i16) [concrete] // CHECK:STDOUT: %assoc0.e6b: %AddWith.assoc_type.6bf = assoc_entity element0, imports.%Core.import_ref.91f8 [concrete] // CHECK:STDOUT: %assoc1.80e: %AddWith.assoc_type.6bf = assoc_entity element1, imports.%Core.import_ref.3cf [concrete] -// CHECK:STDOUT: %Int16.Op.type.83af6e.3: type = fn_type @Int16.Op.3 [concrete] -// CHECK:STDOUT: %Int16.Op.4dca31.3: %Int16.Op.type.83af6e.3 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.b17: = custom_witness (%Int16, %Int16.Op.4dca31.3), @AddWith.1, @AddWith.1(%i16) [concrete] -// CHECK:STDOUT: %facet_value.0c7: %facet_type.b7b = facet_value %Int16, (%custom_witness.e7a31c.1, %custom_witness.b17) [concrete] +// CHECK:STDOUT: %Int16.Op.type.83af6e.2: type = fn_type @Int16.Op.2 [concrete] +// CHECK:STDOUT: %Int16.Op.4dca31.2: %Int16.Op.type.83af6e.2 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.b17: = custom_witness (%Int16, %Int16.Op.4dca31.2), @AddWith.1, @AddWith.1(%i16) [concrete] +// CHECK:STDOUT: %facet_value.a75: %facet_type.b7b = facet_value %Int16, (%custom_witness.1bfa2a.1, %custom_witness.b17) [concrete] // CHECK:STDOUT: %.Self.frozen.e5b: %facet_type.1cc = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %complete_type.5a6: = complete_type_witness %facet_type.1cc [concrete] // CHECK:STDOUT: %.Self.frozen.as_type.b7c: type = facet_access_type %.Self.frozen.e5b [symbolic_self] @@ -664,10 +672,10 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %SubWith.assoc_type.077: type = assoc_entity_type @SubWith.1, @SubWith.1(%i16) [concrete] // CHECK:STDOUT: %assoc0.465: %SubWith.assoc_type.077 = assoc_entity element0, imports.%Core.import_ref.190e [concrete] // CHECK:STDOUT: %assoc1.9f7: %SubWith.assoc_type.077 = assoc_entity element1, imports.%Core.import_ref.3a4 [concrete] -// CHECK:STDOUT: %Int16.Op.type.83af6e.4: type = fn_type @Int16.Op.4 [concrete] -// CHECK:STDOUT: %Int16.Op.4dca31.4: %Int16.Op.type.83af6e.4 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.b07: = custom_witness (%Int16, %Int16.Op.4dca31.4), @SubWith.1, @SubWith.1(%i16) [concrete] -// CHECK:STDOUT: %facet_value.33e: %facet_type.a67 = facet_value %Int16, (%custom_witness.e7a31c.1, %custom_witness.b07) [concrete] +// CHECK:STDOUT: %Int16.Op.type.83af6e.3: type = fn_type @Int16.Op.3 [concrete] +// CHECK:STDOUT: %Int16.Op.4dca31.3: %Int16.Op.type.83af6e.3 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.b07: = custom_witness (%Int16, %Int16.Op.4dca31.3), @SubWith.1, @SubWith.1(%i16) [concrete] +// CHECK:STDOUT: %facet_value.841: %facet_type.a67 = facet_value %Int16, (%custom_witness.1bfa2a.1, %custom_witness.b07) [concrete] // CHECK:STDOUT: %.Self.frozen.bbc: %facet_type.cb2 = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %complete_type.090: = complete_type_witness %facet_type.cb2 [concrete] // CHECK:STDOUT: %.Self.frozen.as_type.ae6: type = facet_access_type %.Self.frozen.bbc [symbolic_self] @@ -684,10 +692,10 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %MulWith.assoc_type.212: type = assoc_entity_type @MulWith.1, @MulWith.1(%i16) [concrete] // CHECK:STDOUT: %assoc0.455: %MulWith.assoc_type.212 = assoc_entity element0, imports.%Core.import_ref.59c [concrete] // CHECK:STDOUT: %assoc1.2d0: %MulWith.assoc_type.212 = assoc_entity element1, imports.%Core.import_ref.5a0 [concrete] -// CHECK:STDOUT: %Int16.Op.type.83af6e.5: type = fn_type @Int16.Op.5 [concrete] -// CHECK:STDOUT: %Int16.Op.4dca31.5: %Int16.Op.type.83af6e.5 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.8bd: = custom_witness (%Int16, %Int16.Op.4dca31.5), @MulWith.1, @MulWith.1(%i16) [concrete] -// CHECK:STDOUT: %facet_value.ba4: %facet_type.d40 = facet_value %Int16, (%custom_witness.e7a31c.1, %custom_witness.8bd) [concrete] +// CHECK:STDOUT: %Int16.Op.type.83af6e.4: type = fn_type @Int16.Op.4 [concrete] +// CHECK:STDOUT: %Int16.Op.4dca31.4: %Int16.Op.type.83af6e.4 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.8bd: = custom_witness (%Int16, %Int16.Op.4dca31.4), @MulWith.1, @MulWith.1(%i16) [concrete] +// CHECK:STDOUT: %facet_value.afd: %facet_type.d40 = facet_value %Int16, (%custom_witness.1bfa2a.1, %custom_witness.8bd) [concrete] // CHECK:STDOUT: %.Self.frozen.c15: %facet_type.67c = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %complete_type.a8b: = complete_type_witness %facet_type.67c [concrete] // CHECK:STDOUT: %.Self.frozen.as_type.225: type = facet_access_type %.Self.frozen.c15 [symbolic_self] @@ -704,10 +712,10 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %DivWith.assoc_type.1f2: type = assoc_entity_type @DivWith.1, @DivWith.1(%i16) [concrete] // CHECK:STDOUT: %assoc0.be2: %DivWith.assoc_type.1f2 = assoc_entity element0, imports.%Core.import_ref.dee [concrete] // CHECK:STDOUT: %assoc1.885: %DivWith.assoc_type.1f2 = assoc_entity element1, imports.%Core.import_ref.7845 [concrete] -// CHECK:STDOUT: %Int16.Op.type.83af6e.6: type = fn_type @Int16.Op.6 [concrete] -// CHECK:STDOUT: %Int16.Op.4dca31.6: %Int16.Op.type.83af6e.6 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.963: = custom_witness (%Int16, %Int16.Op.4dca31.6), @DivWith.1, @DivWith.1(%i16) [concrete] -// CHECK:STDOUT: %facet_value.521: %facet_type.541 = facet_value %Int16, (%custom_witness.e7a31c.1, %custom_witness.963) [concrete] +// CHECK:STDOUT: %Int16.Op.type.83af6e.5: type = fn_type @Int16.Op.5 [concrete] +// CHECK:STDOUT: %Int16.Op.4dca31.5: %Int16.Op.type.83af6e.5 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.963: = custom_witness (%Int16, %Int16.Op.4dca31.5), @DivWith.1, @DivWith.1(%i16) [concrete] +// CHECK:STDOUT: %facet_value.ef1: %facet_type.541 = facet_value %Int16, (%custom_witness.1bfa2a.1, %custom_witness.963) [concrete] // CHECK:STDOUT: %.Self.frozen.128: %facet_type.86c8 = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %complete_type.1cb: = complete_type_witness %facet_type.86c8 [concrete] // CHECK:STDOUT: %.Self.frozen.as_type.ac3: type = facet_access_type %.Self.frozen.128 [symbolic_self] @@ -724,10 +732,10 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %ModWith.assoc_type.e06: type = assoc_entity_type @ModWith.1, @ModWith.1(%i16) [concrete] // CHECK:STDOUT: %assoc0.b5a: %ModWith.assoc_type.e06 = assoc_entity element0, imports.%Core.import_ref.61a [concrete] // CHECK:STDOUT: %assoc1.972: %ModWith.assoc_type.e06 = assoc_entity element1, imports.%Core.import_ref.b56 [concrete] -// CHECK:STDOUT: %Int16.Op.type.83af6e.7: type = fn_type @Int16.Op.7 [concrete] -// CHECK:STDOUT: %Int16.Op.4dca31.7: %Int16.Op.type.83af6e.7 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.8f4: = custom_witness (%Int16, %Int16.Op.4dca31.7), @ModWith.1, @ModWith.1(%i16) [concrete] -// CHECK:STDOUT: %facet_value.ce1: %facet_type.ee6 = facet_value %Int16, (%custom_witness.e7a31c.1, %custom_witness.8f4) [concrete] +// CHECK:STDOUT: %Int16.Op.type.83af6e.6: type = fn_type @Int16.Op.6 [concrete] +// CHECK:STDOUT: %Int16.Op.4dca31.6: %Int16.Op.type.83af6e.6 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.8f4: = custom_witness (%Int16, %Int16.Op.4dca31.6), @ModWith.1, @ModWith.1(%i16) [concrete] +// CHECK:STDOUT: %facet_value.952: %facet_type.ee6 = facet_value %Int16, (%custom_witness.1bfa2a.1, %custom_witness.8f4) [concrete] // CHECK:STDOUT: %.Self.frozen.46c: %facet_type.afdb = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %complete_type.1f9: = complete_type_witness %facet_type.afdb [concrete] // CHECK:STDOUT: %.Self.frozen.as_type.12f: type = facet_access_type %.Self.frozen.46c [symbolic_self] @@ -735,10 +743,14 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %impl.elem0.172: type = impl_witness_access %ModWith.lookup_impl_witness.5ab, element0 [symbolic_self] // CHECK:STDOUT: %pattern_type.4d8: type = pattern_type %facet_type.ee6 [concrete] // CHECK:STDOUT: %T.patt.a7e: %pattern_type.4d8 = symbolic_binding_pattern T, 2 [symbolic] -// CHECK:STDOUT: %Int32.Op.type.83af6e.1: type = fn_type @Int32.Op.1 [concrete] -// CHECK:STDOUT: %Int32.Op.4dca31.1: %Int32.Op.type.83af6e.1 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.e7a31c.2: = custom_witness (%Int32.Op.4dca31.1), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.099: %Destroy.type = facet_value %Int32, (%custom_witness.e7a31c.2) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc190 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc190 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] +// CHECK:STDOUT: %Int32.SubobjectDestroy.type: type = fn_type @Int32.SubobjectDestroy [concrete] +// CHECK:STDOUT: %Int32.SubobjectDestroy: %Int32.SubobjectDestroy.type = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.1bfa2a.2: = custom_witness (%Destroy.WithSelf.Op.403171.4, %Int32.SubobjectDestroy, %Destroy.WithSelf.SelfDestruct.db3fdb.4), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.84d: %Destroy.type = facet_value %Int32, (%custom_witness.1bfa2a.2) [concrete] // CHECK:STDOUT: %facet_type.698: type = facet_type <@Destroy & @AddWith.1, @AddWith.1(%Int32)> [concrete] // CHECK:STDOUT: %.Self.591: %facet_type.698 = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %AddWith.lookup_impl_witness.47a: = lookup_impl_witness %.Self.591, @AddWith.1, @AddWith.1(%Int32) [symbolic_self] @@ -748,10 +760,10 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %AddWith.assoc_type.72d: type = assoc_entity_type @AddWith.1, @AddWith.1(%Int32) [concrete] // CHECK:STDOUT: %assoc0.c2b: %AddWith.assoc_type.72d = assoc_entity element0, imports.%Core.import_ref.91f8 [concrete] // CHECK:STDOUT: %assoc1.0fc: %AddWith.assoc_type.72d = assoc_entity element1, imports.%Core.import_ref.3cf [concrete] -// CHECK:STDOUT: %Int16.Op.type.83af6e.8: type = fn_type @Int16.Op.8 [concrete] -// CHECK:STDOUT: %Int16.Op.4dca31.8: %Int16.Op.type.83af6e.8 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.e02e0c.1: = custom_witness (%Int32, %Int16.Op.4dca31.8), @AddWith.1, @AddWith.1(%Int32) [concrete] -// CHECK:STDOUT: %facet_value.17e: %facet_type.ecf = facet_value %Int16, (%custom_witness.e7a31c.1, %custom_witness.e02e0c.1) [concrete] +// CHECK:STDOUT: %Int16.Op.type.83af6e.7: type = fn_type @Int16.Op.7 [concrete] +// CHECK:STDOUT: %Int16.Op.4dca31.7: %Int16.Op.type.83af6e.7 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.e02e0c.1: = custom_witness (%Int32, %Int16.Op.4dca31.7), @AddWith.1, @AddWith.1(%Int32) [concrete] +// CHECK:STDOUT: %facet_value.7c7: %facet_type.ecf = facet_value %Int16, (%custom_witness.1bfa2a.1, %custom_witness.e02e0c.1) [concrete] // CHECK:STDOUT: %.Self.frozen.f1e: %facet_type.698 = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %complete_type.224: = complete_type_witness %facet_type.698 [concrete] // CHECK:STDOUT: %.Self.frozen.as_type.440: type = facet_access_type %.Self.frozen.f1e [symbolic_self] @@ -763,8 +775,8 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %result.patt.47f: %pattern_type.8b4 = wrapper_binding_pattern result, %result.param_patt.e81 [concrete] // CHECK:STDOUT: %y.param_patt.e0c: %pattern_type.8b4 = value_param_pattern [concrete] // CHECK:STDOUT: %y.patt.9e1: %pattern_type.8b4 = wrapper_binding_pattern y, %y.param_patt.e0c [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.b76: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Destroy.facet.099) [concrete] -// CHECK:STDOUT: %.043: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.b76, %Destroy.facet.099 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.3e9: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.84d) [concrete] +// CHECK:STDOUT: %.57b: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.3e9, %Destroy.facet.84d [concrete] // CHECK:STDOUT: %facet_type.44e: type = facet_type <@Destroy & @SubWith.1, @SubWith.1(%Int32)> [concrete] // CHECK:STDOUT: %.Self.8ac: %facet_type.44e = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %SubWith.lookup_impl_witness.f41: = lookup_impl_witness %.Self.8ac, @SubWith.1, @SubWith.1(%Int32) [symbolic_self] @@ -774,10 +786,10 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %SubWith.assoc_type.68f: type = assoc_entity_type @SubWith.1, @SubWith.1(%Int32) [concrete] // CHECK:STDOUT: %assoc0.f11: %SubWith.assoc_type.68f = assoc_entity element0, imports.%Core.import_ref.190e [concrete] // CHECK:STDOUT: %assoc1.799: %SubWith.assoc_type.68f = assoc_entity element1, imports.%Core.import_ref.3a4 [concrete] -// CHECK:STDOUT: %Int16.Op.type.83af6e.9: type = fn_type @Int16.Op.9 [concrete] -// CHECK:STDOUT: %Int16.Op.4dca31.9: %Int16.Op.type.83af6e.9 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.4dea15.1: = custom_witness (%Int32, %Int16.Op.4dca31.9), @SubWith.1, @SubWith.1(%Int32) [concrete] -// CHECK:STDOUT: %facet_value.9eb: %facet_type.630 = facet_value %Int16, (%custom_witness.e7a31c.1, %custom_witness.4dea15.1) [concrete] +// CHECK:STDOUT: %Int16.Op.type.83af6e.8: type = fn_type @Int16.Op.8 [concrete] +// CHECK:STDOUT: %Int16.Op.4dca31.8: %Int16.Op.type.83af6e.8 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.4dea15.1: = custom_witness (%Int32, %Int16.Op.4dca31.8), @SubWith.1, @SubWith.1(%Int32) [concrete] +// CHECK:STDOUT: %facet_value.16e: %facet_type.630 = facet_value %Int16, (%custom_witness.1bfa2a.1, %custom_witness.4dea15.1) [concrete] // CHECK:STDOUT: %.Self.frozen.db8: %facet_type.44e = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %complete_type.63f: = complete_type_witness %facet_type.44e [concrete] // CHECK:STDOUT: %.Self.frozen.as_type.068: type = facet_access_type %.Self.frozen.db8 [symbolic_self] @@ -794,10 +806,10 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %MulWith.assoc_type.083: type = assoc_entity_type @MulWith.1, @MulWith.1(%Int32) [concrete] // CHECK:STDOUT: %assoc0.fc0: %MulWith.assoc_type.083 = assoc_entity element0, imports.%Core.import_ref.59c [concrete] // CHECK:STDOUT: %assoc1.019: %MulWith.assoc_type.083 = assoc_entity element1, imports.%Core.import_ref.5a0 [concrete] -// CHECK:STDOUT: %Int16.Op.type.83af6e.10: type = fn_type @Int16.Op.10 [concrete] -// CHECK:STDOUT: %Int16.Op.4dca31.10: %Int16.Op.type.83af6e.10 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.337c88.1: = custom_witness (%Int32, %Int16.Op.4dca31.10), @MulWith.1, @MulWith.1(%Int32) [concrete] -// CHECK:STDOUT: %facet_value.9ae: %facet_type.26b = facet_value %Int16, (%custom_witness.e7a31c.1, %custom_witness.337c88.1) [concrete] +// CHECK:STDOUT: %Int16.Op.type.83af6e.9: type = fn_type @Int16.Op.9 [concrete] +// CHECK:STDOUT: %Int16.Op.4dca31.9: %Int16.Op.type.83af6e.9 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.337c88.1: = custom_witness (%Int32, %Int16.Op.4dca31.9), @MulWith.1, @MulWith.1(%Int32) [concrete] +// CHECK:STDOUT: %facet_value.812: %facet_type.26b = facet_value %Int16, (%custom_witness.1bfa2a.1, %custom_witness.337c88.1) [concrete] // CHECK:STDOUT: %.Self.frozen.be6: %facet_type.ff6 = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %complete_type.3fe: = complete_type_witness %facet_type.ff6 [concrete] // CHECK:STDOUT: %.Self.frozen.as_type.aaf: type = facet_access_type %.Self.frozen.be6 [symbolic_self] @@ -814,10 +826,10 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %DivWith.assoc_type.725: type = assoc_entity_type @DivWith.1, @DivWith.1(%Int32) [concrete] // CHECK:STDOUT: %assoc0.2da: %DivWith.assoc_type.725 = assoc_entity element0, imports.%Core.import_ref.dee [concrete] // CHECK:STDOUT: %assoc1.580: %DivWith.assoc_type.725 = assoc_entity element1, imports.%Core.import_ref.7845 [concrete] -// CHECK:STDOUT: %Int16.Op.type.83af6e.11: type = fn_type @Int16.Op.11 [concrete] -// CHECK:STDOUT: %Int16.Op.4dca31.11: %Int16.Op.type.83af6e.11 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.3eb227.1: = custom_witness (%Int32, %Int16.Op.4dca31.11), @DivWith.1, @DivWith.1(%Int32) [concrete] -// CHECK:STDOUT: %facet_value.38c: %facet_type.1a8 = facet_value %Int16, (%custom_witness.e7a31c.1, %custom_witness.3eb227.1) [concrete] +// CHECK:STDOUT: %Int16.Op.type.83af6e.10: type = fn_type @Int16.Op.10 [concrete] +// CHECK:STDOUT: %Int16.Op.4dca31.10: %Int16.Op.type.83af6e.10 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.3eb227.1: = custom_witness (%Int32, %Int16.Op.4dca31.10), @DivWith.1, @DivWith.1(%Int32) [concrete] +// CHECK:STDOUT: %facet_value.0ee56: %facet_type.1a8 = facet_value %Int16, (%custom_witness.1bfa2a.1, %custom_witness.3eb227.1) [concrete] // CHECK:STDOUT: %.Self.frozen.be1: %facet_type.d41 = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %complete_type.11b: = complete_type_witness %facet_type.d41 [concrete] // CHECK:STDOUT: %.Self.frozen.as_type.88a: type = facet_access_type %.Self.frozen.be1 [symbolic_self] @@ -834,10 +846,10 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %ModWith.assoc_type.47d: type = assoc_entity_type @ModWith.1, @ModWith.1(%Int32) [concrete] // CHECK:STDOUT: %assoc0.45c: %ModWith.assoc_type.47d = assoc_entity element0, imports.%Core.import_ref.61a [concrete] // CHECK:STDOUT: %assoc1.878: %ModWith.assoc_type.47d = assoc_entity element1, imports.%Core.import_ref.b56 [concrete] -// CHECK:STDOUT: %Int16.Op.type.83af6e.12: type = fn_type @Int16.Op.12 [concrete] -// CHECK:STDOUT: %Int16.Op.4dca31.12: %Int16.Op.type.83af6e.12 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.501c6d.1: = custom_witness (%Int32, %Int16.Op.4dca31.12), @ModWith.1, @ModWith.1(%Int32) [concrete] -// CHECK:STDOUT: %facet_value.68d: %facet_type.c8c = facet_value %Int16, (%custom_witness.e7a31c.1, %custom_witness.501c6d.1) [concrete] +// CHECK:STDOUT: %Int16.Op.type.83af6e.11: type = fn_type @Int16.Op.11 [concrete] +// CHECK:STDOUT: %Int16.Op.4dca31.11: %Int16.Op.type.83af6e.11 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.501c6d.1: = custom_witness (%Int32, %Int16.Op.4dca31.11), @ModWith.1, @ModWith.1(%Int32) [concrete] +// CHECK:STDOUT: %facet_value.d41: %facet_type.c8c = facet_value %Int16, (%custom_witness.1bfa2a.1, %custom_witness.501c6d.1) [concrete] // CHECK:STDOUT: %.Self.frozen.4b6: %facet_type.ea8 = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %complete_type.2aa: = complete_type_witness %facet_type.ea8 [concrete] // CHECK:STDOUT: %.Self.frozen.as_type.080: type = facet_access_type %.Self.frozen.4b6 [symbolic_self] @@ -846,66 +858,70 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %pattern_type.c9a: type = pattern_type %facet_type.c8c [concrete] // CHECK:STDOUT: %T.patt.b4d: %pattern_type.c9a = symbolic_binding_pattern T, 2 [symbolic] // CHECK:STDOUT: %facet_type.37e: type = facet_type <@Destroy & @AddWith.1, @AddWith.1(%Int16) where %impl.elem0.28c = %Int32> [concrete] -// CHECK:STDOUT: %Int32.Op.type.83af6e.2: type = fn_type @Int32.Op.2 [concrete] -// CHECK:STDOUT: %Int32.Op.4dca31.2: %Int32.Op.type.83af6e.2 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.15f: = custom_witness (%Int32, %Int32.Op.4dca31.2), @AddWith.1, @AddWith.1(%Int16) [concrete] -// CHECK:STDOUT: %facet_value.6ea: %facet_type.37e = facet_value %Int32, (%custom_witness.e7a31c.2, %custom_witness.15f) [concrete] +// CHECK:STDOUT: %Int32.Op.type.83af6e.1: type = fn_type @Int32.Op.1 [concrete] +// CHECK:STDOUT: %Int32.Op.4dca31.1: %Int32.Op.type.83af6e.1 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.15f: = custom_witness (%Int32, %Int32.Op.4dca31.1), @AddWith.1, @AddWith.1(%Int16) [concrete] +// CHECK:STDOUT: %facet_value.169: %facet_type.37e = facet_value %Int32, (%custom_witness.1bfa2a.2, %custom_witness.15f) [concrete] // CHECK:STDOUT: %pattern_type.363: type = pattern_type %facet_type.37e [concrete] // CHECK:STDOUT: %T.patt.ccd: %pattern_type.363 = symbolic_binding_pattern T, 2 [symbolic] // CHECK:STDOUT: %x.param_patt.27c: %pattern_type.8b4 = value_param_pattern [concrete] // CHECK:STDOUT: %x.patt.740: %pattern_type.8b4 = wrapper_binding_pattern x, %x.param_patt.27c [concrete] // CHECK:STDOUT: %facet_type.983: type = facet_type <@Destroy & @SubWith.1, @SubWith.1(%Int16) where %impl.elem0.4a0 = %Int32> [concrete] -// CHECK:STDOUT: %Int32.Op.type.83af6e.3: type = fn_type @Int32.Op.3 [concrete] -// CHECK:STDOUT: %Int32.Op.4dca31.3: %Int32.Op.type.83af6e.3 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.bb4: = custom_witness (%Int32, %Int32.Op.4dca31.3), @SubWith.1, @SubWith.1(%Int16) [concrete] -// CHECK:STDOUT: %facet_value.bcc: %facet_type.983 = facet_value %Int32, (%custom_witness.e7a31c.2, %custom_witness.bb4) [concrete] +// CHECK:STDOUT: %Int32.Op.type.83af6e.2: type = fn_type @Int32.Op.2 [concrete] +// CHECK:STDOUT: %Int32.Op.4dca31.2: %Int32.Op.type.83af6e.2 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.bb4: = custom_witness (%Int32, %Int32.Op.4dca31.2), @SubWith.1, @SubWith.1(%Int16) [concrete] +// CHECK:STDOUT: %facet_value.ddb: %facet_type.983 = facet_value %Int32, (%custom_witness.1bfa2a.2, %custom_witness.bb4) [concrete] // CHECK:STDOUT: %pattern_type.af3: type = pattern_type %facet_type.983 [concrete] // CHECK:STDOUT: %T.patt.14c: %pattern_type.af3 = symbolic_binding_pattern T, 2 [symbolic] // CHECK:STDOUT: %facet_type.f48: type = facet_type <@Destroy & @MulWith.1, @MulWith.1(%Int16) where %impl.elem0.8de = %Int32> [concrete] -// CHECK:STDOUT: %Int32.Op.type.83af6e.4: type = fn_type @Int32.Op.4 [concrete] -// CHECK:STDOUT: %Int32.Op.4dca31.4: %Int32.Op.type.83af6e.4 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.0ab: = custom_witness (%Int32, %Int32.Op.4dca31.4), @MulWith.1, @MulWith.1(%Int16) [concrete] -// CHECK:STDOUT: %facet_value.795: %facet_type.f48 = facet_value %Int32, (%custom_witness.e7a31c.2, %custom_witness.0ab) [concrete] +// CHECK:STDOUT: %Int32.Op.type.83af6e.3: type = fn_type @Int32.Op.3 [concrete] +// CHECK:STDOUT: %Int32.Op.4dca31.3: %Int32.Op.type.83af6e.3 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.0ab: = custom_witness (%Int32, %Int32.Op.4dca31.3), @MulWith.1, @MulWith.1(%Int16) [concrete] +// CHECK:STDOUT: %facet_value.ae7: %facet_type.f48 = facet_value %Int32, (%custom_witness.1bfa2a.2, %custom_witness.0ab) [concrete] // CHECK:STDOUT: %pattern_type.02f: type = pattern_type %facet_type.f48 [concrete] // CHECK:STDOUT: %T.patt.a9e: %pattern_type.02f = symbolic_binding_pattern T, 2 [symbolic] // CHECK:STDOUT: %facet_type.50d: type = facet_type <@Destroy & @DivWith.1, @DivWith.1(%Int16) where %impl.elem0.36a = %Int32> [concrete] -// CHECK:STDOUT: %Int32.Op.type.83af6e.5: type = fn_type @Int32.Op.5 [concrete] -// CHECK:STDOUT: %Int32.Op.4dca31.5: %Int32.Op.type.83af6e.5 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.3ec: = custom_witness (%Int32, %Int32.Op.4dca31.5), @DivWith.1, @DivWith.1(%Int16) [concrete] -// CHECK:STDOUT: %facet_value.c8d: %facet_type.50d = facet_value %Int32, (%custom_witness.e7a31c.2, %custom_witness.3ec) [concrete] +// CHECK:STDOUT: %Int32.Op.type.83af6e.4: type = fn_type @Int32.Op.4 [concrete] +// CHECK:STDOUT: %Int32.Op.4dca31.4: %Int32.Op.type.83af6e.4 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.3ec: = custom_witness (%Int32, %Int32.Op.4dca31.4), @DivWith.1, @DivWith.1(%Int16) [concrete] +// CHECK:STDOUT: %facet_value.003: %facet_type.50d = facet_value %Int32, (%custom_witness.1bfa2a.2, %custom_witness.3ec) [concrete] // CHECK:STDOUT: %pattern_type.9af: type = pattern_type %facet_type.50d [concrete] // CHECK:STDOUT: %T.patt.dfa: %pattern_type.9af = symbolic_binding_pattern T, 2 [symbolic] // CHECK:STDOUT: %facet_type.b37: type = facet_type <@Destroy & @ModWith.1, @ModWith.1(%Int16) where %impl.elem0.436 = %Int32> [concrete] -// CHECK:STDOUT: %Int32.Op.type.83af6e.6: type = fn_type @Int32.Op.6 [concrete] -// CHECK:STDOUT: %Int32.Op.4dca31.6: %Int32.Op.type.83af6e.6 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.de0: = custom_witness (%Int32, %Int32.Op.4dca31.6), @ModWith.1, @ModWith.1(%Int16) [concrete] -// CHECK:STDOUT: %facet_value.da8: %facet_type.b37 = facet_value %Int32, (%custom_witness.e7a31c.2, %custom_witness.de0) [concrete] +// CHECK:STDOUT: %Int32.Op.type.83af6e.5: type = fn_type @Int32.Op.5 [concrete] +// CHECK:STDOUT: %Int32.Op.4dca31.5: %Int32.Op.type.83af6e.5 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.de0: = custom_witness (%Int32, %Int32.Op.4dca31.5), @ModWith.1, @ModWith.1(%Int16) [concrete] +// CHECK:STDOUT: %facet_value.af1: %facet_type.b37 = facet_value %Int32, (%custom_witness.1bfa2a.2, %custom_witness.de0) [concrete] // CHECK:STDOUT: %pattern_type.448: type = pattern_type %facet_type.b37 [concrete] // CHECK:STDOUT: %T.patt.528: %pattern_type.448 = symbolic_binding_pattern T, 2 [symbolic] +// CHECK:STDOUT: %Int32.Op.type.83af6e.6: type = fn_type @Int32.Op.6 [concrete] +// CHECK:STDOUT: %Int32.Op.4dca31.6: %Int32.Op.type.83af6e.6 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.e02e0c.2: = custom_witness (%Int32, %Int32.Op.4dca31.6), @AddWith.1, @AddWith.1(%Int32) [concrete] +// CHECK:STDOUT: %facet_value.c2c: %facet_type.ecf = facet_value %Int32, (%custom_witness.1bfa2a.2, %custom_witness.e02e0c.2) [concrete] // CHECK:STDOUT: %Int32.Op.type.83af6e.7: type = fn_type @Int32.Op.7 [concrete] // CHECK:STDOUT: %Int32.Op.4dca31.7: %Int32.Op.type.83af6e.7 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.e02e0c.2: = custom_witness (%Int32, %Int32.Op.4dca31.7), @AddWith.1, @AddWith.1(%Int32) [concrete] -// CHECK:STDOUT: %facet_value.f1a: %facet_type.ecf = facet_value %Int32, (%custom_witness.e7a31c.2, %custom_witness.e02e0c.2) [concrete] +// CHECK:STDOUT: %custom_witness.4dea15.2: = custom_witness (%Int32, %Int32.Op.4dca31.7), @SubWith.1, @SubWith.1(%Int32) [concrete] +// CHECK:STDOUT: %facet_value.7a2: %facet_type.630 = facet_value %Int32, (%custom_witness.1bfa2a.2, %custom_witness.4dea15.2) [concrete] // CHECK:STDOUT: %Int32.Op.type.83af6e.8: type = fn_type @Int32.Op.8 [concrete] // CHECK:STDOUT: %Int32.Op.4dca31.8: %Int32.Op.type.83af6e.8 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.4dea15.2: = custom_witness (%Int32, %Int32.Op.4dca31.8), @SubWith.1, @SubWith.1(%Int32) [concrete] -// CHECK:STDOUT: %facet_value.6fc: %facet_type.630 = facet_value %Int32, (%custom_witness.e7a31c.2, %custom_witness.4dea15.2) [concrete] +// CHECK:STDOUT: %custom_witness.337c88.2: = custom_witness (%Int32, %Int32.Op.4dca31.8), @MulWith.1, @MulWith.1(%Int32) [concrete] +// CHECK:STDOUT: %facet_value.84e: %facet_type.26b = facet_value %Int32, (%custom_witness.1bfa2a.2, %custom_witness.337c88.2) [concrete] // CHECK:STDOUT: %Int32.Op.type.83af6e.9: type = fn_type @Int32.Op.9 [concrete] // CHECK:STDOUT: %Int32.Op.4dca31.9: %Int32.Op.type.83af6e.9 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.337c88.2: = custom_witness (%Int32, %Int32.Op.4dca31.9), @MulWith.1, @MulWith.1(%Int32) [concrete] -// CHECK:STDOUT: %facet_value.c80: %facet_type.26b = facet_value %Int32, (%custom_witness.e7a31c.2, %custom_witness.337c88.2) [concrete] +// CHECK:STDOUT: %custom_witness.3eb227.2: = custom_witness (%Int32, %Int32.Op.4dca31.9), @DivWith.1, @DivWith.1(%Int32) [concrete] +// CHECK:STDOUT: %facet_value.0bf: %facet_type.1a8 = facet_value %Int32, (%custom_witness.1bfa2a.2, %custom_witness.3eb227.2) [concrete] // CHECK:STDOUT: %Int32.Op.type.83af6e.10: type = fn_type @Int32.Op.10 [concrete] // CHECK:STDOUT: %Int32.Op.4dca31.10: %Int32.Op.type.83af6e.10 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.3eb227.2: = custom_witness (%Int32, %Int32.Op.4dca31.10), @DivWith.1, @DivWith.1(%Int32) [concrete] -// CHECK:STDOUT: %facet_value.b2c: %facet_type.1a8 = facet_value %Int32, (%custom_witness.e7a31c.2, %custom_witness.3eb227.2) [concrete] -// CHECK:STDOUT: %Int32.Op.type.83af6e.11: type = fn_type @Int32.Op.11 [concrete] -// CHECK:STDOUT: %Int32.Op.4dca31.11: %Int32.Op.type.83af6e.11 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.501c6d.2: = custom_witness (%Int32, %Int32.Op.4dca31.11), @ModWith.1, @ModWith.1(%Int32) [concrete] -// CHECK:STDOUT: %facet_value.7ec: %facet_type.c8c = facet_value %Int32, (%custom_witness.e7a31c.2, %custom_witness.501c6d.2) [concrete] -// CHECK:STDOUT: %Int64.Op.type.83af6e.1: type = fn_type @Int64.Op.1 [concrete] -// CHECK:STDOUT: %Int64.Op.4dca31.1: %Int64.Op.type.83af6e.1 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.e7a31c.3: = custom_witness (%Int64.Op.4dca31.1), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.191: %Destroy.type = facet_value %Int64, (%custom_witness.e7a31c.3) [concrete] +// CHECK:STDOUT: %custom_witness.501c6d.2: = custom_witness (%Int32, %Int32.Op.4dca31.10), @ModWith.1, @ModWith.1(%Int32) [concrete] +// CHECK:STDOUT: %facet_value.105: %facet_type.c8c = facet_value %Int32, (%custom_witness.1bfa2a.2, %custom_witness.501c6d.2) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.5: type = fn_type @Destroy.WithSelf.Op.loc211 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.5: %Destroy.WithSelf.Op.type.ef016f.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5: type = fn_type @Destroy.WithSelf.SelfDestruct.loc211 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.5: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5 = struct_value () [concrete] +// CHECK:STDOUT: %Int64.SubobjectDestroy.type: type = fn_type @Int64.SubobjectDestroy [concrete] +// CHECK:STDOUT: %Int64.SubobjectDestroy: %Int64.SubobjectDestroy.type = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.1bfa2a.3: = custom_witness (%Destroy.WithSelf.Op.403171.5, %Int64.SubobjectDestroy, %Destroy.WithSelf.SelfDestruct.db3fdb.5), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.0b4: %Destroy.type = facet_value %Int64, (%custom_witness.1bfa2a.3) [concrete] // CHECK:STDOUT: %facet_type.afd1: type = facet_type <@Destroy & @AddWith.1, @AddWith.1(%Int64)> [concrete] // CHECK:STDOUT: %.Self.d7b: %facet_type.afd1 = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %AddWith.lookup_impl_witness.085: = lookup_impl_witness %.Self.d7b, @AddWith.1, @AddWith.1(%Int64) [symbolic_self] @@ -920,7 +936,7 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %Op.type.442b68.6: type = fn_type @Op.6 [concrete] // CHECK:STDOUT: %Op.72717c.6: %Op.type.442b68.6 = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.68d: = custom_witness (%Int64, %Op.72717c.6), @AddWith.1, @AddWith.1(%Int64) [concrete] -// CHECK:STDOUT: %facet_value.178: %facet_type.522 = facet_value %Int32, (%custom_witness.e7a31c.2, %custom_witness.68d) [concrete] +// CHECK:STDOUT: %facet_value.c15: %facet_type.522 = facet_value %Int32, (%custom_witness.1bfa2a.2, %custom_witness.68d) [concrete] // CHECK:STDOUT: %.Self.frozen.2e1: %facet_type.afd1 = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %complete_type.412: = complete_type_witness %facet_type.afd1 [concrete] // CHECK:STDOUT: %.Self.frozen.as_type.d9c: type = facet_access_type %.Self.frozen.2e1 [symbolic_self] @@ -930,8 +946,8 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %T.patt.f5c: %pattern_type.613 = symbolic_binding_pattern T, 2 [symbolic] // CHECK:STDOUT: %result.param_patt.1e1: %pattern_type.4aa = value_param_pattern [concrete] // CHECK:STDOUT: %result.patt.93b: %pattern_type.4aa = wrapper_binding_pattern result, %result.param_patt.1e1 [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.c2c: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Destroy.facet.191) [concrete] -// CHECK:STDOUT: %.c2e: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.c2c, %Destroy.facet.191 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.bd9: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.0b4) [concrete] +// CHECK:STDOUT: %.9af: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.bd9, %Destroy.facet.0b4 [concrete] // CHECK:STDOUT: %facet_type.502: type = facet_type <@Destroy & @SubWith.1, @SubWith.1(%Int64)> [concrete] // CHECK:STDOUT: %.Self.074: %facet_type.502 = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %SubWith.lookup_impl_witness.0c4: = lookup_impl_witness %.Self.074, @SubWith.1, @SubWith.1(%Int64) [symbolic_self] @@ -944,7 +960,7 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %Op.type.442b68.7: type = fn_type @Op.7 [concrete] // CHECK:STDOUT: %Op.72717c.7: %Op.type.442b68.7 = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.1fa: = custom_witness (%Int64, %Op.72717c.7), @SubWith.1, @SubWith.1(%Int64) [concrete] -// CHECK:STDOUT: %facet_value.c78: %facet_type.e5e = facet_value %Int32, (%custom_witness.e7a31c.2, %custom_witness.1fa) [concrete] +// CHECK:STDOUT: %facet_value.31d: %facet_type.e5e = facet_value %Int32, (%custom_witness.1bfa2a.2, %custom_witness.1fa) [concrete] // CHECK:STDOUT: %.Self.frozen.da7: %facet_type.502 = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %complete_type.181: = complete_type_witness %facet_type.502 [concrete] // CHECK:STDOUT: %.Self.frozen.as_type.436: type = facet_access_type %.Self.frozen.da7 [symbolic_self] @@ -964,7 +980,7 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %Op.type.442b68.8: type = fn_type @Op.8 [concrete] // CHECK:STDOUT: %Op.72717c.8: %Op.type.442b68.8 = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.99d: = custom_witness (%Int64, %Op.72717c.8), @MulWith.1, @MulWith.1(%Int64) [concrete] -// CHECK:STDOUT: %facet_value.34a: %facet_type.9a3 = facet_value %Int32, (%custom_witness.e7a31c.2, %custom_witness.99d) [concrete] +// CHECK:STDOUT: %facet_value.c94: %facet_type.9a3 = facet_value %Int32, (%custom_witness.1bfa2a.2, %custom_witness.99d) [concrete] // CHECK:STDOUT: %.Self.frozen.f85: %facet_type.770 = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %complete_type.16e: = complete_type_witness %facet_type.770 [concrete] // CHECK:STDOUT: %.Self.frozen.as_type.f77: type = facet_access_type %.Self.frozen.f85 [symbolic_self] @@ -984,7 +1000,7 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %Op.type.442b68.9: type = fn_type @Op.9 [concrete] // CHECK:STDOUT: %Op.72717c.9: %Op.type.442b68.9 = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.a8f: = custom_witness (%Int64, %Op.72717c.9), @DivWith.1, @DivWith.1(%Int64) [concrete] -// CHECK:STDOUT: %facet_value.dd9: %facet_type.641 = facet_value %Int32, (%custom_witness.e7a31c.2, %custom_witness.a8f) [concrete] +// CHECK:STDOUT: %facet_value.886: %facet_type.641 = facet_value %Int32, (%custom_witness.1bfa2a.2, %custom_witness.a8f) [concrete] // CHECK:STDOUT: %.Self.frozen.8cb: %facet_type.c98 = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %complete_type.621: = complete_type_witness %facet_type.c98 [concrete] // CHECK:STDOUT: %.Self.frozen.as_type.bdb: type = facet_access_type %.Self.frozen.8cb [symbolic_self] @@ -1004,7 +1020,7 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %Op.type.442b68.10: type = fn_type @Op.10 [concrete] // CHECK:STDOUT: %Op.72717c.10: %Op.type.442b68.10 = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.972: = custom_witness (%Int64, %Op.72717c.10), @ModWith.1, @ModWith.1(%Int64) [concrete] -// CHECK:STDOUT: %facet_value.ea3: %facet_type.096 = facet_value %Int32, (%custom_witness.e7a31c.2, %custom_witness.972) [concrete] +// CHECK:STDOUT: %facet_value.022: %facet_type.096 = facet_value %Int32, (%custom_witness.1bfa2a.2, %custom_witness.972) [concrete] // CHECK:STDOUT: %.Self.frozen.ac6: %facet_type.f26 = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %complete_type.359: = complete_type_witness %facet_type.f26 [concrete] // CHECK:STDOUT: %.Self.frozen.as_type.17a: type = facet_access_type %.Self.frozen.ac6 [symbolic_self] @@ -1016,7 +1032,7 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %Op.type.442b68.11: type = fn_type @Op.11 [concrete] // CHECK:STDOUT: %Op.72717c.11: %Op.type.442b68.11 = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.98f: = custom_witness (%Int64, %Op.72717c.11), @AddWith.1, @AddWith.1(%Int32) [concrete] -// CHECK:STDOUT: %facet_value.393: %facet_type.840 = facet_value %Int64, (%custom_witness.e7a31c.3, %custom_witness.98f) [concrete] +// CHECK:STDOUT: %facet_value.ff6: %facet_type.840 = facet_value %Int64, (%custom_witness.1bfa2a.3, %custom_witness.98f) [concrete] // CHECK:STDOUT: %pattern_type.46d: type = pattern_type %facet_type.840 [concrete] // CHECK:STDOUT: %T.patt.211: %pattern_type.46d = symbolic_binding_pattern T, 2 [symbolic] // CHECK:STDOUT: %x.param_patt.e68: %pattern_type.4aa = value_param_pattern [concrete] @@ -1025,28 +1041,28 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %Op.type.442b68.12: type = fn_type @Op.12 [concrete] // CHECK:STDOUT: %Op.72717c.12: %Op.type.442b68.12 = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.5c3: = custom_witness (%Int64, %Op.72717c.12), @SubWith.1, @SubWith.1(%Int32) [concrete] -// CHECK:STDOUT: %facet_value.e02: %facet_type.99d = facet_value %Int64, (%custom_witness.e7a31c.3, %custom_witness.5c3) [concrete] +// CHECK:STDOUT: %facet_value.263: %facet_type.99d = facet_value %Int64, (%custom_witness.1bfa2a.3, %custom_witness.5c3) [concrete] // CHECK:STDOUT: %pattern_type.b19: type = pattern_type %facet_type.99d [concrete] // CHECK:STDOUT: %T.patt.e50: %pattern_type.b19 = symbolic_binding_pattern T, 2 [symbolic] // CHECK:STDOUT: %facet_type.5e8: type = facet_type <@Destroy & @MulWith.1, @MulWith.1(%Int32) where %impl.elem0.0ea = %Int64> [concrete] // CHECK:STDOUT: %Op.type.442b68.13: type = fn_type @Op.13 [concrete] // CHECK:STDOUT: %Op.72717c.13: %Op.type.442b68.13 = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.ac0: = custom_witness (%Int64, %Op.72717c.13), @MulWith.1, @MulWith.1(%Int32) [concrete] -// CHECK:STDOUT: %facet_value.dda: %facet_type.5e8 = facet_value %Int64, (%custom_witness.e7a31c.3, %custom_witness.ac0) [concrete] +// CHECK:STDOUT: %facet_value.ac4: %facet_type.5e8 = facet_value %Int64, (%custom_witness.1bfa2a.3, %custom_witness.ac0) [concrete] // CHECK:STDOUT: %pattern_type.d24: type = pattern_type %facet_type.5e8 [concrete] // CHECK:STDOUT: %T.patt.54a: %pattern_type.d24 = symbolic_binding_pattern T, 2 [symbolic] // CHECK:STDOUT: %facet_type.97b: type = facet_type <@Destroy & @DivWith.1, @DivWith.1(%Int32) where %impl.elem0.1a6 = %Int64> [concrete] // CHECK:STDOUT: %Op.type.442b68.14: type = fn_type @Op.14 [concrete] // CHECK:STDOUT: %Op.72717c.14: %Op.type.442b68.14 = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.c98: = custom_witness (%Int64, %Op.72717c.14), @DivWith.1, @DivWith.1(%Int32) [concrete] -// CHECK:STDOUT: %facet_value.886: %facet_type.97b = facet_value %Int64, (%custom_witness.e7a31c.3, %custom_witness.c98) [concrete] +// CHECK:STDOUT: %facet_value.955: %facet_type.97b = facet_value %Int64, (%custom_witness.1bfa2a.3, %custom_witness.c98) [concrete] // CHECK:STDOUT: %pattern_type.6b7: type = pattern_type %facet_type.97b [concrete] // CHECK:STDOUT: %T.patt.0b0: %pattern_type.6b7 = symbolic_binding_pattern T, 2 [symbolic] // CHECK:STDOUT: %facet_type.546: type = facet_type <@Destroy & @ModWith.1, @ModWith.1(%Int32) where %impl.elem0.cdb = %Int64> [concrete] // CHECK:STDOUT: %Op.type.442b68.15: type = fn_type @Op.15 [concrete] // CHECK:STDOUT: %Op.72717c.15: %Op.type.442b68.15 = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.e66: = custom_witness (%Int64, %Op.72717c.15), @ModWith.1, @ModWith.1(%Int32) [concrete] -// CHECK:STDOUT: %facet_value.20a: %facet_type.546 = facet_value %Int64, (%custom_witness.e7a31c.3, %custom_witness.e66) [concrete] +// CHECK:STDOUT: %facet_value.03a: %facet_type.546 = facet_value %Int64, (%custom_witness.1bfa2a.3, %custom_witness.e66) [concrete] // CHECK:STDOUT: %pattern_type.5db: type = pattern_type %facet_type.546 [concrete] // CHECK:STDOUT: %T.patt.ed0: %pattern_type.5db = symbolic_binding_pattern T, 2 [symbolic] // CHECK:STDOUT: %U.patt.3a0: %pattern_type.9a5 = symbolic_binding_pattern U, 0 [symbolic] @@ -1167,9 +1183,9 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %AddAssignWith.type.2a0: type = facet_type <@AddAssignWith.1, @AddAssignWith.1(%i16)> [concrete] // CHECK:STDOUT: %AddAssignWith.assoc_type.1bb: type = assoc_entity_type @AddAssignWith.1, @AddAssignWith.1(%i16) [concrete] // CHECK:STDOUT: %assoc0.24b: %AddAssignWith.assoc_type.1bb = assoc_entity element0, imports.%Core.import_ref.3b2 [concrete] -// CHECK:STDOUT: %Int16.Op.type.83af6e.13: type = fn_type @Int16.Op.13 [concrete] -// CHECK:STDOUT: %Int16.Op.4dca31.13: %Int16.Op.type.83af6e.13 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.6a0: = custom_witness (%Int16.Op.4dca31.13), @AddAssignWith.1, @AddAssignWith.1(%i16) [concrete] +// CHECK:STDOUT: %Int16.Op.type.83af6e.12: type = fn_type @Int16.Op.12 [concrete] +// CHECK:STDOUT: %Int16.Op.4dca31.12: %Int16.Op.type.83af6e.12 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.6a0: = custom_witness (%Int16.Op.4dca31.12), @AddAssignWith.1, @AddAssignWith.1(%i16) [concrete] // CHECK:STDOUT: %AddAssignWith.facet.e34: %AddAssignWith.type.2a0 = facet_value %Int16, (%custom_witness.6a0) [concrete] // CHECK:STDOUT: %pattern_type.b256: type = pattern_type %AddAssignWith.type.2a0 [concrete] // CHECK:STDOUT: %T.patt.d2a: %pattern_type.b256 = symbolic_binding_pattern T, 1 [symbolic] @@ -1178,45 +1194,45 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %SubAssignWith.type.e8b: type = facet_type <@SubAssignWith.1, @SubAssignWith.1(%i16)> [concrete] // CHECK:STDOUT: %SubAssignWith.assoc_type.e13: type = assoc_entity_type @SubAssignWith.1, @SubAssignWith.1(%i16) [concrete] // CHECK:STDOUT: %assoc0.47c: %SubAssignWith.assoc_type.e13 = assoc_entity element0, imports.%Core.import_ref.8f2 [concrete] -// CHECK:STDOUT: %Int16.Op.type.83af6e.14: type = fn_type @Int16.Op.14 [concrete] -// CHECK:STDOUT: %Int16.Op.4dca31.14: %Int16.Op.type.83af6e.14 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.722: = custom_witness (%Int16.Op.4dca31.14), @SubAssignWith.1, @SubAssignWith.1(%i16) [concrete] +// CHECK:STDOUT: %Int16.Op.type.83af6e.13: type = fn_type @Int16.Op.13 [concrete] +// CHECK:STDOUT: %Int16.Op.4dca31.13: %Int16.Op.type.83af6e.13 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.722: = custom_witness (%Int16.Op.4dca31.13), @SubAssignWith.1, @SubAssignWith.1(%i16) [concrete] // CHECK:STDOUT: %SubAssignWith.facet.a52: %SubAssignWith.type.e8b = facet_value %Int16, (%custom_witness.722) [concrete] // CHECK:STDOUT: %pattern_type.c22: type = pattern_type %SubAssignWith.type.e8b [concrete] // CHECK:STDOUT: %T.patt.0f1: %pattern_type.c22 = symbolic_binding_pattern T, 1 [symbolic] // CHECK:STDOUT: %MulAssignWith.type.7d4: type = facet_type <@MulAssignWith.1, @MulAssignWith.1(%i16)> [concrete] // CHECK:STDOUT: %MulAssignWith.assoc_type.aa8: type = assoc_entity_type @MulAssignWith.1, @MulAssignWith.1(%i16) [concrete] // CHECK:STDOUT: %assoc0.137: %MulAssignWith.assoc_type.aa8 = assoc_entity element0, imports.%Core.import_ref.ba3 [concrete] -// CHECK:STDOUT: %Int16.Op.type.83af6e.15: type = fn_type @Int16.Op.15 [concrete] -// CHECK:STDOUT: %Int16.Op.4dca31.15: %Int16.Op.type.83af6e.15 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.c67: = custom_witness (%Int16.Op.4dca31.15), @MulAssignWith.1, @MulAssignWith.1(%i16) [concrete] +// CHECK:STDOUT: %Int16.Op.type.83af6e.14: type = fn_type @Int16.Op.14 [concrete] +// CHECK:STDOUT: %Int16.Op.4dca31.14: %Int16.Op.type.83af6e.14 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.c67: = custom_witness (%Int16.Op.4dca31.14), @MulAssignWith.1, @MulAssignWith.1(%i16) [concrete] // CHECK:STDOUT: %MulAssignWith.facet.201: %MulAssignWith.type.7d4 = facet_value %Int16, (%custom_witness.c67) [concrete] // CHECK:STDOUT: %pattern_type.a24: type = pattern_type %MulAssignWith.type.7d4 [concrete] // CHECK:STDOUT: %T.patt.f71: %pattern_type.a24 = symbolic_binding_pattern T, 1 [symbolic] // CHECK:STDOUT: %DivAssignWith.type.081: type = facet_type <@DivAssignWith.1, @DivAssignWith.1(%i16)> [concrete] // CHECK:STDOUT: %DivAssignWith.assoc_type.791: type = assoc_entity_type @DivAssignWith.1, @DivAssignWith.1(%i16) [concrete] // CHECK:STDOUT: %assoc0.a3b: %DivAssignWith.assoc_type.791 = assoc_entity element0, imports.%Core.import_ref.a5d [concrete] -// CHECK:STDOUT: %Int16.Op.type.83af6e.16: type = fn_type @Int16.Op.16 [concrete] -// CHECK:STDOUT: %Int16.Op.4dca31.16: %Int16.Op.type.83af6e.16 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.91d: = custom_witness (%Int16.Op.4dca31.16), @DivAssignWith.1, @DivAssignWith.1(%i16) [concrete] +// CHECK:STDOUT: %Int16.Op.type.83af6e.15: type = fn_type @Int16.Op.15 [concrete] +// CHECK:STDOUT: %Int16.Op.4dca31.15: %Int16.Op.type.83af6e.15 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.91d: = custom_witness (%Int16.Op.4dca31.15), @DivAssignWith.1, @DivAssignWith.1(%i16) [concrete] // CHECK:STDOUT: %DivAssignWith.facet.a72: %DivAssignWith.type.081 = facet_value %Int16, (%custom_witness.91d) [concrete] // CHECK:STDOUT: %pattern_type.c970: type = pattern_type %DivAssignWith.type.081 [concrete] // CHECK:STDOUT: %T.patt.35e: %pattern_type.c970 = symbolic_binding_pattern T, 1 [symbolic] // CHECK:STDOUT: %ModAssignWith.type.1ea: type = facet_type <@ModAssignWith.1, @ModAssignWith.1(%i16)> [concrete] // CHECK:STDOUT: %ModAssignWith.assoc_type.91d: type = assoc_entity_type @ModAssignWith.1, @ModAssignWith.1(%i16) [concrete] // CHECK:STDOUT: %assoc0.b7f: %ModAssignWith.assoc_type.91d = assoc_entity element0, imports.%Core.import_ref.cf6 [concrete] -// CHECK:STDOUT: %Int16.Op.type.83af6e.17: type = fn_type @Int16.Op.17 [concrete] -// CHECK:STDOUT: %Int16.Op.4dca31.17: %Int16.Op.type.83af6e.17 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.17b: = custom_witness (%Int16.Op.4dca31.17), @ModAssignWith.1, @ModAssignWith.1(%i16) [concrete] +// CHECK:STDOUT: %Int16.Op.type.83af6e.16: type = fn_type @Int16.Op.16 [concrete] +// CHECK:STDOUT: %Int16.Op.4dca31.16: %Int16.Op.type.83af6e.16 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.17b: = custom_witness (%Int16.Op.4dca31.16), @ModAssignWith.1, @ModAssignWith.1(%i16) [concrete] // CHECK:STDOUT: %ModAssignWith.facet.4a2: %ModAssignWith.type.1ea = facet_value %Int16, (%custom_witness.17b) [concrete] // CHECK:STDOUT: %pattern_type.6ef: type = pattern_type %ModAssignWith.type.1ea [concrete] // CHECK:STDOUT: %T.patt.dbe: %pattern_type.6ef = symbolic_binding_pattern T, 1 [symbolic] // CHECK:STDOUT: %AddAssignWith.type.23a: type = facet_type <@AddAssignWith.1, @AddAssignWith.1(%Int32)> [concrete] // CHECK:STDOUT: %AddAssignWith.assoc_type.4c7: type = assoc_entity_type @AddAssignWith.1, @AddAssignWith.1(%Int32) [concrete] // CHECK:STDOUT: %assoc0.114: %AddAssignWith.assoc_type.4c7 = assoc_entity element0, imports.%Core.import_ref.3b2 [concrete] -// CHECK:STDOUT: %Int32.Op.type.83af6e.12: type = fn_type @Int32.Op.12 [concrete] -// CHECK:STDOUT: %Int32.Op.4dca31.12: %Int32.Op.type.83af6e.12 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.ebf67a.1: = custom_witness (%Int32.Op.4dca31.12), @AddAssignWith.1, @AddAssignWith.1(%Int32) [concrete] +// CHECK:STDOUT: %Int32.Op.type.83af6e.11: type = fn_type @Int32.Op.11 [concrete] +// CHECK:STDOUT: %Int32.Op.4dca31.11: %Int32.Op.type.83af6e.11 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.ebf67a.1: = custom_witness (%Int32.Op.4dca31.11), @AddAssignWith.1, @AddAssignWith.1(%Int32) [concrete] // CHECK:STDOUT: %AddAssignWith.facet.348: %AddAssignWith.type.23a = facet_value %Int32, (%custom_witness.ebf67a.1) [concrete] // CHECK:STDOUT: %pattern_type.5ad: type = pattern_type %AddAssignWith.type.23a [concrete] // CHECK:STDOUT: %T.patt.96c: %pattern_type.5ad = symbolic_binding_pattern T, 1 [symbolic] @@ -1225,60 +1241,60 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %SubAssignWith.type.4fc: type = facet_type <@SubAssignWith.1, @SubAssignWith.1(%Int32)> [concrete] // CHECK:STDOUT: %SubAssignWith.assoc_type.ac6: type = assoc_entity_type @SubAssignWith.1, @SubAssignWith.1(%Int32) [concrete] // CHECK:STDOUT: %assoc0.c2a: %SubAssignWith.assoc_type.ac6 = assoc_entity element0, imports.%Core.import_ref.8f2 [concrete] -// CHECK:STDOUT: %Int32.Op.type.83af6e.14: type = fn_type @Int32.Op.14 [concrete] -// CHECK:STDOUT: %Int32.Op.4dca31.14: %Int32.Op.type.83af6e.14 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.c2b241.1: = custom_witness (%Int32.Op.4dca31.14), @SubAssignWith.1, @SubAssignWith.1(%Int32) [concrete] +// CHECK:STDOUT: %Int32.Op.type.83af6e.13: type = fn_type @Int32.Op.13 [concrete] +// CHECK:STDOUT: %Int32.Op.4dca31.13: %Int32.Op.type.83af6e.13 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.c2b241.1: = custom_witness (%Int32.Op.4dca31.13), @SubAssignWith.1, @SubAssignWith.1(%Int32) [concrete] // CHECK:STDOUT: %SubAssignWith.facet.e0e: %SubAssignWith.type.4fc = facet_value %Int32, (%custom_witness.c2b241.1) [concrete] // CHECK:STDOUT: %pattern_type.190: type = pattern_type %SubAssignWith.type.4fc [concrete] // CHECK:STDOUT: %T.patt.a39: %pattern_type.190 = symbolic_binding_pattern T, 1 [symbolic] // CHECK:STDOUT: %MulAssignWith.type.5fb: type = facet_type <@MulAssignWith.1, @MulAssignWith.1(%Int32)> [concrete] // CHECK:STDOUT: %MulAssignWith.assoc_type.c04: type = assoc_entity_type @MulAssignWith.1, @MulAssignWith.1(%Int32) [concrete] // CHECK:STDOUT: %assoc0.2db: %MulAssignWith.assoc_type.c04 = assoc_entity element0, imports.%Core.import_ref.ba3 [concrete] -// CHECK:STDOUT: %Int32.Op.type.83af6e.15: type = fn_type @Int32.Op.15 [concrete] -// CHECK:STDOUT: %Int32.Op.4dca31.15: %Int32.Op.type.83af6e.15 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.ec9760.1: = custom_witness (%Int32.Op.4dca31.15), @MulAssignWith.1, @MulAssignWith.1(%Int32) [concrete] +// CHECK:STDOUT: %Int32.Op.type.83af6e.14: type = fn_type @Int32.Op.14 [concrete] +// CHECK:STDOUT: %Int32.Op.4dca31.14: %Int32.Op.type.83af6e.14 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.ec9760.1: = custom_witness (%Int32.Op.4dca31.14), @MulAssignWith.1, @MulAssignWith.1(%Int32) [concrete] // CHECK:STDOUT: %MulAssignWith.facet.13c: %MulAssignWith.type.5fb = facet_value %Int32, (%custom_witness.ec9760.1) [concrete] // CHECK:STDOUT: %pattern_type.f3b: type = pattern_type %MulAssignWith.type.5fb [concrete] // CHECK:STDOUT: %T.patt.f66: %pattern_type.f3b = symbolic_binding_pattern T, 1 [symbolic] // CHECK:STDOUT: %DivAssignWith.type.3ea: type = facet_type <@DivAssignWith.1, @DivAssignWith.1(%Int32)> [concrete] // CHECK:STDOUT: %DivAssignWith.assoc_type.ccd: type = assoc_entity_type @DivAssignWith.1, @DivAssignWith.1(%Int32) [concrete] // CHECK:STDOUT: %assoc0.d23: %DivAssignWith.assoc_type.ccd = assoc_entity element0, imports.%Core.import_ref.a5d [concrete] -// CHECK:STDOUT: %Int32.Op.type.83af6e.16: type = fn_type @Int32.Op.16 [concrete] -// CHECK:STDOUT: %Int32.Op.4dca31.16: %Int32.Op.type.83af6e.16 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.9697f7.1: = custom_witness (%Int32.Op.4dca31.16), @DivAssignWith.1, @DivAssignWith.1(%Int32) [concrete] +// CHECK:STDOUT: %Int32.Op.type.83af6e.15: type = fn_type @Int32.Op.15 [concrete] +// CHECK:STDOUT: %Int32.Op.4dca31.15: %Int32.Op.type.83af6e.15 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.9697f7.1: = custom_witness (%Int32.Op.4dca31.15), @DivAssignWith.1, @DivAssignWith.1(%Int32) [concrete] // CHECK:STDOUT: %DivAssignWith.facet.e59: %DivAssignWith.type.3ea = facet_value %Int32, (%custom_witness.9697f7.1) [concrete] // CHECK:STDOUT: %pattern_type.8f3: type = pattern_type %DivAssignWith.type.3ea [concrete] // CHECK:STDOUT: %T.patt.316: %pattern_type.8f3 = symbolic_binding_pattern T, 1 [symbolic] // CHECK:STDOUT: %ModAssignWith.type.567: type = facet_type <@ModAssignWith.1, @ModAssignWith.1(%Int32)> [concrete] // CHECK:STDOUT: %ModAssignWith.assoc_type.fc5: type = assoc_entity_type @ModAssignWith.1, @ModAssignWith.1(%Int32) [concrete] // CHECK:STDOUT: %assoc0.1c63: %ModAssignWith.assoc_type.fc5 = assoc_entity element0, imports.%Core.import_ref.cf6 [concrete] -// CHECK:STDOUT: %Int32.Op.type.83af6e.17: type = fn_type @Int32.Op.17 [concrete] -// CHECK:STDOUT: %Int32.Op.4dca31.17: %Int32.Op.type.83af6e.17 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.df8f2f.1: = custom_witness (%Int32.Op.4dca31.17), @ModAssignWith.1, @ModAssignWith.1(%Int32) [concrete] +// CHECK:STDOUT: %Int32.Op.type.83af6e.16: type = fn_type @Int32.Op.16 [concrete] +// CHECK:STDOUT: %Int32.Op.4dca31.16: %Int32.Op.type.83af6e.16 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.df8f2f.1: = custom_witness (%Int32.Op.4dca31.16), @ModAssignWith.1, @ModAssignWith.1(%Int32) [concrete] // CHECK:STDOUT: %ModAssignWith.facet.dac: %ModAssignWith.type.567 = facet_value %Int32, (%custom_witness.df8f2f.1) [concrete] // CHECK:STDOUT: %pattern_type.9ff: type = pattern_type %ModAssignWith.type.567 [concrete] // CHECK:STDOUT: %T.patt.6f1: %pattern_type.9ff = symbolic_binding_pattern T, 1 [symbolic] -// CHECK:STDOUT: %Int64.Op.type.83af6e.2: type = fn_type @Int64.Op.2 [concrete] -// CHECK:STDOUT: %Int64.Op.4dca31.2: %Int64.Op.type.83af6e.2 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.ebf67a.2: = custom_witness (%Int64.Op.4dca31.2), @AddAssignWith.1, @AddAssignWith.1(%Int32) [concrete] +// CHECK:STDOUT: %Int64.Op.type.83af6e.1: type = fn_type @Int64.Op.1 [concrete] +// CHECK:STDOUT: %Int64.Op.4dca31.1: %Int64.Op.type.83af6e.1 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.ebf67a.2: = custom_witness (%Int64.Op.4dca31.1), @AddAssignWith.1, @AddAssignWith.1(%Int32) [concrete] // CHECK:STDOUT: %AddAssignWith.facet.144: %AddAssignWith.type.23a = facet_value %Int64, (%custom_witness.ebf67a.2) [concrete] // CHECK:STDOUT: %x.patt.ace: %pattern_type.4aa = ref_binding_pattern x [concrete] // CHECK:STDOUT: %x.param_patt.b33: %pattern_type.4aa = var_param_pattern %x.patt.ace [concrete] +// CHECK:STDOUT: %Int64.Op.type.83af6e.3: type = fn_type @Int64.Op.3 [concrete] +// CHECK:STDOUT: %Int64.Op.4dca31.3: %Int64.Op.type.83af6e.3 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.c2b241.2: = custom_witness (%Int64.Op.4dca31.3), @SubAssignWith.1, @SubAssignWith.1(%Int32) [concrete] +// CHECK:STDOUT: %SubAssignWith.facet.a7e: %SubAssignWith.type.4fc = facet_value %Int64, (%custom_witness.c2b241.2) [concrete] // CHECK:STDOUT: %Int64.Op.type.83af6e.4: type = fn_type @Int64.Op.4 [concrete] // CHECK:STDOUT: %Int64.Op.4dca31.4: %Int64.Op.type.83af6e.4 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.c2b241.2: = custom_witness (%Int64.Op.4dca31.4), @SubAssignWith.1, @SubAssignWith.1(%Int32) [concrete] -// CHECK:STDOUT: %SubAssignWith.facet.a7e: %SubAssignWith.type.4fc = facet_value %Int64, (%custom_witness.c2b241.2) [concrete] +// CHECK:STDOUT: %custom_witness.ec9760.2: = custom_witness (%Int64.Op.4dca31.4), @MulAssignWith.1, @MulAssignWith.1(%Int32) [concrete] +// CHECK:STDOUT: %MulAssignWith.facet.b35: %MulAssignWith.type.5fb = facet_value %Int64, (%custom_witness.ec9760.2) [concrete] // CHECK:STDOUT: %Int64.Op.type.83af6e.5: type = fn_type @Int64.Op.5 [concrete] // CHECK:STDOUT: %Int64.Op.4dca31.5: %Int64.Op.type.83af6e.5 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.ec9760.2: = custom_witness (%Int64.Op.4dca31.5), @MulAssignWith.1, @MulAssignWith.1(%Int32) [concrete] -// CHECK:STDOUT: %MulAssignWith.facet.b35: %MulAssignWith.type.5fb = facet_value %Int64, (%custom_witness.ec9760.2) [concrete] +// CHECK:STDOUT: %custom_witness.9697f7.2: = custom_witness (%Int64.Op.4dca31.5), @DivAssignWith.1, @DivAssignWith.1(%Int32) [concrete] +// CHECK:STDOUT: %DivAssignWith.facet.b1e: %DivAssignWith.type.3ea = facet_value %Int64, (%custom_witness.9697f7.2) [concrete] // CHECK:STDOUT: %Int64.Op.type.83af6e.6: type = fn_type @Int64.Op.6 [concrete] // CHECK:STDOUT: %Int64.Op.4dca31.6: %Int64.Op.type.83af6e.6 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.9697f7.2: = custom_witness (%Int64.Op.4dca31.6), @DivAssignWith.1, @DivAssignWith.1(%Int32) [concrete] -// CHECK:STDOUT: %DivAssignWith.facet.b1e: %DivAssignWith.type.3ea = facet_value %Int64, (%custom_witness.9697f7.2) [concrete] -// CHECK:STDOUT: %Int64.Op.type.83af6e.7: type = fn_type @Int64.Op.7 [concrete] -// CHECK:STDOUT: %Int64.Op.4dca31.7: %Int64.Op.type.83af6e.7 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.df8f2f.2: = custom_witness (%Int64.Op.4dca31.7), @ModAssignWith.1, @ModAssignWith.1(%Int32) [concrete] +// CHECK:STDOUT: %custom_witness.df8f2f.2: = custom_witness (%Int64.Op.4dca31.6), @ModAssignWith.1, @ModAssignWith.1(%Int32) [concrete] // CHECK:STDOUT: %ModAssignWith.facet.342: %ModAssignWith.type.567 = facet_value %Int64, (%custom_witness.df8f2f.2) [concrete] // CHECK:STDOUT: %Inc.type: type = facet_type <@Inc> [concrete] // CHECK:STDOUT: %pattern_type.8c1: type = pattern_type %Inc.type [concrete] @@ -1327,26 +1343,26 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %.16a: type = fn_type_with_self_type %Negate.WithSelf.Op.type.d8a, %Negate.facet.5e5 [symbolic] // CHECK:STDOUT: %impl.elem1.ee9: %.16a = impl_witness_access %Negate.lookup_impl_witness.218, element1 [symbolic] // CHECK:STDOUT: %specific_impl_fn.923: = specific_impl_function %impl.elem1.ee9, @Negate.WithSelf.Op(%Negate.facet.5e5) [symbolic] +// CHECK:STDOUT: %Int32.Op.type.83af6e.17: type = fn_type @Int32.Op.17 [concrete] +// CHECK:STDOUT: %Int32.Op.4dca31.17: %Int32.Op.type.83af6e.17 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f3f: = custom_witness (%Int32.Op.4dca31.17), @Inc [concrete] +// CHECK:STDOUT: %Inc.facet.dd2: %Inc.type = facet_value %Int32, (%custom_witness.f3f) [concrete] // CHECK:STDOUT: %Int32.Op.type.83af6e.18: type = fn_type @Int32.Op.18 [concrete] // CHECK:STDOUT: %Int32.Op.4dca31.18: %Int32.Op.type.83af6e.18 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.f3f: = custom_witness (%Int32.Op.4dca31.18), @Inc [concrete] -// CHECK:STDOUT: %Inc.facet.dd2: %Inc.type = facet_value %Int32, (%custom_witness.f3f) [concrete] -// CHECK:STDOUT: %Int32.Op.type.83af6e.19: type = fn_type @Int32.Op.19 [concrete] -// CHECK:STDOUT: %Int32.Op.4dca31.19: %Int32.Op.type.83af6e.19 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.b24: = custom_witness (%Int32.Op.4dca31.19), @Dec [concrete] +// CHECK:STDOUT: %custom_witness.b24: = custom_witness (%Int32.Op.4dca31.18), @Dec [concrete] // CHECK:STDOUT: %Dec.facet.e1b: %Dec.type = facet_value %Int32, (%custom_witness.b24) [concrete] // CHECK:STDOUT: %facet_type.d8c: type = facet_type <@Destroy & @Negate where %impl.elem0.e29 = %Int64> [concrete] -// CHECK:STDOUT: %Int16.Op.type.83af6e.18: type = fn_type @Int16.Op.18 [concrete] -// CHECK:STDOUT: %Int16.Op.4dca31.18: %Int16.Op.type.83af6e.18 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.100: = custom_witness (%Int64, %Int16.Op.4dca31.18), @Negate [concrete] -// CHECK:STDOUT: %facet_value.9cc: %facet_type.d8c = facet_value %Int16, (%custom_witness.e7a31c.1, %custom_witness.100) [concrete] +// CHECK:STDOUT: %Int16.Op.type.83af6e.17: type = fn_type @Int16.Op.17 [concrete] +// CHECK:STDOUT: %Int16.Op.4dca31.17: %Int16.Op.type.83af6e.17 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.100: = custom_witness (%Int64, %Int16.Op.4dca31.17), @Negate [concrete] +// CHECK:STDOUT: %facet_value.a67: %facet_type.d8c = facet_value %Int16, (%custom_witness.1bfa2a.1, %custom_witness.100) [concrete] // CHECK:STDOUT: %pattern_type.54c: type = pattern_type %facet_type.d8c [concrete] // CHECK:STDOUT: %T.patt.16f: %pattern_type.54c = symbolic_binding_pattern T, 1 [symbolic] // CHECK:STDOUT: %facet_type.021: type = facet_type <@Destroy & @Negate where %impl.elem0.e29 = %Int32> [concrete] -// CHECK:STDOUT: %Int32.Op.type.83af6e.20: type = fn_type @Int32.Op.20 [concrete] -// CHECK:STDOUT: %Int32.Op.4dca31.20: %Int32.Op.type.83af6e.20 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.a85: = custom_witness (%Int32, %Int32.Op.4dca31.20), @Negate [concrete] -// CHECK:STDOUT: %facet_value.dcd: %facet_type.021 = facet_value %Int32, (%custom_witness.e7a31c.2, %custom_witness.a85) [concrete] +// CHECK:STDOUT: %Int32.Op.type.83af6e.19: type = fn_type @Int32.Op.19 [concrete] +// CHECK:STDOUT: %Int32.Op.4dca31.19: %Int32.Op.type.83af6e.19 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.a85: = custom_witness (%Int32, %Int32.Op.4dca31.19), @Negate [concrete] +// CHECK:STDOUT: %facet_value.73e: %facet_type.021 = facet_value %Int32, (%custom_witness.1bfa2a.2, %custom_witness.a85) [concrete] // CHECK:STDOUT: %pattern_type.4cd: type = pattern_type %facet_type.021 [concrete] // CHECK:STDOUT: %T.patt.d74: %pattern_type.4cd = symbolic_binding_pattern T, 1 [symbolic] // CHECK:STDOUT: %complete_type.7a6: = complete_type_witness %AddWith.type.b62 [concrete] @@ -1582,11 +1598,11 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %.loc126_5.6: type = fn_type_with_self_type %AddWith.WithSelf.Op.type, %AddWith.facet [symbolic = %.loc126_5.6 (constants.%.a30)] // CHECK:STDOUT: %impl.elem1.loc126_5.2: @AddWith.loc124.%.loc126_5.6 (%.a30) = impl_witness_access %AddWith.lookup_impl_witness.loc126, element1 [symbolic = %impl.elem1.loc126_5.2 (constants.%impl.elem1.b05)] // CHECK:STDOUT: %specific_impl_fn.loc126_5.3: = specific_impl_function %impl.elem1.loc126_5.2, @AddWith.WithSelf.Op(%U.as_type.loc123_35.1, %AddWith.facet) [symbolic = %specific_impl_fn.loc126_5.3 (constants.%specific_impl_fn.78d)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Result.loc121_9.1) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.d3ece9.2)] -// CHECK:STDOUT: %.loc126_5.7: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Result.loc121_9.1 [symbolic = %.loc126_5.7 (constants.%.53a)] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %Result.loc121_9.1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)] -// CHECK:STDOUT: %impl.elem0.loc126_5.2: @AddWith.loc124.%.loc126_5.7 (%.53a) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc126_5.2 (constants.%impl.elem0.0f9)] -// CHECK:STDOUT: %specific_impl_fn.loc126_5.4: = specific_impl_function %impl.elem0.loc126_5.2, @Destroy.WithSelf.Op.1(%Result.loc121_9.1) [symbolic = %specific_impl_fn.loc126_5.4 (constants.%specific_impl_fn.afc)] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Result.loc121_9.1) [symbolic = %Destroy.WithSelf.SelfDestruct.type (constants.%Destroy.WithSelf.SelfDestruct.type.4e5869.2)] +// CHECK:STDOUT: %.loc126_5.7: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type, %Result.loc121_9.1 [symbolic = %.loc126_5.7 (constants.%.ec8)] +// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %Result.loc121_9.1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.dfb4c4.2)] +// CHECK:STDOUT: %impl.elem2.loc126_5.2: @AddWith.loc124.%.loc126_5.7 (%.ec8) = impl_witness_access %Destroy.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc126_5.2 (constants.%impl.elem2)] +// CHECK:STDOUT: %specific_impl_fn.loc126_5.4: = specific_impl_function %impl.elem2.loc126_5.2, @Destroy.WithSelf.SelfDestruct.1(%Result.loc121_9.1) [symbolic = %specific_impl_fn.loc126_5.4 (constants.%specific_impl_fn.448)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%result.param: @AddWith.loc124.%Result.as_type.loc123_53.1 (%Result.as_type), %x.param: @AddWith.loc124.%T.as_type.loc124_29.1 (%T.as_type.6fc), %y.param: @AddWith.loc124.%U.as_type.loc123_35.1 (%U.as_type.b61)) { // CHECK:STDOUT: !entry: @@ -1602,13 +1618,13 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %.loc126_5.2: ref @AddWith.loc124.%Result.as_type.loc123_53.1 (%Result.as_type) = temporary_storage // CHECK:STDOUT: %AddWith.WithSelf.Op.call: init @AddWith.loc124.%Result.as_type.loc123_53.1 (%Result.as_type) to %.loc126_5.2 = call %bound_method.loc126_5.2(%x.ref, %y.ref) // CHECK:STDOUT: %.loc126_5.3: ref @AddWith.loc124.%Result.as_type.loc123_53.1 (%Result.as_type) = temporary %.loc126_5.2, %AddWith.WithSelf.Op.call -// CHECK:STDOUT: %impl.elem0.loc126_5.1: @AddWith.loc124.%.loc126_5.7 (%.53a) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc126_5.2 (constants.%impl.elem0.0f9)] -// CHECK:STDOUT: %bound_method.loc126_5.3: = bound_method %.loc126_5.3, %impl.elem0.loc126_5.1 +// CHECK:STDOUT: %impl.elem2.loc126_5.1: @AddWith.loc124.%.loc126_5.7 (%.ec8) = impl_witness_access constants.%Destroy.lookup_impl_witness.dfb4c4.2, element2 [symbolic = %impl.elem2.loc126_5.2 (constants.%impl.elem2)] +// CHECK:STDOUT: %bound_method.loc126_5.3: = bound_method %.loc126_5.3, %impl.elem2.loc126_5.1 // CHECK:STDOUT: %.loc126_5.4: %Destroy.type = converted constants.%Result.as_type, constants.%Result [symbolic = %Result.loc121_9.1 (constants.%Result)] // CHECK:STDOUT: %.loc126_5.5: %Destroy.type = converted constants.%Result.as_type, constants.%Result [symbolic = %Result.loc121_9.1 (constants.%Result)] -// CHECK:STDOUT: %specific_impl_fn.loc126_5.2: = specific_impl_function %impl.elem0.loc126_5.1, @Destroy.WithSelf.Op.1(constants.%Result) [symbolic = %specific_impl_fn.loc126_5.4 (constants.%specific_impl_fn.afc)] +// CHECK:STDOUT: %specific_impl_fn.loc126_5.2: = specific_impl_function %impl.elem2.loc126_5.1, @Destroy.WithSelf.SelfDestruct.1(constants.%Result) [symbolic = %specific_impl_fn.loc126_5.4 (constants.%specific_impl_fn.448)] // CHECK:STDOUT: %bound_method.loc126_5.4: = bound_method %.loc126_5.3, %specific_impl_fn.loc126_5.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc126_5.4(%.loc126_5.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %bound_method.loc126_5.4(%.loc126_5.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -1626,11 +1642,11 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %.loc137_5.6: type = fn_type_with_self_type %SubWith.WithSelf.Op.type, %SubWith.facet [symbolic = %.loc137_5.6 (constants.%.a4a)] // CHECK:STDOUT: %impl.elem1.loc137_5.2: @SubWith.loc135.%.loc137_5.6 (%.a4a) = impl_witness_access %SubWith.lookup_impl_witness.loc137, element1 [symbolic = %impl.elem1.loc137_5.2 (constants.%impl.elem1.e4f)] // CHECK:STDOUT: %specific_impl_fn.loc137_5.3: = specific_impl_function %impl.elem1.loc137_5.2, @SubWith.WithSelf.Op(%U.as_type.loc134_35.1, %SubWith.facet) [symbolic = %specific_impl_fn.loc137_5.3 (constants.%specific_impl_fn.46d)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Result.loc132_9.1) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.d3ece9.2)] -// CHECK:STDOUT: %.loc137_5.7: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Result.loc132_9.1 [symbolic = %.loc137_5.7 (constants.%.53a)] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %Result.loc132_9.1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)] -// CHECK:STDOUT: %impl.elem0.loc137_5.2: @SubWith.loc135.%.loc137_5.7 (%.53a) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc137_5.2 (constants.%impl.elem0.0f9)] -// CHECK:STDOUT: %specific_impl_fn.loc137_5.4: = specific_impl_function %impl.elem0.loc137_5.2, @Destroy.WithSelf.Op.1(%Result.loc132_9.1) [symbolic = %specific_impl_fn.loc137_5.4 (constants.%specific_impl_fn.afc)] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Result.loc132_9.1) [symbolic = %Destroy.WithSelf.SelfDestruct.type (constants.%Destroy.WithSelf.SelfDestruct.type.4e5869.2)] +// CHECK:STDOUT: %.loc137_5.7: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type, %Result.loc132_9.1 [symbolic = %.loc137_5.7 (constants.%.ec8)] +// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %Result.loc132_9.1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.dfb4c4.2)] +// CHECK:STDOUT: %impl.elem2.loc137_5.2: @SubWith.loc135.%.loc137_5.7 (%.ec8) = impl_witness_access %Destroy.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc137_5.2 (constants.%impl.elem2)] +// CHECK:STDOUT: %specific_impl_fn.loc137_5.4: = specific_impl_function %impl.elem2.loc137_5.2, @Destroy.WithSelf.SelfDestruct.1(%Result.loc132_9.1) [symbolic = %specific_impl_fn.loc137_5.4 (constants.%specific_impl_fn.448)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%result.param: @SubWith.loc135.%Result.as_type.loc134_53.1 (%Result.as_type), %x.param: @SubWith.loc135.%T.as_type.loc135_29.1 (%T.as_type.58f), %y.param: @SubWith.loc135.%U.as_type.loc134_35.1 (%U.as_type.b61)) { // CHECK:STDOUT: !entry: @@ -1646,13 +1662,13 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %.loc137_5.2: ref @SubWith.loc135.%Result.as_type.loc134_53.1 (%Result.as_type) = temporary_storage // CHECK:STDOUT: %SubWith.WithSelf.Op.call: init @SubWith.loc135.%Result.as_type.loc134_53.1 (%Result.as_type) to %.loc137_5.2 = call %bound_method.loc137_5.2(%x.ref, %y.ref) // CHECK:STDOUT: %.loc137_5.3: ref @SubWith.loc135.%Result.as_type.loc134_53.1 (%Result.as_type) = temporary %.loc137_5.2, %SubWith.WithSelf.Op.call -// CHECK:STDOUT: %impl.elem0.loc137_5.1: @SubWith.loc135.%.loc137_5.7 (%.53a) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc137_5.2 (constants.%impl.elem0.0f9)] -// CHECK:STDOUT: %bound_method.loc137_5.3: = bound_method %.loc137_5.3, %impl.elem0.loc137_5.1 +// CHECK:STDOUT: %impl.elem2.loc137_5.1: @SubWith.loc135.%.loc137_5.7 (%.ec8) = impl_witness_access constants.%Destroy.lookup_impl_witness.dfb4c4.2, element2 [symbolic = %impl.elem2.loc137_5.2 (constants.%impl.elem2)] +// CHECK:STDOUT: %bound_method.loc137_5.3: = bound_method %.loc137_5.3, %impl.elem2.loc137_5.1 // CHECK:STDOUT: %.loc137_5.4: %Destroy.type = converted constants.%Result.as_type, constants.%Result [symbolic = %Result.loc132_9.1 (constants.%Result)] // CHECK:STDOUT: %.loc137_5.5: %Destroy.type = converted constants.%Result.as_type, constants.%Result [symbolic = %Result.loc132_9.1 (constants.%Result)] -// CHECK:STDOUT: %specific_impl_fn.loc137_5.2: = specific_impl_function %impl.elem0.loc137_5.1, @Destroy.WithSelf.Op.1(constants.%Result) [symbolic = %specific_impl_fn.loc137_5.4 (constants.%specific_impl_fn.afc)] +// CHECK:STDOUT: %specific_impl_fn.loc137_5.2: = specific_impl_function %impl.elem2.loc137_5.1, @Destroy.WithSelf.SelfDestruct.1(constants.%Result) [symbolic = %specific_impl_fn.loc137_5.4 (constants.%specific_impl_fn.448)] // CHECK:STDOUT: %bound_method.loc137_5.4: = bound_method %.loc137_5.3, %specific_impl_fn.loc137_5.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc137_5.4(%.loc137_5.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %bound_method.loc137_5.4(%.loc137_5.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -1670,11 +1686,11 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %.loc148_5.6: type = fn_type_with_self_type %MulWith.WithSelf.Op.type, %MulWith.facet [symbolic = %.loc148_5.6 (constants.%.a49)] // CHECK:STDOUT: %impl.elem1.loc148_5.2: @MulWith.loc146.%.loc148_5.6 (%.a49) = impl_witness_access %MulWith.lookup_impl_witness.loc148, element1 [symbolic = %impl.elem1.loc148_5.2 (constants.%impl.elem1.a7b)] // CHECK:STDOUT: %specific_impl_fn.loc148_5.3: = specific_impl_function %impl.elem1.loc148_5.2, @MulWith.WithSelf.Op(%U.as_type.loc145_35.1, %MulWith.facet) [symbolic = %specific_impl_fn.loc148_5.3 (constants.%specific_impl_fn.eab)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Result.loc143_9.1) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.d3ece9.2)] -// CHECK:STDOUT: %.loc148_5.7: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Result.loc143_9.1 [symbolic = %.loc148_5.7 (constants.%.53a)] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %Result.loc143_9.1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)] -// CHECK:STDOUT: %impl.elem0.loc148_5.2: @MulWith.loc146.%.loc148_5.7 (%.53a) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc148_5.2 (constants.%impl.elem0.0f9)] -// CHECK:STDOUT: %specific_impl_fn.loc148_5.4: = specific_impl_function %impl.elem0.loc148_5.2, @Destroy.WithSelf.Op.1(%Result.loc143_9.1) [symbolic = %specific_impl_fn.loc148_5.4 (constants.%specific_impl_fn.afc)] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Result.loc143_9.1) [symbolic = %Destroy.WithSelf.SelfDestruct.type (constants.%Destroy.WithSelf.SelfDestruct.type.4e5869.2)] +// CHECK:STDOUT: %.loc148_5.7: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type, %Result.loc143_9.1 [symbolic = %.loc148_5.7 (constants.%.ec8)] +// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %Result.loc143_9.1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.dfb4c4.2)] +// CHECK:STDOUT: %impl.elem2.loc148_5.2: @MulWith.loc146.%.loc148_5.7 (%.ec8) = impl_witness_access %Destroy.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc148_5.2 (constants.%impl.elem2)] +// CHECK:STDOUT: %specific_impl_fn.loc148_5.4: = specific_impl_function %impl.elem2.loc148_5.2, @Destroy.WithSelf.SelfDestruct.1(%Result.loc143_9.1) [symbolic = %specific_impl_fn.loc148_5.4 (constants.%specific_impl_fn.448)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%result.param: @MulWith.loc146.%Result.as_type.loc145_53.1 (%Result.as_type), %x.param: @MulWith.loc146.%T.as_type.loc146_29.1 (%T.as_type.83f), %y.param: @MulWith.loc146.%U.as_type.loc145_35.1 (%U.as_type.b61)) { // CHECK:STDOUT: !entry: @@ -1690,13 +1706,13 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %.loc148_5.2: ref @MulWith.loc146.%Result.as_type.loc145_53.1 (%Result.as_type) = temporary_storage // CHECK:STDOUT: %MulWith.WithSelf.Op.call: init @MulWith.loc146.%Result.as_type.loc145_53.1 (%Result.as_type) to %.loc148_5.2 = call %bound_method.loc148_5.2(%x.ref, %y.ref) // CHECK:STDOUT: %.loc148_5.3: ref @MulWith.loc146.%Result.as_type.loc145_53.1 (%Result.as_type) = temporary %.loc148_5.2, %MulWith.WithSelf.Op.call -// CHECK:STDOUT: %impl.elem0.loc148_5.1: @MulWith.loc146.%.loc148_5.7 (%.53a) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc148_5.2 (constants.%impl.elem0.0f9)] -// CHECK:STDOUT: %bound_method.loc148_5.3: = bound_method %.loc148_5.3, %impl.elem0.loc148_5.1 +// CHECK:STDOUT: %impl.elem2.loc148_5.1: @MulWith.loc146.%.loc148_5.7 (%.ec8) = impl_witness_access constants.%Destroy.lookup_impl_witness.dfb4c4.2, element2 [symbolic = %impl.elem2.loc148_5.2 (constants.%impl.elem2)] +// CHECK:STDOUT: %bound_method.loc148_5.3: = bound_method %.loc148_5.3, %impl.elem2.loc148_5.1 // CHECK:STDOUT: %.loc148_5.4: %Destroy.type = converted constants.%Result.as_type, constants.%Result [symbolic = %Result.loc143_9.1 (constants.%Result)] // CHECK:STDOUT: %.loc148_5.5: %Destroy.type = converted constants.%Result.as_type, constants.%Result [symbolic = %Result.loc143_9.1 (constants.%Result)] -// CHECK:STDOUT: %specific_impl_fn.loc148_5.2: = specific_impl_function %impl.elem0.loc148_5.1, @Destroy.WithSelf.Op.1(constants.%Result) [symbolic = %specific_impl_fn.loc148_5.4 (constants.%specific_impl_fn.afc)] +// CHECK:STDOUT: %specific_impl_fn.loc148_5.2: = specific_impl_function %impl.elem2.loc148_5.1, @Destroy.WithSelf.SelfDestruct.1(constants.%Result) [symbolic = %specific_impl_fn.loc148_5.4 (constants.%specific_impl_fn.448)] // CHECK:STDOUT: %bound_method.loc148_5.4: = bound_method %.loc148_5.3, %specific_impl_fn.loc148_5.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc148_5.4(%.loc148_5.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %bound_method.loc148_5.4(%.loc148_5.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -1714,11 +1730,11 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %.loc159_5.6: type = fn_type_with_self_type %DivWith.WithSelf.Op.type, %DivWith.facet [symbolic = %.loc159_5.6 (constants.%.6b1)] // CHECK:STDOUT: %impl.elem1.loc159_5.2: @DivWith.loc157.%.loc159_5.6 (%.6b1) = impl_witness_access %DivWith.lookup_impl_witness.loc159, element1 [symbolic = %impl.elem1.loc159_5.2 (constants.%impl.elem1.bfe)] // CHECK:STDOUT: %specific_impl_fn.loc159_5.3: = specific_impl_function %impl.elem1.loc159_5.2, @DivWith.WithSelf.Op(%U.as_type.loc156_35.1, %DivWith.facet) [symbolic = %specific_impl_fn.loc159_5.3 (constants.%specific_impl_fn.e98)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Result.loc154_9.1) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.d3ece9.2)] -// CHECK:STDOUT: %.loc159_5.7: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Result.loc154_9.1 [symbolic = %.loc159_5.7 (constants.%.53a)] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %Result.loc154_9.1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)] -// CHECK:STDOUT: %impl.elem0.loc159_5.2: @DivWith.loc157.%.loc159_5.7 (%.53a) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc159_5.2 (constants.%impl.elem0.0f9)] -// CHECK:STDOUT: %specific_impl_fn.loc159_5.4: = specific_impl_function %impl.elem0.loc159_5.2, @Destroy.WithSelf.Op.1(%Result.loc154_9.1) [symbolic = %specific_impl_fn.loc159_5.4 (constants.%specific_impl_fn.afc)] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Result.loc154_9.1) [symbolic = %Destroy.WithSelf.SelfDestruct.type (constants.%Destroy.WithSelf.SelfDestruct.type.4e5869.2)] +// CHECK:STDOUT: %.loc159_5.7: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type, %Result.loc154_9.1 [symbolic = %.loc159_5.7 (constants.%.ec8)] +// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %Result.loc154_9.1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.dfb4c4.2)] +// CHECK:STDOUT: %impl.elem2.loc159_5.2: @DivWith.loc157.%.loc159_5.7 (%.ec8) = impl_witness_access %Destroy.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc159_5.2 (constants.%impl.elem2)] +// CHECK:STDOUT: %specific_impl_fn.loc159_5.4: = specific_impl_function %impl.elem2.loc159_5.2, @Destroy.WithSelf.SelfDestruct.1(%Result.loc154_9.1) [symbolic = %specific_impl_fn.loc159_5.4 (constants.%specific_impl_fn.448)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%result.param: @DivWith.loc157.%Result.as_type.loc156_53.1 (%Result.as_type), %x.param: @DivWith.loc157.%T.as_type.loc157_29.1 (%T.as_type.a74), %y.param: @DivWith.loc157.%U.as_type.loc156_35.1 (%U.as_type.b61)) { // CHECK:STDOUT: !entry: @@ -1734,13 +1750,13 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %.loc159_5.2: ref @DivWith.loc157.%Result.as_type.loc156_53.1 (%Result.as_type) = temporary_storage // CHECK:STDOUT: %DivWith.WithSelf.Op.call: init @DivWith.loc157.%Result.as_type.loc156_53.1 (%Result.as_type) to %.loc159_5.2 = call %bound_method.loc159_5.2(%x.ref, %y.ref) // CHECK:STDOUT: %.loc159_5.3: ref @DivWith.loc157.%Result.as_type.loc156_53.1 (%Result.as_type) = temporary %.loc159_5.2, %DivWith.WithSelf.Op.call -// CHECK:STDOUT: %impl.elem0.loc159_5.1: @DivWith.loc157.%.loc159_5.7 (%.53a) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc159_5.2 (constants.%impl.elem0.0f9)] -// CHECK:STDOUT: %bound_method.loc159_5.3: = bound_method %.loc159_5.3, %impl.elem0.loc159_5.1 +// CHECK:STDOUT: %impl.elem2.loc159_5.1: @DivWith.loc157.%.loc159_5.7 (%.ec8) = impl_witness_access constants.%Destroy.lookup_impl_witness.dfb4c4.2, element2 [symbolic = %impl.elem2.loc159_5.2 (constants.%impl.elem2)] +// CHECK:STDOUT: %bound_method.loc159_5.3: = bound_method %.loc159_5.3, %impl.elem2.loc159_5.1 // CHECK:STDOUT: %.loc159_5.4: %Destroy.type = converted constants.%Result.as_type, constants.%Result [symbolic = %Result.loc154_9.1 (constants.%Result)] // CHECK:STDOUT: %.loc159_5.5: %Destroy.type = converted constants.%Result.as_type, constants.%Result [symbolic = %Result.loc154_9.1 (constants.%Result)] -// CHECK:STDOUT: %specific_impl_fn.loc159_5.2: = specific_impl_function %impl.elem0.loc159_5.1, @Destroy.WithSelf.Op.1(constants.%Result) [symbolic = %specific_impl_fn.loc159_5.4 (constants.%specific_impl_fn.afc)] +// CHECK:STDOUT: %specific_impl_fn.loc159_5.2: = specific_impl_function %impl.elem2.loc159_5.1, @Destroy.WithSelf.SelfDestruct.1(constants.%Result) [symbolic = %specific_impl_fn.loc159_5.4 (constants.%specific_impl_fn.448)] // CHECK:STDOUT: %bound_method.loc159_5.4: = bound_method %.loc159_5.3, %specific_impl_fn.loc159_5.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc159_5.4(%.loc159_5.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %bound_method.loc159_5.4(%.loc159_5.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -1758,11 +1774,11 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %.loc170_5.6: type = fn_type_with_self_type %ModWith.WithSelf.Op.type, %ModWith.facet [symbolic = %.loc170_5.6 (constants.%.195)] // CHECK:STDOUT: %impl.elem1.loc170_5.2: @ModWith.loc168.%.loc170_5.6 (%.195) = impl_witness_access %ModWith.lookup_impl_witness.loc170, element1 [symbolic = %impl.elem1.loc170_5.2 (constants.%impl.elem1.715)] // CHECK:STDOUT: %specific_impl_fn.loc170_5.3: = specific_impl_function %impl.elem1.loc170_5.2, @ModWith.WithSelf.Op(%U.as_type.loc167_35.1, %ModWith.facet) [symbolic = %specific_impl_fn.loc170_5.3 (constants.%specific_impl_fn.0b2)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Result.loc165_9.1) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.d3ece9.2)] -// CHECK:STDOUT: %.loc170_5.7: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Result.loc165_9.1 [symbolic = %.loc170_5.7 (constants.%.53a)] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %Result.loc165_9.1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)] -// CHECK:STDOUT: %impl.elem0.loc170_5.2: @ModWith.loc168.%.loc170_5.7 (%.53a) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc170_5.2 (constants.%impl.elem0.0f9)] -// CHECK:STDOUT: %specific_impl_fn.loc170_5.4: = specific_impl_function %impl.elem0.loc170_5.2, @Destroy.WithSelf.Op.1(%Result.loc165_9.1) [symbolic = %specific_impl_fn.loc170_5.4 (constants.%specific_impl_fn.afc)] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Result.loc165_9.1) [symbolic = %Destroy.WithSelf.SelfDestruct.type (constants.%Destroy.WithSelf.SelfDestruct.type.4e5869.2)] +// CHECK:STDOUT: %.loc170_5.7: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type, %Result.loc165_9.1 [symbolic = %.loc170_5.7 (constants.%.ec8)] +// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %Result.loc165_9.1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.dfb4c4.2)] +// CHECK:STDOUT: %impl.elem2.loc170_5.2: @ModWith.loc168.%.loc170_5.7 (%.ec8) = impl_witness_access %Destroy.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc170_5.2 (constants.%impl.elem2)] +// CHECK:STDOUT: %specific_impl_fn.loc170_5.4: = specific_impl_function %impl.elem2.loc170_5.2, @Destroy.WithSelf.SelfDestruct.1(%Result.loc165_9.1) [symbolic = %specific_impl_fn.loc170_5.4 (constants.%specific_impl_fn.448)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%result.param: @ModWith.loc168.%Result.as_type.loc167_53.1 (%Result.as_type), %x.param: @ModWith.loc168.%T.as_type.loc168_29.1 (%T.as_type.1c2), %y.param: @ModWith.loc168.%U.as_type.loc167_35.1 (%U.as_type.b61)) { // CHECK:STDOUT: !entry: @@ -1778,13 +1794,13 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %.loc170_5.2: ref @ModWith.loc168.%Result.as_type.loc167_53.1 (%Result.as_type) = temporary_storage // CHECK:STDOUT: %ModWith.WithSelf.Op.call: init @ModWith.loc168.%Result.as_type.loc167_53.1 (%Result.as_type) to %.loc170_5.2 = call %bound_method.loc170_5.2(%x.ref, %y.ref) // CHECK:STDOUT: %.loc170_5.3: ref @ModWith.loc168.%Result.as_type.loc167_53.1 (%Result.as_type) = temporary %.loc170_5.2, %ModWith.WithSelf.Op.call -// CHECK:STDOUT: %impl.elem0.loc170_5.1: @ModWith.loc168.%.loc170_5.7 (%.53a) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc170_5.2 (constants.%impl.elem0.0f9)] -// CHECK:STDOUT: %bound_method.loc170_5.3: = bound_method %.loc170_5.3, %impl.elem0.loc170_5.1 +// CHECK:STDOUT: %impl.elem2.loc170_5.1: @ModWith.loc168.%.loc170_5.7 (%.ec8) = impl_witness_access constants.%Destroy.lookup_impl_witness.dfb4c4.2, element2 [symbolic = %impl.elem2.loc170_5.2 (constants.%impl.elem2)] +// CHECK:STDOUT: %bound_method.loc170_5.3: = bound_method %.loc170_5.3, %impl.elem2.loc170_5.1 // CHECK:STDOUT: %.loc170_5.4: %Destroy.type = converted constants.%Result.as_type, constants.%Result [symbolic = %Result.loc165_9.1 (constants.%Result)] // CHECK:STDOUT: %.loc170_5.5: %Destroy.type = converted constants.%Result.as_type, constants.%Result [symbolic = %Result.loc165_9.1 (constants.%Result)] -// CHECK:STDOUT: %specific_impl_fn.loc170_5.2: = specific_impl_function %impl.elem0.loc170_5.1, @Destroy.WithSelf.Op.1(constants.%Result) [symbolic = %specific_impl_fn.loc170_5.4 (constants.%specific_impl_fn.afc)] +// CHECK:STDOUT: %specific_impl_fn.loc170_5.2: = specific_impl_function %impl.elem2.loc170_5.1, @Destroy.WithSelf.SelfDestruct.1(constants.%Result) [symbolic = %specific_impl_fn.loc170_5.4 (constants.%specific_impl_fn.448)] // CHECK:STDOUT: %bound_method.loc170_5.4: = bound_method %.loc170_5.3, %specific_impl_fn.loc170_5.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc170_5.4(%.loc170_5.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %bound_method.loc170_5.4(%.loc170_5.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -2000,11 +2016,11 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %.loc296_3.7: type = fn_type_with_self_type %Negate.WithSelf.Op.type, %Negate.facet.loc296_3.3 [symbolic = %.loc296_3.7 (constants.%.16a)] // CHECK:STDOUT: %impl.elem1.loc296_3.2: @TestNegate.%.loc296_3.7 (%.16a) = impl_witness_access %Negate.lookup_impl_witness, element1 [symbolic = %impl.elem1.loc296_3.2 (constants.%impl.elem1.ee9)] // CHECK:STDOUT: %specific_impl_fn.loc296_3.3: = specific_impl_function %impl.elem1.loc296_3.2, @Negate.WithSelf.Op(%Negate.facet.loc296_3.3) [symbolic = %specific_impl_fn.loc296_3.3 (constants.%specific_impl_fn.923)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Result.loc292_9.1) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.d3ece9.2)] -// CHECK:STDOUT: %.loc296_3.8: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Result.loc292_9.1 [symbolic = %.loc296_3.8 (constants.%.53a)] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %Result.loc292_9.1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)] -// CHECK:STDOUT: %impl.elem0.loc296_3.2: @TestNegate.%.loc296_3.8 (%.53a) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc296_3.2 (constants.%impl.elem0.0f9)] -// CHECK:STDOUT: %specific_impl_fn.loc296_3.4: = specific_impl_function %impl.elem0.loc296_3.2, @Destroy.WithSelf.Op.1(%Result.loc292_9.1) [symbolic = %specific_impl_fn.loc296_3.4 (constants.%specific_impl_fn.afc)] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Result.loc292_9.1) [symbolic = %Destroy.WithSelf.SelfDestruct.type (constants.%Destroy.WithSelf.SelfDestruct.type.4e5869.2)] +// CHECK:STDOUT: %.loc296_3.8: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type, %Result.loc292_9.1 [symbolic = %.loc296_3.8 (constants.%.ec8)] +// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %Result.loc292_9.1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.dfb4c4.2)] +// CHECK:STDOUT: %impl.elem2.loc296_3.2: @TestNegate.%.loc296_3.8 (%.ec8) = impl_witness_access %Destroy.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc296_3.2 (constants.%impl.elem2)] +// CHECK:STDOUT: %specific_impl_fn.loc296_3.4: = specific_impl_function %impl.elem2.loc296_3.2, @Destroy.WithSelf.SelfDestruct.1(%Result.loc292_9.1) [symbolic = %specific_impl_fn.loc296_3.4 (constants.%specific_impl_fn.448)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%y.param: @TestNegate.%Result.as_type.loc293_49.1 (%Result.as_type), %x.param: @TestNegate.%T.as_type.loc294_24.1 (%T.as_type.684)) { // CHECK:STDOUT: !entry: @@ -2020,13 +2036,13 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %.loc296_3.3: ref @TestNegate.%Result.as_type.loc293_49.1 (%Result.as_type) = temporary_storage // CHECK:STDOUT: %Negate.WithSelf.Op.call: init @TestNegate.%Result.as_type.loc293_49.1 (%Result.as_type) to %.loc296_3.3 = call %bound_method.loc296_3.2(%x.ref) // CHECK:STDOUT: %.loc296_3.4: ref @TestNegate.%Result.as_type.loc293_49.1 (%Result.as_type) = temporary %.loc296_3.3, %Negate.WithSelf.Op.call -// CHECK:STDOUT: %impl.elem0.loc296_3.1: @TestNegate.%.loc296_3.8 (%.53a) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc296_3.2 (constants.%impl.elem0.0f9)] -// CHECK:STDOUT: %bound_method.loc296_3.3: = bound_method %.loc296_3.4, %impl.elem0.loc296_3.1 +// CHECK:STDOUT: %impl.elem2.loc296_3.1: @TestNegate.%.loc296_3.8 (%.ec8) = impl_witness_access constants.%Destroy.lookup_impl_witness.dfb4c4.2, element2 [symbolic = %impl.elem2.loc296_3.2 (constants.%impl.elem2)] +// CHECK:STDOUT: %bound_method.loc296_3.3: = bound_method %.loc296_3.4, %impl.elem2.loc296_3.1 // CHECK:STDOUT: %.loc296_3.5: %Destroy.type = converted constants.%Result.as_type, constants.%Result [symbolic = %Result.loc292_9.1 (constants.%Result)] // CHECK:STDOUT: %.loc296_3.6: %Destroy.type = converted constants.%Result.as_type, constants.%Result [symbolic = %Result.loc292_9.1 (constants.%Result)] -// CHECK:STDOUT: %specific_impl_fn.loc296_3.2: = specific_impl_function %impl.elem0.loc296_3.1, @Destroy.WithSelf.Op.1(constants.%Result) [symbolic = %specific_impl_fn.loc296_3.4 (constants.%specific_impl_fn.afc)] +// CHECK:STDOUT: %specific_impl_fn.loc296_3.2: = specific_impl_function %impl.elem2.loc296_3.1, @Destroy.WithSelf.SelfDestruct.1(constants.%Result) [symbolic = %specific_impl_fn.loc296_3.4 (constants.%specific_impl_fn.448)] // CHECK:STDOUT: %bound_method.loc296_3.4: = bound_method %.loc296_3.4, %specific_impl_fn.loc296_3.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method.loc296_3.4(%.loc296_3.4) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %bound_method.loc296_3.4(%.loc296_3.4) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -2206,11 +2222,11 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %y.patt.loc168_33.2 => constants.%y.patt.603 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @AddWith.loc124(constants.%Destroy.facet.2cc, constants.%Destroy.facet.2cc, constants.%facet_value.1dc) { +// CHECK:STDOUT: specific @AddWith.loc124(constants.%Destroy.facet.f58, constants.%Destroy.facet.f58, constants.%facet_value.a37) { // CHECK:STDOUT: %Result.patt.loc121_9.2 => constants.%Result.patt -// CHECK:STDOUT: %Result.loc121_9.1 => constants.%Destroy.facet.2cc +// CHECK:STDOUT: %Result.loc121_9.1 => constants.%Destroy.facet.f58 // CHECK:STDOUT: %U.patt.loc122_4.2 => constants.%U.patt.7a2 -// CHECK:STDOUT: %U.loc122_4.1 => constants.%Destroy.facet.2cc +// CHECK:STDOUT: %U.loc122_4.1 => constants.%Destroy.facet.f58 // CHECK:STDOUT: %U.as_type.loc123_35.1 => constants.%Int16 // CHECK:STDOUT: %AddWith.type.loc123_35.1 => constants.%AddWith.type.b62 // CHECK:STDOUT: %facet_type.loc123_19 => constants.%facet_type.297 @@ -2228,7 +2244,7 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %facet_type.loc123_37 => constants.%facet_type.225 // CHECK:STDOUT: %pattern_type.loc123 => constants.%pattern_type.34a // CHECK:STDOUT: %T.patt.loc123_4.2 => constants.%T.patt.3ec -// CHECK:STDOUT: %T.loc123_4.1 => constants.%facet_value.1dc +// CHECK:STDOUT: %T.loc123_4.1 => constants.%facet_value.a37 // CHECK:STDOUT: %pattern_type.loc124_16 => constants.%pattern_type.785 // CHECK:STDOUT: %result.param_patt.loc124_16.2 => constants.%result.param_patt.be6 // CHECK:STDOUT: %result.patt.loc124_16.2 => constants.%result.patt.a31 @@ -2252,18 +2268,18 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %.loc126_5.6 => constants.%.2c3 // CHECK:STDOUT: %impl.elem1.loc126_5.2 => constants.%Op.72717c.1 // CHECK:STDOUT: %specific_impl_fn.loc126_5.3 => constants.%Op.72717c.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.9d5 -// CHECK:STDOUT: %.loc126_5.7 => constants.%.6da -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.1 -// CHECK:STDOUT: %impl.elem0.loc126_5.2 => constants.%Int16.Op.4dca31.1 -// CHECK:STDOUT: %specific_impl_fn.loc126_5.4 => constants.%Int16.Op.4dca31.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.2a7 +// CHECK:STDOUT: %.loc126_5.7 => constants.%.4d6 +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.1bfa2a.1 +// CHECK:STDOUT: %impl.elem2.loc126_5.2 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %specific_impl_fn.loc126_5.4 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @SubWith.loc135(constants.%Destroy.facet.2cc, constants.%Destroy.facet.2cc, constants.%facet_value.a29) { +// CHECK:STDOUT: specific @SubWith.loc135(constants.%Destroy.facet.f58, constants.%Destroy.facet.f58, constants.%facet_value.0ee5e) { // CHECK:STDOUT: %Result.patt.loc132_9.2 => constants.%Result.patt -// CHECK:STDOUT: %Result.loc132_9.1 => constants.%Destroy.facet.2cc +// CHECK:STDOUT: %Result.loc132_9.1 => constants.%Destroy.facet.f58 // CHECK:STDOUT: %U.patt.loc133_4.2 => constants.%U.patt.7a2 -// CHECK:STDOUT: %U.loc133_4.1 => constants.%Destroy.facet.2cc +// CHECK:STDOUT: %U.loc133_4.1 => constants.%Destroy.facet.f58 // CHECK:STDOUT: %U.as_type.loc134_35.1 => constants.%Int16 // CHECK:STDOUT: %SubWith.type.loc134_35.1 => constants.%SubWith.type.b12 // CHECK:STDOUT: %facet_type.loc134_19 => constants.%facet_type.b15 @@ -2281,7 +2297,7 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %facet_type.loc134_37 => constants.%facet_type.b71 // CHECK:STDOUT: %pattern_type.loc134 => constants.%pattern_type.f54 // CHECK:STDOUT: %T.patt.loc134_4.2 => constants.%T.patt.842 -// CHECK:STDOUT: %T.loc134_4.1 => constants.%facet_value.a29 +// CHECK:STDOUT: %T.loc134_4.1 => constants.%facet_value.0ee5e // CHECK:STDOUT: %pattern_type.loc135_16 => constants.%pattern_type.785 // CHECK:STDOUT: %result.param_patt.loc135_16.2 => constants.%result.param_patt.be6 // CHECK:STDOUT: %result.patt.loc135_16.2 => constants.%result.patt.a31 @@ -2305,18 +2321,18 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %.loc137_5.6 => constants.%.00a // CHECK:STDOUT: %impl.elem1.loc137_5.2 => constants.%Op.72717c.2 // CHECK:STDOUT: %specific_impl_fn.loc137_5.3 => constants.%Op.72717c.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.9d5 -// CHECK:STDOUT: %.loc137_5.7 => constants.%.6da -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.1 -// CHECK:STDOUT: %impl.elem0.loc137_5.2 => constants.%Int16.Op.4dca31.1 -// CHECK:STDOUT: %specific_impl_fn.loc137_5.4 => constants.%Int16.Op.4dca31.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.2a7 +// CHECK:STDOUT: %.loc137_5.7 => constants.%.4d6 +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.1bfa2a.1 +// CHECK:STDOUT: %impl.elem2.loc137_5.2 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %specific_impl_fn.loc137_5.4 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @MulWith.loc146(constants.%Destroy.facet.2cc, constants.%Destroy.facet.2cc, constants.%facet_value.ba0) { +// CHECK:STDOUT: specific @MulWith.loc146(constants.%Destroy.facet.f58, constants.%Destroy.facet.f58, constants.%facet_value.58f) { // CHECK:STDOUT: %Result.patt.loc143_9.2 => constants.%Result.patt -// CHECK:STDOUT: %Result.loc143_9.1 => constants.%Destroy.facet.2cc +// CHECK:STDOUT: %Result.loc143_9.1 => constants.%Destroy.facet.f58 // CHECK:STDOUT: %U.patt.loc144_4.2 => constants.%U.patt.7a2 -// CHECK:STDOUT: %U.loc144_4.1 => constants.%Destroy.facet.2cc +// CHECK:STDOUT: %U.loc144_4.1 => constants.%Destroy.facet.f58 // CHECK:STDOUT: %U.as_type.loc145_35.1 => constants.%Int16 // CHECK:STDOUT: %MulWith.type.loc145_35.1 => constants.%MulWith.type.c18 // CHECK:STDOUT: %facet_type.loc145_19 => constants.%facet_type.a64 @@ -2334,7 +2350,7 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %facet_type.loc145_37 => constants.%facet_type.662 // CHECK:STDOUT: %pattern_type.loc145 => constants.%pattern_type.90f // CHECK:STDOUT: %T.patt.loc145_4.2 => constants.%T.patt.8ad -// CHECK:STDOUT: %T.loc145_4.1 => constants.%facet_value.ba0 +// CHECK:STDOUT: %T.loc145_4.1 => constants.%facet_value.58f // CHECK:STDOUT: %pattern_type.loc146_16 => constants.%pattern_type.785 // CHECK:STDOUT: %result.param_patt.loc146_16.2 => constants.%result.param_patt.be6 // CHECK:STDOUT: %result.patt.loc146_16.2 => constants.%result.patt.a31 @@ -2358,18 +2374,18 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %.loc148_5.6 => constants.%.0ed // CHECK:STDOUT: %impl.elem1.loc148_5.2 => constants.%Op.72717c.3 // CHECK:STDOUT: %specific_impl_fn.loc148_5.3 => constants.%Op.72717c.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.9d5 -// CHECK:STDOUT: %.loc148_5.7 => constants.%.6da -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.1 -// CHECK:STDOUT: %impl.elem0.loc148_5.2 => constants.%Int16.Op.4dca31.1 -// CHECK:STDOUT: %specific_impl_fn.loc148_5.4 => constants.%Int16.Op.4dca31.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.2a7 +// CHECK:STDOUT: %.loc148_5.7 => constants.%.4d6 +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.1bfa2a.1 +// CHECK:STDOUT: %impl.elem2.loc148_5.2 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %specific_impl_fn.loc148_5.4 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @DivWith.loc157(constants.%Destroy.facet.2cc, constants.%Destroy.facet.2cc, constants.%facet_value.de3) { +// CHECK:STDOUT: specific @DivWith.loc157(constants.%Destroy.facet.f58, constants.%Destroy.facet.f58, constants.%facet_value.b41) { // CHECK:STDOUT: %Result.patt.loc154_9.2 => constants.%Result.patt -// CHECK:STDOUT: %Result.loc154_9.1 => constants.%Destroy.facet.2cc +// CHECK:STDOUT: %Result.loc154_9.1 => constants.%Destroy.facet.f58 // CHECK:STDOUT: %U.patt.loc155_4.2 => constants.%U.patt.7a2 -// CHECK:STDOUT: %U.loc155_4.1 => constants.%Destroy.facet.2cc +// CHECK:STDOUT: %U.loc155_4.1 => constants.%Destroy.facet.f58 // CHECK:STDOUT: %U.as_type.loc156_35.1 => constants.%Int16 // CHECK:STDOUT: %DivWith.type.loc156_35.1 => constants.%DivWith.type.6f9 // CHECK:STDOUT: %facet_type.loc156_19 => constants.%facet_type.0b4 @@ -2387,7 +2403,7 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %facet_type.loc156_37 => constants.%facet_type.bd6 // CHECK:STDOUT: %pattern_type.loc156 => constants.%pattern_type.692 // CHECK:STDOUT: %T.patt.loc156_4.2 => constants.%T.patt.00c -// CHECK:STDOUT: %T.loc156_4.1 => constants.%facet_value.de3 +// CHECK:STDOUT: %T.loc156_4.1 => constants.%facet_value.b41 // CHECK:STDOUT: %pattern_type.loc157_16 => constants.%pattern_type.785 // CHECK:STDOUT: %result.param_patt.loc157_16.2 => constants.%result.param_patt.be6 // CHECK:STDOUT: %result.patt.loc157_16.2 => constants.%result.patt.a31 @@ -2411,18 +2427,18 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %.loc159_5.6 => constants.%.316 // CHECK:STDOUT: %impl.elem1.loc159_5.2 => constants.%Op.72717c.4 // CHECK:STDOUT: %specific_impl_fn.loc159_5.3 => constants.%Op.72717c.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.9d5 -// CHECK:STDOUT: %.loc159_5.7 => constants.%.6da -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.1 -// CHECK:STDOUT: %impl.elem0.loc159_5.2 => constants.%Int16.Op.4dca31.1 -// CHECK:STDOUT: %specific_impl_fn.loc159_5.4 => constants.%Int16.Op.4dca31.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.2a7 +// CHECK:STDOUT: %.loc159_5.7 => constants.%.4d6 +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.1bfa2a.1 +// CHECK:STDOUT: %impl.elem2.loc159_5.2 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %specific_impl_fn.loc159_5.4 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ModWith.loc168(constants.%Destroy.facet.2cc, constants.%Destroy.facet.2cc, constants.%facet_value.718) { +// CHECK:STDOUT: specific @ModWith.loc168(constants.%Destroy.facet.f58, constants.%Destroy.facet.f58, constants.%facet_value.b6e) { // CHECK:STDOUT: %Result.patt.loc165_9.2 => constants.%Result.patt -// CHECK:STDOUT: %Result.loc165_9.1 => constants.%Destroy.facet.2cc +// CHECK:STDOUT: %Result.loc165_9.1 => constants.%Destroy.facet.f58 // CHECK:STDOUT: %U.patt.loc166_4.2 => constants.%U.patt.7a2 -// CHECK:STDOUT: %U.loc166_4.1 => constants.%Destroy.facet.2cc +// CHECK:STDOUT: %U.loc166_4.1 => constants.%Destroy.facet.f58 // CHECK:STDOUT: %U.as_type.loc167_35.1 => constants.%Int16 // CHECK:STDOUT: %ModWith.type.loc167_35.1 => constants.%ModWith.type.763 // CHECK:STDOUT: %facet_type.loc167_19 => constants.%facet_type.ee8 @@ -2440,7 +2456,7 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %facet_type.loc167_37 => constants.%facet_type.a2b // CHECK:STDOUT: %pattern_type.loc167 => constants.%pattern_type.61d // CHECK:STDOUT: %T.patt.loc167_4.2 => constants.%T.patt.a00 -// CHECK:STDOUT: %T.loc167_4.1 => constants.%facet_value.718 +// CHECK:STDOUT: %T.loc167_4.1 => constants.%facet_value.b6e // CHECK:STDOUT: %pattern_type.loc168_16 => constants.%pattern_type.785 // CHECK:STDOUT: %result.param_patt.loc168_16.2 => constants.%result.param_patt.be6 // CHECK:STDOUT: %result.patt.loc168_16.2 => constants.%result.patt.a31 @@ -2464,18 +2480,18 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %.loc170_5.6 => constants.%.9b3 // CHECK:STDOUT: %impl.elem1.loc170_5.2 => constants.%Op.72717c.5 // CHECK:STDOUT: %specific_impl_fn.loc170_5.3 => constants.%Op.72717c.5 -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.9d5 -// CHECK:STDOUT: %.loc170_5.7 => constants.%.6da -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.1 -// CHECK:STDOUT: %impl.elem0.loc170_5.2 => constants.%Int16.Op.4dca31.1 -// CHECK:STDOUT: %specific_impl_fn.loc170_5.4 => constants.%Int16.Op.4dca31.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.2a7 +// CHECK:STDOUT: %.loc170_5.7 => constants.%.4d6 +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.1bfa2a.1 +// CHECK:STDOUT: %impl.elem2.loc170_5.2 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %specific_impl_fn.loc170_5.4 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @AddWith.loc124(constants.%Destroy.facet.2cc, constants.%Destroy.facet.9a3, constants.%facet_value.0c7) { +// CHECK:STDOUT: specific @AddWith.loc124(constants.%Destroy.facet.f58, constants.%Destroy.facet.231, constants.%facet_value.a75) { // CHECK:STDOUT: %Result.patt.loc121_9.2 => constants.%Result.patt -// CHECK:STDOUT: %Result.loc121_9.1 => constants.%Destroy.facet.2cc +// CHECK:STDOUT: %Result.loc121_9.1 => constants.%Destroy.facet.f58 // CHECK:STDOUT: %U.patt.loc122_4.2 => constants.%U.patt.7a2 -// CHECK:STDOUT: %U.loc122_4.1 => constants.%Destroy.facet.9a3 +// CHECK:STDOUT: %U.loc122_4.1 => constants.%Destroy.facet.231 // CHECK:STDOUT: %U.as_type.loc123_35.1 => constants.%i16 // CHECK:STDOUT: %AddWith.type.loc123_35.1 => constants.%AddWith.type.a36 // CHECK:STDOUT: %facet_type.loc123_19 => constants.%facet_type.1cc @@ -2493,7 +2509,7 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %facet_type.loc123_37 => constants.%facet_type.b7b // CHECK:STDOUT: %pattern_type.loc123 => constants.%pattern_type.c51 // CHECK:STDOUT: %T.patt.loc123_4.2 => constants.%T.patt.5cb -// CHECK:STDOUT: %T.loc123_4.1 => constants.%facet_value.0c7 +// CHECK:STDOUT: %T.loc123_4.1 => constants.%facet_value.a75 // CHECK:STDOUT: %pattern_type.loc124_16 => constants.%pattern_type.785 // CHECK:STDOUT: %result.param_patt.loc124_16.2 => constants.%result.param_patt.be6 // CHECK:STDOUT: %result.patt.loc124_16.2 => constants.%result.patt.a31 @@ -2515,20 +2531,20 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %AddWith.facet => constants.%AddWith.facet.b59 // CHECK:STDOUT: %AddWith.WithSelf.Op.type => constants.%AddWith.WithSelf.Op.type.de7 // CHECK:STDOUT: %.loc126_5.6 => constants.%.c9e -// CHECK:STDOUT: %impl.elem1.loc126_5.2 => constants.%Int16.Op.4dca31.3 -// CHECK:STDOUT: %specific_impl_fn.loc126_5.3 => constants.%Int16.Op.4dca31.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.9d5 -// CHECK:STDOUT: %.loc126_5.7 => constants.%.6da -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.1 -// CHECK:STDOUT: %impl.elem0.loc126_5.2 => constants.%Int16.Op.4dca31.1 -// CHECK:STDOUT: %specific_impl_fn.loc126_5.4 => constants.%Int16.Op.4dca31.1 +// CHECK:STDOUT: %impl.elem1.loc126_5.2 => constants.%Int16.Op.4dca31.2 +// CHECK:STDOUT: %specific_impl_fn.loc126_5.3 => constants.%Int16.Op.4dca31.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.2a7 +// CHECK:STDOUT: %.loc126_5.7 => constants.%.4d6 +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.1bfa2a.1 +// CHECK:STDOUT: %impl.elem2.loc126_5.2 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %specific_impl_fn.loc126_5.4 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @SubWith.loc135(constants.%Destroy.facet.2cc, constants.%Destroy.facet.9a3, constants.%facet_value.33e) { +// CHECK:STDOUT: specific @SubWith.loc135(constants.%Destroy.facet.f58, constants.%Destroy.facet.231, constants.%facet_value.841) { // CHECK:STDOUT: %Result.patt.loc132_9.2 => constants.%Result.patt -// CHECK:STDOUT: %Result.loc132_9.1 => constants.%Destroy.facet.2cc +// CHECK:STDOUT: %Result.loc132_9.1 => constants.%Destroy.facet.f58 // CHECK:STDOUT: %U.patt.loc133_4.2 => constants.%U.patt.7a2 -// CHECK:STDOUT: %U.loc133_4.1 => constants.%Destroy.facet.9a3 +// CHECK:STDOUT: %U.loc133_4.1 => constants.%Destroy.facet.231 // CHECK:STDOUT: %U.as_type.loc134_35.1 => constants.%i16 // CHECK:STDOUT: %SubWith.type.loc134_35.1 => constants.%SubWith.type.08b // CHECK:STDOUT: %facet_type.loc134_19 => constants.%facet_type.cb2 @@ -2546,7 +2562,7 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %facet_type.loc134_37 => constants.%facet_type.a67 // CHECK:STDOUT: %pattern_type.loc134 => constants.%pattern_type.486 // CHECK:STDOUT: %T.patt.loc134_4.2 => constants.%T.patt.eb2 -// CHECK:STDOUT: %T.loc134_4.1 => constants.%facet_value.33e +// CHECK:STDOUT: %T.loc134_4.1 => constants.%facet_value.841 // CHECK:STDOUT: %pattern_type.loc135_16 => constants.%pattern_type.785 // CHECK:STDOUT: %result.param_patt.loc135_16.2 => constants.%result.param_patt.be6 // CHECK:STDOUT: %result.patt.loc135_16.2 => constants.%result.patt.a31 @@ -2568,20 +2584,20 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %SubWith.facet => constants.%SubWith.facet.ef4 // CHECK:STDOUT: %SubWith.WithSelf.Op.type => constants.%SubWith.WithSelf.Op.type.723 // CHECK:STDOUT: %.loc137_5.6 => constants.%.6f3 -// CHECK:STDOUT: %impl.elem1.loc137_5.2 => constants.%Int16.Op.4dca31.4 -// CHECK:STDOUT: %specific_impl_fn.loc137_5.3 => constants.%Int16.Op.4dca31.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.9d5 -// CHECK:STDOUT: %.loc137_5.7 => constants.%.6da -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.1 -// CHECK:STDOUT: %impl.elem0.loc137_5.2 => constants.%Int16.Op.4dca31.1 -// CHECK:STDOUT: %specific_impl_fn.loc137_5.4 => constants.%Int16.Op.4dca31.1 +// CHECK:STDOUT: %impl.elem1.loc137_5.2 => constants.%Int16.Op.4dca31.3 +// CHECK:STDOUT: %specific_impl_fn.loc137_5.3 => constants.%Int16.Op.4dca31.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.2a7 +// CHECK:STDOUT: %.loc137_5.7 => constants.%.4d6 +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.1bfa2a.1 +// CHECK:STDOUT: %impl.elem2.loc137_5.2 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %specific_impl_fn.loc137_5.4 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @MulWith.loc146(constants.%Destroy.facet.2cc, constants.%Destroy.facet.9a3, constants.%facet_value.ba4) { +// CHECK:STDOUT: specific @MulWith.loc146(constants.%Destroy.facet.f58, constants.%Destroy.facet.231, constants.%facet_value.afd) { // CHECK:STDOUT: %Result.patt.loc143_9.2 => constants.%Result.patt -// CHECK:STDOUT: %Result.loc143_9.1 => constants.%Destroy.facet.2cc +// CHECK:STDOUT: %Result.loc143_9.1 => constants.%Destroy.facet.f58 // CHECK:STDOUT: %U.patt.loc144_4.2 => constants.%U.patt.7a2 -// CHECK:STDOUT: %U.loc144_4.1 => constants.%Destroy.facet.9a3 +// CHECK:STDOUT: %U.loc144_4.1 => constants.%Destroy.facet.231 // CHECK:STDOUT: %U.as_type.loc145_35.1 => constants.%i16 // CHECK:STDOUT: %MulWith.type.loc145_35.1 => constants.%MulWith.type.55d // CHECK:STDOUT: %facet_type.loc145_19 => constants.%facet_type.67c @@ -2599,7 +2615,7 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %facet_type.loc145_37 => constants.%facet_type.d40 // CHECK:STDOUT: %pattern_type.loc145 => constants.%pattern_type.f6f // CHECK:STDOUT: %T.patt.loc145_4.2 => constants.%T.patt.dc7 -// CHECK:STDOUT: %T.loc145_4.1 => constants.%facet_value.ba4 +// CHECK:STDOUT: %T.loc145_4.1 => constants.%facet_value.afd // CHECK:STDOUT: %pattern_type.loc146_16 => constants.%pattern_type.785 // CHECK:STDOUT: %result.param_patt.loc146_16.2 => constants.%result.param_patt.be6 // CHECK:STDOUT: %result.patt.loc146_16.2 => constants.%result.patt.a31 @@ -2621,20 +2637,20 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %MulWith.facet => constants.%MulWith.facet.19a // CHECK:STDOUT: %MulWith.WithSelf.Op.type => constants.%MulWith.WithSelf.Op.type.7b1 // CHECK:STDOUT: %.loc148_5.6 => constants.%.d82 -// CHECK:STDOUT: %impl.elem1.loc148_5.2 => constants.%Int16.Op.4dca31.5 -// CHECK:STDOUT: %specific_impl_fn.loc148_5.3 => constants.%Int16.Op.4dca31.5 -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.9d5 -// CHECK:STDOUT: %.loc148_5.7 => constants.%.6da -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.1 -// CHECK:STDOUT: %impl.elem0.loc148_5.2 => constants.%Int16.Op.4dca31.1 -// CHECK:STDOUT: %specific_impl_fn.loc148_5.4 => constants.%Int16.Op.4dca31.1 +// CHECK:STDOUT: %impl.elem1.loc148_5.2 => constants.%Int16.Op.4dca31.4 +// CHECK:STDOUT: %specific_impl_fn.loc148_5.3 => constants.%Int16.Op.4dca31.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.2a7 +// CHECK:STDOUT: %.loc148_5.7 => constants.%.4d6 +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.1bfa2a.1 +// CHECK:STDOUT: %impl.elem2.loc148_5.2 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %specific_impl_fn.loc148_5.4 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @DivWith.loc157(constants.%Destroy.facet.2cc, constants.%Destroy.facet.9a3, constants.%facet_value.521) { +// CHECK:STDOUT: specific @DivWith.loc157(constants.%Destroy.facet.f58, constants.%Destroy.facet.231, constants.%facet_value.ef1) { // CHECK:STDOUT: %Result.patt.loc154_9.2 => constants.%Result.patt -// CHECK:STDOUT: %Result.loc154_9.1 => constants.%Destroy.facet.2cc +// CHECK:STDOUT: %Result.loc154_9.1 => constants.%Destroy.facet.f58 // CHECK:STDOUT: %U.patt.loc155_4.2 => constants.%U.patt.7a2 -// CHECK:STDOUT: %U.loc155_4.1 => constants.%Destroy.facet.9a3 +// CHECK:STDOUT: %U.loc155_4.1 => constants.%Destroy.facet.231 // CHECK:STDOUT: %U.as_type.loc156_35.1 => constants.%i16 // CHECK:STDOUT: %DivWith.type.loc156_35.1 => constants.%DivWith.type.ab0 // CHECK:STDOUT: %facet_type.loc156_19 => constants.%facet_type.86c8 @@ -2652,7 +2668,7 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %facet_type.loc156_37 => constants.%facet_type.541 // CHECK:STDOUT: %pattern_type.loc156 => constants.%pattern_type.80a // CHECK:STDOUT: %T.patt.loc156_4.2 => constants.%T.patt.c06 -// CHECK:STDOUT: %T.loc156_4.1 => constants.%facet_value.521 +// CHECK:STDOUT: %T.loc156_4.1 => constants.%facet_value.ef1 // CHECK:STDOUT: %pattern_type.loc157_16 => constants.%pattern_type.785 // CHECK:STDOUT: %result.param_patt.loc157_16.2 => constants.%result.param_patt.be6 // CHECK:STDOUT: %result.patt.loc157_16.2 => constants.%result.patt.a31 @@ -2674,20 +2690,20 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %DivWith.facet => constants.%DivWith.facet.115 // CHECK:STDOUT: %DivWith.WithSelf.Op.type => constants.%DivWith.WithSelf.Op.type.a49 // CHECK:STDOUT: %.loc159_5.6 => constants.%.251 -// CHECK:STDOUT: %impl.elem1.loc159_5.2 => constants.%Int16.Op.4dca31.6 -// CHECK:STDOUT: %specific_impl_fn.loc159_5.3 => constants.%Int16.Op.4dca31.6 -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.9d5 -// CHECK:STDOUT: %.loc159_5.7 => constants.%.6da -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.1 -// CHECK:STDOUT: %impl.elem0.loc159_5.2 => constants.%Int16.Op.4dca31.1 -// CHECK:STDOUT: %specific_impl_fn.loc159_5.4 => constants.%Int16.Op.4dca31.1 +// CHECK:STDOUT: %impl.elem1.loc159_5.2 => constants.%Int16.Op.4dca31.5 +// CHECK:STDOUT: %specific_impl_fn.loc159_5.3 => constants.%Int16.Op.4dca31.5 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.2a7 +// CHECK:STDOUT: %.loc159_5.7 => constants.%.4d6 +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.1bfa2a.1 +// CHECK:STDOUT: %impl.elem2.loc159_5.2 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %specific_impl_fn.loc159_5.4 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ModWith.loc168(constants.%Destroy.facet.2cc, constants.%Destroy.facet.9a3, constants.%facet_value.ce1) { +// CHECK:STDOUT: specific @ModWith.loc168(constants.%Destroy.facet.f58, constants.%Destroy.facet.231, constants.%facet_value.952) { // CHECK:STDOUT: %Result.patt.loc165_9.2 => constants.%Result.patt -// CHECK:STDOUT: %Result.loc165_9.1 => constants.%Destroy.facet.2cc +// CHECK:STDOUT: %Result.loc165_9.1 => constants.%Destroy.facet.f58 // CHECK:STDOUT: %U.patt.loc166_4.2 => constants.%U.patt.7a2 -// CHECK:STDOUT: %U.loc166_4.1 => constants.%Destroy.facet.9a3 +// CHECK:STDOUT: %U.loc166_4.1 => constants.%Destroy.facet.231 // CHECK:STDOUT: %U.as_type.loc167_35.1 => constants.%i16 // CHECK:STDOUT: %ModWith.type.loc167_35.1 => constants.%ModWith.type.0b2 // CHECK:STDOUT: %facet_type.loc167_19 => constants.%facet_type.afdb @@ -2705,7 +2721,7 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %facet_type.loc167_37 => constants.%facet_type.ee6 // CHECK:STDOUT: %pattern_type.loc167 => constants.%pattern_type.4d8 // CHECK:STDOUT: %T.patt.loc167_4.2 => constants.%T.patt.a7e -// CHECK:STDOUT: %T.loc167_4.1 => constants.%facet_value.ce1 +// CHECK:STDOUT: %T.loc167_4.1 => constants.%facet_value.952 // CHECK:STDOUT: %pattern_type.loc168_16 => constants.%pattern_type.785 // CHECK:STDOUT: %result.param_patt.loc168_16.2 => constants.%result.param_patt.be6 // CHECK:STDOUT: %result.patt.loc168_16.2 => constants.%result.patt.a31 @@ -2727,20 +2743,20 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %ModWith.facet => constants.%ModWith.facet.925 // CHECK:STDOUT: %ModWith.WithSelf.Op.type => constants.%ModWith.WithSelf.Op.type.519 // CHECK:STDOUT: %.loc170_5.6 => constants.%.66e2 -// CHECK:STDOUT: %impl.elem1.loc170_5.2 => constants.%Int16.Op.4dca31.7 -// CHECK:STDOUT: %specific_impl_fn.loc170_5.3 => constants.%Int16.Op.4dca31.7 -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.9d5 -// CHECK:STDOUT: %.loc170_5.7 => constants.%.6da -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.1 -// CHECK:STDOUT: %impl.elem0.loc170_5.2 => constants.%Int16.Op.4dca31.1 -// CHECK:STDOUT: %specific_impl_fn.loc170_5.4 => constants.%Int16.Op.4dca31.1 +// CHECK:STDOUT: %impl.elem1.loc170_5.2 => constants.%Int16.Op.4dca31.6 +// CHECK:STDOUT: %specific_impl_fn.loc170_5.3 => constants.%Int16.Op.4dca31.6 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.2a7 +// CHECK:STDOUT: %.loc170_5.7 => constants.%.4d6 +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.1bfa2a.1 +// CHECK:STDOUT: %impl.elem2.loc170_5.2 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %specific_impl_fn.loc170_5.4 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @AddWith.loc124(constants.%Destroy.facet.099, constants.%Destroy.facet.099, constants.%facet_value.17e) { +// CHECK:STDOUT: specific @AddWith.loc124(constants.%Destroy.facet.84d, constants.%Destroy.facet.84d, constants.%facet_value.7c7) { // CHECK:STDOUT: %Result.patt.loc121_9.2 => constants.%Result.patt -// CHECK:STDOUT: %Result.loc121_9.1 => constants.%Destroy.facet.099 +// CHECK:STDOUT: %Result.loc121_9.1 => constants.%Destroy.facet.84d // CHECK:STDOUT: %U.patt.loc122_4.2 => constants.%U.patt.7a2 -// CHECK:STDOUT: %U.loc122_4.1 => constants.%Destroy.facet.099 +// CHECK:STDOUT: %U.loc122_4.1 => constants.%Destroy.facet.84d // CHECK:STDOUT: %U.as_type.loc123_35.1 => constants.%Int32 // CHECK:STDOUT: %AddWith.type.loc123_35.1 => constants.%AddWith.type.c71 // CHECK:STDOUT: %facet_type.loc123_19 => constants.%facet_type.698 @@ -2758,7 +2774,7 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %facet_type.loc123_37 => constants.%facet_type.ecf // CHECK:STDOUT: %pattern_type.loc123 => constants.%pattern_type.c976 // CHECK:STDOUT: %T.patt.loc123_4.2 => constants.%T.patt.0a8 -// CHECK:STDOUT: %T.loc123_4.1 => constants.%facet_value.17e +// CHECK:STDOUT: %T.loc123_4.1 => constants.%facet_value.7c7 // CHECK:STDOUT: %pattern_type.loc124_16 => constants.%pattern_type.8b4 // CHECK:STDOUT: %result.param_patt.loc124_16.2 => constants.%result.param_patt.e81 // CHECK:STDOUT: %result.patt.loc124_16.2 => constants.%result.patt.47f @@ -2780,20 +2796,20 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %AddWith.facet => constants.%AddWith.facet.007 // CHECK:STDOUT: %AddWith.WithSelf.Op.type => constants.%AddWith.WithSelf.Op.type.dc4 // CHECK:STDOUT: %.loc126_5.6 => constants.%.dbb -// CHECK:STDOUT: %impl.elem1.loc126_5.2 => constants.%Int16.Op.4dca31.8 -// CHECK:STDOUT: %specific_impl_fn.loc126_5.3 => constants.%Int16.Op.4dca31.8 -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.b76 -// CHECK:STDOUT: %.loc126_5.7 => constants.%.043 -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.2 -// CHECK:STDOUT: %impl.elem0.loc126_5.2 => constants.%Int32.Op.4dca31.1 -// CHECK:STDOUT: %specific_impl_fn.loc126_5.4 => constants.%Int32.Op.4dca31.1 +// CHECK:STDOUT: %impl.elem1.loc126_5.2 => constants.%Int16.Op.4dca31.7 +// CHECK:STDOUT: %specific_impl_fn.loc126_5.3 => constants.%Int16.Op.4dca31.7 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.3e9 +// CHECK:STDOUT: %.loc126_5.7 => constants.%.57b +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.1bfa2a.2 +// CHECK:STDOUT: %impl.elem2.loc126_5.2 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %specific_impl_fn.loc126_5.4 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @SubWith.loc135(constants.%Destroy.facet.099, constants.%Destroy.facet.099, constants.%facet_value.9eb) { +// CHECK:STDOUT: specific @SubWith.loc135(constants.%Destroy.facet.84d, constants.%Destroy.facet.84d, constants.%facet_value.16e) { // CHECK:STDOUT: %Result.patt.loc132_9.2 => constants.%Result.patt -// CHECK:STDOUT: %Result.loc132_9.1 => constants.%Destroy.facet.099 +// CHECK:STDOUT: %Result.loc132_9.1 => constants.%Destroy.facet.84d // CHECK:STDOUT: %U.patt.loc133_4.2 => constants.%U.patt.7a2 -// CHECK:STDOUT: %U.loc133_4.1 => constants.%Destroy.facet.099 +// CHECK:STDOUT: %U.loc133_4.1 => constants.%Destroy.facet.84d // CHECK:STDOUT: %U.as_type.loc134_35.1 => constants.%Int32 // CHECK:STDOUT: %SubWith.type.loc134_35.1 => constants.%SubWith.type.c81 // CHECK:STDOUT: %facet_type.loc134_19 => constants.%facet_type.44e @@ -2811,7 +2827,7 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %facet_type.loc134_37 => constants.%facet_type.630 // CHECK:STDOUT: %pattern_type.loc134 => constants.%pattern_type.c58 // CHECK:STDOUT: %T.patt.loc134_4.2 => constants.%T.patt.315 -// CHECK:STDOUT: %T.loc134_4.1 => constants.%facet_value.9eb +// CHECK:STDOUT: %T.loc134_4.1 => constants.%facet_value.16e // CHECK:STDOUT: %pattern_type.loc135_16 => constants.%pattern_type.8b4 // CHECK:STDOUT: %result.param_patt.loc135_16.2 => constants.%result.param_patt.e81 // CHECK:STDOUT: %result.patt.loc135_16.2 => constants.%result.patt.47f @@ -2833,20 +2849,20 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %SubWith.facet => constants.%SubWith.facet.703 // CHECK:STDOUT: %SubWith.WithSelf.Op.type => constants.%SubWith.WithSelf.Op.type.6eb // CHECK:STDOUT: %.loc137_5.6 => constants.%.114 -// CHECK:STDOUT: %impl.elem1.loc137_5.2 => constants.%Int16.Op.4dca31.9 -// CHECK:STDOUT: %specific_impl_fn.loc137_5.3 => constants.%Int16.Op.4dca31.9 -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.b76 -// CHECK:STDOUT: %.loc137_5.7 => constants.%.043 -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.2 -// CHECK:STDOUT: %impl.elem0.loc137_5.2 => constants.%Int32.Op.4dca31.1 -// CHECK:STDOUT: %specific_impl_fn.loc137_5.4 => constants.%Int32.Op.4dca31.1 +// CHECK:STDOUT: %impl.elem1.loc137_5.2 => constants.%Int16.Op.4dca31.8 +// CHECK:STDOUT: %specific_impl_fn.loc137_5.3 => constants.%Int16.Op.4dca31.8 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.3e9 +// CHECK:STDOUT: %.loc137_5.7 => constants.%.57b +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.1bfa2a.2 +// CHECK:STDOUT: %impl.elem2.loc137_5.2 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %specific_impl_fn.loc137_5.4 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @MulWith.loc146(constants.%Destroy.facet.099, constants.%Destroy.facet.099, constants.%facet_value.9ae) { +// CHECK:STDOUT: specific @MulWith.loc146(constants.%Destroy.facet.84d, constants.%Destroy.facet.84d, constants.%facet_value.812) { // CHECK:STDOUT: %Result.patt.loc143_9.2 => constants.%Result.patt -// CHECK:STDOUT: %Result.loc143_9.1 => constants.%Destroy.facet.099 +// CHECK:STDOUT: %Result.loc143_9.1 => constants.%Destroy.facet.84d // CHECK:STDOUT: %U.patt.loc144_4.2 => constants.%U.patt.7a2 -// CHECK:STDOUT: %U.loc144_4.1 => constants.%Destroy.facet.099 +// CHECK:STDOUT: %U.loc144_4.1 => constants.%Destroy.facet.84d // CHECK:STDOUT: %U.as_type.loc145_35.1 => constants.%Int32 // CHECK:STDOUT: %MulWith.type.loc145_35.1 => constants.%MulWith.type.eeb // CHECK:STDOUT: %facet_type.loc145_19 => constants.%facet_type.ff6 @@ -2864,7 +2880,7 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %facet_type.loc145_37 => constants.%facet_type.26b // CHECK:STDOUT: %pattern_type.loc145 => constants.%pattern_type.354 // CHECK:STDOUT: %T.patt.loc145_4.2 => constants.%T.patt.4b7 -// CHECK:STDOUT: %T.loc145_4.1 => constants.%facet_value.9ae +// CHECK:STDOUT: %T.loc145_4.1 => constants.%facet_value.812 // CHECK:STDOUT: %pattern_type.loc146_16 => constants.%pattern_type.8b4 // CHECK:STDOUT: %result.param_patt.loc146_16.2 => constants.%result.param_patt.e81 // CHECK:STDOUT: %result.patt.loc146_16.2 => constants.%result.patt.47f @@ -2886,20 +2902,20 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %MulWith.facet => constants.%MulWith.facet.fcd // CHECK:STDOUT: %MulWith.WithSelf.Op.type => constants.%MulWith.WithSelf.Op.type.99f // CHECK:STDOUT: %.loc148_5.6 => constants.%.c1c -// CHECK:STDOUT: %impl.elem1.loc148_5.2 => constants.%Int16.Op.4dca31.10 -// CHECK:STDOUT: %specific_impl_fn.loc148_5.3 => constants.%Int16.Op.4dca31.10 -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.b76 -// CHECK:STDOUT: %.loc148_5.7 => constants.%.043 -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.2 -// CHECK:STDOUT: %impl.elem0.loc148_5.2 => constants.%Int32.Op.4dca31.1 -// CHECK:STDOUT: %specific_impl_fn.loc148_5.4 => constants.%Int32.Op.4dca31.1 +// CHECK:STDOUT: %impl.elem1.loc148_5.2 => constants.%Int16.Op.4dca31.9 +// CHECK:STDOUT: %specific_impl_fn.loc148_5.3 => constants.%Int16.Op.4dca31.9 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.3e9 +// CHECK:STDOUT: %.loc148_5.7 => constants.%.57b +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.1bfa2a.2 +// CHECK:STDOUT: %impl.elem2.loc148_5.2 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %specific_impl_fn.loc148_5.4 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @DivWith.loc157(constants.%Destroy.facet.099, constants.%Destroy.facet.099, constants.%facet_value.38c) { +// CHECK:STDOUT: specific @DivWith.loc157(constants.%Destroy.facet.84d, constants.%Destroy.facet.84d, constants.%facet_value.0ee56) { // CHECK:STDOUT: %Result.patt.loc154_9.2 => constants.%Result.patt -// CHECK:STDOUT: %Result.loc154_9.1 => constants.%Destroy.facet.099 +// CHECK:STDOUT: %Result.loc154_9.1 => constants.%Destroy.facet.84d // CHECK:STDOUT: %U.patt.loc155_4.2 => constants.%U.patt.7a2 -// CHECK:STDOUT: %U.loc155_4.1 => constants.%Destroy.facet.099 +// CHECK:STDOUT: %U.loc155_4.1 => constants.%Destroy.facet.84d // CHECK:STDOUT: %U.as_type.loc156_35.1 => constants.%Int32 // CHECK:STDOUT: %DivWith.type.loc156_35.1 => constants.%DivWith.type.fb1 // CHECK:STDOUT: %facet_type.loc156_19 => constants.%facet_type.d41 @@ -2917,7 +2933,7 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %facet_type.loc156_37 => constants.%facet_type.1a8 // CHECK:STDOUT: %pattern_type.loc156 => constants.%pattern_type.761 // CHECK:STDOUT: %T.patt.loc156_4.2 => constants.%T.patt.f94 -// CHECK:STDOUT: %T.loc156_4.1 => constants.%facet_value.38c +// CHECK:STDOUT: %T.loc156_4.1 => constants.%facet_value.0ee56 // CHECK:STDOUT: %pattern_type.loc157_16 => constants.%pattern_type.8b4 // CHECK:STDOUT: %result.param_patt.loc157_16.2 => constants.%result.param_patt.e81 // CHECK:STDOUT: %result.patt.loc157_16.2 => constants.%result.patt.47f @@ -2939,20 +2955,20 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %DivWith.facet => constants.%DivWith.facet.3bd // CHECK:STDOUT: %DivWith.WithSelf.Op.type => constants.%DivWith.WithSelf.Op.type.500 // CHECK:STDOUT: %.loc159_5.6 => constants.%.ebc -// CHECK:STDOUT: %impl.elem1.loc159_5.2 => constants.%Int16.Op.4dca31.11 -// CHECK:STDOUT: %specific_impl_fn.loc159_5.3 => constants.%Int16.Op.4dca31.11 -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.b76 -// CHECK:STDOUT: %.loc159_5.7 => constants.%.043 -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.2 -// CHECK:STDOUT: %impl.elem0.loc159_5.2 => constants.%Int32.Op.4dca31.1 -// CHECK:STDOUT: %specific_impl_fn.loc159_5.4 => constants.%Int32.Op.4dca31.1 +// CHECK:STDOUT: %impl.elem1.loc159_5.2 => constants.%Int16.Op.4dca31.10 +// CHECK:STDOUT: %specific_impl_fn.loc159_5.3 => constants.%Int16.Op.4dca31.10 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.3e9 +// CHECK:STDOUT: %.loc159_5.7 => constants.%.57b +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.1bfa2a.2 +// CHECK:STDOUT: %impl.elem2.loc159_5.2 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %specific_impl_fn.loc159_5.4 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ModWith.loc168(constants.%Destroy.facet.099, constants.%Destroy.facet.099, constants.%facet_value.68d) { +// CHECK:STDOUT: specific @ModWith.loc168(constants.%Destroy.facet.84d, constants.%Destroy.facet.84d, constants.%facet_value.d41) { // CHECK:STDOUT: %Result.patt.loc165_9.2 => constants.%Result.patt -// CHECK:STDOUT: %Result.loc165_9.1 => constants.%Destroy.facet.099 +// CHECK:STDOUT: %Result.loc165_9.1 => constants.%Destroy.facet.84d // CHECK:STDOUT: %U.patt.loc166_4.2 => constants.%U.patt.7a2 -// CHECK:STDOUT: %U.loc166_4.1 => constants.%Destroy.facet.099 +// CHECK:STDOUT: %U.loc166_4.1 => constants.%Destroy.facet.84d // CHECK:STDOUT: %U.as_type.loc167_35.1 => constants.%Int32 // CHECK:STDOUT: %ModWith.type.loc167_35.1 => constants.%ModWith.type.253 // CHECK:STDOUT: %facet_type.loc167_19 => constants.%facet_type.ea8 @@ -2970,7 +2986,7 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %facet_type.loc167_37 => constants.%facet_type.c8c // CHECK:STDOUT: %pattern_type.loc167 => constants.%pattern_type.c9a // CHECK:STDOUT: %T.patt.loc167_4.2 => constants.%T.patt.b4d -// CHECK:STDOUT: %T.loc167_4.1 => constants.%facet_value.68d +// CHECK:STDOUT: %T.loc167_4.1 => constants.%facet_value.d41 // CHECK:STDOUT: %pattern_type.loc168_16 => constants.%pattern_type.8b4 // CHECK:STDOUT: %result.param_patt.loc168_16.2 => constants.%result.param_patt.e81 // CHECK:STDOUT: %result.patt.loc168_16.2 => constants.%result.patt.47f @@ -2992,20 +3008,20 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %ModWith.facet => constants.%ModWith.facet.a29 // CHECK:STDOUT: %ModWith.WithSelf.Op.type => constants.%ModWith.WithSelf.Op.type.d03 // CHECK:STDOUT: %.loc170_5.6 => constants.%.839 -// CHECK:STDOUT: %impl.elem1.loc170_5.2 => constants.%Int16.Op.4dca31.12 -// CHECK:STDOUT: %specific_impl_fn.loc170_5.3 => constants.%Int16.Op.4dca31.12 -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.b76 -// CHECK:STDOUT: %.loc170_5.7 => constants.%.043 -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.2 -// CHECK:STDOUT: %impl.elem0.loc170_5.2 => constants.%Int32.Op.4dca31.1 -// CHECK:STDOUT: %specific_impl_fn.loc170_5.4 => constants.%Int32.Op.4dca31.1 +// CHECK:STDOUT: %impl.elem1.loc170_5.2 => constants.%Int16.Op.4dca31.11 +// CHECK:STDOUT: %specific_impl_fn.loc170_5.3 => constants.%Int16.Op.4dca31.11 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.3e9 +// CHECK:STDOUT: %.loc170_5.7 => constants.%.57b +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.1bfa2a.2 +// CHECK:STDOUT: %impl.elem2.loc170_5.2 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %specific_impl_fn.loc170_5.4 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @AddWith.loc124(constants.%Destroy.facet.099, constants.%Destroy.facet.2cc, constants.%facet_value.6ea) { +// CHECK:STDOUT: specific @AddWith.loc124(constants.%Destroy.facet.84d, constants.%Destroy.facet.f58, constants.%facet_value.169) { // CHECK:STDOUT: %Result.patt.loc121_9.2 => constants.%Result.patt -// CHECK:STDOUT: %Result.loc121_9.1 => constants.%Destroy.facet.099 +// CHECK:STDOUT: %Result.loc121_9.1 => constants.%Destroy.facet.84d // CHECK:STDOUT: %U.patt.loc122_4.2 => constants.%U.patt.7a2 -// CHECK:STDOUT: %U.loc122_4.1 => constants.%Destroy.facet.2cc +// CHECK:STDOUT: %U.loc122_4.1 => constants.%Destroy.facet.f58 // CHECK:STDOUT: %U.as_type.loc123_35.1 => constants.%Int16 // CHECK:STDOUT: %AddWith.type.loc123_35.1 => constants.%AddWith.type.b62 // CHECK:STDOUT: %facet_type.loc123_19 => constants.%facet_type.297 @@ -3023,7 +3039,7 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %facet_type.loc123_37 => constants.%facet_type.37e // CHECK:STDOUT: %pattern_type.loc123 => constants.%pattern_type.363 // CHECK:STDOUT: %T.patt.loc123_4.2 => constants.%T.patt.ccd -// CHECK:STDOUT: %T.loc123_4.1 => constants.%facet_value.6ea +// CHECK:STDOUT: %T.loc123_4.1 => constants.%facet_value.169 // CHECK:STDOUT: %pattern_type.loc124_16 => constants.%pattern_type.8b4 // CHECK:STDOUT: %result.param_patt.loc124_16.2 => constants.%result.param_patt.e81 // CHECK:STDOUT: %result.patt.loc124_16.2 => constants.%result.patt.47f @@ -3045,20 +3061,20 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %AddWith.facet => constants.%AddWith.facet.35b // CHECK:STDOUT: %AddWith.WithSelf.Op.type => constants.%AddWith.WithSelf.Op.type.29e // CHECK:STDOUT: %.loc126_5.6 => constants.%.45e -// CHECK:STDOUT: %impl.elem1.loc126_5.2 => constants.%Int32.Op.4dca31.2 -// CHECK:STDOUT: %specific_impl_fn.loc126_5.3 => constants.%Int32.Op.4dca31.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.b76 -// CHECK:STDOUT: %.loc126_5.7 => constants.%.043 -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.2 -// CHECK:STDOUT: %impl.elem0.loc126_5.2 => constants.%Int32.Op.4dca31.1 -// CHECK:STDOUT: %specific_impl_fn.loc126_5.4 => constants.%Int32.Op.4dca31.1 +// CHECK:STDOUT: %impl.elem1.loc126_5.2 => constants.%Int32.Op.4dca31.1 +// CHECK:STDOUT: %specific_impl_fn.loc126_5.3 => constants.%Int32.Op.4dca31.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.3e9 +// CHECK:STDOUT: %.loc126_5.7 => constants.%.57b +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.1bfa2a.2 +// CHECK:STDOUT: %impl.elem2.loc126_5.2 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %specific_impl_fn.loc126_5.4 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @SubWith.loc135(constants.%Destroy.facet.099, constants.%Destroy.facet.2cc, constants.%facet_value.bcc) { +// CHECK:STDOUT: specific @SubWith.loc135(constants.%Destroy.facet.84d, constants.%Destroy.facet.f58, constants.%facet_value.ddb) { // CHECK:STDOUT: %Result.patt.loc132_9.2 => constants.%Result.patt -// CHECK:STDOUT: %Result.loc132_9.1 => constants.%Destroy.facet.099 +// CHECK:STDOUT: %Result.loc132_9.1 => constants.%Destroy.facet.84d // CHECK:STDOUT: %U.patt.loc133_4.2 => constants.%U.patt.7a2 -// CHECK:STDOUT: %U.loc133_4.1 => constants.%Destroy.facet.2cc +// CHECK:STDOUT: %U.loc133_4.1 => constants.%Destroy.facet.f58 // CHECK:STDOUT: %U.as_type.loc134_35.1 => constants.%Int16 // CHECK:STDOUT: %SubWith.type.loc134_35.1 => constants.%SubWith.type.b12 // CHECK:STDOUT: %facet_type.loc134_19 => constants.%facet_type.b15 @@ -3076,7 +3092,7 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %facet_type.loc134_37 => constants.%facet_type.983 // CHECK:STDOUT: %pattern_type.loc134 => constants.%pattern_type.af3 // CHECK:STDOUT: %T.patt.loc134_4.2 => constants.%T.patt.14c -// CHECK:STDOUT: %T.loc134_4.1 => constants.%facet_value.bcc +// CHECK:STDOUT: %T.loc134_4.1 => constants.%facet_value.ddb // CHECK:STDOUT: %pattern_type.loc135_16 => constants.%pattern_type.8b4 // CHECK:STDOUT: %result.param_patt.loc135_16.2 => constants.%result.param_patt.e81 // CHECK:STDOUT: %result.patt.loc135_16.2 => constants.%result.patt.47f @@ -3098,20 +3114,20 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %SubWith.facet => constants.%SubWith.facet.8da // CHECK:STDOUT: %SubWith.WithSelf.Op.type => constants.%SubWith.WithSelf.Op.type.85b // CHECK:STDOUT: %.loc137_5.6 => constants.%.db9 -// CHECK:STDOUT: %impl.elem1.loc137_5.2 => constants.%Int32.Op.4dca31.3 -// CHECK:STDOUT: %specific_impl_fn.loc137_5.3 => constants.%Int32.Op.4dca31.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.b76 -// CHECK:STDOUT: %.loc137_5.7 => constants.%.043 -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.2 -// CHECK:STDOUT: %impl.elem0.loc137_5.2 => constants.%Int32.Op.4dca31.1 -// CHECK:STDOUT: %specific_impl_fn.loc137_5.4 => constants.%Int32.Op.4dca31.1 +// CHECK:STDOUT: %impl.elem1.loc137_5.2 => constants.%Int32.Op.4dca31.2 +// CHECK:STDOUT: %specific_impl_fn.loc137_5.3 => constants.%Int32.Op.4dca31.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.3e9 +// CHECK:STDOUT: %.loc137_5.7 => constants.%.57b +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.1bfa2a.2 +// CHECK:STDOUT: %impl.elem2.loc137_5.2 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %specific_impl_fn.loc137_5.4 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @MulWith.loc146(constants.%Destroy.facet.099, constants.%Destroy.facet.2cc, constants.%facet_value.795) { +// CHECK:STDOUT: specific @MulWith.loc146(constants.%Destroy.facet.84d, constants.%Destroy.facet.f58, constants.%facet_value.ae7) { // CHECK:STDOUT: %Result.patt.loc143_9.2 => constants.%Result.patt -// CHECK:STDOUT: %Result.loc143_9.1 => constants.%Destroy.facet.099 +// CHECK:STDOUT: %Result.loc143_9.1 => constants.%Destroy.facet.84d // CHECK:STDOUT: %U.patt.loc144_4.2 => constants.%U.patt.7a2 -// CHECK:STDOUT: %U.loc144_4.1 => constants.%Destroy.facet.2cc +// CHECK:STDOUT: %U.loc144_4.1 => constants.%Destroy.facet.f58 // CHECK:STDOUT: %U.as_type.loc145_35.1 => constants.%Int16 // CHECK:STDOUT: %MulWith.type.loc145_35.1 => constants.%MulWith.type.c18 // CHECK:STDOUT: %facet_type.loc145_19 => constants.%facet_type.a64 @@ -3129,7 +3145,7 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %facet_type.loc145_37 => constants.%facet_type.f48 // CHECK:STDOUT: %pattern_type.loc145 => constants.%pattern_type.02f // CHECK:STDOUT: %T.patt.loc145_4.2 => constants.%T.patt.a9e -// CHECK:STDOUT: %T.loc145_4.1 => constants.%facet_value.795 +// CHECK:STDOUT: %T.loc145_4.1 => constants.%facet_value.ae7 // CHECK:STDOUT: %pattern_type.loc146_16 => constants.%pattern_type.8b4 // CHECK:STDOUT: %result.param_patt.loc146_16.2 => constants.%result.param_patt.e81 // CHECK:STDOUT: %result.patt.loc146_16.2 => constants.%result.patt.47f @@ -3151,20 +3167,20 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %MulWith.facet => constants.%MulWith.facet.920 // CHECK:STDOUT: %MulWith.WithSelf.Op.type => constants.%MulWith.WithSelf.Op.type.545 // CHECK:STDOUT: %.loc148_5.6 => constants.%.c5e -// CHECK:STDOUT: %impl.elem1.loc148_5.2 => constants.%Int32.Op.4dca31.4 -// CHECK:STDOUT: %specific_impl_fn.loc148_5.3 => constants.%Int32.Op.4dca31.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.b76 -// CHECK:STDOUT: %.loc148_5.7 => constants.%.043 -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.2 -// CHECK:STDOUT: %impl.elem0.loc148_5.2 => constants.%Int32.Op.4dca31.1 -// CHECK:STDOUT: %specific_impl_fn.loc148_5.4 => constants.%Int32.Op.4dca31.1 +// CHECK:STDOUT: %impl.elem1.loc148_5.2 => constants.%Int32.Op.4dca31.3 +// CHECK:STDOUT: %specific_impl_fn.loc148_5.3 => constants.%Int32.Op.4dca31.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.3e9 +// CHECK:STDOUT: %.loc148_5.7 => constants.%.57b +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.1bfa2a.2 +// CHECK:STDOUT: %impl.elem2.loc148_5.2 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %specific_impl_fn.loc148_5.4 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @DivWith.loc157(constants.%Destroy.facet.099, constants.%Destroy.facet.2cc, constants.%facet_value.c8d) { +// CHECK:STDOUT: specific @DivWith.loc157(constants.%Destroy.facet.84d, constants.%Destroy.facet.f58, constants.%facet_value.003) { // CHECK:STDOUT: %Result.patt.loc154_9.2 => constants.%Result.patt -// CHECK:STDOUT: %Result.loc154_9.1 => constants.%Destroy.facet.099 +// CHECK:STDOUT: %Result.loc154_9.1 => constants.%Destroy.facet.84d // CHECK:STDOUT: %U.patt.loc155_4.2 => constants.%U.patt.7a2 -// CHECK:STDOUT: %U.loc155_4.1 => constants.%Destroy.facet.2cc +// CHECK:STDOUT: %U.loc155_4.1 => constants.%Destroy.facet.f58 // CHECK:STDOUT: %U.as_type.loc156_35.1 => constants.%Int16 // CHECK:STDOUT: %DivWith.type.loc156_35.1 => constants.%DivWith.type.6f9 // CHECK:STDOUT: %facet_type.loc156_19 => constants.%facet_type.0b4 @@ -3182,7 +3198,7 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %facet_type.loc156_37 => constants.%facet_type.50d // CHECK:STDOUT: %pattern_type.loc156 => constants.%pattern_type.9af // CHECK:STDOUT: %T.patt.loc156_4.2 => constants.%T.patt.dfa -// CHECK:STDOUT: %T.loc156_4.1 => constants.%facet_value.c8d +// CHECK:STDOUT: %T.loc156_4.1 => constants.%facet_value.003 // CHECK:STDOUT: %pattern_type.loc157_16 => constants.%pattern_type.8b4 // CHECK:STDOUT: %result.param_patt.loc157_16.2 => constants.%result.param_patt.e81 // CHECK:STDOUT: %result.patt.loc157_16.2 => constants.%result.patt.47f @@ -3204,20 +3220,20 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %DivWith.facet => constants.%DivWith.facet.c79 // CHECK:STDOUT: %DivWith.WithSelf.Op.type => constants.%DivWith.WithSelf.Op.type.a6b // CHECK:STDOUT: %.loc159_5.6 => constants.%.558 -// CHECK:STDOUT: %impl.elem1.loc159_5.2 => constants.%Int32.Op.4dca31.5 -// CHECK:STDOUT: %specific_impl_fn.loc159_5.3 => constants.%Int32.Op.4dca31.5 -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.b76 -// CHECK:STDOUT: %.loc159_5.7 => constants.%.043 -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.2 -// CHECK:STDOUT: %impl.elem0.loc159_5.2 => constants.%Int32.Op.4dca31.1 -// CHECK:STDOUT: %specific_impl_fn.loc159_5.4 => constants.%Int32.Op.4dca31.1 +// CHECK:STDOUT: %impl.elem1.loc159_5.2 => constants.%Int32.Op.4dca31.4 +// CHECK:STDOUT: %specific_impl_fn.loc159_5.3 => constants.%Int32.Op.4dca31.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.3e9 +// CHECK:STDOUT: %.loc159_5.7 => constants.%.57b +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.1bfa2a.2 +// CHECK:STDOUT: %impl.elem2.loc159_5.2 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %specific_impl_fn.loc159_5.4 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ModWith.loc168(constants.%Destroy.facet.099, constants.%Destroy.facet.2cc, constants.%facet_value.da8) { +// CHECK:STDOUT: specific @ModWith.loc168(constants.%Destroy.facet.84d, constants.%Destroy.facet.f58, constants.%facet_value.af1) { // CHECK:STDOUT: %Result.patt.loc165_9.2 => constants.%Result.patt -// CHECK:STDOUT: %Result.loc165_9.1 => constants.%Destroy.facet.099 +// CHECK:STDOUT: %Result.loc165_9.1 => constants.%Destroy.facet.84d // CHECK:STDOUT: %U.patt.loc166_4.2 => constants.%U.patt.7a2 -// CHECK:STDOUT: %U.loc166_4.1 => constants.%Destroy.facet.2cc +// CHECK:STDOUT: %U.loc166_4.1 => constants.%Destroy.facet.f58 // CHECK:STDOUT: %U.as_type.loc167_35.1 => constants.%Int16 // CHECK:STDOUT: %ModWith.type.loc167_35.1 => constants.%ModWith.type.763 // CHECK:STDOUT: %facet_type.loc167_19 => constants.%facet_type.ee8 @@ -3235,7 +3251,7 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %facet_type.loc167_37 => constants.%facet_type.b37 // CHECK:STDOUT: %pattern_type.loc167 => constants.%pattern_type.448 // CHECK:STDOUT: %T.patt.loc167_4.2 => constants.%T.patt.528 -// CHECK:STDOUT: %T.loc167_4.1 => constants.%facet_value.da8 +// CHECK:STDOUT: %T.loc167_4.1 => constants.%facet_value.af1 // CHECK:STDOUT: %pattern_type.loc168_16 => constants.%pattern_type.8b4 // CHECK:STDOUT: %result.param_patt.loc168_16.2 => constants.%result.param_patt.e81 // CHECK:STDOUT: %result.patt.loc168_16.2 => constants.%result.patt.47f @@ -3257,20 +3273,20 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %ModWith.facet => constants.%ModWith.facet.bef // CHECK:STDOUT: %ModWith.WithSelf.Op.type => constants.%ModWith.WithSelf.Op.type.d54 // CHECK:STDOUT: %.loc170_5.6 => constants.%.8c0 -// CHECK:STDOUT: %impl.elem1.loc170_5.2 => constants.%Int32.Op.4dca31.6 -// CHECK:STDOUT: %specific_impl_fn.loc170_5.3 => constants.%Int32.Op.4dca31.6 -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.b76 -// CHECK:STDOUT: %.loc170_5.7 => constants.%.043 -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.2 -// CHECK:STDOUT: %impl.elem0.loc170_5.2 => constants.%Int32.Op.4dca31.1 -// CHECK:STDOUT: %specific_impl_fn.loc170_5.4 => constants.%Int32.Op.4dca31.1 +// CHECK:STDOUT: %impl.elem1.loc170_5.2 => constants.%Int32.Op.4dca31.5 +// CHECK:STDOUT: %specific_impl_fn.loc170_5.3 => constants.%Int32.Op.4dca31.5 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.3e9 +// CHECK:STDOUT: %.loc170_5.7 => constants.%.57b +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.1bfa2a.2 +// CHECK:STDOUT: %impl.elem2.loc170_5.2 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %specific_impl_fn.loc170_5.4 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @AddWith.loc124(constants.%Destroy.facet.099, constants.%Destroy.facet.099, constants.%facet_value.f1a) { +// CHECK:STDOUT: specific @AddWith.loc124(constants.%Destroy.facet.84d, constants.%Destroy.facet.84d, constants.%facet_value.c2c) { // CHECK:STDOUT: %Result.patt.loc121_9.2 => constants.%Result.patt -// CHECK:STDOUT: %Result.loc121_9.1 => constants.%Destroy.facet.099 +// CHECK:STDOUT: %Result.loc121_9.1 => constants.%Destroy.facet.84d // CHECK:STDOUT: %U.patt.loc122_4.2 => constants.%U.patt.7a2 -// CHECK:STDOUT: %U.loc122_4.1 => constants.%Destroy.facet.099 +// CHECK:STDOUT: %U.loc122_4.1 => constants.%Destroy.facet.84d // CHECK:STDOUT: %U.as_type.loc123_35.1 => constants.%Int32 // CHECK:STDOUT: %AddWith.type.loc123_35.1 => constants.%AddWith.type.c71 // CHECK:STDOUT: %facet_type.loc123_19 => constants.%facet_type.698 @@ -3288,7 +3304,7 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %facet_type.loc123_37 => constants.%facet_type.ecf // CHECK:STDOUT: %pattern_type.loc123 => constants.%pattern_type.c976 // CHECK:STDOUT: %T.patt.loc123_4.2 => constants.%T.patt.0a8 -// CHECK:STDOUT: %T.loc123_4.1 => constants.%facet_value.f1a +// CHECK:STDOUT: %T.loc123_4.1 => constants.%facet_value.c2c // CHECK:STDOUT: %pattern_type.loc124_16 => constants.%pattern_type.8b4 // CHECK:STDOUT: %result.param_patt.loc124_16.2 => constants.%result.param_patt.e81 // CHECK:STDOUT: %result.patt.loc124_16.2 => constants.%result.patt.47f @@ -3310,20 +3326,20 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %AddWith.facet => constants.%AddWith.facet.ee1 // CHECK:STDOUT: %AddWith.WithSelf.Op.type => constants.%AddWith.WithSelf.Op.type.5a5 // CHECK:STDOUT: %.loc126_5.6 => constants.%.dcb -// CHECK:STDOUT: %impl.elem1.loc126_5.2 => constants.%Int32.Op.4dca31.7 -// CHECK:STDOUT: %specific_impl_fn.loc126_5.3 => constants.%Int32.Op.4dca31.7 -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.b76 -// CHECK:STDOUT: %.loc126_5.7 => constants.%.043 -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.2 -// CHECK:STDOUT: %impl.elem0.loc126_5.2 => constants.%Int32.Op.4dca31.1 -// CHECK:STDOUT: %specific_impl_fn.loc126_5.4 => constants.%Int32.Op.4dca31.1 +// CHECK:STDOUT: %impl.elem1.loc126_5.2 => constants.%Int32.Op.4dca31.6 +// CHECK:STDOUT: %specific_impl_fn.loc126_5.3 => constants.%Int32.Op.4dca31.6 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.3e9 +// CHECK:STDOUT: %.loc126_5.7 => constants.%.57b +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.1bfa2a.2 +// CHECK:STDOUT: %impl.elem2.loc126_5.2 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %specific_impl_fn.loc126_5.4 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @SubWith.loc135(constants.%Destroy.facet.099, constants.%Destroy.facet.099, constants.%facet_value.6fc) { +// CHECK:STDOUT: specific @SubWith.loc135(constants.%Destroy.facet.84d, constants.%Destroy.facet.84d, constants.%facet_value.7a2) { // CHECK:STDOUT: %Result.patt.loc132_9.2 => constants.%Result.patt -// CHECK:STDOUT: %Result.loc132_9.1 => constants.%Destroy.facet.099 +// CHECK:STDOUT: %Result.loc132_9.1 => constants.%Destroy.facet.84d // CHECK:STDOUT: %U.patt.loc133_4.2 => constants.%U.patt.7a2 -// CHECK:STDOUT: %U.loc133_4.1 => constants.%Destroy.facet.099 +// CHECK:STDOUT: %U.loc133_4.1 => constants.%Destroy.facet.84d // CHECK:STDOUT: %U.as_type.loc134_35.1 => constants.%Int32 // CHECK:STDOUT: %SubWith.type.loc134_35.1 => constants.%SubWith.type.c81 // CHECK:STDOUT: %facet_type.loc134_19 => constants.%facet_type.44e @@ -3341,7 +3357,7 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %facet_type.loc134_37 => constants.%facet_type.630 // CHECK:STDOUT: %pattern_type.loc134 => constants.%pattern_type.c58 // CHECK:STDOUT: %T.patt.loc134_4.2 => constants.%T.patt.315 -// CHECK:STDOUT: %T.loc134_4.1 => constants.%facet_value.6fc +// CHECK:STDOUT: %T.loc134_4.1 => constants.%facet_value.7a2 // CHECK:STDOUT: %pattern_type.loc135_16 => constants.%pattern_type.8b4 // CHECK:STDOUT: %result.param_patt.loc135_16.2 => constants.%result.param_patt.e81 // CHECK:STDOUT: %result.patt.loc135_16.2 => constants.%result.patt.47f @@ -3363,20 +3379,20 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %SubWith.facet => constants.%SubWith.facet.3dd // CHECK:STDOUT: %SubWith.WithSelf.Op.type => constants.%SubWith.WithSelf.Op.type.ccc // CHECK:STDOUT: %.loc137_5.6 => constants.%.237 -// CHECK:STDOUT: %impl.elem1.loc137_5.2 => constants.%Int32.Op.4dca31.8 -// CHECK:STDOUT: %specific_impl_fn.loc137_5.3 => constants.%Int32.Op.4dca31.8 -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.b76 -// CHECK:STDOUT: %.loc137_5.7 => constants.%.043 -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.2 -// CHECK:STDOUT: %impl.elem0.loc137_5.2 => constants.%Int32.Op.4dca31.1 -// CHECK:STDOUT: %specific_impl_fn.loc137_5.4 => constants.%Int32.Op.4dca31.1 +// CHECK:STDOUT: %impl.elem1.loc137_5.2 => constants.%Int32.Op.4dca31.7 +// CHECK:STDOUT: %specific_impl_fn.loc137_5.3 => constants.%Int32.Op.4dca31.7 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.3e9 +// CHECK:STDOUT: %.loc137_5.7 => constants.%.57b +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.1bfa2a.2 +// CHECK:STDOUT: %impl.elem2.loc137_5.2 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %specific_impl_fn.loc137_5.4 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @MulWith.loc146(constants.%Destroy.facet.099, constants.%Destroy.facet.099, constants.%facet_value.c80) { +// CHECK:STDOUT: specific @MulWith.loc146(constants.%Destroy.facet.84d, constants.%Destroy.facet.84d, constants.%facet_value.84e) { // CHECK:STDOUT: %Result.patt.loc143_9.2 => constants.%Result.patt -// CHECK:STDOUT: %Result.loc143_9.1 => constants.%Destroy.facet.099 +// CHECK:STDOUT: %Result.loc143_9.1 => constants.%Destroy.facet.84d // CHECK:STDOUT: %U.patt.loc144_4.2 => constants.%U.patt.7a2 -// CHECK:STDOUT: %U.loc144_4.1 => constants.%Destroy.facet.099 +// CHECK:STDOUT: %U.loc144_4.1 => constants.%Destroy.facet.84d // CHECK:STDOUT: %U.as_type.loc145_35.1 => constants.%Int32 // CHECK:STDOUT: %MulWith.type.loc145_35.1 => constants.%MulWith.type.eeb // CHECK:STDOUT: %facet_type.loc145_19 => constants.%facet_type.ff6 @@ -3394,7 +3410,7 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %facet_type.loc145_37 => constants.%facet_type.26b // CHECK:STDOUT: %pattern_type.loc145 => constants.%pattern_type.354 // CHECK:STDOUT: %T.patt.loc145_4.2 => constants.%T.patt.4b7 -// CHECK:STDOUT: %T.loc145_4.1 => constants.%facet_value.c80 +// CHECK:STDOUT: %T.loc145_4.1 => constants.%facet_value.84e // CHECK:STDOUT: %pattern_type.loc146_16 => constants.%pattern_type.8b4 // CHECK:STDOUT: %result.param_patt.loc146_16.2 => constants.%result.param_patt.e81 // CHECK:STDOUT: %result.patt.loc146_16.2 => constants.%result.patt.47f @@ -3416,20 +3432,20 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %MulWith.facet => constants.%MulWith.facet.4d3 // CHECK:STDOUT: %MulWith.WithSelf.Op.type => constants.%MulWith.WithSelf.Op.type.843 // CHECK:STDOUT: %.loc148_5.6 => constants.%.8c9 -// CHECK:STDOUT: %impl.elem1.loc148_5.2 => constants.%Int32.Op.4dca31.9 -// CHECK:STDOUT: %specific_impl_fn.loc148_5.3 => constants.%Int32.Op.4dca31.9 -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.b76 -// CHECK:STDOUT: %.loc148_5.7 => constants.%.043 -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.2 -// CHECK:STDOUT: %impl.elem0.loc148_5.2 => constants.%Int32.Op.4dca31.1 -// CHECK:STDOUT: %specific_impl_fn.loc148_5.4 => constants.%Int32.Op.4dca31.1 +// CHECK:STDOUT: %impl.elem1.loc148_5.2 => constants.%Int32.Op.4dca31.8 +// CHECK:STDOUT: %specific_impl_fn.loc148_5.3 => constants.%Int32.Op.4dca31.8 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.3e9 +// CHECK:STDOUT: %.loc148_5.7 => constants.%.57b +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.1bfa2a.2 +// CHECK:STDOUT: %impl.elem2.loc148_5.2 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %specific_impl_fn.loc148_5.4 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @DivWith.loc157(constants.%Destroy.facet.099, constants.%Destroy.facet.099, constants.%facet_value.b2c) { +// CHECK:STDOUT: specific @DivWith.loc157(constants.%Destroy.facet.84d, constants.%Destroy.facet.84d, constants.%facet_value.0bf) { // CHECK:STDOUT: %Result.patt.loc154_9.2 => constants.%Result.patt -// CHECK:STDOUT: %Result.loc154_9.1 => constants.%Destroy.facet.099 +// CHECK:STDOUT: %Result.loc154_9.1 => constants.%Destroy.facet.84d // CHECK:STDOUT: %U.patt.loc155_4.2 => constants.%U.patt.7a2 -// CHECK:STDOUT: %U.loc155_4.1 => constants.%Destroy.facet.099 +// CHECK:STDOUT: %U.loc155_4.1 => constants.%Destroy.facet.84d // CHECK:STDOUT: %U.as_type.loc156_35.1 => constants.%Int32 // CHECK:STDOUT: %DivWith.type.loc156_35.1 => constants.%DivWith.type.fb1 // CHECK:STDOUT: %facet_type.loc156_19 => constants.%facet_type.d41 @@ -3447,7 +3463,7 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %facet_type.loc156_37 => constants.%facet_type.1a8 // CHECK:STDOUT: %pattern_type.loc156 => constants.%pattern_type.761 // CHECK:STDOUT: %T.patt.loc156_4.2 => constants.%T.patt.f94 -// CHECK:STDOUT: %T.loc156_4.1 => constants.%facet_value.b2c +// CHECK:STDOUT: %T.loc156_4.1 => constants.%facet_value.0bf // CHECK:STDOUT: %pattern_type.loc157_16 => constants.%pattern_type.8b4 // CHECK:STDOUT: %result.param_patt.loc157_16.2 => constants.%result.param_patt.e81 // CHECK:STDOUT: %result.patt.loc157_16.2 => constants.%result.patt.47f @@ -3469,20 +3485,20 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %DivWith.facet => constants.%DivWith.facet.4fe // CHECK:STDOUT: %DivWith.WithSelf.Op.type => constants.%DivWith.WithSelf.Op.type.24e // CHECK:STDOUT: %.loc159_5.6 => constants.%.450 -// CHECK:STDOUT: %impl.elem1.loc159_5.2 => constants.%Int32.Op.4dca31.10 -// CHECK:STDOUT: %specific_impl_fn.loc159_5.3 => constants.%Int32.Op.4dca31.10 -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.b76 -// CHECK:STDOUT: %.loc159_5.7 => constants.%.043 -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.2 -// CHECK:STDOUT: %impl.elem0.loc159_5.2 => constants.%Int32.Op.4dca31.1 -// CHECK:STDOUT: %specific_impl_fn.loc159_5.4 => constants.%Int32.Op.4dca31.1 +// CHECK:STDOUT: %impl.elem1.loc159_5.2 => constants.%Int32.Op.4dca31.9 +// CHECK:STDOUT: %specific_impl_fn.loc159_5.3 => constants.%Int32.Op.4dca31.9 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.3e9 +// CHECK:STDOUT: %.loc159_5.7 => constants.%.57b +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.1bfa2a.2 +// CHECK:STDOUT: %impl.elem2.loc159_5.2 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %specific_impl_fn.loc159_5.4 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ModWith.loc168(constants.%Destroy.facet.099, constants.%Destroy.facet.099, constants.%facet_value.7ec) { +// CHECK:STDOUT: specific @ModWith.loc168(constants.%Destroy.facet.84d, constants.%Destroy.facet.84d, constants.%facet_value.105) { // CHECK:STDOUT: %Result.patt.loc165_9.2 => constants.%Result.patt -// CHECK:STDOUT: %Result.loc165_9.1 => constants.%Destroy.facet.099 +// CHECK:STDOUT: %Result.loc165_9.1 => constants.%Destroy.facet.84d // CHECK:STDOUT: %U.patt.loc166_4.2 => constants.%U.patt.7a2 -// CHECK:STDOUT: %U.loc166_4.1 => constants.%Destroy.facet.099 +// CHECK:STDOUT: %U.loc166_4.1 => constants.%Destroy.facet.84d // CHECK:STDOUT: %U.as_type.loc167_35.1 => constants.%Int32 // CHECK:STDOUT: %ModWith.type.loc167_35.1 => constants.%ModWith.type.253 // CHECK:STDOUT: %facet_type.loc167_19 => constants.%facet_type.ea8 @@ -3500,7 +3516,7 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %facet_type.loc167_37 => constants.%facet_type.c8c // CHECK:STDOUT: %pattern_type.loc167 => constants.%pattern_type.c9a // CHECK:STDOUT: %T.patt.loc167_4.2 => constants.%T.patt.b4d -// CHECK:STDOUT: %T.loc167_4.1 => constants.%facet_value.7ec +// CHECK:STDOUT: %T.loc167_4.1 => constants.%facet_value.105 // CHECK:STDOUT: %pattern_type.loc168_16 => constants.%pattern_type.8b4 // CHECK:STDOUT: %result.param_patt.loc168_16.2 => constants.%result.param_patt.e81 // CHECK:STDOUT: %result.patt.loc168_16.2 => constants.%result.patt.47f @@ -3522,20 +3538,20 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %ModWith.facet => constants.%ModWith.facet.60c // CHECK:STDOUT: %ModWith.WithSelf.Op.type => constants.%ModWith.WithSelf.Op.type.bed // CHECK:STDOUT: %.loc170_5.6 => constants.%.382 -// CHECK:STDOUT: %impl.elem1.loc170_5.2 => constants.%Int32.Op.4dca31.11 -// CHECK:STDOUT: %specific_impl_fn.loc170_5.3 => constants.%Int32.Op.4dca31.11 -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.b76 -// CHECK:STDOUT: %.loc170_5.7 => constants.%.043 -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.2 -// CHECK:STDOUT: %impl.elem0.loc170_5.2 => constants.%Int32.Op.4dca31.1 -// CHECK:STDOUT: %specific_impl_fn.loc170_5.4 => constants.%Int32.Op.4dca31.1 +// CHECK:STDOUT: %impl.elem1.loc170_5.2 => constants.%Int32.Op.4dca31.10 +// CHECK:STDOUT: %specific_impl_fn.loc170_5.3 => constants.%Int32.Op.4dca31.10 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.3e9 +// CHECK:STDOUT: %.loc170_5.7 => constants.%.57b +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.1bfa2a.2 +// CHECK:STDOUT: %impl.elem2.loc170_5.2 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %specific_impl_fn.loc170_5.4 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @AddWith.loc124(constants.%Destroy.facet.191, constants.%Destroy.facet.191, constants.%facet_value.178) { +// CHECK:STDOUT: specific @AddWith.loc124(constants.%Destroy.facet.0b4, constants.%Destroy.facet.0b4, constants.%facet_value.c15) { // CHECK:STDOUT: %Result.patt.loc121_9.2 => constants.%Result.patt -// CHECK:STDOUT: %Result.loc121_9.1 => constants.%Destroy.facet.191 +// CHECK:STDOUT: %Result.loc121_9.1 => constants.%Destroy.facet.0b4 // CHECK:STDOUT: %U.patt.loc122_4.2 => constants.%U.patt.7a2 -// CHECK:STDOUT: %U.loc122_4.1 => constants.%Destroy.facet.191 +// CHECK:STDOUT: %U.loc122_4.1 => constants.%Destroy.facet.0b4 // CHECK:STDOUT: %U.as_type.loc123_35.1 => constants.%Int64 // CHECK:STDOUT: %AddWith.type.loc123_35.1 => constants.%AddWith.type.b5b // CHECK:STDOUT: %facet_type.loc123_19 => constants.%facet_type.afd1 @@ -3553,7 +3569,7 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %facet_type.loc123_37 => constants.%facet_type.522 // CHECK:STDOUT: %pattern_type.loc123 => constants.%pattern_type.613 // CHECK:STDOUT: %T.patt.loc123_4.2 => constants.%T.patt.f5c -// CHECK:STDOUT: %T.loc123_4.1 => constants.%facet_value.178 +// CHECK:STDOUT: %T.loc123_4.1 => constants.%facet_value.c15 // CHECK:STDOUT: %pattern_type.loc124_16 => constants.%pattern_type.4aa // CHECK:STDOUT: %result.param_patt.loc124_16.2 => constants.%result.param_patt.1e1 // CHECK:STDOUT: %result.patt.loc124_16.2 => constants.%result.patt.93b @@ -3577,18 +3593,18 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %.loc126_5.6 => constants.%.b22 // CHECK:STDOUT: %impl.elem1.loc126_5.2 => constants.%Op.72717c.6 // CHECK:STDOUT: %specific_impl_fn.loc126_5.3 => constants.%Op.72717c.6 -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.c2c -// CHECK:STDOUT: %.loc126_5.7 => constants.%.c2e -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.3 -// CHECK:STDOUT: %impl.elem0.loc126_5.2 => constants.%Int64.Op.4dca31.1 -// CHECK:STDOUT: %specific_impl_fn.loc126_5.4 => constants.%Int64.Op.4dca31.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.bd9 +// CHECK:STDOUT: %.loc126_5.7 => constants.%.9af +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.1bfa2a.3 +// CHECK:STDOUT: %impl.elem2.loc126_5.2 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 +// CHECK:STDOUT: %specific_impl_fn.loc126_5.4 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @SubWith.loc135(constants.%Destroy.facet.191, constants.%Destroy.facet.191, constants.%facet_value.c78) { +// CHECK:STDOUT: specific @SubWith.loc135(constants.%Destroy.facet.0b4, constants.%Destroy.facet.0b4, constants.%facet_value.31d) { // CHECK:STDOUT: %Result.patt.loc132_9.2 => constants.%Result.patt -// CHECK:STDOUT: %Result.loc132_9.1 => constants.%Destroy.facet.191 +// CHECK:STDOUT: %Result.loc132_9.1 => constants.%Destroy.facet.0b4 // CHECK:STDOUT: %U.patt.loc133_4.2 => constants.%U.patt.7a2 -// CHECK:STDOUT: %U.loc133_4.1 => constants.%Destroy.facet.191 +// CHECK:STDOUT: %U.loc133_4.1 => constants.%Destroy.facet.0b4 // CHECK:STDOUT: %U.as_type.loc134_35.1 => constants.%Int64 // CHECK:STDOUT: %SubWith.type.loc134_35.1 => constants.%SubWith.type.a46 // CHECK:STDOUT: %facet_type.loc134_19 => constants.%facet_type.502 @@ -3606,7 +3622,7 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %facet_type.loc134_37 => constants.%facet_type.e5e // CHECK:STDOUT: %pattern_type.loc134 => constants.%pattern_type.41a // CHECK:STDOUT: %T.patt.loc134_4.2 => constants.%T.patt.282 -// CHECK:STDOUT: %T.loc134_4.1 => constants.%facet_value.c78 +// CHECK:STDOUT: %T.loc134_4.1 => constants.%facet_value.31d // CHECK:STDOUT: %pattern_type.loc135_16 => constants.%pattern_type.4aa // CHECK:STDOUT: %result.param_patt.loc135_16.2 => constants.%result.param_patt.1e1 // CHECK:STDOUT: %result.patt.loc135_16.2 => constants.%result.patt.93b @@ -3630,18 +3646,18 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %.loc137_5.6 => constants.%.c3d // CHECK:STDOUT: %impl.elem1.loc137_5.2 => constants.%Op.72717c.7 // CHECK:STDOUT: %specific_impl_fn.loc137_5.3 => constants.%Op.72717c.7 -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.c2c -// CHECK:STDOUT: %.loc137_5.7 => constants.%.c2e -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.3 -// CHECK:STDOUT: %impl.elem0.loc137_5.2 => constants.%Int64.Op.4dca31.1 -// CHECK:STDOUT: %specific_impl_fn.loc137_5.4 => constants.%Int64.Op.4dca31.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.bd9 +// CHECK:STDOUT: %.loc137_5.7 => constants.%.9af +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.1bfa2a.3 +// CHECK:STDOUT: %impl.elem2.loc137_5.2 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 +// CHECK:STDOUT: %specific_impl_fn.loc137_5.4 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @MulWith.loc146(constants.%Destroy.facet.191, constants.%Destroy.facet.191, constants.%facet_value.34a) { +// CHECK:STDOUT: specific @MulWith.loc146(constants.%Destroy.facet.0b4, constants.%Destroy.facet.0b4, constants.%facet_value.c94) { // CHECK:STDOUT: %Result.patt.loc143_9.2 => constants.%Result.patt -// CHECK:STDOUT: %Result.loc143_9.1 => constants.%Destroy.facet.191 +// CHECK:STDOUT: %Result.loc143_9.1 => constants.%Destroy.facet.0b4 // CHECK:STDOUT: %U.patt.loc144_4.2 => constants.%U.patt.7a2 -// CHECK:STDOUT: %U.loc144_4.1 => constants.%Destroy.facet.191 +// CHECK:STDOUT: %U.loc144_4.1 => constants.%Destroy.facet.0b4 // CHECK:STDOUT: %U.as_type.loc145_35.1 => constants.%Int64 // CHECK:STDOUT: %MulWith.type.loc145_35.1 => constants.%MulWith.type.76f // CHECK:STDOUT: %facet_type.loc145_19 => constants.%facet_type.770 @@ -3659,7 +3675,7 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %facet_type.loc145_37 => constants.%facet_type.9a3 // CHECK:STDOUT: %pattern_type.loc145 => constants.%pattern_type.346 // CHECK:STDOUT: %T.patt.loc145_4.2 => constants.%T.patt.6f8 -// CHECK:STDOUT: %T.loc145_4.1 => constants.%facet_value.34a +// CHECK:STDOUT: %T.loc145_4.1 => constants.%facet_value.c94 // CHECK:STDOUT: %pattern_type.loc146_16 => constants.%pattern_type.4aa // CHECK:STDOUT: %result.param_patt.loc146_16.2 => constants.%result.param_patt.1e1 // CHECK:STDOUT: %result.patt.loc146_16.2 => constants.%result.patt.93b @@ -3683,18 +3699,18 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %.loc148_5.6 => constants.%.921 // CHECK:STDOUT: %impl.elem1.loc148_5.2 => constants.%Op.72717c.8 // CHECK:STDOUT: %specific_impl_fn.loc148_5.3 => constants.%Op.72717c.8 -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.c2c -// CHECK:STDOUT: %.loc148_5.7 => constants.%.c2e -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.3 -// CHECK:STDOUT: %impl.elem0.loc148_5.2 => constants.%Int64.Op.4dca31.1 -// CHECK:STDOUT: %specific_impl_fn.loc148_5.4 => constants.%Int64.Op.4dca31.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.bd9 +// CHECK:STDOUT: %.loc148_5.7 => constants.%.9af +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.1bfa2a.3 +// CHECK:STDOUT: %impl.elem2.loc148_5.2 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 +// CHECK:STDOUT: %specific_impl_fn.loc148_5.4 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @DivWith.loc157(constants.%Destroy.facet.191, constants.%Destroy.facet.191, constants.%facet_value.dd9) { +// CHECK:STDOUT: specific @DivWith.loc157(constants.%Destroy.facet.0b4, constants.%Destroy.facet.0b4, constants.%facet_value.886) { // CHECK:STDOUT: %Result.patt.loc154_9.2 => constants.%Result.patt -// CHECK:STDOUT: %Result.loc154_9.1 => constants.%Destroy.facet.191 +// CHECK:STDOUT: %Result.loc154_9.1 => constants.%Destroy.facet.0b4 // CHECK:STDOUT: %U.patt.loc155_4.2 => constants.%U.patt.7a2 -// CHECK:STDOUT: %U.loc155_4.1 => constants.%Destroy.facet.191 +// CHECK:STDOUT: %U.loc155_4.1 => constants.%Destroy.facet.0b4 // CHECK:STDOUT: %U.as_type.loc156_35.1 => constants.%Int64 // CHECK:STDOUT: %DivWith.type.loc156_35.1 => constants.%DivWith.type.095 // CHECK:STDOUT: %facet_type.loc156_19 => constants.%facet_type.c98 @@ -3712,7 +3728,7 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %facet_type.loc156_37 => constants.%facet_type.641 // CHECK:STDOUT: %pattern_type.loc156 => constants.%pattern_type.719 // CHECK:STDOUT: %T.patt.loc156_4.2 => constants.%T.patt.e0b -// CHECK:STDOUT: %T.loc156_4.1 => constants.%facet_value.dd9 +// CHECK:STDOUT: %T.loc156_4.1 => constants.%facet_value.886 // CHECK:STDOUT: %pattern_type.loc157_16 => constants.%pattern_type.4aa // CHECK:STDOUT: %result.param_patt.loc157_16.2 => constants.%result.param_patt.1e1 // CHECK:STDOUT: %result.patt.loc157_16.2 => constants.%result.patt.93b @@ -3736,18 +3752,18 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %.loc159_5.6 => constants.%.26f // CHECK:STDOUT: %impl.elem1.loc159_5.2 => constants.%Op.72717c.9 // CHECK:STDOUT: %specific_impl_fn.loc159_5.3 => constants.%Op.72717c.9 -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.c2c -// CHECK:STDOUT: %.loc159_5.7 => constants.%.c2e -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.3 -// CHECK:STDOUT: %impl.elem0.loc159_5.2 => constants.%Int64.Op.4dca31.1 -// CHECK:STDOUT: %specific_impl_fn.loc159_5.4 => constants.%Int64.Op.4dca31.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.bd9 +// CHECK:STDOUT: %.loc159_5.7 => constants.%.9af +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.1bfa2a.3 +// CHECK:STDOUT: %impl.elem2.loc159_5.2 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 +// CHECK:STDOUT: %specific_impl_fn.loc159_5.4 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ModWith.loc168(constants.%Destroy.facet.191, constants.%Destroy.facet.191, constants.%facet_value.ea3) { +// CHECK:STDOUT: specific @ModWith.loc168(constants.%Destroy.facet.0b4, constants.%Destroy.facet.0b4, constants.%facet_value.022) { // CHECK:STDOUT: %Result.patt.loc165_9.2 => constants.%Result.patt -// CHECK:STDOUT: %Result.loc165_9.1 => constants.%Destroy.facet.191 +// CHECK:STDOUT: %Result.loc165_9.1 => constants.%Destroy.facet.0b4 // CHECK:STDOUT: %U.patt.loc166_4.2 => constants.%U.patt.7a2 -// CHECK:STDOUT: %U.loc166_4.1 => constants.%Destroy.facet.191 +// CHECK:STDOUT: %U.loc166_4.1 => constants.%Destroy.facet.0b4 // CHECK:STDOUT: %U.as_type.loc167_35.1 => constants.%Int64 // CHECK:STDOUT: %ModWith.type.loc167_35.1 => constants.%ModWith.type.204 // CHECK:STDOUT: %facet_type.loc167_19 => constants.%facet_type.f26 @@ -3765,7 +3781,7 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %facet_type.loc167_37 => constants.%facet_type.096 // CHECK:STDOUT: %pattern_type.loc167 => constants.%pattern_type.df3 // CHECK:STDOUT: %T.patt.loc167_4.2 => constants.%T.patt.c87 -// CHECK:STDOUT: %T.loc167_4.1 => constants.%facet_value.ea3 +// CHECK:STDOUT: %T.loc167_4.1 => constants.%facet_value.022 // CHECK:STDOUT: %pattern_type.loc168_16 => constants.%pattern_type.4aa // CHECK:STDOUT: %result.param_patt.loc168_16.2 => constants.%result.param_patt.1e1 // CHECK:STDOUT: %result.patt.loc168_16.2 => constants.%result.patt.93b @@ -3789,18 +3805,18 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %.loc170_5.6 => constants.%.ed0 // CHECK:STDOUT: %impl.elem1.loc170_5.2 => constants.%Op.72717c.10 // CHECK:STDOUT: %specific_impl_fn.loc170_5.3 => constants.%Op.72717c.10 -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.c2c -// CHECK:STDOUT: %.loc170_5.7 => constants.%.c2e -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.3 -// CHECK:STDOUT: %impl.elem0.loc170_5.2 => constants.%Int64.Op.4dca31.1 -// CHECK:STDOUT: %specific_impl_fn.loc170_5.4 => constants.%Int64.Op.4dca31.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.bd9 +// CHECK:STDOUT: %.loc170_5.7 => constants.%.9af +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.1bfa2a.3 +// CHECK:STDOUT: %impl.elem2.loc170_5.2 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 +// CHECK:STDOUT: %specific_impl_fn.loc170_5.4 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @AddWith.loc124(constants.%Destroy.facet.191, constants.%Destroy.facet.099, constants.%facet_value.393) { +// CHECK:STDOUT: specific @AddWith.loc124(constants.%Destroy.facet.0b4, constants.%Destroy.facet.84d, constants.%facet_value.ff6) { // CHECK:STDOUT: %Result.patt.loc121_9.2 => constants.%Result.patt -// CHECK:STDOUT: %Result.loc121_9.1 => constants.%Destroy.facet.191 +// CHECK:STDOUT: %Result.loc121_9.1 => constants.%Destroy.facet.0b4 // CHECK:STDOUT: %U.patt.loc122_4.2 => constants.%U.patt.7a2 -// CHECK:STDOUT: %U.loc122_4.1 => constants.%Destroy.facet.099 +// CHECK:STDOUT: %U.loc122_4.1 => constants.%Destroy.facet.84d // CHECK:STDOUT: %U.as_type.loc123_35.1 => constants.%Int32 // CHECK:STDOUT: %AddWith.type.loc123_35.1 => constants.%AddWith.type.c71 // CHECK:STDOUT: %facet_type.loc123_19 => constants.%facet_type.698 @@ -3818,7 +3834,7 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %facet_type.loc123_37 => constants.%facet_type.840 // CHECK:STDOUT: %pattern_type.loc123 => constants.%pattern_type.46d // CHECK:STDOUT: %T.patt.loc123_4.2 => constants.%T.patt.211 -// CHECK:STDOUT: %T.loc123_4.1 => constants.%facet_value.393 +// CHECK:STDOUT: %T.loc123_4.1 => constants.%facet_value.ff6 // CHECK:STDOUT: %pattern_type.loc124_16 => constants.%pattern_type.4aa // CHECK:STDOUT: %result.param_patt.loc124_16.2 => constants.%result.param_patt.1e1 // CHECK:STDOUT: %result.patt.loc124_16.2 => constants.%result.patt.93b @@ -3842,18 +3858,18 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %.loc126_5.6 => constants.%.df7 // CHECK:STDOUT: %impl.elem1.loc126_5.2 => constants.%Op.72717c.11 // CHECK:STDOUT: %specific_impl_fn.loc126_5.3 => constants.%Op.72717c.11 -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.c2c -// CHECK:STDOUT: %.loc126_5.7 => constants.%.c2e -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.3 -// CHECK:STDOUT: %impl.elem0.loc126_5.2 => constants.%Int64.Op.4dca31.1 -// CHECK:STDOUT: %specific_impl_fn.loc126_5.4 => constants.%Int64.Op.4dca31.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.bd9 +// CHECK:STDOUT: %.loc126_5.7 => constants.%.9af +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.1bfa2a.3 +// CHECK:STDOUT: %impl.elem2.loc126_5.2 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 +// CHECK:STDOUT: %specific_impl_fn.loc126_5.4 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @SubWith.loc135(constants.%Destroy.facet.191, constants.%Destroy.facet.099, constants.%facet_value.e02) { +// CHECK:STDOUT: specific @SubWith.loc135(constants.%Destroy.facet.0b4, constants.%Destroy.facet.84d, constants.%facet_value.263) { // CHECK:STDOUT: %Result.patt.loc132_9.2 => constants.%Result.patt -// CHECK:STDOUT: %Result.loc132_9.1 => constants.%Destroy.facet.191 +// CHECK:STDOUT: %Result.loc132_9.1 => constants.%Destroy.facet.0b4 // CHECK:STDOUT: %U.patt.loc133_4.2 => constants.%U.patt.7a2 -// CHECK:STDOUT: %U.loc133_4.1 => constants.%Destroy.facet.099 +// CHECK:STDOUT: %U.loc133_4.1 => constants.%Destroy.facet.84d // CHECK:STDOUT: %U.as_type.loc134_35.1 => constants.%Int32 // CHECK:STDOUT: %SubWith.type.loc134_35.1 => constants.%SubWith.type.c81 // CHECK:STDOUT: %facet_type.loc134_19 => constants.%facet_type.44e @@ -3871,7 +3887,7 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %facet_type.loc134_37 => constants.%facet_type.99d // CHECK:STDOUT: %pattern_type.loc134 => constants.%pattern_type.b19 // CHECK:STDOUT: %T.patt.loc134_4.2 => constants.%T.patt.e50 -// CHECK:STDOUT: %T.loc134_4.1 => constants.%facet_value.e02 +// CHECK:STDOUT: %T.loc134_4.1 => constants.%facet_value.263 // CHECK:STDOUT: %pattern_type.loc135_16 => constants.%pattern_type.4aa // CHECK:STDOUT: %result.param_patt.loc135_16.2 => constants.%result.param_patt.1e1 // CHECK:STDOUT: %result.patt.loc135_16.2 => constants.%result.patt.93b @@ -3895,18 +3911,18 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %.loc137_5.6 => constants.%.ad9 // CHECK:STDOUT: %impl.elem1.loc137_5.2 => constants.%Op.72717c.12 // CHECK:STDOUT: %specific_impl_fn.loc137_5.3 => constants.%Op.72717c.12 -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.c2c -// CHECK:STDOUT: %.loc137_5.7 => constants.%.c2e -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.3 -// CHECK:STDOUT: %impl.elem0.loc137_5.2 => constants.%Int64.Op.4dca31.1 -// CHECK:STDOUT: %specific_impl_fn.loc137_5.4 => constants.%Int64.Op.4dca31.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.bd9 +// CHECK:STDOUT: %.loc137_5.7 => constants.%.9af +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.1bfa2a.3 +// CHECK:STDOUT: %impl.elem2.loc137_5.2 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 +// CHECK:STDOUT: %specific_impl_fn.loc137_5.4 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @MulWith.loc146(constants.%Destroy.facet.191, constants.%Destroy.facet.099, constants.%facet_value.dda) { +// CHECK:STDOUT: specific @MulWith.loc146(constants.%Destroy.facet.0b4, constants.%Destroy.facet.84d, constants.%facet_value.ac4) { // CHECK:STDOUT: %Result.patt.loc143_9.2 => constants.%Result.patt -// CHECK:STDOUT: %Result.loc143_9.1 => constants.%Destroy.facet.191 +// CHECK:STDOUT: %Result.loc143_9.1 => constants.%Destroy.facet.0b4 // CHECK:STDOUT: %U.patt.loc144_4.2 => constants.%U.patt.7a2 -// CHECK:STDOUT: %U.loc144_4.1 => constants.%Destroy.facet.099 +// CHECK:STDOUT: %U.loc144_4.1 => constants.%Destroy.facet.84d // CHECK:STDOUT: %U.as_type.loc145_35.1 => constants.%Int32 // CHECK:STDOUT: %MulWith.type.loc145_35.1 => constants.%MulWith.type.eeb // CHECK:STDOUT: %facet_type.loc145_19 => constants.%facet_type.ff6 @@ -3924,7 +3940,7 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %facet_type.loc145_37 => constants.%facet_type.5e8 // CHECK:STDOUT: %pattern_type.loc145 => constants.%pattern_type.d24 // CHECK:STDOUT: %T.patt.loc145_4.2 => constants.%T.patt.54a -// CHECK:STDOUT: %T.loc145_4.1 => constants.%facet_value.dda +// CHECK:STDOUT: %T.loc145_4.1 => constants.%facet_value.ac4 // CHECK:STDOUT: %pattern_type.loc146_16 => constants.%pattern_type.4aa // CHECK:STDOUT: %result.param_patt.loc146_16.2 => constants.%result.param_patt.1e1 // CHECK:STDOUT: %result.patt.loc146_16.2 => constants.%result.patt.93b @@ -3948,18 +3964,18 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %.loc148_5.6 => constants.%.be6 // CHECK:STDOUT: %impl.elem1.loc148_5.2 => constants.%Op.72717c.13 // CHECK:STDOUT: %specific_impl_fn.loc148_5.3 => constants.%Op.72717c.13 -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.c2c -// CHECK:STDOUT: %.loc148_5.7 => constants.%.c2e -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.3 -// CHECK:STDOUT: %impl.elem0.loc148_5.2 => constants.%Int64.Op.4dca31.1 -// CHECK:STDOUT: %specific_impl_fn.loc148_5.4 => constants.%Int64.Op.4dca31.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.bd9 +// CHECK:STDOUT: %.loc148_5.7 => constants.%.9af +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.1bfa2a.3 +// CHECK:STDOUT: %impl.elem2.loc148_5.2 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 +// CHECK:STDOUT: %specific_impl_fn.loc148_5.4 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @DivWith.loc157(constants.%Destroy.facet.191, constants.%Destroy.facet.099, constants.%facet_value.886) { +// CHECK:STDOUT: specific @DivWith.loc157(constants.%Destroy.facet.0b4, constants.%Destroy.facet.84d, constants.%facet_value.955) { // CHECK:STDOUT: %Result.patt.loc154_9.2 => constants.%Result.patt -// CHECK:STDOUT: %Result.loc154_9.1 => constants.%Destroy.facet.191 +// CHECK:STDOUT: %Result.loc154_9.1 => constants.%Destroy.facet.0b4 // CHECK:STDOUT: %U.patt.loc155_4.2 => constants.%U.patt.7a2 -// CHECK:STDOUT: %U.loc155_4.1 => constants.%Destroy.facet.099 +// CHECK:STDOUT: %U.loc155_4.1 => constants.%Destroy.facet.84d // CHECK:STDOUT: %U.as_type.loc156_35.1 => constants.%Int32 // CHECK:STDOUT: %DivWith.type.loc156_35.1 => constants.%DivWith.type.fb1 // CHECK:STDOUT: %facet_type.loc156_19 => constants.%facet_type.d41 @@ -3977,7 +3993,7 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %facet_type.loc156_37 => constants.%facet_type.97b // CHECK:STDOUT: %pattern_type.loc156 => constants.%pattern_type.6b7 // CHECK:STDOUT: %T.patt.loc156_4.2 => constants.%T.patt.0b0 -// CHECK:STDOUT: %T.loc156_4.1 => constants.%facet_value.886 +// CHECK:STDOUT: %T.loc156_4.1 => constants.%facet_value.955 // CHECK:STDOUT: %pattern_type.loc157_16 => constants.%pattern_type.4aa // CHECK:STDOUT: %result.param_patt.loc157_16.2 => constants.%result.param_patt.1e1 // CHECK:STDOUT: %result.patt.loc157_16.2 => constants.%result.patt.93b @@ -4001,18 +4017,18 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %.loc159_5.6 => constants.%.436 // CHECK:STDOUT: %impl.elem1.loc159_5.2 => constants.%Op.72717c.14 // CHECK:STDOUT: %specific_impl_fn.loc159_5.3 => constants.%Op.72717c.14 -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.c2c -// CHECK:STDOUT: %.loc159_5.7 => constants.%.c2e -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.3 -// CHECK:STDOUT: %impl.elem0.loc159_5.2 => constants.%Int64.Op.4dca31.1 -// CHECK:STDOUT: %specific_impl_fn.loc159_5.4 => constants.%Int64.Op.4dca31.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.bd9 +// CHECK:STDOUT: %.loc159_5.7 => constants.%.9af +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.1bfa2a.3 +// CHECK:STDOUT: %impl.elem2.loc159_5.2 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 +// CHECK:STDOUT: %specific_impl_fn.loc159_5.4 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @ModWith.loc168(constants.%Destroy.facet.191, constants.%Destroy.facet.099, constants.%facet_value.20a) { +// CHECK:STDOUT: specific @ModWith.loc168(constants.%Destroy.facet.0b4, constants.%Destroy.facet.84d, constants.%facet_value.03a) { // CHECK:STDOUT: %Result.patt.loc165_9.2 => constants.%Result.patt -// CHECK:STDOUT: %Result.loc165_9.1 => constants.%Destroy.facet.191 +// CHECK:STDOUT: %Result.loc165_9.1 => constants.%Destroy.facet.0b4 // CHECK:STDOUT: %U.patt.loc166_4.2 => constants.%U.patt.7a2 -// CHECK:STDOUT: %U.loc166_4.1 => constants.%Destroy.facet.099 +// CHECK:STDOUT: %U.loc166_4.1 => constants.%Destroy.facet.84d // CHECK:STDOUT: %U.as_type.loc167_35.1 => constants.%Int32 // CHECK:STDOUT: %ModWith.type.loc167_35.1 => constants.%ModWith.type.253 // CHECK:STDOUT: %facet_type.loc167_19 => constants.%facet_type.ea8 @@ -4030,7 +4046,7 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %facet_type.loc167_37 => constants.%facet_type.546 // CHECK:STDOUT: %pattern_type.loc167 => constants.%pattern_type.5db // CHECK:STDOUT: %T.patt.loc167_4.2 => constants.%T.patt.ed0 -// CHECK:STDOUT: %T.loc167_4.1 => constants.%facet_value.20a +// CHECK:STDOUT: %T.loc167_4.1 => constants.%facet_value.03a // CHECK:STDOUT: %pattern_type.loc168_16 => constants.%pattern_type.4aa // CHECK:STDOUT: %result.param_patt.loc168_16.2 => constants.%result.param_patt.1e1 // CHECK:STDOUT: %result.patt.loc168_16.2 => constants.%result.patt.93b @@ -4054,11 +4070,11 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %.loc170_5.6 => constants.%.66e6 // CHECK:STDOUT: %impl.elem1.loc170_5.2 => constants.%Op.72717c.15 // CHECK:STDOUT: %specific_impl_fn.loc170_5.3 => constants.%Op.72717c.15 -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.c2c -// CHECK:STDOUT: %.loc170_5.7 => constants.%.c2e -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.3 -// CHECK:STDOUT: %impl.elem0.loc170_5.2 => constants.%Int64.Op.4dca31.1 -// CHECK:STDOUT: %specific_impl_fn.loc170_5.4 => constants.%Int64.Op.4dca31.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.bd9 +// CHECK:STDOUT: %.loc170_5.7 => constants.%.9af +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.1bfa2a.3 +// CHECK:STDOUT: %impl.elem2.loc170_5.2 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 +// CHECK:STDOUT: %specific_impl_fn.loc170_5.4 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @AddAssignWith.loc225(constants.%U.67d, constants.%T.792) { @@ -4165,8 +4181,8 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %AddAssignWith.WithSelf.Op.type => constants.%AddAssignWith.WithSelf.Op.type.eb5 // CHECK:STDOUT: %.loc227_5.2 => constants.%.063 // CHECK:STDOUT: %AddAssignWith.lookup_impl_witness => constants.%custom_witness.6a0 -// CHECK:STDOUT: %impl.elem0.loc227_5.2 => constants.%Int16.Op.4dca31.13 -// CHECK:STDOUT: %specific_impl_fn.loc227_5.2 => constants.%Int16.Op.4dca31.13 +// CHECK:STDOUT: %impl.elem0.loc227_5.2 => constants.%Int16.Op.4dca31.12 +// CHECK:STDOUT: %specific_impl_fn.loc227_5.2 => constants.%Int16.Op.4dca31.12 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @SubAssignWith.loc231(constants.%i16, constants.%SubAssignWith.facet.a52) { @@ -4193,8 +4209,8 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %SubAssignWith.WithSelf.Op.type => constants.%SubAssignWith.WithSelf.Op.type.163 // CHECK:STDOUT: %.loc233_5.2 => constants.%.dc4 // CHECK:STDOUT: %SubAssignWith.lookup_impl_witness => constants.%custom_witness.722 -// CHECK:STDOUT: %impl.elem0.loc233_5.2 => constants.%Int16.Op.4dca31.14 -// CHECK:STDOUT: %specific_impl_fn.loc233_5.2 => constants.%Int16.Op.4dca31.14 +// CHECK:STDOUT: %impl.elem0.loc233_5.2 => constants.%Int16.Op.4dca31.13 +// CHECK:STDOUT: %specific_impl_fn.loc233_5.2 => constants.%Int16.Op.4dca31.13 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @MulAssignWith.loc237(constants.%i16, constants.%MulAssignWith.facet.201) { @@ -4221,8 +4237,8 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %MulAssignWith.WithSelf.Op.type => constants.%MulAssignWith.WithSelf.Op.type.170 // CHECK:STDOUT: %.loc239_5.2 => constants.%.69d // CHECK:STDOUT: %MulAssignWith.lookup_impl_witness => constants.%custom_witness.c67 -// CHECK:STDOUT: %impl.elem0.loc239_5.2 => constants.%Int16.Op.4dca31.15 -// CHECK:STDOUT: %specific_impl_fn.loc239_5.2 => constants.%Int16.Op.4dca31.15 +// CHECK:STDOUT: %impl.elem0.loc239_5.2 => constants.%Int16.Op.4dca31.14 +// CHECK:STDOUT: %specific_impl_fn.loc239_5.2 => constants.%Int16.Op.4dca31.14 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @DivAssignWith.loc243(constants.%i16, constants.%DivAssignWith.facet.a72) { @@ -4249,8 +4265,8 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %DivAssignWith.WithSelf.Op.type => constants.%DivAssignWith.WithSelf.Op.type.d5b // CHECK:STDOUT: %.loc245_5.2 => constants.%.8d8 // CHECK:STDOUT: %DivAssignWith.lookup_impl_witness => constants.%custom_witness.91d -// CHECK:STDOUT: %impl.elem0.loc245_5.2 => constants.%Int16.Op.4dca31.16 -// CHECK:STDOUT: %specific_impl_fn.loc245_5.2 => constants.%Int16.Op.4dca31.16 +// CHECK:STDOUT: %impl.elem0.loc245_5.2 => constants.%Int16.Op.4dca31.15 +// CHECK:STDOUT: %specific_impl_fn.loc245_5.2 => constants.%Int16.Op.4dca31.15 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ModAssignWith.loc249(constants.%i16, constants.%ModAssignWith.facet.4a2) { @@ -4277,8 +4293,8 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %ModAssignWith.WithSelf.Op.type => constants.%ModAssignWith.WithSelf.Op.type.374 // CHECK:STDOUT: %.loc251_5.2 => constants.%.eca // CHECK:STDOUT: %ModAssignWith.lookup_impl_witness => constants.%custom_witness.17b -// CHECK:STDOUT: %impl.elem0.loc251_5.2 => constants.%Int16.Op.4dca31.17 -// CHECK:STDOUT: %specific_impl_fn.loc251_5.2 => constants.%Int16.Op.4dca31.17 +// CHECK:STDOUT: %impl.elem0.loc251_5.2 => constants.%Int16.Op.4dca31.16 +// CHECK:STDOUT: %specific_impl_fn.loc251_5.2 => constants.%Int16.Op.4dca31.16 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @AddAssignWith.loc225(constants.%Int32, constants.%AddAssignWith.facet.348) { @@ -4305,8 +4321,8 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %AddAssignWith.WithSelf.Op.type => constants.%AddAssignWith.WithSelf.Op.type.96d // CHECK:STDOUT: %.loc227_5.2 => constants.%.65c // CHECK:STDOUT: %AddAssignWith.lookup_impl_witness => constants.%custom_witness.ebf67a.1 -// CHECK:STDOUT: %impl.elem0.loc227_5.2 => constants.%Int32.Op.4dca31.12 -// CHECK:STDOUT: %specific_impl_fn.loc227_5.2 => constants.%Int32.Op.4dca31.12 +// CHECK:STDOUT: %impl.elem0.loc227_5.2 => constants.%Int32.Op.4dca31.11 +// CHECK:STDOUT: %specific_impl_fn.loc227_5.2 => constants.%Int32.Op.4dca31.11 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @SubAssignWith.loc231(constants.%Int32, constants.%SubAssignWith.facet.e0e) { @@ -4333,8 +4349,8 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %SubAssignWith.WithSelf.Op.type => constants.%SubAssignWith.WithSelf.Op.type.6ac // CHECK:STDOUT: %.loc233_5.2 => constants.%.740 // CHECK:STDOUT: %SubAssignWith.lookup_impl_witness => constants.%custom_witness.c2b241.1 -// CHECK:STDOUT: %impl.elem0.loc233_5.2 => constants.%Int32.Op.4dca31.14 -// CHECK:STDOUT: %specific_impl_fn.loc233_5.2 => constants.%Int32.Op.4dca31.14 +// CHECK:STDOUT: %impl.elem0.loc233_5.2 => constants.%Int32.Op.4dca31.13 +// CHECK:STDOUT: %specific_impl_fn.loc233_5.2 => constants.%Int32.Op.4dca31.13 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @MulAssignWith.loc237(constants.%Int32, constants.%MulAssignWith.facet.13c) { @@ -4361,8 +4377,8 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %MulAssignWith.WithSelf.Op.type => constants.%MulAssignWith.WithSelf.Op.type.73c // CHECK:STDOUT: %.loc239_5.2 => constants.%.a28 // CHECK:STDOUT: %MulAssignWith.lookup_impl_witness => constants.%custom_witness.ec9760.1 -// CHECK:STDOUT: %impl.elem0.loc239_5.2 => constants.%Int32.Op.4dca31.15 -// CHECK:STDOUT: %specific_impl_fn.loc239_5.2 => constants.%Int32.Op.4dca31.15 +// CHECK:STDOUT: %impl.elem0.loc239_5.2 => constants.%Int32.Op.4dca31.14 +// CHECK:STDOUT: %specific_impl_fn.loc239_5.2 => constants.%Int32.Op.4dca31.14 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @DivAssignWith.loc243(constants.%Int32, constants.%DivAssignWith.facet.e59) { @@ -4389,8 +4405,8 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %DivAssignWith.WithSelf.Op.type => constants.%DivAssignWith.WithSelf.Op.type.b74 // CHECK:STDOUT: %.loc245_5.2 => constants.%.204 // CHECK:STDOUT: %DivAssignWith.lookup_impl_witness => constants.%custom_witness.9697f7.1 -// CHECK:STDOUT: %impl.elem0.loc245_5.2 => constants.%Int32.Op.4dca31.16 -// CHECK:STDOUT: %specific_impl_fn.loc245_5.2 => constants.%Int32.Op.4dca31.16 +// CHECK:STDOUT: %impl.elem0.loc245_5.2 => constants.%Int32.Op.4dca31.15 +// CHECK:STDOUT: %specific_impl_fn.loc245_5.2 => constants.%Int32.Op.4dca31.15 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ModAssignWith.loc249(constants.%Int32, constants.%ModAssignWith.facet.dac) { @@ -4417,8 +4433,8 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %ModAssignWith.WithSelf.Op.type => constants.%ModAssignWith.WithSelf.Op.type.16f // CHECK:STDOUT: %.loc251_5.2 => constants.%.c84 // CHECK:STDOUT: %ModAssignWith.lookup_impl_witness => constants.%custom_witness.df8f2f.1 -// CHECK:STDOUT: %impl.elem0.loc251_5.2 => constants.%Int32.Op.4dca31.17 -// CHECK:STDOUT: %specific_impl_fn.loc251_5.2 => constants.%Int32.Op.4dca31.17 +// CHECK:STDOUT: %impl.elem0.loc251_5.2 => constants.%Int32.Op.4dca31.16 +// CHECK:STDOUT: %specific_impl_fn.loc251_5.2 => constants.%Int32.Op.4dca31.16 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @AddAssignWith.loc225(constants.%Int32, constants.%AddAssignWith.facet.144) { @@ -4445,8 +4461,8 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %AddAssignWith.WithSelf.Op.type => constants.%AddAssignWith.WithSelf.Op.type.cf5 // CHECK:STDOUT: %.loc227_5.2 => constants.%.6e0 // CHECK:STDOUT: %AddAssignWith.lookup_impl_witness => constants.%custom_witness.ebf67a.2 -// CHECK:STDOUT: %impl.elem0.loc227_5.2 => constants.%Int64.Op.4dca31.2 -// CHECK:STDOUT: %specific_impl_fn.loc227_5.2 => constants.%Int64.Op.4dca31.2 +// CHECK:STDOUT: %impl.elem0.loc227_5.2 => constants.%Int64.Op.4dca31.1 +// CHECK:STDOUT: %specific_impl_fn.loc227_5.2 => constants.%Int64.Op.4dca31.1 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @SubAssignWith.loc231(constants.%Int32, constants.%SubAssignWith.facet.a7e) { @@ -4473,8 +4489,8 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %SubAssignWith.WithSelf.Op.type => constants.%SubAssignWith.WithSelf.Op.type.a31 // CHECK:STDOUT: %.loc233_5.2 => constants.%.70d // CHECK:STDOUT: %SubAssignWith.lookup_impl_witness => constants.%custom_witness.c2b241.2 -// CHECK:STDOUT: %impl.elem0.loc233_5.2 => constants.%Int64.Op.4dca31.4 -// CHECK:STDOUT: %specific_impl_fn.loc233_5.2 => constants.%Int64.Op.4dca31.4 +// CHECK:STDOUT: %impl.elem0.loc233_5.2 => constants.%Int64.Op.4dca31.3 +// CHECK:STDOUT: %specific_impl_fn.loc233_5.2 => constants.%Int64.Op.4dca31.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @MulAssignWith.loc237(constants.%Int32, constants.%MulAssignWith.facet.b35) { @@ -4501,8 +4517,8 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %MulAssignWith.WithSelf.Op.type => constants.%MulAssignWith.WithSelf.Op.type.606 // CHECK:STDOUT: %.loc239_5.2 => constants.%.375 // CHECK:STDOUT: %MulAssignWith.lookup_impl_witness => constants.%custom_witness.ec9760.2 -// CHECK:STDOUT: %impl.elem0.loc239_5.2 => constants.%Int64.Op.4dca31.5 -// CHECK:STDOUT: %specific_impl_fn.loc239_5.2 => constants.%Int64.Op.4dca31.5 +// CHECK:STDOUT: %impl.elem0.loc239_5.2 => constants.%Int64.Op.4dca31.4 +// CHECK:STDOUT: %specific_impl_fn.loc239_5.2 => constants.%Int64.Op.4dca31.4 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @DivAssignWith.loc243(constants.%Int32, constants.%DivAssignWith.facet.b1e) { @@ -4529,8 +4545,8 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %DivAssignWith.WithSelf.Op.type => constants.%DivAssignWith.WithSelf.Op.type.d14 // CHECK:STDOUT: %.loc245_5.2 => constants.%.f69 // CHECK:STDOUT: %DivAssignWith.lookup_impl_witness => constants.%custom_witness.9697f7.2 -// CHECK:STDOUT: %impl.elem0.loc245_5.2 => constants.%Int64.Op.4dca31.6 -// CHECK:STDOUT: %specific_impl_fn.loc245_5.2 => constants.%Int64.Op.4dca31.6 +// CHECK:STDOUT: %impl.elem0.loc245_5.2 => constants.%Int64.Op.4dca31.5 +// CHECK:STDOUT: %specific_impl_fn.loc245_5.2 => constants.%Int64.Op.4dca31.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @ModAssignWith.loc249(constants.%Int32, constants.%ModAssignWith.facet.342) { @@ -4557,8 +4573,8 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %ModAssignWith.WithSelf.Op.type => constants.%ModAssignWith.WithSelf.Op.type.690 // CHECK:STDOUT: %.loc251_5.2 => constants.%.af4 // CHECK:STDOUT: %ModAssignWith.lookup_impl_witness => constants.%custom_witness.df8f2f.2 -// CHECK:STDOUT: %impl.elem0.loc251_5.2 => constants.%Int64.Op.4dca31.7 -// CHECK:STDOUT: %specific_impl_fn.loc251_5.2 => constants.%Int64.Op.4dca31.7 +// CHECK:STDOUT: %impl.elem0.loc251_5.2 => constants.%Int64.Op.4dca31.6 +// CHECK:STDOUT: %specific_impl_fn.loc251_5.2 => constants.%Int64.Op.4dca31.6 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @TestInc(constants.%T.8f3) { @@ -4609,8 +4625,8 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %Inc.WithSelf.Op.type => constants.%Inc.WithSelf.Op.type.d1d // CHECK:STDOUT: %.loc280_3.3 => constants.%.176 // CHECK:STDOUT: %Inc.lookup_impl_witness => constants.%custom_witness.f3f -// CHECK:STDOUT: %impl.elem0.loc280_3.2 => constants.%Int32.Op.4dca31.18 -// CHECK:STDOUT: %specific_impl_fn.loc280_3.2 => constants.%Int32.Op.4dca31.18 +// CHECK:STDOUT: %impl.elem0.loc280_3.2 => constants.%Int32.Op.4dca31.17 +// CHECK:STDOUT: %specific_impl_fn.loc280_3.2 => constants.%Int32.Op.4dca31.17 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: specific @TestDec(constants.%Dec.facet.e1b) { @@ -4626,18 +4642,18 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %Dec.WithSelf.Op.type => constants.%Dec.WithSelf.Op.type.e55 // CHECK:STDOUT: %.loc286_3.3 => constants.%.d09 // CHECK:STDOUT: %Dec.lookup_impl_witness => constants.%custom_witness.b24 -// CHECK:STDOUT: %impl.elem0.loc286_3.2 => constants.%Int32.Op.4dca31.19 -// CHECK:STDOUT: %specific_impl_fn.loc286_3.2 => constants.%Int32.Op.4dca31.19 +// CHECK:STDOUT: %impl.elem0.loc286_3.2 => constants.%Int32.Op.4dca31.18 +// CHECK:STDOUT: %specific_impl_fn.loc286_3.2 => constants.%Int32.Op.4dca31.18 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @TestNegate(constants.%Destroy.facet.191, constants.%facet_value.9cc) { +// CHECK:STDOUT: specific @TestNegate(constants.%Destroy.facet.0b4, constants.%facet_value.a67) { // CHECK:STDOUT: %Result.patt.loc292_9.2 => constants.%Result.patt -// CHECK:STDOUT: %Result.loc292_9.1 => constants.%Destroy.facet.191 +// CHECK:STDOUT: %Result.loc292_9.1 => constants.%Destroy.facet.0b4 // CHECK:STDOUT: %Result.as_type.loc293_49.1 => constants.%Int64 // CHECK:STDOUT: %facet_type => constants.%facet_type.d8c // CHECK:STDOUT: %pattern_type.loc293 => constants.%pattern_type.54c // CHECK:STDOUT: %T.patt.loc293_4.2 => constants.%T.patt.16f -// CHECK:STDOUT: %T.loc293_4.1 => constants.%facet_value.9cc +// CHECK:STDOUT: %T.loc293_4.1 => constants.%facet_value.a67 // CHECK:STDOUT: %pattern_type.loc294_11 => constants.%pattern_type.4aa // CHECK:STDOUT: %y.param_patt.loc294_11.2 => constants.%y.param_patt.a08 // CHECK:STDOUT: %y.patt.loc294_11.2 => constants.%y.patt.069 @@ -4653,23 +4669,23 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %Negate.facet.loc296_3.3 => constants.%Negate.facet.8f4 // CHECK:STDOUT: %Negate.WithSelf.Op.type => constants.%Negate.WithSelf.Op.type.181 // CHECK:STDOUT: %.loc296_3.7 => constants.%.66a -// CHECK:STDOUT: %impl.elem1.loc296_3.2 => constants.%Int16.Op.4dca31.18 -// CHECK:STDOUT: %specific_impl_fn.loc296_3.3 => constants.%Int16.Op.4dca31.18 -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.c2c -// CHECK:STDOUT: %.loc296_3.8 => constants.%.c2e -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.3 -// CHECK:STDOUT: %impl.elem0.loc296_3.2 => constants.%Int64.Op.4dca31.1 -// CHECK:STDOUT: %specific_impl_fn.loc296_3.4 => constants.%Int64.Op.4dca31.1 +// CHECK:STDOUT: %impl.elem1.loc296_3.2 => constants.%Int16.Op.4dca31.17 +// CHECK:STDOUT: %specific_impl_fn.loc296_3.3 => constants.%Int16.Op.4dca31.17 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.bd9 +// CHECK:STDOUT: %.loc296_3.8 => constants.%.9af +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.1bfa2a.3 +// CHECK:STDOUT: %impl.elem2.loc296_3.2 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 +// CHECK:STDOUT: %specific_impl_fn.loc296_3.4 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @TestNegate(constants.%Destroy.facet.099, constants.%facet_value.dcd) { +// CHECK:STDOUT: specific @TestNegate(constants.%Destroy.facet.84d, constants.%facet_value.73e) { // CHECK:STDOUT: %Result.patt.loc292_9.2 => constants.%Result.patt -// CHECK:STDOUT: %Result.loc292_9.1 => constants.%Destroy.facet.099 +// CHECK:STDOUT: %Result.loc292_9.1 => constants.%Destroy.facet.84d // CHECK:STDOUT: %Result.as_type.loc293_49.1 => constants.%Int32 // CHECK:STDOUT: %facet_type => constants.%facet_type.021 // CHECK:STDOUT: %pattern_type.loc293 => constants.%pattern_type.4cd // CHECK:STDOUT: %T.patt.loc293_4.2 => constants.%T.patt.d74 -// CHECK:STDOUT: %T.loc293_4.1 => constants.%facet_value.dcd +// CHECK:STDOUT: %T.loc293_4.1 => constants.%facet_value.73e // CHECK:STDOUT: %pattern_type.loc294_11 => constants.%pattern_type.8b4 // CHECK:STDOUT: %y.param_patt.loc294_11.2 => constants.%y.param_patt.e0c // CHECK:STDOUT: %y.patt.loc294_11.2 => constants.%y.patt.9e1 @@ -4685,12 +4701,12 @@ fn TestUnaryOperators(a: Cpp.Int16, b: Cpp.Int32) { // CHECK:STDOUT: %Negate.facet.loc296_3.3 => constants.%Negate.facet.aa9 // CHECK:STDOUT: %Negate.WithSelf.Op.type => constants.%Negate.WithSelf.Op.type.050 // CHECK:STDOUT: %.loc296_3.7 => constants.%.668 -// CHECK:STDOUT: %impl.elem1.loc296_3.2 => constants.%Int32.Op.4dca31.20 -// CHECK:STDOUT: %specific_impl_fn.loc296_3.3 => constants.%Int32.Op.4dca31.20 -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.b76 -// CHECK:STDOUT: %.loc296_3.8 => constants.%.043 -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.e7a31c.2 -// CHECK:STDOUT: %impl.elem0.loc296_3.2 => constants.%Int32.Op.4dca31.1 -// CHECK:STDOUT: %specific_impl_fn.loc296_3.4 => constants.%Int32.Op.4dca31.1 +// CHECK:STDOUT: %impl.elem1.loc296_3.2 => constants.%Int32.Op.4dca31.19 +// CHECK:STDOUT: %specific_impl_fn.loc296_3.3 => constants.%Int32.Op.4dca31.19 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.3e9 +// CHECK:STDOUT: %.loc296_3.8 => constants.%.57b +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.1bfa2a.2 +// CHECK:STDOUT: %impl.elem2.loc296_3.2 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %specific_impl_fn.loc296_3.4 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/operators/operators.carbon b/toolchain/check/testdata/interop/cpp/operators/operators.carbon index 230348fac37c..cfabddeeef44 100644 --- a/toolchain/check/testdata/interop/cpp/operators/operators.carbon +++ b/toolchain/check/testdata/interop/cpp/operators/operators.carbon @@ -1043,10 +1043,14 @@ fn F() { // CHECK:STDOUT: %complement.patt: %pattern_type.bbc = value_binding_pattern complement [concrete] // CHECK:STDOUT: %operator_Tilde__carbon_thunk.type: type = fn_type @operator_Tilde__carbon_thunk [concrete] // CHECK:STDOUT: %operator_Tilde__carbon_thunk: %operator_Tilde__carbon_thunk.type = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.e2f: %pattern_type.bbc = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.790: %pattern_type.bbc = wrapper_binding_pattern self, %self.param_patt.e2f [concrete] // CHECK:STDOUT: %C.cpp_destructor.type: type = fn_type @C.cpp_destructor [concrete] // CHECK:STDOUT: %C.cpp_destructor: %C.cpp_destructor.type = struct_value () [concrete] -// CHECK:STDOUT: %C.Op.type: type = fn_type @C.Op [concrete] -// CHECK:STDOUT: %C.Op: %C.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc18 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc18 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1088,6 +1092,16 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc18 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.bbc = ref_param_pattern [concrete = constants.%self.param_patt.e2f] +// CHECK:STDOUT: %self.patt: %pattern_type.bbc = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.790] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c.var: ref %C = var_storage %c.var_patt @@ -1149,21 +1163,24 @@ fn F() { // CHECK:STDOUT: %complement.patt: %pattern_type.bbc = value_binding_pattern complement [concrete = constants.%complement.patt] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: %C.Op.bound.loc18: = bound_method %.loc18_34.3, constants.%C.Op -// CHECK:STDOUT: %Op.ref.loc18: %C.cpp_destructor.type = name_ref Op, imports.%C.cpp_destructor.decl [concrete = constants.%C.cpp_destructor] -// CHECK:STDOUT: %C.cpp_destructor.bound.loc18: = bound_method %.loc18_34.3, %Op.ref.loc18 -// CHECK:STDOUT: %C.cpp_destructor.call.loc18: init %empty_tuple.type = call %C.cpp_destructor.bound.loc18(%.loc18_34.3) -// CHECK:STDOUT: %C.Op.bound.loc15: = bound_method %.loc15_29.3, constants.%C.Op -// CHECK:STDOUT: %Op.ref.loc15: %C.cpp_destructor.type = name_ref Op, imports.%C.cpp_destructor.decl [concrete = constants.%C.cpp_destructor] -// CHECK:STDOUT: %C.cpp_destructor.bound.loc15: = bound_method %.loc15_29.3, %Op.ref.loc15 -// CHECK:STDOUT: %C.cpp_destructor.call.loc15: init %empty_tuple.type = call %C.cpp_destructor.bound.loc15(%.loc15_29.3) -// CHECK:STDOUT: %C.Op.bound.loc8: = bound_method %c.var, constants.%C.Op -// CHECK:STDOUT: %Op.ref.loc8: %C.cpp_destructor.type = name_ref Op, imports.%C.cpp_destructor.decl [concrete = constants.%C.cpp_destructor] -// CHECK:STDOUT: %C.cpp_destructor.bound.loc8: = bound_method %c.var, %Op.ref.loc8 -// CHECK:STDOUT: %C.cpp_destructor.call.loc8: init %empty_tuple.type = call %C.cpp_destructor.bound.loc8(%c.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc18: = bound_method %.loc18_34.3, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc18: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc18(%.loc18_34.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc15: = bound_method %.loc15_29.3, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc15: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc15(%.loc15_29.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: = bound_method %c.var, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%c.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc18(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param) +// CHECK:STDOUT: %C.cpp_destructor.call: init %empty_tuple.type = call imports.%C.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- import_binary_operators.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -1274,17 +1291,27 @@ fn F() { // CHECK:STDOUT: %operator_LessEqual__carbon_thunk: %operator_LessEqual__carbon_thunk.type = struct_value () [concrete] // CHECK:STDOUT: %index.patt: %pattern_type.6b6 = value_binding_pattern index [concrete] // CHECK:STDOUT: %int_42.20e: Core.IntLiteral = int_value 42 [concrete] +// CHECK:STDOUT: %self.param_patt.d5f: %pattern_type.b2b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.7ef: %pattern_type.b2b = wrapper_binding_pattern self, %self.param_patt.d5f [concrete] // CHECK:STDOUT: %BinaryC.cpp_operator.type: type = fn_type @BinaryC.cpp_operator [concrete] // CHECK:STDOUT: %BinaryC.cpp_operator: %BinaryC.cpp_operator.type = struct_value () [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.bf3: = bound_method %int_42.20e, %Core.IntLiteral.as.ImplicitAs.impl.Convert.e39 [concrete] // CHECK:STDOUT: %bound_method.098: = bound_method %int_42.20e, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_42.ac4: %i32 = int_value 42 [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc45 [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.40d: %pattern_type.831 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.560: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt.40d [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfc: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc45 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01: %Destroy.WithSelf.SubobjectDestroy.type.dfc = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc45 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc45 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete] // CHECK:STDOUT: %BinaryC.cpp_destructor.type: type = fn_type @BinaryC.cpp_destructor [concrete] // CHECK:STDOUT: %BinaryC.cpp_destructor: %BinaryC.cpp_destructor.type = struct_value () [concrete] -// CHECK:STDOUT: %BinaryC.Op.type: type = fn_type @BinaryC.Op [concrete] -// CHECK:STDOUT: %BinaryC.Op: %BinaryC.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc23 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc23 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1443,6 +1470,30 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl: %Destroy.WithSelf.SubobjectDestroy.type.dfc = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc45 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d] +// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0 +// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc45 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d] +// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0 +// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc23 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b2b = ref_param_pattern [concrete = constants.%self.param_patt.d5f] +// CHECK:STDOUT: %self.patt: %pattern_type.b2b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.7ef] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %BinaryC = ref_param call_param0 +// CHECK:STDOUT: %self: ref %BinaryC = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c1.var: ref %BinaryC = var_storage %c1.var_patt @@ -1908,72 +1959,66 @@ fn F() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %index.patt: %pattern_type.6b6 = value_binding_pattern index [concrete = constants.%index.patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc45: = bound_method %.loc45_44.3, constants.%Destroy.WithSelf.Op.403 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc45: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc45(%.loc45_44.3) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc44: = bound_method %.loc44_47.3, constants.%Destroy.WithSelf.Op.403 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc44: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc44(%.loc44_47.3) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc43: = bound_method %.loc43_35.3, constants.%Destroy.WithSelf.Op.403 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc43: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc43(%.loc43_35.3) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc42: = bound_method %.loc42_38.3, constants.%Destroy.WithSelf.Op.403 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc42: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc42(%.loc42_38.3) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc41: = bound_method %.loc41_35.3, constants.%Destroy.WithSelf.Op.403 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc41: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc41(%.loc41_35.3) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc40: = bound_method %.loc40_31.3, constants.%Destroy.WithSelf.Op.403 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc40: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc40(%.loc40_31.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc45: = bound_method %.loc45_44.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc45: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc45(%.loc45_44.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc44: = bound_method %.loc44_47.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc44: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc44(%.loc44_47.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc43: = bound_method %.loc43_35.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc43: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc43(%.loc43_35.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc42: = bound_method %.loc42_38.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc42: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc42(%.loc42_38.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc41: = bound_method %.loc41_35.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc41: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc41(%.loc41_35.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc40: = bound_method %.loc40_31.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc40: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc40(%.loc40_31.3) // CHECK:STDOUT: -// CHECK:STDOUT: %BinaryC.Op.bound.loc23: = bound_method %.loc23_44.3, constants.%BinaryC.Op -// CHECK:STDOUT: %Op.ref.loc23: %BinaryC.cpp_destructor.type = name_ref Op, imports.%BinaryC.cpp_destructor.decl [concrete = constants.%BinaryC.cpp_destructor] -// CHECK:STDOUT: %BinaryC.cpp_destructor.bound.loc23: = bound_method %.loc23_44.3, %Op.ref.loc23 -// CHECK:STDOUT: %BinaryC.cpp_destructor.call.loc23: init %empty_tuple.type = call %BinaryC.cpp_destructor.bound.loc23(%.loc23_44.3) -// CHECK:STDOUT: %BinaryC.Op.bound.loc22: = bound_method %.loc22_43.3, constants.%BinaryC.Op -// CHECK:STDOUT: %Op.ref.loc22: %BinaryC.cpp_destructor.type = name_ref Op, imports.%BinaryC.cpp_destructor.decl [concrete = constants.%BinaryC.cpp_destructor] -// CHECK:STDOUT: %BinaryC.cpp_destructor.bound.loc22: = bound_method %.loc22_43.3, %Op.ref.loc22 -// CHECK:STDOUT: %BinaryC.cpp_destructor.call.loc22: init %empty_tuple.type = call %BinaryC.cpp_destructor.bound.loc22(%.loc22_43.3) -// CHECK:STDOUT: %BinaryC.Op.bound.loc21: = bound_method %.loc21_44.3, constants.%BinaryC.Op -// CHECK:STDOUT: %Op.ref.loc21: %BinaryC.cpp_destructor.type = name_ref Op, imports.%BinaryC.cpp_destructor.decl [concrete = constants.%BinaryC.cpp_destructor] -// CHECK:STDOUT: %BinaryC.cpp_destructor.bound.loc21: = bound_method %.loc21_44.3, %Op.ref.loc21 -// CHECK:STDOUT: %BinaryC.cpp_destructor.call.loc21: init %empty_tuple.type = call %BinaryC.cpp_destructor.bound.loc21(%.loc21_44.3) -// CHECK:STDOUT: %BinaryC.Op.bound.loc20: = bound_method %.loc20_43.3, constants.%BinaryC.Op -// CHECK:STDOUT: %Op.ref.loc20: %BinaryC.cpp_destructor.type = name_ref Op, imports.%BinaryC.cpp_destructor.decl [concrete = constants.%BinaryC.cpp_destructor] -// CHECK:STDOUT: %BinaryC.cpp_destructor.bound.loc20: = bound_method %.loc20_43.3, %Op.ref.loc20 -// CHECK:STDOUT: %BinaryC.cpp_destructor.call.loc20: init %empty_tuple.type = call %BinaryC.cpp_destructor.bound.loc20(%.loc20_43.3) -// CHECK:STDOUT: %BinaryC.Op.bound.loc19: = bound_method %.loc19_44.3, constants.%BinaryC.Op -// CHECK:STDOUT: %Op.ref.loc19: %BinaryC.cpp_destructor.type = name_ref Op, imports.%BinaryC.cpp_destructor.decl [concrete = constants.%BinaryC.cpp_destructor] -// CHECK:STDOUT: %BinaryC.cpp_destructor.bound.loc19: = bound_method %.loc19_44.3, %Op.ref.loc19 -// CHECK:STDOUT: %BinaryC.cpp_destructor.call.loc19: init %empty_tuple.type = call %BinaryC.cpp_destructor.bound.loc19(%.loc19_44.3) -// CHECK:STDOUT: %BinaryC.Op.bound.loc16: = bound_method %.loc16_39.3, constants.%BinaryC.Op -// CHECK:STDOUT: %Op.ref.loc16: %BinaryC.cpp_destructor.type = name_ref Op, imports.%BinaryC.cpp_destructor.decl [concrete = constants.%BinaryC.cpp_destructor] -// CHECK:STDOUT: %BinaryC.cpp_destructor.bound.loc16: = bound_method %.loc16_39.3, %Op.ref.loc16 -// CHECK:STDOUT: %BinaryC.cpp_destructor.call.loc16: init %empty_tuple.type = call %BinaryC.cpp_destructor.bound.loc16(%.loc16_39.3) -// CHECK:STDOUT: %BinaryC.Op.bound.loc15: = bound_method %.loc15_41.3, constants.%BinaryC.Op -// CHECK:STDOUT: %Op.ref.loc15: %BinaryC.cpp_destructor.type = name_ref Op, imports.%BinaryC.cpp_destructor.decl [concrete = constants.%BinaryC.cpp_destructor] -// CHECK:STDOUT: %BinaryC.cpp_destructor.bound.loc15: = bound_method %.loc15_41.3, %Op.ref.loc15 -// CHECK:STDOUT: %BinaryC.cpp_destructor.call.loc15: init %empty_tuple.type = call %BinaryC.cpp_destructor.bound.loc15(%.loc15_41.3) -// CHECK:STDOUT: %BinaryC.Op.bound.loc14: = bound_method %.loc14_47.3, constants.%BinaryC.Op -// CHECK:STDOUT: %Op.ref.loc14: %BinaryC.cpp_destructor.type = name_ref Op, imports.%BinaryC.cpp_destructor.decl [concrete = constants.%BinaryC.cpp_destructor] -// CHECK:STDOUT: %BinaryC.cpp_destructor.bound.loc14: = bound_method %.loc14_47.3, %Op.ref.loc14 -// CHECK:STDOUT: %BinaryC.cpp_destructor.call.loc14: init %empty_tuple.type = call %BinaryC.cpp_destructor.bound.loc14(%.loc14_47.3) -// CHECK:STDOUT: %BinaryC.Op.bound.loc13: = bound_method %.loc13_44.3, constants.%BinaryC.Op -// CHECK:STDOUT: %Op.ref.loc13: %BinaryC.cpp_destructor.type = name_ref Op, imports.%BinaryC.cpp_destructor.decl [concrete = constants.%BinaryC.cpp_destructor] -// CHECK:STDOUT: %BinaryC.cpp_destructor.bound.loc13: = bound_method %.loc13_44.3, %Op.ref.loc13 -// CHECK:STDOUT: %BinaryC.cpp_destructor.call.loc13: init %empty_tuple.type = call %BinaryC.cpp_destructor.bound.loc13(%.loc13_44.3) -// CHECK:STDOUT: %BinaryC.Op.bound.loc12: = bound_method %.loc12_41.3, constants.%BinaryC.Op -// CHECK:STDOUT: %Op.ref.loc12: %BinaryC.cpp_destructor.type = name_ref Op, imports.%BinaryC.cpp_destructor.decl [concrete = constants.%BinaryC.cpp_destructor] -// CHECK:STDOUT: %BinaryC.cpp_destructor.bound.loc12: = bound_method %.loc12_41.3, %Op.ref.loc12 -// CHECK:STDOUT: %BinaryC.cpp_destructor.call.loc12: init %empty_tuple.type = call %BinaryC.cpp_destructor.bound.loc12(%.loc12_41.3) -// CHECK:STDOUT: %BinaryC.Op.bound.loc9: = bound_method %c2.var, constants.%BinaryC.Op -// CHECK:STDOUT: %Op.ref.loc9: %BinaryC.cpp_destructor.type = name_ref Op, imports.%BinaryC.cpp_destructor.decl [concrete = constants.%BinaryC.cpp_destructor] -// CHECK:STDOUT: %BinaryC.cpp_destructor.bound.loc9: = bound_method %c2.var, %Op.ref.loc9 -// CHECK:STDOUT: %BinaryC.cpp_destructor.call.loc9: init %empty_tuple.type = call %BinaryC.cpp_destructor.bound.loc9(%c2.var) -// CHECK:STDOUT: %BinaryC.Op.bound.loc8: = bound_method %c1.var, constants.%BinaryC.Op -// CHECK:STDOUT: %Op.ref.loc8: %BinaryC.cpp_destructor.type = name_ref Op, imports.%BinaryC.cpp_destructor.decl [concrete = constants.%BinaryC.cpp_destructor] -// CHECK:STDOUT: %BinaryC.cpp_destructor.bound.loc8: = bound_method %c1.var, %Op.ref.loc8 -// CHECK:STDOUT: %BinaryC.cpp_destructor.call.loc8: init %empty_tuple.type = call %BinaryC.cpp_destructor.bound.loc8(%c1.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc23: = bound_method %.loc23_44.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc23: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc23(%.loc23_44.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc22: = bound_method %.loc22_43.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc22: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc22(%.loc22_43.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc21: = bound_method %.loc21_44.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc21: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc21(%.loc21_44.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc20: = bound_method %.loc20_43.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc20: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc20(%.loc20_43.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc19: = bound_method %.loc19_44.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc19: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc19(%.loc19_44.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16: = bound_method %.loc16_39.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16(%.loc16_39.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc15: = bound_method %.loc15_41.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc15: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc15(%.loc15_41.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14: = bound_method %.loc14_47.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14(%.loc14_47.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc13: = bound_method %.loc13_44.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc13: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc13(%.loc13_44.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc12: = bound_method %.loc12_41.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc12: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc12(%.loc12_41.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc9: = bound_method %c2.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc9(%c2.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: = bound_method %c1.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%c1.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc45(%self.param: ref bool) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc45(%self.param: ref bool) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc45(%self.param: ref bool) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc23(%self.param: ref %BinaryC) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc23(%self.param: ref %BinaryC) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %BinaryC.cpp_destructor.call: init %empty_tuple.type = call imports.%BinaryC.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- multiple_calls.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -1993,10 +2038,14 @@ fn F() { // CHECK:STDOUT: %operator_Plus__carbon_thunk: %operator_Plus__carbon_thunk.type = struct_value () [concrete] // CHECK:STDOUT: %c4.patt: %pattern_type.b2b = value_binding_pattern c4 [concrete] // CHECK:STDOUT: %c5.patt: %pattern_type.b2b = value_binding_pattern c5 [concrete] +// CHECK:STDOUT: %self.param_patt.d5f: %pattern_type.b2b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.7ef: %pattern_type.b2b = wrapper_binding_pattern self, %self.param_patt.d5f [concrete] // CHECK:STDOUT: %BinaryC.cpp_destructor.type: type = fn_type @BinaryC.cpp_destructor [concrete] // CHECK:STDOUT: %BinaryC.cpp_destructor: %BinaryC.cpp_destructor.type = struct_value () [concrete] -// CHECK:STDOUT: %BinaryC.Op.type: type = fn_type @BinaryC.Op [concrete] -// CHECK:STDOUT: %BinaryC.Op: %BinaryC.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc12 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc12 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -2023,6 +2072,16 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc12 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b2b = ref_param_pattern [concrete = constants.%self.param_patt.d5f] +// CHECK:STDOUT: %self.patt: %pattern_type.b2b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.7ef] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %BinaryC = ref_param call_param0 +// CHECK:STDOUT: %self: ref %BinaryC = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref.loc8_25: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -2120,29 +2179,28 @@ fn F() { // CHECK:STDOUT: %c5.patt: %pattern_type.b2b = value_binding_pattern c5 [concrete = constants.%c5.patt] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: %BinaryC.Op.bound.loc12: = bound_method %.loc12_35.3, constants.%BinaryC.Op -// CHECK:STDOUT: %Op.ref.loc12: %BinaryC.cpp_destructor.type = name_ref Op, imports.%BinaryC.cpp_destructor.decl [concrete = constants.%BinaryC.cpp_destructor] -// CHECK:STDOUT: %BinaryC.cpp_destructor.bound.loc12: = bound_method %.loc12_35.3, %Op.ref.loc12 -// CHECK:STDOUT: %BinaryC.cpp_destructor.call.loc12: init %empty_tuple.type = call %BinaryC.cpp_destructor.bound.loc12(%.loc12_35.3) -// CHECK:STDOUT: %BinaryC.Op.bound.loc11: = bound_method %.loc11_28.3, constants.%BinaryC.Op -// CHECK:STDOUT: %Op.ref.loc11: %BinaryC.cpp_destructor.type = name_ref Op, imports.%BinaryC.cpp_destructor.decl [concrete = constants.%BinaryC.cpp_destructor] -// CHECK:STDOUT: %BinaryC.cpp_destructor.bound.loc11: = bound_method %.loc11_28.3, %Op.ref.loc11 -// CHECK:STDOUT: %BinaryC.cpp_destructor.call.loc11: init %empty_tuple.type = call %BinaryC.cpp_destructor.bound.loc11(%.loc11_28.3) -// CHECK:STDOUT: %BinaryC.Op.bound.loc10: = bound_method %.loc10_28.3, constants.%BinaryC.Op -// CHECK:STDOUT: %Op.ref.loc10: %BinaryC.cpp_destructor.type = name_ref Op, imports.%BinaryC.cpp_destructor.decl [concrete = constants.%BinaryC.cpp_destructor] -// CHECK:STDOUT: %BinaryC.cpp_destructor.bound.loc10: = bound_method %.loc10_28.3, %Op.ref.loc10 -// CHECK:STDOUT: %BinaryC.cpp_destructor.call.loc10: init %empty_tuple.type = call %BinaryC.cpp_destructor.bound.loc10(%.loc10_28.3) -// CHECK:STDOUT: %BinaryC.Op.bound.loc9: = bound_method %.loc9_45.3, constants.%BinaryC.Op -// CHECK:STDOUT: %Op.ref.loc9: %BinaryC.cpp_destructor.type = name_ref Op, imports.%BinaryC.cpp_destructor.decl [concrete = constants.%BinaryC.cpp_destructor] -// CHECK:STDOUT: %BinaryC.cpp_destructor.bound.loc9: = bound_method %.loc9_45.3, %Op.ref.loc9 -// CHECK:STDOUT: %BinaryC.cpp_destructor.call.loc9: init %empty_tuple.type = call %BinaryC.cpp_destructor.bound.loc9(%.loc9_45.3) -// CHECK:STDOUT: %BinaryC.Op.bound.loc8: = bound_method %.loc8_45.3, constants.%BinaryC.Op -// CHECK:STDOUT: %Op.ref.loc8: %BinaryC.cpp_destructor.type = name_ref Op, imports.%BinaryC.cpp_destructor.decl [concrete = constants.%BinaryC.cpp_destructor] -// CHECK:STDOUT: %BinaryC.cpp_destructor.bound.loc8: = bound_method %.loc8_45.3, %Op.ref.loc8 -// CHECK:STDOUT: %BinaryC.cpp_destructor.call.loc8: init %empty_tuple.type = call %BinaryC.cpp_destructor.bound.loc8(%.loc8_45.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc12: = bound_method %.loc12_35.3, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc12: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc12(%.loc12_35.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc11: = bound_method %.loc11_28.3, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc11: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc11(%.loc11_28.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10: = bound_method %.loc10_28.3, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10(%.loc10_28.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc9: = bound_method %.loc9_45.3, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc9(%.loc9_45.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: = bound_method %.loc8_45.3, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%.loc8_45.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc12(%self.param: ref %BinaryC) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc12(%self.param: ref %BinaryC) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param) +// CHECK:STDOUT: %BinaryC.cpp_destructor.call: init %empty_tuple.type = call imports.%BinaryC.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_rewrite_spaceship.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -2169,12 +2227,22 @@ fn F() { // CHECK:STDOUT: %less_than_or_equal.patt: %pattern_type.831 = value_binding_pattern less_than_or_equal [concrete] // CHECK:STDOUT: %operator_LessEqual__carbon_thunk.type: type = fn_type @operator_LessEqual__carbon_thunk [concrete] // CHECK:STDOUT: %operator_LessEqual__carbon_thunk: %operator_LessEqual__carbon_thunk.type = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc36 [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.40d: %pattern_type.831 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.560: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt.40d [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfc: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc36 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01: %Destroy.WithSelf.SubobjectDestroy.type.dfc = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc36 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc36 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.e2f: %pattern_type.bbc = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.790: %pattern_type.bbc = wrapper_binding_pattern self, %self.param_patt.e2f [concrete] // CHECK:STDOUT: %C.cpp_destructor.type: type = fn_type @C.cpp_destructor [concrete] // CHECK:STDOUT: %C.cpp_destructor: %C.cpp_destructor.type = struct_value () [concrete] -// CHECK:STDOUT: %C.Op.type: type = fn_type @C.Op [concrete] -// CHECK:STDOUT: %C.Op: %C.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc16 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc16 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -2206,6 +2274,30 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl: %Destroy.WithSelf.SubobjectDestroy.type.dfc = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc36 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d] +// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0 +// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc36 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d] +// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0 +// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc16 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.bbc = ref_param_pattern [concrete = constants.%self.param_patt.e2f] +// CHECK:STDOUT: %self.patt: %pattern_type.bbc = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.790] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c1.var: ref %C = var_storage %c1.var_patt @@ -2296,24 +2388,38 @@ fn F() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %less_than_or_equal.patt: %pattern_type.831 = value_binding_pattern less_than_or_equal [concrete = constants.%less_than_or_equal.patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc36: = bound_method %.loc36_44.3, constants.%Destroy.WithSelf.Op.403 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc36: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc36(%.loc36_44.3) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc19: = bound_method %.loc19_38.3, constants.%Destroy.WithSelf.Op.403 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc19: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc19(%.loc19_38.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc36: = bound_method %.loc36_44.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc36: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc36(%.loc36_44.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc19: = bound_method %.loc19_38.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc19: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc19(%.loc19_38.3) // CHECK:STDOUT: -// CHECK:STDOUT: %C.Op.bound.loc16: = bound_method %c2.var, constants.%C.Op -// CHECK:STDOUT: %Op.ref.loc16: %C.cpp_destructor.type = name_ref Op, imports.%C.cpp_destructor.decl [concrete = constants.%C.cpp_destructor] -// CHECK:STDOUT: %C.cpp_destructor.bound.loc16: = bound_method %c2.var, %Op.ref.loc16 -// CHECK:STDOUT: %C.cpp_destructor.call.loc16: init %empty_tuple.type = call %C.cpp_destructor.bound.loc16(%c2.var) -// CHECK:STDOUT: %C.Op.bound.loc15: = bound_method %c1.var, constants.%C.Op -// CHECK:STDOUT: %Op.ref.loc15: %C.cpp_destructor.type = name_ref Op, imports.%C.cpp_destructor.decl [concrete = constants.%C.cpp_destructor] -// CHECK:STDOUT: %C.cpp_destructor.bound.loc15: = bound_method %c1.var, %Op.ref.loc15 -// CHECK:STDOUT: %C.cpp_destructor.call.loc15: init %empty_tuple.type = call %C.cpp_destructor.bound.loc15(%c1.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16: = bound_method %c2.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16(%c2.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc15: = bound_method %c1.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc15: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc15(%c1.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc36(%self.param: ref bool) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc36(%self.param: ref bool) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc36(%self.param: ref bool) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc16(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %C.cpp_destructor.call: init %empty_tuple.type = call imports.%C.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_rewrite_equal.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -2336,12 +2442,22 @@ fn F() { // CHECK:STDOUT: %operator_EqualEqual__carbon_thunk.type: type = fn_type @operator_EqualEqual__carbon_thunk [concrete] // CHECK:STDOUT: %operator_EqualEqual__carbon_thunk: %operator_EqualEqual__carbon_thunk.type = struct_value () [concrete] // CHECK:STDOUT: %not_equal.patt: %pattern_type.831 = value_binding_pattern not_equal [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc16 [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.40d: %pattern_type.831 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.560: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt.40d [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfc: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc16 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01: %Destroy.WithSelf.SubobjectDestroy.type.dfc = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc16 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc16 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.765: %pattern_type.4e7 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.9b7: %pattern_type.4e7 = wrapper_binding_pattern self, %self.param_patt.765 [concrete] // CHECK:STDOUT: %EqualC.cpp_destructor.type: type = fn_type @EqualC.cpp_destructor [concrete] // CHECK:STDOUT: %EqualC.cpp_destructor: %EqualC.cpp_destructor.type = struct_value () [concrete] -// CHECK:STDOUT: %EqualC.Op.type: type = fn_type @EqualC.Op [concrete] -// CHECK:STDOUT: %EqualC.Op: %EqualC.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc13 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc13 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -2368,6 +2484,30 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl: %Destroy.WithSelf.SubobjectDestroy.type.dfc = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc16 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d] +// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0 +// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc16 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d] +// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0 +// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc13 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.4e7 = ref_param_pattern [concrete = constants.%self.param_patt.765] +// CHECK:STDOUT: %self.patt: %pattern_type.4e7 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.9b7] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %EqualC = ref_param call_param0 +// CHECK:STDOUT: %self: ref %EqualC = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c1.var: ref %EqualC = var_storage %c1.var_patt @@ -2432,22 +2572,36 @@ fn F() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %not_equal.patt: %pattern_type.831 = value_binding_pattern not_equal [concrete = constants.%not_equal.patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.loc16_31.3, constants.%Destroy.WithSelf.Op.403 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%.loc16_31.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16: = bound_method %.loc16_31.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16(%.loc16_31.3) // CHECK:STDOUT: -// CHECK:STDOUT: %EqualC.Op.bound.loc13: = bound_method %c2.var, constants.%EqualC.Op -// CHECK:STDOUT: %Op.ref.loc13: %EqualC.cpp_destructor.type = name_ref Op, imports.%EqualC.cpp_destructor.decl [concrete = constants.%EqualC.cpp_destructor] -// CHECK:STDOUT: %EqualC.cpp_destructor.bound.loc13: = bound_method %c2.var, %Op.ref.loc13 -// CHECK:STDOUT: %EqualC.cpp_destructor.call.loc13: init %empty_tuple.type = call %EqualC.cpp_destructor.bound.loc13(%c2.var) -// CHECK:STDOUT: %EqualC.Op.bound.loc12: = bound_method %c1.var, constants.%EqualC.Op -// CHECK:STDOUT: %Op.ref.loc12: %EqualC.cpp_destructor.type = name_ref Op, imports.%EqualC.cpp_destructor.decl [concrete = constants.%EqualC.cpp_destructor] -// CHECK:STDOUT: %EqualC.cpp_destructor.bound.loc12: = bound_method %c1.var, %Op.ref.loc12 -// CHECK:STDOUT: %EqualC.cpp_destructor.call.loc12: init %empty_tuple.type = call %EqualC.cpp_destructor.bound.loc12(%c1.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc13: = bound_method %c2.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc13: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc13(%c2.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc12: = bound_method %c1.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc12: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc12(%c1.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc16(%self.param: ref bool) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16(%self.param: ref bool) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc16(%self.param: ref bool) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc13(%self.param: ref %EqualC) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc13(%self.param: ref %EqualC) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %EqualC.cpp_destructor.call: init %empty_tuple.type = call imports.%EqualC.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- import_single_namespace.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -2465,10 +2619,14 @@ fn F() { // CHECK:STDOUT: %c3.patt: %pattern_type.7cb = value_binding_pattern c3 [concrete] // CHECK:STDOUT: %operator_Plus__carbon_thunk.type: type = fn_type @operator_Plus__carbon_thunk [concrete] // CHECK:STDOUT: %operator_Plus__carbon_thunk: %operator_Plus__carbon_thunk.type = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.bfc: %pattern_type.7cb = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.c51: %pattern_type.7cb = wrapper_binding_pattern self, %self.param_patt.bfc [concrete] // CHECK:STDOUT: %C.cpp_destructor.type: type = fn_type @C.cpp_destructor [concrete] // CHECK:STDOUT: %C.cpp_destructor: %C.cpp_destructor.type = struct_value () [concrete] -// CHECK:STDOUT: %C.Op.type: type = fn_type @C.Op [concrete] -// CHECK:STDOUT: %C.Op: %C.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc10 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -2499,6 +2657,16 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc10 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.7cb = ref_param_pattern [concrete = constants.%self.param_patt.bfc] +// CHECK:STDOUT: %self.patt: %pattern_type.7cb = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.c51] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref.loc8_21: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -2561,21 +2729,24 @@ fn F() { // CHECK:STDOUT: %c3.patt: %pattern_type.7cb = value_binding_pattern c3 [concrete = constants.%c3.patt] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: %C.Op.bound.loc10: = bound_method %.loc10_31.3, constants.%C.Op -// CHECK:STDOUT: %Op.ref.loc10: %C.cpp_destructor.type = name_ref Op, imports.%C.cpp_destructor.decl [concrete = constants.%C.cpp_destructor] -// CHECK:STDOUT: %C.cpp_destructor.bound.loc10: = bound_method %.loc10_31.3, %Op.ref.loc10 -// CHECK:STDOUT: %C.cpp_destructor.call.loc10: init %empty_tuple.type = call %C.cpp_destructor.bound.loc10(%.loc10_31.3) -// CHECK:STDOUT: %C.Op.bound.loc9: = bound_method %.loc9_31.3, constants.%C.Op -// CHECK:STDOUT: %Op.ref.loc9: %C.cpp_destructor.type = name_ref Op, imports.%C.cpp_destructor.decl [concrete = constants.%C.cpp_destructor] -// CHECK:STDOUT: %C.cpp_destructor.bound.loc9: = bound_method %.loc9_31.3, %Op.ref.loc9 -// CHECK:STDOUT: %C.cpp_destructor.call.loc9: init %empty_tuple.type = call %C.cpp_destructor.bound.loc9(%.loc9_31.3) -// CHECK:STDOUT: %C.Op.bound.loc8: = bound_method %.loc8_31.3, constants.%C.Op -// CHECK:STDOUT: %Op.ref.loc8: %C.cpp_destructor.type = name_ref Op, imports.%C.cpp_destructor.decl [concrete = constants.%C.cpp_destructor] -// CHECK:STDOUT: %C.cpp_destructor.bound.loc8: = bound_method %.loc8_31.3, %Op.ref.loc8 -// CHECK:STDOUT: %C.cpp_destructor.call.loc8: init %empty_tuple.type = call %C.cpp_destructor.bound.loc8(%.loc8_31.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10: = bound_method %.loc10_31.3, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10(%.loc10_31.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc9: = bound_method %.loc9_31.3, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc9(%.loc9_31.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: = bound_method %.loc8_31.3, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%.loc8_31.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param) +// CHECK:STDOUT: %C.cpp_destructor.call: init %empty_tuple.type = call imports.%C.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- import_multiple_namespaces.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -2603,14 +2774,22 @@ fn F() { // CHECK:STDOUT: %c4.patt: %pattern_type.00d = value_binding_pattern c4 [concrete] // CHECK:STDOUT: %operator_Minus__carbon_thunk.type: type = fn_type @operator_Minus__carbon_thunk [concrete] // CHECK:STDOUT: %operator_Minus__carbon_thunk: %operator_Minus__carbon_thunk.type = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.79f: %pattern_type.00d = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.d7a: %pattern_type.00d = wrapper_binding_pattern self, %self.param_patt.79f [concrete] // CHECK:STDOUT: %C2.cpp_destructor.type: type = fn_type @C2.cpp_destructor [concrete] // CHECK:STDOUT: %C2.cpp_destructor: %C2.cpp_destructor.type = struct_value () [concrete] -// CHECK:STDOUT: %C2.Op.type: type = fn_type @C2.Op [concrete] -// CHECK:STDOUT: %C2.Op: %C2.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc11 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc11 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.b11: %pattern_type.da8 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.fde: %pattern_type.da8 = wrapper_binding_pattern self, %self.param_patt.b11 [concrete] // CHECK:STDOUT: %C1.cpp_destructor.type: type = fn_type @C1.cpp_destructor [concrete] // CHECK:STDOUT: %C1.cpp_destructor: %C1.cpp_destructor.type = struct_value () [concrete] -// CHECK:STDOUT: %C1.Op.type: type = fn_type @C1.Op [concrete] -// CHECK:STDOUT: %C1.Op: %C1.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -2663,6 +2842,23 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc11 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.00d = ref_param_pattern [concrete = constants.%self.param_patt.79f] +// CHECK:STDOUT: %self.patt: %pattern_type.00d = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d7a] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C2 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C2 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc8 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.da8 = ref_param_pattern [concrete = constants.%self.param_patt.b11] +// CHECK:STDOUT: %self.patt: %pattern_type.da8 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.fde] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C1 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C1 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref.loc8_23: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -2746,26 +2942,36 @@ fn F() { // CHECK:STDOUT: %c4.patt: %pattern_type.00d = value_binding_pattern c4 [concrete = constants.%c4.patt] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: %C2.Op.bound.loc11: = bound_method %.loc11_33.3, constants.%C2.Op -// CHECK:STDOUT: %Op.ref.loc11: %C2.cpp_destructor.type = name_ref Op, imports.%C2.cpp_destructor.decl [concrete = constants.%C2.cpp_destructor] -// CHECK:STDOUT: %C2.cpp_destructor.bound.loc11: = bound_method %.loc11_33.3, %Op.ref.loc11 -// CHECK:STDOUT: %C2.cpp_destructor.call.loc11: init %empty_tuple.type = call %C2.cpp_destructor.bound.loc11(%.loc11_33.3) -// CHECK:STDOUT: %C2.Op.bound.loc10: = bound_method %.loc10_33.3, constants.%C2.Op -// CHECK:STDOUT: %Op.ref.loc10: %C2.cpp_destructor.type = name_ref Op, imports.%C2.cpp_destructor.decl [concrete = constants.%C2.cpp_destructor] -// CHECK:STDOUT: %C2.cpp_destructor.bound.loc10: = bound_method %.loc10_33.3, %Op.ref.loc10 -// CHECK:STDOUT: %C2.cpp_destructor.call.loc10: init %empty_tuple.type = call %C2.cpp_destructor.bound.loc10(%.loc10_33.3) -// CHECK:STDOUT: %C2.Op.bound.loc9: = bound_method %.loc9_36.3, constants.%C2.Op -// CHECK:STDOUT: %Op.ref.loc9: %C2.cpp_destructor.type = name_ref Op, imports.%C2.cpp_destructor.decl [concrete = constants.%C2.cpp_destructor] -// CHECK:STDOUT: %C2.cpp_destructor.bound.loc9: = bound_method %.loc9_36.3, %Op.ref.loc9 -// CHECK:STDOUT: %C2.cpp_destructor.call.loc9: init %empty_tuple.type = call %C2.cpp_destructor.bound.loc9(%.loc9_36.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc11: = bound_method %.loc11_33.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc11: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc11(%.loc11_33.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10: = bound_method %.loc10_33.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10(%.loc10_33.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc9: = bound_method %.loc9_36.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc9(%.loc9_36.3) // CHECK:STDOUT: -// CHECK:STDOUT: %C1.Op.bound: = bound_method %.loc8_36.3, constants.%C1.Op -// CHECK:STDOUT: %Op.ref.loc8: %C1.cpp_destructor.type = name_ref Op, imports.%C1.cpp_destructor.decl [concrete = constants.%C1.cpp_destructor] -// CHECK:STDOUT: %C1.cpp_destructor.bound: = bound_method %.loc8_36.3, %Op.ref.loc8 -// CHECK:STDOUT: %C1.cpp_destructor.call: init %empty_tuple.type = call %C1.cpp_destructor.bound(%.loc8_36.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: = bound_method %.loc8_36.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%.loc8_36.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11(%self.param: ref %C2) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11(%self.param: ref %C2) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %C2.cpp_destructor.call: init %empty_tuple.type = call imports.%C2.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8(%self.param: ref %C1) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8(%self.param: ref %C1) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %C1.cpp_destructor.call: init %empty_tuple.type = call imports.%C1.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_import_operands_in_namespace_operator_in_global.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -2781,10 +2987,14 @@ fn F() { // CHECK:STDOUT: %C__carbon_thunk: %C__carbon_thunk.type = struct_value () [concrete] // CHECK:STDOUT: %c2.patt: %pattern_type.73b = value_binding_pattern c2 [concrete] // CHECK:STDOUT: %c3.patt: %pattern_type.73b = value_binding_pattern c3 [concrete] +// CHECK:STDOUT: %self.param_patt.a6a: %pattern_type.73b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.fd6: %pattern_type.73b = wrapper_binding_pattern self, %self.param_patt.a6a [concrete] // CHECK:STDOUT: %C.cpp_destructor.type: type = fn_type @C.cpp_destructor [concrete] // CHECK:STDOUT: %C.cpp_destructor: %C.cpp_destructor.type = struct_value () [concrete] -// CHECK:STDOUT: %C.Op.type: type = fn_type @C.Op [concrete] -// CHECK:STDOUT: %C.Op: %C.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -2810,6 +3020,16 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc9 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.73b = ref_param_pattern [concrete = constants.%self.param_patt.a6a] +// CHECK:STDOUT: %self.patt: %pattern_type.73b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.fd6] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref.loc8_29: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -2862,17 +3082,22 @@ fn F() { // CHECK:STDOUT: %c3.patt: %pattern_type.73b = value_binding_pattern c3 [concrete = constants.%c3.patt] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: %C.Op.bound.loc9: = bound_method %.loc9_47.3, constants.%C.Op -// CHECK:STDOUT: %Op.ref.loc9: %C.cpp_destructor.type = name_ref Op, imports.%C.cpp_destructor.decl [concrete = constants.%C.cpp_destructor] -// CHECK:STDOUT: %C.cpp_destructor.bound.loc9: = bound_method %.loc9_47.3, %Op.ref.loc9 -// CHECK:STDOUT: %C.cpp_destructor.call.loc9: init %empty_tuple.type = call %C.cpp_destructor.bound.loc9(%.loc9_47.3) -// CHECK:STDOUT: %C.Op.bound.loc8: = bound_method %.loc8_47.3, constants.%C.Op -// CHECK:STDOUT: %Op.ref.loc8: %C.cpp_destructor.type = name_ref Op, imports.%C.cpp_destructor.decl [concrete = constants.%C.cpp_destructor] -// CHECK:STDOUT: %C.cpp_destructor.bound.loc8: = bound_method %.loc8_47.3, %Op.ref.loc8 -// CHECK:STDOUT: %C.cpp_destructor.call.loc8: init %empty_tuple.type = call %C.cpp_destructor.bound.loc8(%.loc8_47.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc9: = bound_method %.loc9_47.3, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc9(%.loc9_47.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: = bound_method %.loc8_47.3, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%.loc8_47.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param) +// CHECK:STDOUT: %C.cpp_destructor.call: init %empty_tuple.type = call imports.%C.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- import_inner_class.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -2891,10 +3116,14 @@ fn F() { // CHECK:STDOUT: %c3.patt: %pattern_type.aac = value_binding_pattern c3 [concrete] // CHECK:STDOUT: %operator_Plus__carbon_thunk.type: type = fn_type @operator_Plus__carbon_thunk [concrete] // CHECK:STDOUT: %operator_Plus__carbon_thunk: %operator_Plus__carbon_thunk.type = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.f64: %pattern_type.aac = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.fdd: %pattern_type.aac = wrapper_binding_pattern self, %self.param_patt.f64 [concrete] // CHECK:STDOUT: %C.cpp_destructor.type: type = fn_type @C.cpp_destructor [concrete] // CHECK:STDOUT: %C.cpp_destructor: %C.cpp_destructor.type = struct_value () [concrete] -// CHECK:STDOUT: %C.Op.type: type = fn_type @C.Op [concrete] -// CHECK:STDOUT: %C.Op: %C.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc10 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -2922,6 +3151,16 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc10 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.aac = ref_param_pattern [concrete = constants.%self.param_patt.f64] +// CHECK:STDOUT: %self.patt: %pattern_type.aac = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.fdd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref.loc8_21: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -2984,21 +3223,24 @@ fn F() { // CHECK:STDOUT: %c3.patt: %pattern_type.aac = value_binding_pattern c3 [concrete = constants.%c3.patt] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: %C.Op.bound.loc10: = bound_method %.loc10_31.3, constants.%C.Op -// CHECK:STDOUT: %Op.ref.loc10: %C.cpp_destructor.type = name_ref Op, imports.%C.cpp_destructor.decl [concrete = constants.%C.cpp_destructor] -// CHECK:STDOUT: %C.cpp_destructor.bound.loc10: = bound_method %.loc10_31.3, %Op.ref.loc10 -// CHECK:STDOUT: %C.cpp_destructor.call.loc10: init %empty_tuple.type = call %C.cpp_destructor.bound.loc10(%.loc10_31.3) -// CHECK:STDOUT: %C.Op.bound.loc9: = bound_method %.loc9_31.3, constants.%C.Op -// CHECK:STDOUT: %Op.ref.loc9: %C.cpp_destructor.type = name_ref Op, imports.%C.cpp_destructor.decl [concrete = constants.%C.cpp_destructor] -// CHECK:STDOUT: %C.cpp_destructor.bound.loc9: = bound_method %.loc9_31.3, %Op.ref.loc9 -// CHECK:STDOUT: %C.cpp_destructor.call.loc9: init %empty_tuple.type = call %C.cpp_destructor.bound.loc9(%.loc9_31.3) -// CHECK:STDOUT: %C.Op.bound.loc8: = bound_method %.loc8_31.3, constants.%C.Op -// CHECK:STDOUT: %Op.ref.loc8: %C.cpp_destructor.type = name_ref Op, imports.%C.cpp_destructor.decl [concrete = constants.%C.cpp_destructor] -// CHECK:STDOUT: %C.cpp_destructor.bound.loc8: = bound_method %.loc8_31.3, %Op.ref.loc8 -// CHECK:STDOUT: %C.cpp_destructor.call.loc8: init %empty_tuple.type = call %C.cpp_destructor.bound.loc8(%.loc8_31.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10: = bound_method %.loc10_31.3, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10(%.loc10_31.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc9: = bound_method %.loc9_31.3, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc9(%.loc9_31.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: = bound_method %.loc8_31.3, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%.loc8_31.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param) +// CHECK:STDOUT: %C.cpp_destructor.call: init %empty_tuple.type = call imports.%C.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- import_inner_class_in_namespace.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -3017,10 +3259,14 @@ fn F() { // CHECK:STDOUT: %c3.patt: %pattern_type.f6e = value_binding_pattern c3 [concrete] // CHECK:STDOUT: %operator_Plus__carbon_thunk.type: type = fn_type @operator_Plus__carbon_thunk [concrete] // CHECK:STDOUT: %operator_Plus__carbon_thunk: %operator_Plus__carbon_thunk.type = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.83b: %pattern_type.f6e = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.afb: %pattern_type.f6e = wrapper_binding_pattern self, %self.param_patt.83b [concrete] // CHECK:STDOUT: %C.cpp_destructor.type: type = fn_type @C.cpp_destructor [concrete] // CHECK:STDOUT: %C.cpp_destructor: %C.cpp_destructor.type = struct_value () [concrete] -// CHECK:STDOUT: %C.Op.type: type = fn_type @C.Op [concrete] -// CHECK:STDOUT: %C.Op: %C.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc10 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -3052,6 +3298,16 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc10 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f6e = ref_param_pattern [concrete = constants.%self.param_patt.83b] +// CHECK:STDOUT: %self.patt: %pattern_type.f6e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.afb] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref.loc8_23: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -3119,21 +3375,24 @@ fn F() { // CHECK:STDOUT: %c3.patt: %pattern_type.f6e = value_binding_pattern c3 [concrete = constants.%c3.patt] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: %C.Op.bound.loc10: = bound_method %.loc10_33.3, constants.%C.Op -// CHECK:STDOUT: %Op.ref.loc10: %C.cpp_destructor.type = name_ref Op, imports.%C.cpp_destructor.decl [concrete = constants.%C.cpp_destructor] -// CHECK:STDOUT: %C.cpp_destructor.bound.loc10: = bound_method %.loc10_33.3, %Op.ref.loc10 -// CHECK:STDOUT: %C.cpp_destructor.call.loc10: init %empty_tuple.type = call %C.cpp_destructor.bound.loc10(%.loc10_33.3) -// CHECK:STDOUT: %C.Op.bound.loc9: = bound_method %.loc9_35.3, constants.%C.Op -// CHECK:STDOUT: %Op.ref.loc9: %C.cpp_destructor.type = name_ref Op, imports.%C.cpp_destructor.decl [concrete = constants.%C.cpp_destructor] -// CHECK:STDOUT: %C.cpp_destructor.bound.loc9: = bound_method %.loc9_35.3, %Op.ref.loc9 -// CHECK:STDOUT: %C.cpp_destructor.call.loc9: init %empty_tuple.type = call %C.cpp_destructor.bound.loc9(%.loc9_35.3) -// CHECK:STDOUT: %C.Op.bound.loc8: = bound_method %.loc8_35.3, constants.%C.Op -// CHECK:STDOUT: %Op.ref.loc8: %C.cpp_destructor.type = name_ref Op, imports.%C.cpp_destructor.decl [concrete = constants.%C.cpp_destructor] -// CHECK:STDOUT: %C.cpp_destructor.bound.loc8: = bound_method %.loc8_35.3, %Op.ref.loc8 -// CHECK:STDOUT: %C.cpp_destructor.call.loc8: init %empty_tuple.type = call %C.cpp_destructor.bound.loc8(%.loc8_35.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10: = bound_method %.loc10_33.3, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10(%.loc10_33.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc9: = bound_method %.loc9_35.3, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc9(%.loc9_35.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: = bound_method %.loc8_35.3, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%.loc8_35.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param) +// CHECK:STDOUT: %C.cpp_destructor.call: init %empty_tuple.type = call imports.%C.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- import_member_add_with.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -3150,6 +3409,8 @@ fn F() { // CHECK:STDOUT: %MemberClass__carbon_thunk: %MemberClass__carbon_thunk.type = struct_value () [concrete] // CHECK:STDOUT: %c2.patt: %pattern_type.809 = ref_binding_pattern c2 [concrete] // CHECK:STDOUT: %c2.var_patt: %pattern_type.809 = var_pattern %c2.patt [concrete] +// CHECK:STDOUT: %self.param_patt.5e6: %pattern_type.809 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.82a: %pattern_type.809 = wrapper_binding_pattern self, %self.param_patt.5e6 [concrete] // CHECK:STDOUT: %operator_Minus__carbon_thunk.type: type = fn_type @operator_Minus__carbon_thunk [concrete] // CHECK:STDOUT: %operator_Minus__carbon_thunk: %operator_Minus__carbon_thunk.type = struct_value () [concrete] // CHECK:STDOUT: %c3.patt: %pattern_type.809 = ref_binding_pattern c3 [concrete] @@ -3158,8 +3419,10 @@ fn F() { // CHECK:STDOUT: %operator_Plus__carbon_thunk: %operator_Plus__carbon_thunk.type = struct_value () [concrete] // CHECK:STDOUT: %MemberClass.cpp_destructor.type: type = fn_type @MemberClass.cpp_destructor [concrete] // CHECK:STDOUT: %MemberClass.cpp_destructor: %MemberClass.cpp_destructor.type = struct_value () [concrete] -// CHECK:STDOUT: %MemberClass.Op.type: type = fn_type @MemberClass.Op [concrete] -// CHECK:STDOUT: %MemberClass.Op: %MemberClass.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc10 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -3191,6 +3454,16 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc10 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.809 = ref_param_pattern [concrete = constants.%self.param_patt.5e6] +// CHECK:STDOUT: %self.patt: %pattern_type.809 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.82a] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %MemberClass = ref_param call_param0 +// CHECK:STDOUT: %self: ref %MemberClass = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c1.var: ref %MemberClass = var_storage %c1.var_patt @@ -3248,21 +3521,24 @@ fn F() { // CHECK:STDOUT: %c3.var_patt: %pattern_type.809 = var_pattern %c3.patt [concrete = constants.%c3.var_patt] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: %MemberClass.Op.bound.loc10: = bound_method %c3.var, constants.%MemberClass.Op -// CHECK:STDOUT: %Op.ref.loc10: %MemberClass.cpp_destructor.type = name_ref Op, imports.%MemberClass.cpp_destructor.decl [concrete = constants.%MemberClass.cpp_destructor] -// CHECK:STDOUT: %MemberClass.cpp_destructor.bound.loc10: = bound_method %c3.var, %Op.ref.loc10 -// CHECK:STDOUT: %MemberClass.cpp_destructor.call.loc10: init %empty_tuple.type = call %MemberClass.cpp_destructor.bound.loc10(%c3.var) -// CHECK:STDOUT: %MemberClass.Op.bound.loc9: = bound_method %c2.var, constants.%MemberClass.Op -// CHECK:STDOUT: %Op.ref.loc9: %MemberClass.cpp_destructor.type = name_ref Op, imports.%MemberClass.cpp_destructor.decl [concrete = constants.%MemberClass.cpp_destructor] -// CHECK:STDOUT: %MemberClass.cpp_destructor.bound.loc9: = bound_method %c2.var, %Op.ref.loc9 -// CHECK:STDOUT: %MemberClass.cpp_destructor.call.loc9: init %empty_tuple.type = call %MemberClass.cpp_destructor.bound.loc9(%c2.var) -// CHECK:STDOUT: %MemberClass.Op.bound.loc8: = bound_method %c1.var, constants.%MemberClass.Op -// CHECK:STDOUT: %Op.ref.loc8: %MemberClass.cpp_destructor.type = name_ref Op, imports.%MemberClass.cpp_destructor.decl [concrete = constants.%MemberClass.cpp_destructor] -// CHECK:STDOUT: %MemberClass.cpp_destructor.bound.loc8: = bound_method %c1.var, %Op.ref.loc8 -// CHECK:STDOUT: %MemberClass.cpp_destructor.call.loc8: init %empty_tuple.type = call %MemberClass.cpp_destructor.bound.loc8(%c1.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10: = bound_method %c3.var, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10(%c3.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc9: = bound_method %c2.var, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc9(%c2.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: = bound_method %c1.var, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%c1.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10(%self.param: ref %MemberClass) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10(%self.param: ref %MemberClass) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param) +// CHECK:STDOUT: %MemberClass.cpp_destructor.call: init %empty_tuple.type = call imports.%MemberClass.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- indirect_template_instantiation.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -3306,10 +3582,14 @@ fn F() { // CHECK:STDOUT: %c3.patt: %pattern_type.bbc = value_binding_pattern c3 [concrete] // CHECK:STDOUT: %operator_Plus__carbon_thunk.type: type = fn_type @operator_Plus__carbon_thunk [concrete] // CHECK:STDOUT: %operator_Plus__carbon_thunk: %operator_Plus__carbon_thunk.type = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.e2f: %pattern_type.bbc = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.790: %pattern_type.bbc = wrapper_binding_pattern self, %self.param_patt.e2f [concrete] // CHECK:STDOUT: %C.cpp_destructor.type: type = fn_type @C.cpp_destructor [concrete] // CHECK:STDOUT: %C.cpp_destructor: %C.cpp_destructor.type = struct_value () [concrete] -// CHECK:STDOUT: %C.Op.type: type = fn_type @C.Op [concrete] -// CHECK:STDOUT: %C.Op: %C.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc10 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -3330,6 +3610,16 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc10 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.bbc = ref_param_pattern [concrete = constants.%self.param_patt.e2f] +// CHECK:STDOUT: %self.patt: %pattern_type.bbc = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.790] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: @@ -3354,10 +3644,17 @@ fn F() { // CHECK:STDOUT: %c3.patt: %pattern_type.bbc = value_binding_pattern c3 [concrete = constants.%c3.patt] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: %C.Op.bound.loc10: = bound_method %.loc10_29.3, constants.%C.Op -// CHECK:STDOUT: %Op.ref.loc10: %C.cpp_destructor.type = name_ref Op, imports.%C.cpp_destructor.decl [concrete = constants.%C.cpp_destructor] -// CHECK:STDOUT: %C.cpp_destructor.bound.loc10: = bound_method %.loc10_29.3, %Op.ref.loc10 -// CHECK:STDOUT: %C.cpp_destructor.call.loc10: init %empty_tuple.type = call %C.cpp_destructor.bound.loc10(%.loc10_29.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10: = bound_method %.loc10_29.3, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10(%.loc10_29.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param) +// CHECK:STDOUT: %C.cpp_destructor.call: init %empty_tuple.type = call imports.%C.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/primitive_types/arithmetic.carbon b/toolchain/check/testdata/interop/cpp/primitive_types/arithmetic.carbon index ccf3bd895586..3f87cc07f010 100644 --- a/toolchain/check/testdata/interop/cpp/primitive_types/arithmetic.carbon +++ b/toolchain/check/testdata/interop/cpp/primitive_types/arithmetic.carbon @@ -549,10 +549,16 @@ fn F() { // CHECK:STDOUT: %x.patt: %pattern_type.668 = value_binding_pattern x [concrete] // CHECK:STDOUT: %unsigned_int.foo.cpp_overload_set.type: type = cpp_overload_set_type @unsigned_int.foo.cpp_overload_set [concrete] // CHECK:STDOUT: %unsigned_int.foo.cpp_overload_set.value: %unsigned_int.foo.cpp_overload_set.type = cpp_overload_set_value @unsigned_int.foo.cpp_overload_set [concrete] +// CHECK:STDOUT: %self.param_patt.9be: %pattern_type.990 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.330: %pattern_type.990 = wrapper_binding_pattern self, %self.param_patt.9be [concrete] // CHECK:STDOUT: %unsigned_int.foo.type: type = fn_type @unsigned_int.foo [concrete] // CHECK:STDOUT: %unsigned_int.foo: %unsigned_int.foo.type = struct_value () [concrete] // CHECK:STDOUT: %unsigned_int.cpp_destructor.type: type = fn_type @unsigned_int.cpp_destructor [concrete] // CHECK:STDOUT: %unsigned_int.cpp_destructor: %unsigned_int.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc12 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc12 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -569,6 +575,21 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } +// CHECK:STDOUT: %unsigned_int.cpp_destructor.decl: %unsigned_int.cpp_destructor.type = fn_decl @unsigned_int.cpp_destructor [concrete = constants.%unsigned_int.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc12 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.990 = ref_param_pattern [concrete = constants.%self.param_patt.9be] +// CHECK:STDOUT: %self.patt: %pattern_type.990 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.330] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %unsigned_int = ref_param call_param0 +// CHECK:STDOUT: %self: ref %unsigned_int = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -602,8 +623,17 @@ fn F() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %x.patt: %pattern_type.668 = value_binding_pattern x [concrete = constants.%x.patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %unsigned_int.cpp_destructor.bound: = bound_method %unsigned_int.var, constants.%unsigned_int.cpp_destructor -// CHECK:STDOUT: %unsigned_int.cpp_destructor.call: init %empty_tuple.type = call %unsigned_int.cpp_destructor.bound(%unsigned_int.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %unsigned_int.var, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%unsigned_int.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc12(%self.param: ref %unsigned_int) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc12(%self.param: ref %unsigned_int) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param) +// CHECK:STDOUT: %unsigned_int.cpp_destructor.call: init %empty_tuple.type = call imports.%unsigned_int.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/primitive_types/long_and_long_long.darwin.carbon b/toolchain/check/testdata/interop/cpp/primitive_types/long_and_long_long.darwin.carbon index 1189fc8e26ba..10646a7ba02c 100644 --- a/toolchain/check/testdata/interop/cpp/primitive_types/long_and_long_long.darwin.carbon +++ b/toolchain/check/testdata/interop/cpp/primitive_types/long_and_long_long.darwin.carbon @@ -690,12 +690,32 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.7cb: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%f32.c73, %ImplicitAs.facet.fcd) [concrete] // CHECK:STDOUT: %.7fe: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.7cb, %ImplicitAs.facet.fcd [concrete] // CHECK:STDOUT: %Core.FloatLiteral.as.ImplicitAs.impl.Convert.bound: = bound_method %float.6da, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.b37 [concrete] +// CHECK:STDOUT: %pattern_type.240: type = pattern_type %f32.c73 [concrete] // CHECK:STDOUT: %Core.FloatLiteral.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Core.FloatLiteral.as.ImplicitAs.impl.Convert.b37, @Core.FloatLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete] // CHECK:STDOUT: %bound_method: = bound_method %float.6da, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %float.943: %f32.c73 = float_value 1 [concrete] // CHECK:STDOUT: %array: %array_type = tuple_value (%float.943) [concrete] +// CHECK:STDOUT: %pattern_type.945: type = pattern_type %f32.9b3 [concrete] +// CHECK:STDOUT: %self.param_patt.755: %pattern_type.945 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.17e: %pattern_type.945 = wrapper_binding_pattern self, %self.param_patt.755 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc11_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.c62: %pattern_type.240 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.ed0: %pattern_type.240 = wrapper_binding_pattern self, %self.param_patt.c62 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc11_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.c06: %pattern_type.18b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.a67: %pattern_type.18b = wrapper_binding_pattern self, %self.param_patt.c06 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc11_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc11_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -715,6 +735,51 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %ImplicitAs.impl_witness_table.1e0 = impl_witness_table (%Core.import_ref.c4c), @Core.FloatLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.945 = ref_param_pattern [concrete = constants.%self.param_patt.755] +// CHECK:STDOUT: %self.patt: %pattern_type.945 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.17e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.9b3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.9b3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc11_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.945 = ref_param_pattern [concrete = constants.%self.param_patt.755] +// CHECK:STDOUT: %self.patt: %pattern_type.945 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.17e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.9b3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.9b3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.240 = ref_param_pattern [concrete = constants.%self.param_patt.c62] +// CHECK:STDOUT: %self.patt: %pattern_type.240 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ed0] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.c73 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.c73 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc11_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.240 = ref_param_pattern [concrete = constants.%self.param_patt.c62] +// CHECK:STDOUT: %self.patt: %pattern_type.240 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ed0] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.c73 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.c73 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.18b = ref_param_pattern [concrete = constants.%self.param_patt.c06] +// CHECK:STDOUT: %self.patt: %pattern_type.18b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a67] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc11_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.18b = ref_param_pattern [concrete = constants.%self.param_patt.c06] +// CHECK:STDOUT: %self.patt: %pattern_type.18b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a67] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1.loc8: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] @@ -779,20 +844,47 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %a.patt: %pattern_type.18b = ref_binding_pattern a [concrete = constants.%a.patt] // CHECK:STDOUT: %a.var_patt: %pattern_type.18b = var_pattern %a.patt [concrete = constants.%a.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_3.1(%self.param: ref %f32.9b3) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_3.1(%self.param: ref %f32.9b3) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_3.2(%self.param: ref %f32.c73) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_3.1(%self.param: ref %f32.9b3) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_3.2(%self.param: ref %f32.c73) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_3.2(%self.param: ref %f32.c73) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_3.2(%self.param: ref %f32.c73) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_3.3(%self.param: ref %array_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -863,12 +955,32 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.7cb: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%f32.c73, %ImplicitAs.facet.fcd) [concrete] // CHECK:STDOUT: %.7fe: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.7cb, %ImplicitAs.facet.fcd [concrete] // CHECK:STDOUT: %Core.FloatLiteral.as.ImplicitAs.impl.Convert.bound: = bound_method %float.6da, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.b37 [concrete] +// CHECK:STDOUT: %pattern_type.240: type = pattern_type %f32.c73 [concrete] // CHECK:STDOUT: %Core.FloatLiteral.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Core.FloatLiteral.as.ImplicitAs.impl.Convert.b37, @Core.FloatLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete] // CHECK:STDOUT: %bound_method: = bound_method %float.6da, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %float.943: %f32.c73 = float_value 1 [concrete] // CHECK:STDOUT: %array: %array_type = tuple_value (%float.943) [concrete] +// CHECK:STDOUT: %pattern_type.945: type = pattern_type %f32.9b3 [concrete] +// CHECK:STDOUT: %self.param_patt.755: %pattern_type.945 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.17e: %pattern_type.945 = wrapper_binding_pattern self, %self.param_patt.755 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc11_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.c62: %pattern_type.240 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.ed0: %pattern_type.240 = wrapper_binding_pattern self, %self.param_patt.c62 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc11_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.c06: %pattern_type.18b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.a67: %pattern_type.18b = wrapper_binding_pattern self, %self.param_patt.c06 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc11_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc11_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -888,6 +1000,51 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %ImplicitAs.impl_witness_table.1e0 = impl_witness_table (%Core.import_ref.c4c), @Core.FloatLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.945 = ref_param_pattern [concrete = constants.%self.param_patt.755] +// CHECK:STDOUT: %self.patt: %pattern_type.945 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.17e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.9b3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.9b3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc11_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.945 = ref_param_pattern [concrete = constants.%self.param_patt.755] +// CHECK:STDOUT: %self.patt: %pattern_type.945 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.17e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.9b3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.9b3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.240 = ref_param_pattern [concrete = constants.%self.param_patt.c62] +// CHECK:STDOUT: %self.patt: %pattern_type.240 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ed0] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.c73 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.c73 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc11_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.240 = ref_param_pattern [concrete = constants.%self.param_patt.c62] +// CHECK:STDOUT: %self.patt: %pattern_type.240 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ed0] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.c73 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.c73 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.18b = ref_param_pattern [concrete = constants.%self.param_patt.c06] +// CHECK:STDOUT: %self.patt: %pattern_type.18b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a67] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc11_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.18b = ref_param_pattern [concrete = constants.%self.param_patt.c06] +// CHECK:STDOUT: %self.patt: %pattern_type.18b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a67] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1.loc8: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] @@ -952,20 +1109,47 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %a.patt: %pattern_type.18b = ref_binding_pattern a [concrete = constants.%a.patt] // CHECK:STDOUT: %a.var_patt: %pattern_type.18b = var_pattern %a.patt [concrete = constants.%a.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_3.1(%self.param: ref %f32.9b3) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_3.1(%self.param: ref %f32.9b3) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_3.2(%self.param: ref %f32.c73) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_3.1(%self.param: ref %f32.9b3) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_3.2(%self.param: ref %f32.c73) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_3.2(%self.param: ref %f32.c73) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_3.2(%self.param: ref %f32.c73) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_3.3(%self.param: ref %array_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1068,16 +1252,48 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.7cb: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%f32.c73, %ImplicitAs.facet.fcd) [concrete] // CHECK:STDOUT: %.7fe: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.7cb, %ImplicitAs.facet.fcd [concrete] // CHECK:STDOUT: %Core.FloatLiteral.as.ImplicitAs.impl.Convert.bound: = bound_method %float.6da, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.b37 [concrete] +// CHECK:STDOUT: %pattern_type.240: type = pattern_type %f32.c73 [concrete] // CHECK:STDOUT: %Core.FloatLiteral.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Core.FloatLiteral.as.ImplicitAs.impl.Convert.b37, @Core.FloatLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete] // CHECK:STDOUT: %bound_method.3e4: = bound_method %float.6da, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %float.943: %f32.c73 = float_value 1 [concrete] // CHECK:STDOUT: %array: %array_type = tuple_value (%float.943) [concrete] +// CHECK:STDOUT: %pattern_type.945: type = pattern_type %f32.9b3 [concrete] +// CHECK:STDOUT: %self.param_patt.755: %pattern_type.945 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.17e: %pattern_type.945 = wrapper_binding_pattern self, %self.param_patt.755 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc24_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc24_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.c62: %pattern_type.240 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.ed0: %pattern_type.240 = wrapper_binding_pattern self, %self.param_patt.c62 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc24_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc24_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.c06: %pattern_type.18b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.a67: %pattern_type.18b = wrapper_binding_pattern self, %self.param_patt.c06 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc24_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc24_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc24_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.98a: %pattern_type.357 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.784: %pattern_type.357 = wrapper_binding_pattern self, %self.param_patt.98a [concrete] // CHECK:STDOUT: %LongLongResult.cpp_destructor.type: type = fn_type @LongLongResult.cpp_destructor [concrete] // CHECK:STDOUT: %LongLongResult.cpp_destructor: %LongLongResult.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc22 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc22 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.b62: %pattern_type.ae7 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.5c45: %pattern_type.ae7 = wrapper_binding_pattern self, %self.param_patt.b62 [concrete] // CHECK:STDOUT: %LongResult.cpp_destructor.type: type = fn_type @LongResult.cpp_destructor [concrete] // CHECK:STDOUT: %LongResult.cpp_destructor: %LongResult.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.5: type = fn_type @Destroy.WithSelf.Op.loc19 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.5: %Destroy.WithSelf.Op.type.ef016f.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5: type = fn_type @Destroy.WithSelf.SelfDestruct.loc19 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.5: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1112,6 +1328,75 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %As.impl_witness_table.d22 = impl_witness_table (%Core.import_ref.64b), @Core.IntLiteral.as.As.impl.f25 [concrete] // CHECK:STDOUT: %Core.import_ref.c4c: @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type (%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type.063) = import_ref Core//prelude/types/float, loc{{\d+_\d+}}, loaded [symbolic = @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert (constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.d4f)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.1e0 = impl_witness_table (%Core.import_ref.c4c), @Core.FloatLiteral.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %LongLongResult.cpp_destructor.decl: %LongLongResult.cpp_destructor.type = fn_decl @LongLongResult.cpp_destructor [concrete = constants.%LongLongResult.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: %LongResult.cpp_destructor.decl: %LongResult.cpp_destructor.type = fn_decl @LongResult.cpp_destructor [concrete = constants.%LongResult.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc24_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.945 = ref_param_pattern [concrete = constants.%self.param_patt.755] +// CHECK:STDOUT: %self.patt: %pattern_type.945 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.17e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.9b3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.9b3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc24_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.945 = ref_param_pattern [concrete = constants.%self.param_patt.755] +// CHECK:STDOUT: %self.patt: %pattern_type.945 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.17e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.9b3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.9b3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc24_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.240 = ref_param_pattern [concrete = constants.%self.param_patt.c62] +// CHECK:STDOUT: %self.patt: %pattern_type.240 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ed0] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.c73 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.c73 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc24_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.240 = ref_param_pattern [concrete = constants.%self.param_patt.c62] +// CHECK:STDOUT: %self.patt: %pattern_type.240 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ed0] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.c73 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.c73 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc24_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.18b = ref_param_pattern [concrete = constants.%self.param_patt.c06] +// CHECK:STDOUT: %self.patt: %pattern_type.18b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a67] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc24_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.18b = ref_param_pattern [concrete = constants.%self.param_patt.c06] +// CHECK:STDOUT: %self.patt: %pattern_type.18b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a67] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc22 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.357 = ref_param_pattern [concrete = constants.%self.param_patt.98a] +// CHECK:STDOUT: %self.patt: %pattern_type.357 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.784] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %LongLongResult = ref_param call_param0 +// CHECK:STDOUT: %self: ref %LongLongResult = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.5: %Destroy.WithSelf.Op.type.ef016f.5 = fn_decl @Destroy.WithSelf.Op.loc19 [concrete = constants.%Destroy.WithSelf.Op.403171.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.ae7 = ref_param_pattern [concrete = constants.%self.param_patt.b62] +// CHECK:STDOUT: %self.patt: %pattern_type.ae7 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.5c45] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %LongResult = ref_param call_param0 +// CHECK:STDOUT: %self: ref %LongResult = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -1245,26 +1530,71 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %a.patt: %pattern_type.18b = ref_binding_pattern a [concrete = constants.%a.patt] // CHECK:STDOUT: %a.var_patt: %pattern_type.18b = var_pattern %a.patt [concrete = constants.%a.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%a.var) -// CHECK:STDOUT: %LongLongResult.cpp_destructor.bound.loc22: = bound_method %.loc22_81.3, constants.%LongLongResult.cpp_destructor -// CHECK:STDOUT: %LongLongResult.cpp_destructor.call.loc22: init %empty_tuple.type = call %LongLongResult.cpp_destructor.bound.loc22(%.loc22_81.3) -// CHECK:STDOUT: %LongResult.cpp_destructor.bound: = bound_method %.loc19_73.3, constants.%LongResult.cpp_destructor -// CHECK:STDOUT: %LongResult.cpp_destructor.call: init %empty_tuple.type = call %LongResult.cpp_destructor.bound(%.loc19_73.3) -// CHECK:STDOUT: %LongLongResult.cpp_destructor.bound.loc16: = bound_method %.loc16_87.3, constants.%LongLongResult.cpp_destructor -// CHECK:STDOUT: %LongLongResult.cpp_destructor.call.loc16: init %empty_tuple.type = call %LongLongResult.cpp_destructor.bound.loc16(%.loc16_87.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc24: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc24: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc24(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc22: = bound_method %.loc22_81.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc22: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc22(%.loc22_81.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc19: = bound_method %.loc19_73.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc19: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc19(%.loc19_73.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16: = bound_method %.loc16_87.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16(%.loc16_87.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc24_3.1(%self.param: ref %f32.9b3) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_3.1(%self.param: ref %f32.9b3) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_3.2(%self.param: ref %f32.c73) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc24_3.1(%self.param: ref %f32.9b3) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc24_3.2(%self.param: ref %f32.c73) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_3.2(%self.param: ref %f32.c73) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc24_3.2(%self.param: ref %f32.c73) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc24_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_3.3(%self.param: ref %array_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc24_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc22(%self.param: ref %LongLongResult) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc22(%self.param: ref %LongLongResult) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %LongLongResult.cpp_destructor.call: init %empty_tuple.type = call imports.%LongLongResult.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc19(%self.param: ref %LongResult) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc19(%self.param: ref %LongResult) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.5(%self.param) +// CHECK:STDOUT: %LongResult.cpp_destructor.call: init %empty_tuple.type = call imports.%LongResult.cpp_destructor.decl(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1299,8 +1629,28 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %.6f73: type = fn_type_with_self_type %Copy.WithSelf.Op.type.881, %Copy.facet [concrete] // CHECK:STDOUT: %Cpp.long.as.Copy.impl.Op.type: type = fn_type @Cpp.long.as.Copy.impl.Op [concrete] // CHECK:STDOUT: %Cpp.long.as.Copy.impl.Op: %Cpp.long.as.Copy.impl.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.e13: type = pattern_type %i64.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.7d9: %pattern_type.e13 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.bb9: %pattern_type.e13 = wrapper_binding_pattern self, %self.param_patt.7d9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc9_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.f57: type = pattern_type %i64 [concrete] +// CHECK:STDOUT: %self.param_patt.108: %pattern_type.f57 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.5f4: %pattern_type.f57 = wrapper_binding_pattern self, %self.param_patt.108 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.fe4: %pattern_type.ada = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.0d8: %pattern_type.ada = wrapper_binding_pattern self, %self.param_patt.fe4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc9_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1314,6 +1664,51 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %Copy.impl_witness_table.842 = impl_witness_table (%Core.import_ref.9c3), @Cpp.long.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e13 = ref_param_pattern [concrete = constants.%self.param_patt.7d9] +// CHECK:STDOUT: %self.patt: %pattern_type.e13 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.bb9] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i64.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i64.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc9_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e13 = ref_param_pattern [concrete = constants.%self.param_patt.7d9] +// CHECK:STDOUT: %self.patt: %pattern_type.e13 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.bb9] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i64.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i64.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f57 = ref_param_pattern [concrete = constants.%self.param_patt.108] +// CHECK:STDOUT: %self.patt: %pattern_type.f57 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.5f4] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i64 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i64 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc9_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f57 = ref_param_pattern [concrete = constants.%self.param_patt.108] +// CHECK:STDOUT: %self.patt: %pattern_type.f57 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.5f4] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i64 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i64 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.ada = ref_param_pattern [concrete = constants.%self.param_patt.fe4] +// CHECK:STDOUT: %self.patt: %pattern_type.ada = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.0d8] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Cpp.long = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Cpp.long = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc9_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.ada = ref_param_pattern [concrete = constants.%self.param_patt.fe4] +// CHECK:STDOUT: %self.patt: %pattern_type.ada = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.0d8] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Cpp.long = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Cpp.long = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @CopyLongLong() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.var: ref %Cpp.long = var_storage %a.var_patt @@ -1348,22 +1743,49 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %b.patt: %pattern_type.ada = ref_binding_pattern b [concrete = constants.%b.patt] // CHECK:STDOUT: %b.var_patt: %pattern_type.ada = var_pattern %b.patt [concrete = constants.%b.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc9: = bound_method %b.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc9(%b.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc8: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc8(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc9: = bound_method %b.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc9(%b.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.1(%self.param: ref %i64.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.1(%self.param: ref %i64.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.2(%self.param: ref %i64) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.1(%self.param: ref %i64.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.2(%self.param: ref %i64) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.3(%self.param: ref %Cpp.long) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.2(%self.param: ref %i64) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.2(%self.param: ref %i64) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.3(%self.param: ref %Cpp.long) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.3(%self.param: ref %Cpp.long) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.3(%self.param: ref %Cpp.long) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2505,6 +2927,8 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %Cpp.long.as.AddAssignWith.impl.Op.1fe1da.1: %Cpp.long.as.AddAssignWith.impl.Op.type.1757be.1 = struct_value () [symbolic] // CHECK:STDOUT: %Cpp.long.as.AddAssignWith.impl.Op.type.1757be.2: type = fn_type @Cpp.long.as.AddAssignWith.impl.Op.2, @Cpp.long.as.AddAssignWith.impl(%U.1ae) [symbolic] // CHECK:STDOUT: %Cpp.long.as.AddAssignWith.impl.Op.1fe1da.2: %Cpp.long.as.AddAssignWith.impl.Op.type.1757be.2 = struct_value () [symbolic] +// CHECK:STDOUT: %self.param_patt.fe4: %pattern_type.ada = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.0d8: %pattern_type.ada = wrapper_binding_pattern self, %self.param_patt.fe4 [concrete] // CHECK:STDOUT: %Copy.impl_witness.78e: = impl_witness imports.%Copy.impl_witness_table.842 [concrete] // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %Cpp.long, (%Copy.impl_witness.78e) [concrete] // CHECK:STDOUT: %ImplicitAs.impl_witness.0e1: = impl_witness imports.%ImplicitAs.impl_witness_table.fac, @T.as_type.as.ImplicitAs.impl(%Copy.facet) [concrete] @@ -2654,8 +3078,26 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %.934: type = fn_type_with_self_type %RightShiftAssignWith.WithSelf.Op.type.efa, %RightShiftAssignWith.facet.af7 [concrete] // CHECK:STDOUT: %Cpp.long.as.RightShiftAssignWith.impl.Op.specific_fn.368c78.1: = specific_function %Cpp.long.as.RightShiftAssignWith.impl.Op.3dae5a.2, @Cpp.long.as.RightShiftAssignWith.impl.Op.1(%ImplicitAs.facet.0ac) [concrete] // CHECK:STDOUT: %Cpp.long.as.RightShiftAssignWith.impl.Op.specific_fn.368c78.2: = specific_function %Cpp.long.as.RightShiftAssignWith.impl.Op.3dae5a.1, @Cpp.long.as.RightShiftAssignWith.impl.Op.2(%ImplicitAs.facet.0ac) [concrete] +// CHECK:STDOUT: %pattern_type.e13: type = pattern_type %i64.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.7d9: %pattern_type.e13 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.bb9: %pattern_type.e13 = wrapper_binding_pattern self, %self.param_patt.7d9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc9_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.f57: type = pattern_type %i64 [concrete] +// CHECK:STDOUT: %self.param_patt.108: %pattern_type.f57 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.5f4: %pattern_type.f57 = wrapper_binding_pattern self, %self.param_patt.108 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc9_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] // CHECK:STDOUT: %Cpp.long.as.Copy.impl.Op.type: type = fn_type @Cpp.long.as.Copy.impl.Op [concrete] // CHECK:STDOUT: %Cpp.long.as.Copy.impl.Op: %Cpp.long.as.Copy.impl.Op.type = struct_value () [concrete] // CHECK:STDOUT: } @@ -2703,6 +3145,51 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %Core.Op.592: @Cpp.long.as.RightShiftAssignWith.impl.%Cpp.long.as.RightShiftAssignWith.impl.Op.type.1 (%Cpp.long.as.RightShiftAssignWith.impl.Op.type.dd27f0.2) = import_ref Core//prelude/types/cpp/int, Op, loaded [symbolic = @Cpp.long.as.RightShiftAssignWith.impl.%Cpp.long.as.RightShiftAssignWith.impl.Op.1 (constants.%Cpp.long.as.RightShiftAssignWith.impl.Op.9a6679.2)] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e13 = ref_param_pattern [concrete = constants.%self.param_patt.7d9] +// CHECK:STDOUT: %self.patt: %pattern_type.e13 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.bb9] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i64.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i64.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc9_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e13 = ref_param_pattern [concrete = constants.%self.param_patt.7d9] +// CHECK:STDOUT: %self.patt: %pattern_type.e13 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.bb9] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i64.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i64.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f57 = ref_param_pattern [concrete = constants.%self.param_patt.108] +// CHECK:STDOUT: %self.patt: %pattern_type.f57 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.5f4] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i64 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i64 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc9_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f57 = ref_param_pattern [concrete = constants.%self.param_patt.108] +// CHECK:STDOUT: %self.patt: %pattern_type.f57 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.5f4] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i64 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i64 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.ada = ref_param_pattern [concrete = constants.%self.param_patt.fe4] +// CHECK:STDOUT: %self.patt: %pattern_type.ada = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.0d8] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Cpp.long = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Cpp.long = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc9_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.ada = ref_param_pattern [concrete = constants.%self.param_patt.fe4] +// CHECK:STDOUT: %self.patt: %pattern_type.ada = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.0d8] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Cpp.long = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Cpp.long = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @CompoundAssignmentHomogeneousLong() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.var: ref %Cpp.long = var_storage %a.var_patt @@ -2907,22 +3394,49 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %Cpp.long.as.RightShiftAssignWith.impl.Op.specific_fn: = specific_function %Op.ref.loc21, @Cpp.long.as.RightShiftAssignWith.impl.Op.2(constants.%ImplicitAs.facet.0ac) [concrete = constants.%Cpp.long.as.RightShiftAssignWith.impl.Op.specific_fn.368c78.2] // CHECK:STDOUT: %bound_method.loc21_5.3: = bound_method %a.ref.loc21, %Cpp.long.as.RightShiftAssignWith.impl.Op.specific_fn // CHECK:STDOUT: %Cpp.long.as.RightShiftAssignWith.impl.Op.call: init %empty_tuple.type = call %bound_method.loc21_5.3(%a.ref.loc21, %.loc21_9) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc9: = bound_method %b.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc9(%b.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc8: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc8(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc9: = bound_method %b.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc9(%b.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.1(%self.param: ref %i64.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.1(%self.param: ref %i64.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.2(%self.param: ref %i64) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.1(%self.param: ref %i64.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.2(%self.param: ref %i64) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.3(%self.param: ref %Cpp.long) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.2(%self.param: ref %i64) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.2(%self.param: ref %i64) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.3(%self.param: ref %Cpp.long) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.3(%self.param: ref %Cpp.long) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.3(%self.param: ref %Cpp.long) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3368,6 +3882,8 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %Cpp.long.as.AddAssignWith.impl.Op.1fe1da.1: %Cpp.long.as.AddAssignWith.impl.Op.type.1757be.1 = struct_value () [symbolic] // CHECK:STDOUT: %Cpp.long.as.AddAssignWith.impl.Op.type.1757be.2: type = fn_type @Cpp.long.as.AddAssignWith.impl.Op.2, @Cpp.long.as.AddAssignWith.impl(%U.1ae) [symbolic] // CHECK:STDOUT: %Cpp.long.as.AddAssignWith.impl.Op.1fe1da.2: %Cpp.long.as.AddAssignWith.impl.Op.type.1757be.2 = struct_value () [symbolic] +// CHECK:STDOUT: %self.param_patt.fe4: %pattern_type.ada = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.0d8: %pattern_type.ada = wrapper_binding_pattern self, %self.param_patt.fe4 [concrete] // CHECK:STDOUT: %AddAssignWith.impl_witness.e16: = impl_witness imports.%AddAssignWith.impl_witness_table.2c1, @Cpp.long.as.AddAssignWith.impl(%ImplicitAs.facet) [concrete] // CHECK:STDOUT: %Cpp.long.as.AddAssignWith.impl.Op.type.393661.1: type = fn_type @Cpp.long.as.AddAssignWith.impl.Op.2, @Cpp.long.as.AddAssignWith.impl(%ImplicitAs.facet) [concrete] // CHECK:STDOUT: %Cpp.long.as.AddAssignWith.impl.Op.17a680.1: %Cpp.long.as.AddAssignWith.impl.Op.type.393661.1 = struct_value () [concrete] @@ -3378,8 +3894,26 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %.330: type = fn_type_with_self_type %AddAssignWith.WithSelf.Op.type.77c, %AddAssignWith.facet.775 [concrete] // CHECK:STDOUT: %Cpp.long.as.AddAssignWith.impl.Op.specific_fn.a9f447.1: = specific_function %Cpp.long.as.AddAssignWith.impl.Op.17a680.2, @Cpp.long.as.AddAssignWith.impl.Op.1(%ImplicitAs.facet) [concrete] // CHECK:STDOUT: %Cpp.long.as.AddAssignWith.impl.Op.specific_fn.a9f447.2: = specific_function %Cpp.long.as.AddAssignWith.impl.Op.17a680.1, @Cpp.long.as.AddAssignWith.impl.Op.2(%ImplicitAs.facet) [concrete] +// CHECK:STDOUT: %pattern_type.e13: type = pattern_type %i64.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.7d9: %pattern_type.e13 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.bb9: %pattern_type.e13 = wrapper_binding_pattern self, %self.param_patt.7d9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc8_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.f57: type = pattern_type %i64 [concrete] +// CHECK:STDOUT: %self.param_patt.108: %pattern_type.f57 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.5f4: %pattern_type.f57 = wrapper_binding_pattern self, %self.param_patt.108 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc8_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc8_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -3394,6 +3928,51 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %Core.Op.373: @Cpp.long.as.AddAssignWith.impl.%Cpp.long.as.AddAssignWith.impl.Op.type.1 (%Cpp.long.as.AddAssignWith.impl.Op.type.1757be.2) = import_ref Core//prelude/types/cpp/int, Op, loaded [symbolic = @Cpp.long.as.AddAssignWith.impl.%Cpp.long.as.AddAssignWith.impl.Op.1 (constants.%Cpp.long.as.AddAssignWith.impl.Op.1fe1da.2)] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e13 = ref_param_pattern [concrete = constants.%self.param_patt.7d9] +// CHECK:STDOUT: %self.patt: %pattern_type.e13 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.bb9] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i64.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i64.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc8_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e13 = ref_param_pattern [concrete = constants.%self.param_patt.7d9] +// CHECK:STDOUT: %self.patt: %pattern_type.e13 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.bb9] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i64.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i64.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f57 = ref_param_pattern [concrete = constants.%self.param_patt.108] +// CHECK:STDOUT: %self.patt: %pattern_type.f57 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.5f4] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i64 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i64 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc8_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f57 = ref_param_pattern [concrete = constants.%self.param_patt.108] +// CHECK:STDOUT: %self.patt: %pattern_type.f57 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.5f4] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i64 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i64 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.ada = ref_param_pattern [concrete = constants.%self.param_patt.fe4] +// CHECK:STDOUT: %self.patt: %pattern_type.ada = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.0d8] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Cpp.long = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Cpp.long = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc8_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.ada = ref_param_pattern [concrete = constants.%self.param_patt.fe4] +// CHECK:STDOUT: %self.patt: %pattern_type.ada = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.0d8] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Cpp.long = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Cpp.long = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @CompoundAssignmentLongAndIntLiteral() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.var: ref %Cpp.long = var_storage %a.var_patt @@ -3433,20 +4012,47 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %.loc9_8.1: %Cpp.long = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9 [concrete = constants.%int_1.33f] // CHECK:STDOUT: %.loc9_8.2: %Cpp.long = converted %int_1.loc9, %.loc9_8.1 [concrete = constants.%int_1.33f] // CHECK:STDOUT: %Cpp.long.as.AddAssignWith.impl.Op.call: init %empty_tuple.type = call %bound_method.loc9_5.3(%a.ref, %.loc9_8.2) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.1(%self.param: ref %i64.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.1(%self.param: ref %i64.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.2(%self.param: ref %i64) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.1(%self.param: ref %i64.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.2(%self.param: ref %i64) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.3(%self.param: ref %Cpp.long) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.2(%self.param: ref %i64) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.2(%self.param: ref %i64) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.3(%self.param: ref %Cpp.long) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.3(%self.param: ref %Cpp.long) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.3(%self.param: ref %Cpp.long) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3507,14 +4113,27 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %AddAssignWith.facet.e82: %AddAssignWith.type.e06 = facet_value %i64, (%AddAssignWith.impl_witness.80d) [concrete] // CHECK:STDOUT: %AddAssignWith.WithSelf.Op.type.def: type = fn_type @AddAssignWith.WithSelf.Op, @AddAssignWith.WithSelf(%Cpp.long, %AddAssignWith.facet.e82) [concrete] // CHECK:STDOUT: %.d61: type = fn_type_with_self_type %AddAssignWith.WithSelf.Op.type.def, %AddAssignWith.facet.e82 [concrete] +// CHECK:STDOUT: %self.param_patt.108: %pattern_type.f57 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.5f4: %pattern_type.f57 = wrapper_binding_pattern self, %self.param_patt.108 [concrete] // CHECK:STDOUT: %Int.as.AddAssignWith.impl.Op.specific_fn.64d5fa.1: = specific_function %Int.as.AddAssignWith.impl.Op.3fffc9.2, @Int.as.AddAssignWith.impl.Op.1(%int_64, %ImplicitAs.facet.8fd) [concrete] // CHECK:STDOUT: %Int.as.AddAssignWith.impl.Op.specific_fn.64d5fa.2: = specific_function %Int.as.AddAssignWith.impl.Op.3fffc9.1, @Int.as.AddAssignWith.impl.Op.2(%int_64, %ImplicitAs.facet.8fd) [concrete] // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.d9b: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%i64, %ImplicitAs.facet.8fd) [concrete] // CHECK:STDOUT: %.bf5: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.d9b, %ImplicitAs.facet.8fd [concrete] // CHECK:STDOUT: %Cpp.long.as.ImplicitAs.impl.Convert.type: type = fn_type @Cpp.long.as.ImplicitAs.impl.Convert [concrete] // CHECK:STDOUT: %Cpp.long.as.ImplicitAs.impl.Convert: %Cpp.long.as.ImplicitAs.impl.Convert.type = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.e13: type = pattern_type %i64.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.7d9: %pattern_type.e13 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.bb9: %pattern_type.e13 = wrapper_binding_pattern self, %self.param_patt.7d9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc8_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc8_3.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -3533,6 +4152,37 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %ImplicitAs.impl_witness_table.00c = impl_witness_table (%Core.import_ref.06c923.2), @Cpp.long.as.ImplicitAs.impl.c8d [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e13 = ref_param_pattern [concrete = constants.%self.param_patt.7d9] +// CHECK:STDOUT: %self.patt: %pattern_type.e13 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.bb9] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i64.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i64.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc8_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e13 = ref_param_pattern [concrete = constants.%self.param_patt.7d9] +// CHECK:STDOUT: %self.patt: %pattern_type.e13 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.bb9] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i64.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i64.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f57 = ref_param_pattern [concrete = constants.%self.param_patt.108] +// CHECK:STDOUT: %self.patt: %pattern_type.f57 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.5f4] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i64 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i64 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc8_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f57 = ref_param_pattern [concrete = constants.%self.param_patt.108] +// CHECK:STDOUT: %self.patt: %pattern_type.f57 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.5f4] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i64 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i64 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @CompoundAssignmentLongAndRuntimeI64() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.var: ref %i64 = var_storage %a.var_patt @@ -3581,15 +4231,33 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %.loc10_8.1: %i64 = value_of_initializer %Cpp.long.as.ImplicitAs.impl.Convert.call // CHECK:STDOUT: %.loc10_8.2: %i64 = converted %b.ref, %.loc10_8.1 // CHECK:STDOUT: %Int.as.AddAssignWith.impl.Op.call: init %empty_tuple.type = call %bound_method.loc10_5.3(%a.ref, %.loc10_8.2) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.1(%self.param: ref %i64.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.1(%self.param: ref %i64.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.2(%self.param: ref %i64) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.1(%self.param: ref %i64.builtin) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.2(%self.param: ref %i64) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.2(%self.param: ref %i64) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.2(%self.param: ref %i64) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3622,6 +4290,8 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %.067: type = fn_type_with_self_type %Inc.WithSelf.Op.type.6c1, %Inc.facet [concrete] // CHECK:STDOUT: %Cpp.long.as.Inc.impl.Op.type: type = fn_type @Cpp.long.as.Inc.impl.Op [concrete] // CHECK:STDOUT: %Cpp.long.as.Inc.impl.Op: %Cpp.long.as.Inc.impl.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.fe4: %pattern_type.ada = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.0d8: %pattern_type.ada = wrapper_binding_pattern self, %self.param_patt.fe4 [concrete] // CHECK:STDOUT: %Dec.type: type = facet_type <@Dec> [concrete] // CHECK:STDOUT: %Dec.impl_witness: = impl_witness imports.%Dec.impl_witness_table [concrete] // CHECK:STDOUT: %Dec.facet: %Dec.type = facet_value %Cpp.long, (%Dec.impl_witness) [concrete] @@ -3629,8 +4299,26 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %.964: type = fn_type_with_self_type %Dec.WithSelf.Op.type.9c9, %Dec.facet [concrete] // CHECK:STDOUT: %Cpp.long.as.Dec.impl.Op.type: type = fn_type @Cpp.long.as.Dec.impl.Op [concrete] // CHECK:STDOUT: %Cpp.long.as.Dec.impl.Op: %Cpp.long.as.Dec.impl.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.e13: type = pattern_type %i64.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.7d9: %pattern_type.e13 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.bb9: %pattern_type.e13 = wrapper_binding_pattern self, %self.param_patt.7d9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc8_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.f57: type = pattern_type %i64 [concrete] +// CHECK:STDOUT: %self.param_patt.108: %pattern_type.f57 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.5f4: %pattern_type.f57 = wrapper_binding_pattern self, %self.param_patt.108 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc8_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc8_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -3646,6 +4334,51 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %Dec.impl_witness_table = impl_witness_table (%Core.import_ref.9c3475.2), @Cpp.long.as.Dec.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e13 = ref_param_pattern [concrete = constants.%self.param_patt.7d9] +// CHECK:STDOUT: %self.patt: %pattern_type.e13 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.bb9] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i64.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i64.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc8_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e13 = ref_param_pattern [concrete = constants.%self.param_patt.7d9] +// CHECK:STDOUT: %self.patt: %pattern_type.e13 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.bb9] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i64.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i64.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f57 = ref_param_pattern [concrete = constants.%self.param_patt.108] +// CHECK:STDOUT: %self.patt: %pattern_type.f57 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.5f4] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i64 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i64 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc8_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f57 = ref_param_pattern [concrete = constants.%self.param_patt.108] +// CHECK:STDOUT: %self.patt: %pattern_type.f57 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.5f4] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i64 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i64 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.ada = ref_param_pattern [concrete = constants.%self.param_patt.fe4] +// CHECK:STDOUT: %self.patt: %pattern_type.ada = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.0d8] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Cpp.long = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Cpp.long = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc8_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.ada = ref_param_pattern [concrete = constants.%self.param_patt.fe4] +// CHECK:STDOUT: %self.patt: %pattern_type.ada = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.0d8] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Cpp.long = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Cpp.long = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @IncrementDecrementLong() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.var: ref %Cpp.long = var_storage %a.var_patt @@ -3672,20 +4405,47 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %impl.elem0.loc10: %.964 = impl_witness_access constants.%Dec.impl_witness, element0 [concrete = constants.%Cpp.long.as.Dec.impl.Op] // CHECK:STDOUT: %bound_method.loc10: = bound_method %a.ref.loc10, %impl.elem0.loc10 // CHECK:STDOUT: %Cpp.long.as.Dec.impl.Op.call: init %empty_tuple.type = call %bound_method.loc10(%a.ref.loc10) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.1(%self.param: ref %i64.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.1(%self.param: ref %i64.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.2(%self.param: ref %i64) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.1(%self.param: ref %i64.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.2(%self.param: ref %i64) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.3(%self.param: ref %Cpp.long) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.2(%self.param: ref %i64) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.2(%self.param: ref %i64) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.3(%self.param: ref %Cpp.long) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.3(%self.param: ref %Cpp.long) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.3(%self.param: ref %Cpp.long) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3779,16 +4539,48 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.7cb: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%f32.c73, %ImplicitAs.facet.fcd) [concrete] // CHECK:STDOUT: %.7fe: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.7cb, %ImplicitAs.facet.fcd [concrete] // CHECK:STDOUT: %Core.FloatLiteral.as.ImplicitAs.impl.Convert.bound: = bound_method %float.6da, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.b37 [concrete] +// CHECK:STDOUT: %pattern_type.240: type = pattern_type %f32.c73 [concrete] // CHECK:STDOUT: %Core.FloatLiteral.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Core.FloatLiteral.as.ImplicitAs.impl.Convert.b37, @Core.FloatLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete] // CHECK:STDOUT: %bound_method.3e4: = bound_method %float.6da, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %float.943: %f32.c73 = float_value 1 [concrete] // CHECK:STDOUT: %array: %array_type = tuple_value (%float.943) [concrete] +// CHECK:STDOUT: %pattern_type.945: type = pattern_type %f32.9b3 [concrete] +// CHECK:STDOUT: %self.param_patt.755: %pattern_type.945 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.17e: %pattern_type.945 = wrapper_binding_pattern self, %self.param_patt.755 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc24_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc24_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.c62: %pattern_type.240 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.ed0: %pattern_type.240 = wrapper_binding_pattern self, %self.param_patt.c62 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc24_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc24_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.c06: %pattern_type.18b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.a67: %pattern_type.18b = wrapper_binding_pattern self, %self.param_patt.c06 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc24_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc24_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc24_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.2ef: %pattern_type.97e = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.a5a: %pattern_type.97e = wrapper_binding_pattern self, %self.param_patt.2ef [concrete] // CHECK:STDOUT: %ULongLongResult.cpp_destructor.type: type = fn_type @ULongLongResult.cpp_destructor [concrete] // CHECK:STDOUT: %ULongLongResult.cpp_destructor: %ULongLongResult.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc22 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc22 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.116: %pattern_type.97f = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.eb6: %pattern_type.97f = wrapper_binding_pattern self, %self.param_patt.116 [concrete] // CHECK:STDOUT: %ULongResult.cpp_destructor.type: type = fn_type @ULongResult.cpp_destructor [concrete] // CHECK:STDOUT: %ULongResult.cpp_destructor: %ULongResult.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.5: type = fn_type @Destroy.WithSelf.Op.loc19 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.5: %Destroy.WithSelf.Op.type.ef016f.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5: type = fn_type @Destroy.WithSelf.SelfDestruct.loc19 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.5: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -3823,6 +4615,75 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %ImplicitAs.impl_witness_table.090 = impl_witness_table (%Core.import_ref.06c923.3), @Cpp.unsigned_long.as.ImplicitAs.impl.8de [concrete] // CHECK:STDOUT: %Core.import_ref.c4c: @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type (%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type.063) = import_ref Core//prelude/types/float, loc{{\d+_\d+}}, loaded [symbolic = @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert (constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.d4f)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.1e0 = impl_witness_table (%Core.import_ref.c4c), @Core.FloatLiteral.as.ImplicitAs.impl [concrete] +// CHECK:STDOUT: %ULongLongResult.cpp_destructor.decl: %ULongLongResult.cpp_destructor.type = fn_decl @ULongLongResult.cpp_destructor [concrete = constants.%ULongLongResult.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: %ULongResult.cpp_destructor.decl: %ULongResult.cpp_destructor.type = fn_decl @ULongResult.cpp_destructor [concrete = constants.%ULongResult.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc24_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.945 = ref_param_pattern [concrete = constants.%self.param_patt.755] +// CHECK:STDOUT: %self.patt: %pattern_type.945 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.17e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.9b3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.9b3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc24_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.945 = ref_param_pattern [concrete = constants.%self.param_patt.755] +// CHECK:STDOUT: %self.patt: %pattern_type.945 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.17e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.9b3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.9b3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc24_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.240 = ref_param_pattern [concrete = constants.%self.param_patt.c62] +// CHECK:STDOUT: %self.patt: %pattern_type.240 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ed0] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.c73 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.c73 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc24_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.240 = ref_param_pattern [concrete = constants.%self.param_patt.c62] +// CHECK:STDOUT: %self.patt: %pattern_type.240 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ed0] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.c73 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.c73 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc24_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.18b = ref_param_pattern [concrete = constants.%self.param_patt.c06] +// CHECK:STDOUT: %self.patt: %pattern_type.18b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a67] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc24_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.18b = ref_param_pattern [concrete = constants.%self.param_patt.c06] +// CHECK:STDOUT: %self.patt: %pattern_type.18b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a67] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc22 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.97e = ref_param_pattern [concrete = constants.%self.param_patt.2ef] +// CHECK:STDOUT: %self.patt: %pattern_type.97e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a5a] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ULongLongResult = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ULongLongResult = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.5: %Destroy.WithSelf.Op.type.ef016f.5 = fn_decl @Destroy.WithSelf.Op.loc19 [concrete = constants.%Destroy.WithSelf.Op.403171.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.97f = ref_param_pattern [concrete = constants.%self.param_patt.116] +// CHECK:STDOUT: %self.patt: %pattern_type.97f = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.eb6] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ULongResult = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ULongResult = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -3959,26 +4820,71 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %a.patt: %pattern_type.18b = ref_binding_pattern a [concrete = constants.%a.patt] // CHECK:STDOUT: %a.var_patt: %pattern_type.18b = var_pattern %a.patt [concrete = constants.%a.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%a.var) -// CHECK:STDOUT: %ULongLongResult.cpp_destructor.bound.loc22: = bound_method %.loc22_83.3, constants.%ULongLongResult.cpp_destructor -// CHECK:STDOUT: %ULongLongResult.cpp_destructor.call.loc22: init %empty_tuple.type = call %ULongLongResult.cpp_destructor.bound.loc22(%.loc22_83.3) -// CHECK:STDOUT: %ULongResult.cpp_destructor.bound: = bound_method %.loc19_93.3, constants.%ULongResult.cpp_destructor -// CHECK:STDOUT: %ULongResult.cpp_destructor.call: init %empty_tuple.type = call %ULongResult.cpp_destructor.bound(%.loc19_93.3) -// CHECK:STDOUT: %ULongLongResult.cpp_destructor.bound.loc16: = bound_method %.loc16_107.3, constants.%ULongLongResult.cpp_destructor -// CHECK:STDOUT: %ULongLongResult.cpp_destructor.call.loc16: init %empty_tuple.type = call %ULongLongResult.cpp_destructor.bound.loc16(%.loc16_107.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc24: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc24: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc24(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc22: = bound_method %.loc22_83.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc22: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc22(%.loc22_83.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc19: = bound_method %.loc19_93.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc19: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc19(%.loc19_93.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16: = bound_method %.loc16_107.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16(%.loc16_107.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc24_3.1(%self.param: ref %f32.9b3) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_3.1(%self.param: ref %f32.9b3) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_3.2(%self.param: ref %f32.c73) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc24_3.1(%self.param: ref %f32.9b3) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc24_3.2(%self.param: ref %f32.c73) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_3.2(%self.param: ref %f32.c73) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc24_3.2(%self.param: ref %f32.c73) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc24_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_3.3(%self.param: ref %array_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc24_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc22(%self.param: ref %ULongLongResult) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc22(%self.param: ref %ULongLongResult) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %ULongLongResult.cpp_destructor.call: init %empty_tuple.type = call imports.%ULongLongResult.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc19(%self.param: ref %ULongResult) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc19(%self.param: ref %ULongResult) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.5(%self.param) +// CHECK:STDOUT: %ULongResult.cpp_destructor.call: init %empty_tuple.type = call imports.%ULongResult.cpp_destructor.decl(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -4013,8 +4919,28 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %.63b: type = fn_type_with_self_type %Copy.WithSelf.Op.type.ca5, %Copy.facet [concrete] // CHECK:STDOUT: %Cpp.unsigned_long.as.Copy.impl.Op.type: type = fn_type @Cpp.unsigned_long.as.Copy.impl.Op [concrete] // CHECK:STDOUT: %Cpp.unsigned_long.as.Copy.impl.Op: %Cpp.unsigned_long.as.Copy.impl.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.844: type = pattern_type %u64.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.e64: %pattern_type.844 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.7e0: %pattern_type.844 = wrapper_binding_pattern self, %self.param_patt.e64 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc9_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.b35: type = pattern_type %u64 [concrete] +// CHECK:STDOUT: %self.param_patt.3f1: %pattern_type.b35 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.842: %pattern_type.b35 = wrapper_binding_pattern self, %self.param_patt.3f1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.15d: %pattern_type.172 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.1f0: %pattern_type.172 = wrapper_binding_pattern self, %self.param_patt.15d [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc9_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -4028,6 +4954,51 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %Copy.impl_witness_table.2f0 = impl_witness_table (%Core.import_ref.9c3), @Cpp.unsigned_long.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.844 = ref_param_pattern [concrete = constants.%self.param_patt.e64] +// CHECK:STDOUT: %self.patt: %pattern_type.844 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.7e0] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %u64.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %u64.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc9_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.844 = ref_param_pattern [concrete = constants.%self.param_patt.e64] +// CHECK:STDOUT: %self.patt: %pattern_type.844 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.7e0] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %u64.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %u64.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b35 = ref_param_pattern [concrete = constants.%self.param_patt.3f1] +// CHECK:STDOUT: %self.patt: %pattern_type.b35 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.842] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %u64 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %u64 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc9_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b35 = ref_param_pattern [concrete = constants.%self.param_patt.3f1] +// CHECK:STDOUT: %self.patt: %pattern_type.b35 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.842] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %u64 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %u64 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.172 = ref_param_pattern [concrete = constants.%self.param_patt.15d] +// CHECK:STDOUT: %self.patt: %pattern_type.172 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.1f0] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Cpp.unsigned_long = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Cpp.unsigned_long = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc9_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.172 = ref_param_pattern [concrete = constants.%self.param_patt.15d] +// CHECK:STDOUT: %self.patt: %pattern_type.172 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.1f0] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Cpp.unsigned_long = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Cpp.unsigned_long = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @CopyUnsignedLong() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.var: ref %Cpp.unsigned_long = var_storage %a.var_patt @@ -4062,22 +5033,49 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %b.patt: %pattern_type.172 = ref_binding_pattern b [concrete = constants.%b.patt] // CHECK:STDOUT: %b.var_patt: %pattern_type.172 = var_pattern %b.patt [concrete = constants.%b.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc9: = bound_method %b.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc9(%b.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc8: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc8(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc9: = bound_method %b.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc9(%b.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.1(%self.param: ref %u64.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.1(%self.param: ref %u64.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.2(%self.param: ref %u64) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.1(%self.param: ref %u64.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.2(%self.param: ref %u64) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.3(%self.param: ref %Cpp.unsigned_long) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.2(%self.param: ref %u64) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.2(%self.param: ref %u64) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.3(%self.param: ref %Cpp.unsigned_long) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.3(%self.param: ref %Cpp.unsigned_long) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.3(%self.param: ref %Cpp.unsigned_long) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/primitive_types/long_and_long_long.llp64.carbon b/toolchain/check/testdata/interop/cpp/primitive_types/long_and_long_long.llp64.carbon index ac2487dc6c88..a1142b030222 100644 --- a/toolchain/check/testdata/interop/cpp/primitive_types/long_and_long_long.llp64.carbon +++ b/toolchain/check/testdata/interop/cpp/primitive_types/long_and_long_long.llp64.carbon @@ -756,12 +756,32 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.7cb: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%f32.c73, %ImplicitAs.facet.fcd) [concrete] // CHECK:STDOUT: %.7fe: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.7cb, %ImplicitAs.facet.fcd [concrete] // CHECK:STDOUT: %Core.FloatLiteral.as.ImplicitAs.impl.Convert.bound: = bound_method %float.6da, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.b37 [concrete] +// CHECK:STDOUT: %pattern_type.240: type = pattern_type %f32.c73 [concrete] // CHECK:STDOUT: %Core.FloatLiteral.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Core.FloatLiteral.as.ImplicitAs.impl.Convert.b37, @Core.FloatLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete] // CHECK:STDOUT: %bound_method.3e4: = bound_method %float.6da, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %float.943: %f32.c73 = float_value 1 [concrete] // CHECK:STDOUT: %array: %array_type = tuple_value (%float.943) [concrete] +// CHECK:STDOUT: %pattern_type.945: type = pattern_type %f32.9b3 [concrete] +// CHECK:STDOUT: %self.param_patt.755: %pattern_type.945 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.17e: %pattern_type.945 = wrapper_binding_pattern self, %self.param_patt.755 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc11_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.c62: %pattern_type.240 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.ed0: %pattern_type.240 = wrapper_binding_pattern self, %self.param_patt.c62 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc11_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.c06: %pattern_type.18b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.a67: %pattern_type.18b = wrapper_binding_pattern self, %self.param_patt.c06 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc11_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc11_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -779,6 +799,51 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %ImplicitAs.impl_witness_table.1e0 = impl_witness_table (%Core.import_ref.c4c), @Core.FloatLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.945 = ref_param_pattern [concrete = constants.%self.param_patt.755] +// CHECK:STDOUT: %self.patt: %pattern_type.945 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.17e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.9b3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.9b3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc11_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.945 = ref_param_pattern [concrete = constants.%self.param_patt.755] +// CHECK:STDOUT: %self.patt: %pattern_type.945 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.17e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.9b3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.9b3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.240 = ref_param_pattern [concrete = constants.%self.param_patt.c62] +// CHECK:STDOUT: %self.patt: %pattern_type.240 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ed0] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.c73 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.c73 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc11_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.240 = ref_param_pattern [concrete = constants.%self.param_patt.c62] +// CHECK:STDOUT: %self.patt: %pattern_type.240 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ed0] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.c73 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.c73 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.18b = ref_param_pattern [concrete = constants.%self.param_patt.c06] +// CHECK:STDOUT: %self.patt: %pattern_type.18b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a67] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc11_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.18b = ref_param_pattern [concrete = constants.%self.param_patt.c06] +// CHECK:STDOUT: %self.patt: %pattern_type.18b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a67] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1.loc8: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] @@ -845,20 +910,47 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %a.patt: %pattern_type.18b = ref_binding_pattern a [concrete = constants.%a.patt] // CHECK:STDOUT: %a.var_patt: %pattern_type.18b = var_pattern %a.patt [concrete = constants.%a.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_3.1(%self.param: ref %f32.9b3) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_3.1(%self.param: ref %f32.9b3) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_3.2(%self.param: ref %f32.c73) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_3.1(%self.param: ref %f32.9b3) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_3.2(%self.param: ref %f32.c73) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_3.2(%self.param: ref %f32.c73) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_3.2(%self.param: ref %f32.c73) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_3.3(%self.param: ref %array_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -934,12 +1026,32 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.7cb: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%f32.c73, %ImplicitAs.facet.fcd) [concrete] // CHECK:STDOUT: %.7fe: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.7cb, %ImplicitAs.facet.fcd [concrete] // CHECK:STDOUT: %Core.FloatLiteral.as.ImplicitAs.impl.Convert.bound: = bound_method %float.6da, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.b37 [concrete] +// CHECK:STDOUT: %pattern_type.240: type = pattern_type %f32.c73 [concrete] // CHECK:STDOUT: %Core.FloatLiteral.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Core.FloatLiteral.as.ImplicitAs.impl.Convert.b37, @Core.FloatLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete] // CHECK:STDOUT: %bound_method.3e4: = bound_method %float.6da, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %float.943: %f32.c73 = float_value 1 [concrete] // CHECK:STDOUT: %array: %array_type = tuple_value (%float.943) [concrete] +// CHECK:STDOUT: %pattern_type.945: type = pattern_type %f32.9b3 [concrete] +// CHECK:STDOUT: %self.param_patt.755: %pattern_type.945 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.17e: %pattern_type.945 = wrapper_binding_pattern self, %self.param_patt.755 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc11_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.c62: %pattern_type.240 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.ed0: %pattern_type.240 = wrapper_binding_pattern self, %self.param_patt.c62 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc11_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.c06: %pattern_type.18b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.a67: %pattern_type.18b = wrapper_binding_pattern self, %self.param_patt.c06 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc11_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc11_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -957,6 +1069,51 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %ImplicitAs.impl_witness_table.1e0 = impl_witness_table (%Core.import_ref.c4c), @Core.FloatLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.945 = ref_param_pattern [concrete = constants.%self.param_patt.755] +// CHECK:STDOUT: %self.patt: %pattern_type.945 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.17e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.9b3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.9b3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc11_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.945 = ref_param_pattern [concrete = constants.%self.param_patt.755] +// CHECK:STDOUT: %self.patt: %pattern_type.945 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.17e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.9b3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.9b3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.240 = ref_param_pattern [concrete = constants.%self.param_patt.c62] +// CHECK:STDOUT: %self.patt: %pattern_type.240 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ed0] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.c73 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.c73 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc11_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.240 = ref_param_pattern [concrete = constants.%self.param_patt.c62] +// CHECK:STDOUT: %self.patt: %pattern_type.240 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ed0] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.c73 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.c73 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.18b = ref_param_pattern [concrete = constants.%self.param_patt.c06] +// CHECK:STDOUT: %self.patt: %pattern_type.18b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a67] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc11_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.18b = ref_param_pattern [concrete = constants.%self.param_patt.c06] +// CHECK:STDOUT: %self.patt: %pattern_type.18b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a67] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1.loc8: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] @@ -1023,20 +1180,47 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %a.patt: %pattern_type.18b = ref_binding_pattern a [concrete = constants.%a.patt] // CHECK:STDOUT: %a.var_patt: %pattern_type.18b = var_pattern %a.patt [concrete = constants.%a.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_3.1(%self.param: ref %f32.9b3) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_3.1(%self.param: ref %f32.9b3) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_3.2(%self.param: ref %f32.c73) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_3.1(%self.param: ref %f32.9b3) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_3.2(%self.param: ref %f32.c73) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_3.2(%self.param: ref %f32.c73) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_3.2(%self.param: ref %f32.c73) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_3.3(%self.param: ref %array_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1134,17 +1318,49 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.7cb: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%f32.c73, %ImplicitAs.facet.fcd) [concrete] // CHECK:STDOUT: %.7fe: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.7cb, %ImplicitAs.facet.fcd [concrete] // CHECK:STDOUT: %Core.FloatLiteral.as.ImplicitAs.impl.Convert.bound: = bound_method %float.6da, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.b37 [concrete] +// CHECK:STDOUT: %pattern_type.240: type = pattern_type %f32.c73 [concrete] // CHECK:STDOUT: %Core.FloatLiteral.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Core.FloatLiteral.as.ImplicitAs.impl.Convert.b37, @Core.FloatLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete] // CHECK:STDOUT: %bound_method: = bound_method %float.6da, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %float.943: %f32.c73 = float_value 1 [concrete] // CHECK:STDOUT: %array: %array_type = tuple_value (%float.943) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.945: type = pattern_type %f32.9b3 [concrete] +// CHECK:STDOUT: %self.param_patt.755: %pattern_type.945 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.17e: %pattern_type.945 = wrapper_binding_pattern self, %self.param_patt.755 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc26_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc26_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.c62: %pattern_type.240 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.ed0: %pattern_type.240 = wrapper_binding_pattern self, %self.param_patt.c62 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc26_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc26_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.c06: %pattern_type.18b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.a67: %pattern_type.18b = wrapper_binding_pattern self, %self.param_patt.c06 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc26_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc26_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc26_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.123: %pattern_type.596 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.1e9: %pattern_type.596 = wrapper_binding_pattern self, %self.param_patt.123 [concrete] // CHECK:STDOUT: %IntResult.cpp_destructor.type: type = fn_type @IntResult.cpp_destructor [concrete] // CHECK:STDOUT: %IntResult.cpp_destructor: %IntResult.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc22 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc22 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.39f: %pattern_type.142c0 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.7bb: %pattern_type.142c0 = wrapper_binding_pattern self, %self.param_patt.39f [concrete] // CHECK:STDOUT: %LongResult.cpp_destructor.type: type = fn_type @LongResult.cpp_destructor [concrete] // CHECK:STDOUT: %LongResult.cpp_destructor: %LongResult.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.5: type = fn_type @Destroy.WithSelf.Op.loc19 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.5: %Destroy.WithSelf.Op.type.ef016f.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5: type = fn_type @Destroy.WithSelf.SelfDestruct.loc19 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.5: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1200,6 +1416,75 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %Core.import_ref.c4c: @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type (%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type.063) = import_ref Core//prelude/types/float, loc{{\d+_\d+}}, loaded [symbolic = @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert (constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.d4f)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.1e0 = impl_witness_table (%Core.import_ref.c4c), @Core.FloatLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/destroy, Destroy, loaded [concrete = constants.%Destroy.type] +// CHECK:STDOUT: %IntResult.cpp_destructor.decl: %IntResult.cpp_destructor.type = fn_decl @IntResult.cpp_destructor [concrete = constants.%IntResult.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: %LongResult.cpp_destructor.decl: %LongResult.cpp_destructor.type = fn_decl @LongResult.cpp_destructor [concrete = constants.%LongResult.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc26_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.945 = ref_param_pattern [concrete = constants.%self.param_patt.755] +// CHECK:STDOUT: %self.patt: %pattern_type.945 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.17e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.9b3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.9b3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc26_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.945 = ref_param_pattern [concrete = constants.%self.param_patt.755] +// CHECK:STDOUT: %self.patt: %pattern_type.945 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.17e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.9b3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.9b3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc26_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.240 = ref_param_pattern [concrete = constants.%self.param_patt.c62] +// CHECK:STDOUT: %self.patt: %pattern_type.240 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ed0] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.c73 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.c73 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc26_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.240 = ref_param_pattern [concrete = constants.%self.param_patt.c62] +// CHECK:STDOUT: %self.patt: %pattern_type.240 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ed0] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.c73 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.c73 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc26_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.18b = ref_param_pattern [concrete = constants.%self.param_patt.c06] +// CHECK:STDOUT: %self.patt: %pattern_type.18b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a67] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc26_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.18b = ref_param_pattern [concrete = constants.%self.param_patt.c06] +// CHECK:STDOUT: %self.patt: %pattern_type.18b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a67] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc22 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.596 = ref_param_pattern [concrete = constants.%self.param_patt.123] +// CHECK:STDOUT: %self.patt: %pattern_type.596 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.1e9] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %IntResult = ref_param call_param0 +// CHECK:STDOUT: %self: ref %IntResult = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.5: %Destroy.WithSelf.Op.type.ef016f.5 = fn_decl @Destroy.WithSelf.Op.loc19 [concrete = constants.%Destroy.WithSelf.Op.403171.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.142c0 = ref_param_pattern [concrete = constants.%self.param_patt.39f] +// CHECK:STDOUT: %self.patt: %pattern_type.142c0 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.7bb] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %LongResult = ref_param call_param0 +// CHECK:STDOUT: %self: ref %LongResult = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -1336,26 +1621,71 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %a.patt: %pattern_type.18b = ref_binding_pattern a [concrete = constants.%a.patt] // CHECK:STDOUT: %a.var_patt: %pattern_type.18b = var_pattern %a.patt [concrete = constants.%a.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%a.var) -// CHECK:STDOUT: %IntResult.cpp_destructor.bound: = bound_method %.loc22_72.3, constants.%IntResult.cpp_destructor -// CHECK:STDOUT: %IntResult.cpp_destructor.call: init %empty_tuple.type = call %IntResult.cpp_destructor.bound(%.loc22_72.3) -// CHECK:STDOUT: %LongResult.cpp_destructor.bound.loc19: = bound_method %.loc19_83.3, constants.%LongResult.cpp_destructor -// CHECK:STDOUT: %LongResult.cpp_destructor.call.loc19: init %empty_tuple.type = call %LongResult.cpp_destructor.bound.loc19(%.loc19_83.3) -// CHECK:STDOUT: %LongResult.cpp_destructor.bound.loc16: = bound_method %.loc16_69.3, constants.%LongResult.cpp_destructor -// CHECK:STDOUT: %LongResult.cpp_destructor.call.loc16: init %empty_tuple.type = call %LongResult.cpp_destructor.bound.loc16(%.loc16_69.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc26: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc26: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc26(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc22: = bound_method %.loc22_72.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc22: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc22(%.loc22_72.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc19: = bound_method %.loc19_83.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc19: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc19(%.loc19_83.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16: = bound_method %.loc16_69.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16(%.loc16_69.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc26_3.1(%self.param: ref %f32.9b3) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc26_3.1(%self.param: ref %f32.9b3) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc26_3.2(%self.param: ref %f32.c73) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc26_3.1(%self.param: ref %f32.9b3) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc26_3.2(%self.param: ref %f32.c73) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc26_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc26_3.2(%self.param: ref %f32.c73) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc26_3.2(%self.param: ref %f32.c73) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc26_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc26_3.3(%self.param: ref %array_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc26_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc22(%self.param: ref %IntResult) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc22(%self.param: ref %IntResult) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %IntResult.cpp_destructor.call: init %empty_tuple.type = call imports.%IntResult.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc19(%self.param: ref %LongResult) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc19(%self.param: ref %LongResult) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.5(%self.param) +// CHECK:STDOUT: %LongResult.cpp_destructor.call: init %empty_tuple.type = call imports.%LongResult.cpp_destructor.decl(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1390,8 +1720,28 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %.f58: type = fn_type_with_self_type %Copy.WithSelf.Op.type.7c0, %Copy.facet [concrete] // CHECK:STDOUT: %Cpp.long.as.Copy.impl.Op.type: type = fn_type @Cpp.long.as.Copy.impl.Op [concrete] // CHECK:STDOUT: %Cpp.long.as.Copy.impl.Op: %Cpp.long.as.Copy.impl.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc9_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.6b6: type = pattern_type %i32 [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.2bb: %pattern_type.25e = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.cb1: %pattern_type.25e = wrapper_binding_pattern self, %self.param_patt.2bb [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc9_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1405,6 +1755,51 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %Copy.impl_witness_table.6ef = impl_witness_table (%Core.import_ref.9c3), @Cpp.long.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc9_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc9_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.25e = ref_param_pattern [concrete = constants.%self.param_patt.2bb] +// CHECK:STDOUT: %self.patt: %pattern_type.25e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cb1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Cpp.long = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Cpp.long = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc9_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.25e = ref_param_pattern [concrete = constants.%self.param_patt.2bb] +// CHECK:STDOUT: %self.patt: %pattern_type.25e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cb1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Cpp.long = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Cpp.long = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @CopyLong() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.var: ref %Cpp.long = var_storage %a.var_patt @@ -1439,22 +1834,49 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %b.patt: %pattern_type.25e = ref_binding_pattern b [concrete = constants.%b.patt] // CHECK:STDOUT: %b.var_patt: %pattern_type.25e = var_pattern %b.patt [concrete = constants.%b.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc9: = bound_method %b.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc9(%b.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc8: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc8(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc9: = bound_method %b.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc9(%b.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.3(%self.param: ref %Cpp.long) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.3(%self.param: ref %Cpp.long) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.3(%self.param: ref %Cpp.long) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.3(%self.param: ref %Cpp.long) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2775,6 +3197,8 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %Cpp.long.as.AddAssignWith.impl.Op.d1bf47.1: %Cpp.long.as.AddAssignWith.impl.Op.type.3959e4.1 = struct_value () [symbolic] // CHECK:STDOUT: %Cpp.long.as.AddAssignWith.impl.Op.type.3959e4.2: type = fn_type @Cpp.long.as.AddAssignWith.impl.Op.2, @Cpp.long.as.AddAssignWith.impl(%U.315) [symbolic] // CHECK:STDOUT: %Cpp.long.as.AddAssignWith.impl.Op.d1bf47.2: %Cpp.long.as.AddAssignWith.impl.Op.type.3959e4.2 = struct_value () [symbolic] +// CHECK:STDOUT: %self.param_patt.2bb: %pattern_type.25e = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.cb1: %pattern_type.25e = wrapper_binding_pattern self, %self.param_patt.2bb [concrete] // CHECK:STDOUT: %Copy.impl_witness.c0b: = impl_witness imports.%Copy.impl_witness_table.6ef [concrete] // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %Cpp.long, (%Copy.impl_witness.c0b) [concrete] // CHECK:STDOUT: %ImplicitAs.impl_witness.0b7: = impl_witness imports.%ImplicitAs.impl_witness_table.fac, @T.as_type.as.ImplicitAs.impl(%Copy.facet) [concrete] @@ -2924,8 +3348,26 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %.401: type = fn_type_with_self_type %RightShiftAssignWith.WithSelf.Op.type.459, %RightShiftAssignWith.facet.d0b [concrete] // CHECK:STDOUT: %Cpp.long.as.RightShiftAssignWith.impl.Op.specific_fn.3dff2c.1: = specific_function %Cpp.long.as.RightShiftAssignWith.impl.Op.12df33.2, @Cpp.long.as.RightShiftAssignWith.impl.Op.1(%ImplicitAs.facet.4d5) [concrete] // CHECK:STDOUT: %Cpp.long.as.RightShiftAssignWith.impl.Op.specific_fn.3dff2c.2: = specific_function %Cpp.long.as.RightShiftAssignWith.impl.Op.12df33.1, @Cpp.long.as.RightShiftAssignWith.impl.Op.2(%ImplicitAs.facet.4d5) [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc9_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.6b6: type = pattern_type %i32 [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc9_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] // CHECK:STDOUT: %Cpp.long.as.Copy.impl.Op.type: type = fn_type @Cpp.long.as.Copy.impl.Op [concrete] // CHECK:STDOUT: %Cpp.long.as.Copy.impl.Op: %Cpp.long.as.Copy.impl.Op.type = struct_value () [concrete] // CHECK:STDOUT: } @@ -2973,6 +3415,51 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %Core.Op.127: @Cpp.long.as.RightShiftAssignWith.impl.%Cpp.long.as.RightShiftAssignWith.impl.Op.type.1 (%Cpp.long.as.RightShiftAssignWith.impl.Op.type.e450db.2) = import_ref Core//prelude/types/cpp/int, Op, loaded [symbolic = @Cpp.long.as.RightShiftAssignWith.impl.%Cpp.long.as.RightShiftAssignWith.impl.Op.1 (constants.%Cpp.long.as.RightShiftAssignWith.impl.Op.27a493.2)] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc9_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc9_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.25e = ref_param_pattern [concrete = constants.%self.param_patt.2bb] +// CHECK:STDOUT: %self.patt: %pattern_type.25e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cb1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Cpp.long = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Cpp.long = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc9_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.25e = ref_param_pattern [concrete = constants.%self.param_patt.2bb] +// CHECK:STDOUT: %self.patt: %pattern_type.25e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cb1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Cpp.long = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Cpp.long = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @CompoundAssignmentHomogeneousLong() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.var: ref %Cpp.long = var_storage %a.var_patt @@ -3177,22 +3664,49 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %Cpp.long.as.RightShiftAssignWith.impl.Op.specific_fn: = specific_function %Op.ref.loc21, @Cpp.long.as.RightShiftAssignWith.impl.Op.2(constants.%ImplicitAs.facet.4d5) [concrete = constants.%Cpp.long.as.RightShiftAssignWith.impl.Op.specific_fn.3dff2c.2] // CHECK:STDOUT: %bound_method.loc21_5.3: = bound_method %a.ref.loc21, %Cpp.long.as.RightShiftAssignWith.impl.Op.specific_fn // CHECK:STDOUT: %Cpp.long.as.RightShiftAssignWith.impl.Op.call: init %empty_tuple.type = call %bound_method.loc21_5.3(%a.ref.loc21, %.loc21_9) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc9: = bound_method %b.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc9(%b.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc8: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc8(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc9: = bound_method %b.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc9(%b.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.3(%self.param: ref %Cpp.long) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.3(%self.param: ref %Cpp.long) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.3(%self.param: ref %Cpp.long) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.3(%self.param: ref %Cpp.long) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3204,6 +3718,7 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] +// CHECK:STDOUT: %pattern_type.6b6: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %Cpp.long: type = class_type @Long32 [concrete] // CHECK:STDOUT: %pattern_type.25e: type = pattern_type %Cpp.long [concrete] @@ -3224,6 +3739,8 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %Cpp.long.as.AddAssignWith.impl.Op.d1bf47.1: %Cpp.long.as.AddAssignWith.impl.Op.type.3959e4.1 = struct_value () [symbolic] // CHECK:STDOUT: %Cpp.long.as.AddAssignWith.impl.Op.type.3959e4.2: type = fn_type @Cpp.long.as.AddAssignWith.impl.Op.2, @Cpp.long.as.AddAssignWith.impl(%U.315) [symbolic] // CHECK:STDOUT: %Cpp.long.as.AddAssignWith.impl.Op.d1bf47.2: %Cpp.long.as.AddAssignWith.impl.Op.type.3959e4.2 = struct_value () [symbolic] +// CHECK:STDOUT: %self.param_patt.2bb: %pattern_type.25e = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.cb1: %pattern_type.25e = wrapper_binding_pattern self, %self.param_patt.2bb [concrete] // CHECK:STDOUT: %ImplicitAs.impl_witness.2e1: = impl_witness imports.%ImplicitAs.impl_witness_table.96f [concrete] // CHECK:STDOUT: %ImplicitAs.facet.2ac: %ImplicitAs.type.7eb = facet_value %i32, (%ImplicitAs.impl_witness.2e1) [concrete] // CHECK:STDOUT: %AddAssignWith.impl_witness.1cb: = impl_witness imports.%AddAssignWith.impl_witness_table.015, @Cpp.long.as.AddAssignWith.impl(%ImplicitAs.facet.2ac) [concrete] @@ -3375,8 +3892,25 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %.f59: type = fn_type_with_self_type %RightShiftAssignWith.WithSelf.Op.type.155, %RightShiftAssignWith.facet.940 [concrete] // CHECK:STDOUT: %Cpp.long.as.RightShiftAssignWith.impl.Op.specific_fn.03ccc7.1: = specific_function %Cpp.long.as.RightShiftAssignWith.impl.Op.30352f.2, @Cpp.long.as.RightShiftAssignWith.impl.Op.1(%ImplicitAs.facet.2ac) [concrete] // CHECK:STDOUT: %Cpp.long.as.RightShiftAssignWith.impl.Op.specific_fn.03ccc7.2: = specific_function %Cpp.long.as.RightShiftAssignWith.impl.Op.30352f.1, @Cpp.long.as.RightShiftAssignWith.impl.Op.2(%ImplicitAs.facet.2ac) [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc9_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc9_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -3420,6 +3954,51 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %Core.Op.127: @Cpp.long.as.RightShiftAssignWith.impl.%Cpp.long.as.RightShiftAssignWith.impl.Op.type.1 (%Cpp.long.as.RightShiftAssignWith.impl.Op.type.e450db.2) = import_ref Core//prelude/types/cpp/int, Op, loaded [symbolic = @Cpp.long.as.RightShiftAssignWith.impl.%Cpp.long.as.RightShiftAssignWith.impl.Op.1 (constants.%Cpp.long.as.RightShiftAssignWith.impl.Op.27a493.2)] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc9_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc9_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.25e = ref_param_pattern [concrete = constants.%self.param_patt.2bb] +// CHECK:STDOUT: %self.patt: %pattern_type.25e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cb1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Cpp.long = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Cpp.long = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc9_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.25e = ref_param_pattern [concrete = constants.%self.param_patt.2bb] +// CHECK:STDOUT: %self.patt: %pattern_type.25e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cb1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Cpp.long = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Cpp.long = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @CompoundAssignmentLongAndI32() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: @@ -3649,20 +4228,47 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %.loc20_9.1: %Cpp.long = value_of_initializer %i32.as.ImplicitAs.impl.Convert.call.loc20 // CHECK:STDOUT: %.loc20_9.2: %Cpp.long = converted %b.ref.loc20, %.loc20_9.1 // CHECK:STDOUT: %Cpp.long.as.RightShiftAssignWith.impl.Op.call: init %empty_tuple.type = call %bound_method.loc20_5.3(%a.ref.loc20, %.loc20_9.2) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.3(%self.param: ref %Cpp.long) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.3(%self.param: ref %Cpp.long) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.3(%self.param: ref %Cpp.long) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.3(%self.param: ref %Cpp.long) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3694,6 +4300,8 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %Cpp.long.as.AddAssignWith.impl.Op.d1bf47.1: %Cpp.long.as.AddAssignWith.impl.Op.type.3959e4.1 = struct_value () [symbolic] // CHECK:STDOUT: %Cpp.long.as.AddAssignWith.impl.Op.type.3959e4.2: type = fn_type @Cpp.long.as.AddAssignWith.impl.Op.2, @Cpp.long.as.AddAssignWith.impl(%U.315) [symbolic] // CHECK:STDOUT: %Cpp.long.as.AddAssignWith.impl.Op.d1bf47.2: %Cpp.long.as.AddAssignWith.impl.Op.type.3959e4.2 = struct_value () [symbolic] +// CHECK:STDOUT: %self.param_patt.2bb: %pattern_type.25e = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.cb1: %pattern_type.25e = wrapper_binding_pattern self, %self.param_patt.2bb [concrete] // CHECK:STDOUT: %AddAssignWith.impl_witness.fbe: = impl_witness imports.%AddAssignWith.impl_witness_table.015, @Cpp.long.as.AddAssignWith.impl(%ImplicitAs.facet) [concrete] // CHECK:STDOUT: %Cpp.long.as.AddAssignWith.impl.Op.type.48c987.1: type = fn_type @Cpp.long.as.AddAssignWith.impl.Op.2, @Cpp.long.as.AddAssignWith.impl(%ImplicitAs.facet) [concrete] // CHECK:STDOUT: %Cpp.long.as.AddAssignWith.impl.Op.99fe7e.1: %Cpp.long.as.AddAssignWith.impl.Op.type.48c987.1 = struct_value () [concrete] @@ -3704,8 +4312,26 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %.fd5: type = fn_type_with_self_type %AddAssignWith.WithSelf.Op.type.b43, %AddAssignWith.facet.e2c [concrete] // CHECK:STDOUT: %Cpp.long.as.AddAssignWith.impl.Op.specific_fn.c6f135.1: = specific_function %Cpp.long.as.AddAssignWith.impl.Op.99fe7e.2, @Cpp.long.as.AddAssignWith.impl.Op.1(%ImplicitAs.facet) [concrete] // CHECK:STDOUT: %Cpp.long.as.AddAssignWith.impl.Op.specific_fn.c6f135.2: = specific_function %Cpp.long.as.AddAssignWith.impl.Op.99fe7e.1, @Cpp.long.as.AddAssignWith.impl.Op.2(%ImplicitAs.facet) [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc8_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.6b6: type = pattern_type %i32 [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc8_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc8_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -3720,6 +4346,51 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %Core.Op.7fd: @Cpp.long.as.AddAssignWith.impl.%Cpp.long.as.AddAssignWith.impl.Op.type.1 (%Cpp.long.as.AddAssignWith.impl.Op.type.3959e4.2) = import_ref Core//prelude/types/cpp/int, Op, loaded [symbolic = @Cpp.long.as.AddAssignWith.impl.%Cpp.long.as.AddAssignWith.impl.Op.1 (constants.%Cpp.long.as.AddAssignWith.impl.Op.d1bf47.2)] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc8_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc8_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.25e = ref_param_pattern [concrete = constants.%self.param_patt.2bb] +// CHECK:STDOUT: %self.patt: %pattern_type.25e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cb1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Cpp.long = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Cpp.long = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc8_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.25e = ref_param_pattern [concrete = constants.%self.param_patt.2bb] +// CHECK:STDOUT: %self.patt: %pattern_type.25e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cb1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Cpp.long = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Cpp.long = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @CompoundAssignmentLongAndIntLiteral() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.var: ref %Cpp.long = var_storage %a.var_patt @@ -3759,20 +4430,47 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %.loc9_8.1: %Cpp.long = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9 [concrete = constants.%int_1.9ce] // CHECK:STDOUT: %.loc9_8.2: %Cpp.long = converted %int_1.loc9, %.loc9_8.1 [concrete = constants.%int_1.9ce] // CHECK:STDOUT: %Cpp.long.as.AddAssignWith.impl.Op.call: init %empty_tuple.type = call %bound_method.loc9_5.3(%a.ref, %.loc9_8.2) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.3(%self.param: ref %Cpp.long) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.3(%self.param: ref %Cpp.long) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.3(%self.param: ref %Cpp.long) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.3(%self.param: ref %Cpp.long) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3820,6 +4518,8 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %Cpp.long.as.AddAssignWith.impl.Op.d1bf47.1: %Cpp.long.as.AddAssignWith.impl.Op.type.3959e4.1 = struct_value () [symbolic] // CHECK:STDOUT: %Cpp.long.as.AddAssignWith.impl.Op.type.3959e4.2: type = fn_type @Cpp.long.as.AddAssignWith.impl.Op.2, @Cpp.long.as.AddAssignWith.impl(%U.315) [symbolic] // CHECK:STDOUT: %Cpp.long.as.AddAssignWith.impl.Op.d1bf47.2: %Cpp.long.as.AddAssignWith.impl.Op.type.3959e4.2 = struct_value () [symbolic] +// CHECK:STDOUT: %self.param_patt.2bb: %pattern_type.25e = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.cb1: %pattern_type.25e = wrapper_binding_pattern self, %self.param_patt.2bb [concrete] // CHECK:STDOUT: %ImplicitAs.impl_witness.2e1: = impl_witness imports.%ImplicitAs.impl_witness_table.96f [concrete] // CHECK:STDOUT: %ImplicitAs.facet.2ac: %ImplicitAs.type.7eb = facet_value %i32, (%ImplicitAs.impl_witness.2e1) [concrete] // CHECK:STDOUT: %AddAssignWith.impl_witness.1cb: = impl_witness imports.%AddAssignWith.impl_witness_table.015, @Cpp.long.as.AddAssignWith.impl(%ImplicitAs.facet.2ac) [concrete] @@ -3836,8 +4536,25 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %.08c: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.f2d, %ImplicitAs.facet.2ac [concrete] // CHECK:STDOUT: %i32.as.ImplicitAs.impl.Convert.type: type = fn_type @i32.as.ImplicitAs.impl.Convert [concrete] // CHECK:STDOUT: %i32.as.ImplicitAs.impl.Convert: %i32.as.ImplicitAs.impl.Convert.type = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc8_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc8_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc8_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -3856,6 +4573,51 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %ImplicitAs.impl_witness_table.96f = impl_witness_table (%Core.import_ref.06c923.2), @i32.as.ImplicitAs.impl.133 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc8_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc8_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.25e = ref_param_pattern [concrete = constants.%self.param_patt.2bb] +// CHECK:STDOUT: %self.patt: %pattern_type.25e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cb1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Cpp.long = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Cpp.long = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc8_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.25e = ref_param_pattern [concrete = constants.%self.param_patt.2bb] +// CHECK:STDOUT: %self.patt: %pattern_type.25e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cb1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Cpp.long = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Cpp.long = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @CompoundAssignmentLongAndRuntimeI32() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.var: ref %Cpp.long = var_storage %a.var_patt @@ -3908,20 +4670,47 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %.loc10_8.1: %Cpp.long = value_of_initializer %i32.as.ImplicitAs.impl.Convert.call // CHECK:STDOUT: %.loc10_8.2: %Cpp.long = converted %b.ref, %.loc10_8.1 // CHECK:STDOUT: %Cpp.long.as.AddAssignWith.impl.Op.call: init %empty_tuple.type = call %bound_method.loc10_5.3(%a.ref, %.loc10_8.2) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.3(%self.param: ref %Cpp.long) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.3(%self.param: ref %Cpp.long) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.3(%self.param: ref %Cpp.long) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.3(%self.param: ref %Cpp.long) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3954,6 +4743,8 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %.1a6: type = fn_type_with_self_type %Inc.WithSelf.Op.type.b2b, %Inc.facet [concrete] // CHECK:STDOUT: %Cpp.long.as.Inc.impl.Op.type: type = fn_type @Cpp.long.as.Inc.impl.Op [concrete] // CHECK:STDOUT: %Cpp.long.as.Inc.impl.Op: %Cpp.long.as.Inc.impl.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.2bb: %pattern_type.25e = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.cb1: %pattern_type.25e = wrapper_binding_pattern self, %self.param_patt.2bb [concrete] // CHECK:STDOUT: %Dec.type: type = facet_type <@Dec> [concrete] // CHECK:STDOUT: %Dec.impl_witness: = impl_witness imports.%Dec.impl_witness_table [concrete] // CHECK:STDOUT: %Dec.facet: %Dec.type = facet_value %Cpp.long, (%Dec.impl_witness) [concrete] @@ -3961,8 +4752,26 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %.2e4: type = fn_type_with_self_type %Dec.WithSelf.Op.type.e5a, %Dec.facet [concrete] // CHECK:STDOUT: %Cpp.long.as.Dec.impl.Op.type: type = fn_type @Cpp.long.as.Dec.impl.Op [concrete] // CHECK:STDOUT: %Cpp.long.as.Dec.impl.Op: %Cpp.long.as.Dec.impl.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc8_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.6b6: type = pattern_type %i32 [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc8_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc8_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -3978,6 +4787,51 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %Dec.impl_witness_table = impl_witness_table (%Core.import_ref.9c3475.2), @Cpp.long.as.Dec.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc8_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc8_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.25e = ref_param_pattern [concrete = constants.%self.param_patt.2bb] +// CHECK:STDOUT: %self.patt: %pattern_type.25e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cb1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Cpp.long = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Cpp.long = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc8_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.25e = ref_param_pattern [concrete = constants.%self.param_patt.2bb] +// CHECK:STDOUT: %self.patt: %pattern_type.25e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cb1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Cpp.long = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Cpp.long = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @IncrementDecrementLong() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.var: ref %Cpp.long = var_storage %a.var_patt @@ -4004,20 +4858,47 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %impl.elem0.loc10: %.2e4 = impl_witness_access constants.%Dec.impl_witness, element0 [concrete = constants.%Cpp.long.as.Dec.impl.Op] // CHECK:STDOUT: %bound_method.loc10: = bound_method %a.ref.loc10, %impl.elem0.loc10 // CHECK:STDOUT: %Cpp.long.as.Dec.impl.Op.call: init %empty_tuple.type = call %bound_method.loc10(%a.ref.loc10) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.3(%self.param: ref %Cpp.long) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.3(%self.param: ref %Cpp.long) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.3(%self.param: ref %Cpp.long) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.3(%self.param: ref %Cpp.long) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -4118,17 +4999,49 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.7cb: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%f32.c73, %ImplicitAs.facet.fcd) [concrete] // CHECK:STDOUT: %.7fe: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.7cb, %ImplicitAs.facet.fcd [concrete] // CHECK:STDOUT: %Core.FloatLiteral.as.ImplicitAs.impl.Convert.bound: = bound_method %float.6da, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.b37 [concrete] +// CHECK:STDOUT: %pattern_type.240: type = pattern_type %f32.c73 [concrete] // CHECK:STDOUT: %Core.FloatLiteral.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Core.FloatLiteral.as.ImplicitAs.impl.Convert.b37, @Core.FloatLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete] // CHECK:STDOUT: %bound_method.3e4: = bound_method %float.6da, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %float.943: %f32.c73 = float_value 1 [concrete] // CHECK:STDOUT: %array: %array_type = tuple_value (%float.943) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.945: type = pattern_type %f32.9b3 [concrete] +// CHECK:STDOUT: %self.param_patt.755: %pattern_type.945 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.17e: %pattern_type.945 = wrapper_binding_pattern self, %self.param_patt.755 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc24_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc24_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.c62: %pattern_type.240 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.ed0: %pattern_type.240 = wrapper_binding_pattern self, %self.param_patt.c62 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc24_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc24_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.c06: %pattern_type.18b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.a67: %pattern_type.18b = wrapper_binding_pattern self, %self.param_patt.c06 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc24_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc24_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc24_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.adc: %pattern_type.116 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.7ed: %pattern_type.116 = wrapper_binding_pattern self, %self.param_patt.adc [concrete] // CHECK:STDOUT: %UIntResult.cpp_destructor.type: type = fn_type @UIntResult.cpp_destructor [concrete] // CHECK:STDOUT: %UIntResult.cpp_destructor: %UIntResult.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc22 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc22 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.7ab: %pattern_type.f8a = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.7af: %pattern_type.f8a = wrapper_binding_pattern self, %self.param_patt.7ab [concrete] // CHECK:STDOUT: %ULongResult.cpp_destructor.type: type = fn_type @ULongResult.cpp_destructor [concrete] // CHECK:STDOUT: %ULongResult.cpp_destructor: %ULongResult.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.5: type = fn_type @Destroy.WithSelf.Op.loc19 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.5: %Destroy.WithSelf.Op.type.ef016f.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5: type = fn_type @Destroy.WithSelf.SelfDestruct.loc19 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.5: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -4184,6 +5097,75 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %Core.import_ref.c4c: @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type (%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type.063) = import_ref Core//prelude/types/float, loc{{\d+_\d+}}, loaded [symbolic = @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert (constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.d4f)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.1e0 = impl_witness_table (%Core.import_ref.c4c), @Core.FloatLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/destroy, Destroy, loaded [concrete = constants.%Destroy.type] +// CHECK:STDOUT: %UIntResult.cpp_destructor.decl: %UIntResult.cpp_destructor.type = fn_decl @UIntResult.cpp_destructor [concrete = constants.%UIntResult.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: %ULongResult.cpp_destructor.decl: %ULongResult.cpp_destructor.type = fn_decl @ULongResult.cpp_destructor [concrete = constants.%ULongResult.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc24_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.945 = ref_param_pattern [concrete = constants.%self.param_patt.755] +// CHECK:STDOUT: %self.patt: %pattern_type.945 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.17e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.9b3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.9b3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc24_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.945 = ref_param_pattern [concrete = constants.%self.param_patt.755] +// CHECK:STDOUT: %self.patt: %pattern_type.945 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.17e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.9b3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.9b3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc24_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.240 = ref_param_pattern [concrete = constants.%self.param_patt.c62] +// CHECK:STDOUT: %self.patt: %pattern_type.240 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ed0] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.c73 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.c73 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc24_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.240 = ref_param_pattern [concrete = constants.%self.param_patt.c62] +// CHECK:STDOUT: %self.patt: %pattern_type.240 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ed0] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.c73 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.c73 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc24_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.18b = ref_param_pattern [concrete = constants.%self.param_patt.c06] +// CHECK:STDOUT: %self.patt: %pattern_type.18b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a67] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc24_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.18b = ref_param_pattern [concrete = constants.%self.param_patt.c06] +// CHECK:STDOUT: %self.patt: %pattern_type.18b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a67] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc22 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.116 = ref_param_pattern [concrete = constants.%self.param_patt.adc] +// CHECK:STDOUT: %self.patt: %pattern_type.116 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.7ed] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %UIntResult = ref_param call_param0 +// CHECK:STDOUT: %self: ref %UIntResult = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.5: %Destroy.WithSelf.Op.type.ef016f.5 = fn_decl @Destroy.WithSelf.Op.loc19 [concrete = constants.%Destroy.WithSelf.Op.403171.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f8a = ref_param_pattern [concrete = constants.%self.param_patt.7ab] +// CHECK:STDOUT: %self.patt: %pattern_type.f8a = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.7af] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ULongResult = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ULongResult = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -4313,26 +5295,71 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %a.patt: %pattern_type.18b = ref_binding_pattern a [concrete = constants.%a.patt] // CHECK:STDOUT: %a.var_patt: %pattern_type.18b = var_pattern %a.patt [concrete = constants.%a.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%a.var) -// CHECK:STDOUT: %UIntResult.cpp_destructor.bound: = bound_method %.loc22_74.3, constants.%UIntResult.cpp_destructor -// CHECK:STDOUT: %UIntResult.cpp_destructor.call: init %empty_tuple.type = call %UIntResult.cpp_destructor.bound(%.loc22_74.3) -// CHECK:STDOUT: %ULongResult.cpp_destructor.bound.loc19: = bound_method %.loc19_87.3, constants.%ULongResult.cpp_destructor -// CHECK:STDOUT: %ULongResult.cpp_destructor.call.loc19: init %empty_tuple.type = call %ULongResult.cpp_destructor.bound.loc19(%.loc19_87.3) -// CHECK:STDOUT: %ULongResult.cpp_destructor.bound.loc16: = bound_method %.loc16_89.3, constants.%ULongResult.cpp_destructor -// CHECK:STDOUT: %ULongResult.cpp_destructor.call.loc16: init %empty_tuple.type = call %ULongResult.cpp_destructor.bound.loc16(%.loc16_89.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc24: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc24: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc24(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc22: = bound_method %.loc22_74.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc22: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc22(%.loc22_74.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc19: = bound_method %.loc19_87.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc19: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc19(%.loc19_87.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16: = bound_method %.loc16_89.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16(%.loc16_89.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc24_3.1(%self.param: ref %f32.9b3) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_3.1(%self.param: ref %f32.9b3) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_3.2(%self.param: ref %f32.c73) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc24_3.1(%self.param: ref %f32.9b3) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc24_3.2(%self.param: ref %f32.c73) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_3.2(%self.param: ref %f32.c73) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc24_3.2(%self.param: ref %f32.c73) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc24_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_3.3(%self.param: ref %array_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc24_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc22(%self.param: ref %UIntResult) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc22(%self.param: ref %UIntResult) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %UIntResult.cpp_destructor.call: init %empty_tuple.type = call imports.%UIntResult.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc19(%self.param: ref %ULongResult) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc19(%self.param: ref %ULongResult) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.5(%self.param) +// CHECK:STDOUT: %ULongResult.cpp_destructor.call: init %empty_tuple.type = call imports.%ULongResult.cpp_destructor.decl(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -4367,8 +5394,28 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %.78b: type = fn_type_with_self_type %Copy.WithSelf.Op.type.5ce, %Copy.facet [concrete] // CHECK:STDOUT: %Cpp.unsigned_long.as.Copy.impl.Op.type: type = fn_type @Cpp.unsigned_long.as.Copy.impl.Op [concrete] // CHECK:STDOUT: %Cpp.unsigned_long.as.Copy.impl.Op: %Cpp.unsigned_long.as.Copy.impl.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.b1b: type = pattern_type %u32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.a81: %pattern_type.b1b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.095: %pattern_type.b1b = wrapper_binding_pattern self, %self.param_patt.a81 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc9_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.668: type = pattern_type %u32 [concrete] +// CHECK:STDOUT: %self.param_patt.e4c: %pattern_type.668 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.77f: %pattern_type.668 = wrapper_binding_pattern self, %self.param_patt.e4c [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.ca8: %pattern_type.1a0 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.ffb: %pattern_type.1a0 = wrapper_binding_pattern self, %self.param_patt.ca8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc9_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -4382,6 +5429,51 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %Copy.impl_witness_table.786 = impl_witness_table (%Core.import_ref.9c3), @Cpp.unsigned_long.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b1b = ref_param_pattern [concrete = constants.%self.param_patt.a81] +// CHECK:STDOUT: %self.patt: %pattern_type.b1b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.095] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %u32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %u32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc9_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b1b = ref_param_pattern [concrete = constants.%self.param_patt.a81] +// CHECK:STDOUT: %self.patt: %pattern_type.b1b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.095] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %u32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %u32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.668 = ref_param_pattern [concrete = constants.%self.param_patt.e4c] +// CHECK:STDOUT: %self.patt: %pattern_type.668 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.77f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %u32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %u32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc9_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.668 = ref_param_pattern [concrete = constants.%self.param_patt.e4c] +// CHECK:STDOUT: %self.patt: %pattern_type.668 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.77f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %u32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %u32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.1a0 = ref_param_pattern [concrete = constants.%self.param_patt.ca8] +// CHECK:STDOUT: %self.patt: %pattern_type.1a0 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ffb] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Cpp.unsigned_long = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Cpp.unsigned_long = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc9_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.1a0 = ref_param_pattern [concrete = constants.%self.param_patt.ca8] +// CHECK:STDOUT: %self.patt: %pattern_type.1a0 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ffb] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Cpp.unsigned_long = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Cpp.unsigned_long = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @CopyUnsignedLong() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.var: ref %Cpp.unsigned_long = var_storage %a.var_patt @@ -4416,22 +5508,49 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %b.patt: %pattern_type.1a0 = ref_binding_pattern b [concrete = constants.%b.patt] // CHECK:STDOUT: %b.var_patt: %pattern_type.1a0 = var_pattern %b.patt [concrete = constants.%b.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc9: = bound_method %b.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc9(%b.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc8: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc8(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc9: = bound_method %b.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc9(%b.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.1(%self.param: ref %u32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.1(%self.param: ref %u32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.2(%self.param: ref %u32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.1(%self.param: ref %u32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.2(%self.param: ref %u32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.3(%self.param: ref %Cpp.unsigned_long) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.2(%self.param: ref %u32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.2(%self.param: ref %u32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.3(%self.param: ref %Cpp.unsigned_long) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.3(%self.param: ref %Cpp.unsigned_long) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.3(%self.param: ref %Cpp.unsigned_long) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/primitive_types/long_and_long_long.lp64.carbon b/toolchain/check/testdata/interop/cpp/primitive_types/long_and_long_long.lp64.carbon index dda0a2718244..c6bc58cde1f7 100644 --- a/toolchain/check/testdata/interop/cpp/primitive_types/long_and_long_long.lp64.carbon +++ b/toolchain/check/testdata/interop/cpp/primitive_types/long_and_long_long.lp64.carbon @@ -704,12 +704,32 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.7cb: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%f32.c73, %ImplicitAs.facet.fcd) [concrete] // CHECK:STDOUT: %.7fe: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.7cb, %ImplicitAs.facet.fcd [concrete] // CHECK:STDOUT: %Core.FloatLiteral.as.ImplicitAs.impl.Convert.bound: = bound_method %float.6da, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.b37 [concrete] +// CHECK:STDOUT: %pattern_type.240: type = pattern_type %f32.c73 [concrete] // CHECK:STDOUT: %Core.FloatLiteral.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Core.FloatLiteral.as.ImplicitAs.impl.Convert.b37, @Core.FloatLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete] // CHECK:STDOUT: %bound_method.3e4: = bound_method %float.6da, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %float.943: %f32.c73 = float_value 1 [concrete] // CHECK:STDOUT: %array: %array_type = tuple_value (%float.943) [concrete] +// CHECK:STDOUT: %pattern_type.945: type = pattern_type %f32.9b3 [concrete] +// CHECK:STDOUT: %self.param_patt.755: %pattern_type.945 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.17e: %pattern_type.945 = wrapper_binding_pattern self, %self.param_patt.755 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc11_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.c62: %pattern_type.240 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.ed0: %pattern_type.240 = wrapper_binding_pattern self, %self.param_patt.c62 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc11_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.c06: %pattern_type.18b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.a67: %pattern_type.18b = wrapper_binding_pattern self, %self.param_patt.c06 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc11_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc11_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -727,6 +747,51 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %ImplicitAs.impl_witness_table.1e0 = impl_witness_table (%Core.import_ref.c4c), @Core.FloatLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.945 = ref_param_pattern [concrete = constants.%self.param_patt.755] +// CHECK:STDOUT: %self.patt: %pattern_type.945 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.17e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.9b3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.9b3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc11_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.945 = ref_param_pattern [concrete = constants.%self.param_patt.755] +// CHECK:STDOUT: %self.patt: %pattern_type.945 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.17e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.9b3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.9b3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.240 = ref_param_pattern [concrete = constants.%self.param_patt.c62] +// CHECK:STDOUT: %self.patt: %pattern_type.240 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ed0] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.c73 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.c73 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc11_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.240 = ref_param_pattern [concrete = constants.%self.param_patt.c62] +// CHECK:STDOUT: %self.patt: %pattern_type.240 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ed0] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.c73 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.c73 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.18b = ref_param_pattern [concrete = constants.%self.param_patt.c06] +// CHECK:STDOUT: %self.patt: %pattern_type.18b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a67] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc11_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.18b = ref_param_pattern [concrete = constants.%self.param_patt.c06] +// CHECK:STDOUT: %self.patt: %pattern_type.18b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a67] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1.loc8: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] @@ -793,20 +858,47 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %a.patt: %pattern_type.18b = ref_binding_pattern a [concrete = constants.%a.patt] // CHECK:STDOUT: %a.var_patt: %pattern_type.18b = var_pattern %a.patt [concrete = constants.%a.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_3.1(%self.param: ref %f32.9b3) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_3.1(%self.param: ref %f32.9b3) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_3.2(%self.param: ref %f32.c73) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_3.1(%self.param: ref %f32.9b3) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_3.2(%self.param: ref %f32.c73) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_3.2(%self.param: ref %f32.c73) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_3.2(%self.param: ref %f32.c73) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_3.3(%self.param: ref %array_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -882,12 +974,32 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.7cb: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%f32.c73, %ImplicitAs.facet.fcd) [concrete] // CHECK:STDOUT: %.7fe: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.7cb, %ImplicitAs.facet.fcd [concrete] // CHECK:STDOUT: %Core.FloatLiteral.as.ImplicitAs.impl.Convert.bound: = bound_method %float.6da, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.b37 [concrete] +// CHECK:STDOUT: %pattern_type.240: type = pattern_type %f32.c73 [concrete] // CHECK:STDOUT: %Core.FloatLiteral.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Core.FloatLiteral.as.ImplicitAs.impl.Convert.b37, @Core.FloatLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete] // CHECK:STDOUT: %bound_method.3e4: = bound_method %float.6da, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %float.943: %f32.c73 = float_value 1 [concrete] // CHECK:STDOUT: %array: %array_type = tuple_value (%float.943) [concrete] +// CHECK:STDOUT: %pattern_type.945: type = pattern_type %f32.9b3 [concrete] +// CHECK:STDOUT: %self.param_patt.755: %pattern_type.945 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.17e: %pattern_type.945 = wrapper_binding_pattern self, %self.param_patt.755 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc11_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.c62: %pattern_type.240 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.ed0: %pattern_type.240 = wrapper_binding_pattern self, %self.param_patt.c62 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc11_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.c06: %pattern_type.18b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.a67: %pattern_type.18b = wrapper_binding_pattern self, %self.param_patt.c06 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc11_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc11_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -905,6 +1017,51 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %ImplicitAs.impl_witness_table.1e0 = impl_witness_table (%Core.import_ref.c4c), @Core.FloatLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.945 = ref_param_pattern [concrete = constants.%self.param_patt.755] +// CHECK:STDOUT: %self.patt: %pattern_type.945 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.17e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.9b3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.9b3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc11_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.945 = ref_param_pattern [concrete = constants.%self.param_patt.755] +// CHECK:STDOUT: %self.patt: %pattern_type.945 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.17e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.9b3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.9b3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.240 = ref_param_pattern [concrete = constants.%self.param_patt.c62] +// CHECK:STDOUT: %self.patt: %pattern_type.240 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ed0] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.c73 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.c73 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc11_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.240 = ref_param_pattern [concrete = constants.%self.param_patt.c62] +// CHECK:STDOUT: %self.patt: %pattern_type.240 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ed0] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.c73 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.c73 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.18b = ref_param_pattern [concrete = constants.%self.param_patt.c06] +// CHECK:STDOUT: %self.patt: %pattern_type.18b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a67] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc11_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.18b = ref_param_pattern [concrete = constants.%self.param_patt.c06] +// CHECK:STDOUT: %self.patt: %pattern_type.18b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a67] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %int_1.loc8: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] @@ -971,20 +1128,47 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %a.patt: %pattern_type.18b = ref_binding_pattern a [concrete = constants.%a.patt] // CHECK:STDOUT: %a.var_patt: %pattern_type.18b = var_pattern %a.patt [concrete = constants.%a.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_3.1(%self.param: ref %f32.9b3) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_3.1(%self.param: ref %f32.9b3) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_3.2(%self.param: ref %f32.c73) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_3.1(%self.param: ref %f32.9b3) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_3.2(%self.param: ref %f32.c73) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_3.2(%self.param: ref %f32.c73) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_3.2(%self.param: ref %f32.c73) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_3.3(%self.param: ref %array_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1072,17 +1256,49 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.7cb: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%f32.c73, %ImplicitAs.facet.fcd) [concrete] // CHECK:STDOUT: %.7fe: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.7cb, %ImplicitAs.facet.fcd [concrete] // CHECK:STDOUT: %Core.FloatLiteral.as.ImplicitAs.impl.Convert.bound: = bound_method %float.6da, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.b37 [concrete] +// CHECK:STDOUT: %pattern_type.240: type = pattern_type %f32.c73 [concrete] // CHECK:STDOUT: %Core.FloatLiteral.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Core.FloatLiteral.as.ImplicitAs.impl.Convert.b37, @Core.FloatLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete] // CHECK:STDOUT: %bound_method: = bound_method %float.6da, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %float.943: %f32.c73 = float_value 1 [concrete] // CHECK:STDOUT: %array: %array_type = tuple_value (%float.943) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.945: type = pattern_type %f32.9b3 [concrete] +// CHECK:STDOUT: %self.param_patt.755: %pattern_type.945 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.17e: %pattern_type.945 = wrapper_binding_pattern self, %self.param_patt.755 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc24_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc24_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.c62: %pattern_type.240 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.ed0: %pattern_type.240 = wrapper_binding_pattern self, %self.param_patt.c62 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc24_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc24_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.c06: %pattern_type.18b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.a67: %pattern_type.18b = wrapper_binding_pattern self, %self.param_patt.c06 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc24_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc24_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc24_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.b62: %pattern_type.ae7 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.5c45: %pattern_type.ae7 = wrapper_binding_pattern self, %self.param_patt.b62 [concrete] // CHECK:STDOUT: %LongResult.cpp_destructor.type: type = fn_type @LongResult.cpp_destructor [concrete] // CHECK:STDOUT: %LongResult.cpp_destructor: %LongResult.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc22 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc22 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.98a: %pattern_type.357 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.784: %pattern_type.357 = wrapper_binding_pattern self, %self.param_patt.98a [concrete] // CHECK:STDOUT: %LongLongResult.cpp_destructor.type: type = fn_type @LongLongResult.cpp_destructor [concrete] // CHECK:STDOUT: %LongLongResult.cpp_destructor: %LongLongResult.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.5: type = fn_type @Destroy.WithSelf.Op.loc19 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.5: %Destroy.WithSelf.Op.type.ef016f.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5: type = fn_type @Destroy.WithSelf.SelfDestruct.loc19 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.5: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1136,6 +1352,75 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %Core.import_ref.c4c: @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type (%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type.063) = import_ref Core//prelude/types/float, loc{{\d+_\d+}}, loaded [symbolic = @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert (constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.d4f)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.1e0 = impl_witness_table (%Core.import_ref.c4c), @Core.FloatLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/destroy, Destroy, loaded [concrete = constants.%Destroy.type] +// CHECK:STDOUT: %LongResult.cpp_destructor.decl: %LongResult.cpp_destructor.type = fn_decl @LongResult.cpp_destructor [concrete = constants.%LongResult.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: %LongLongResult.cpp_destructor.decl: %LongLongResult.cpp_destructor.type = fn_decl @LongLongResult.cpp_destructor [concrete = constants.%LongLongResult.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc24_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.945 = ref_param_pattern [concrete = constants.%self.param_patt.755] +// CHECK:STDOUT: %self.patt: %pattern_type.945 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.17e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.9b3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.9b3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc24_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.945 = ref_param_pattern [concrete = constants.%self.param_patt.755] +// CHECK:STDOUT: %self.patt: %pattern_type.945 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.17e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.9b3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.9b3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc24_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.240 = ref_param_pattern [concrete = constants.%self.param_patt.c62] +// CHECK:STDOUT: %self.patt: %pattern_type.240 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ed0] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.c73 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.c73 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc24_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.240 = ref_param_pattern [concrete = constants.%self.param_patt.c62] +// CHECK:STDOUT: %self.patt: %pattern_type.240 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ed0] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.c73 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.c73 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc24_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.18b = ref_param_pattern [concrete = constants.%self.param_patt.c06] +// CHECK:STDOUT: %self.patt: %pattern_type.18b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a67] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc24_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.18b = ref_param_pattern [concrete = constants.%self.param_patt.c06] +// CHECK:STDOUT: %self.patt: %pattern_type.18b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a67] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc22 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.ae7 = ref_param_pattern [concrete = constants.%self.param_patt.b62] +// CHECK:STDOUT: %self.patt: %pattern_type.ae7 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.5c45] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %LongResult = ref_param call_param0 +// CHECK:STDOUT: %self: ref %LongResult = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.5: %Destroy.WithSelf.Op.type.ef016f.5 = fn_decl @Destroy.WithSelf.Op.loc19 [concrete = constants.%Destroy.WithSelf.Op.403171.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.357 = ref_param_pattern [concrete = constants.%self.param_patt.98a] +// CHECK:STDOUT: %self.patt: %pattern_type.357 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.784] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %LongLongResult = ref_param call_param0 +// CHECK:STDOUT: %self: ref %LongLongResult = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -1261,26 +1546,71 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %a.patt: %pattern_type.18b = ref_binding_pattern a [concrete = constants.%a.patt] // CHECK:STDOUT: %a.var_patt: %pattern_type.18b = var_pattern %a.patt [concrete = constants.%a.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%a.var) -// CHECK:STDOUT: %LongResult.cpp_destructor.bound: = bound_method %.loc22_77.3, constants.%LongResult.cpp_destructor -// CHECK:STDOUT: %LongResult.cpp_destructor.call: init %empty_tuple.type = call %LongResult.cpp_destructor.bound(%.loc22_77.3) -// CHECK:STDOUT: %LongLongResult.cpp_destructor.bound.loc19: = bound_method %.loc19_101.3, constants.%LongLongResult.cpp_destructor -// CHECK:STDOUT: %LongLongResult.cpp_destructor.call.loc19: init %empty_tuple.type = call %LongLongResult.cpp_destructor.bound.loc19(%.loc19_101.3) -// CHECK:STDOUT: %LongLongResult.cpp_destructor.bound.loc16: = bound_method %.loc16_87.3, constants.%LongLongResult.cpp_destructor -// CHECK:STDOUT: %LongLongResult.cpp_destructor.call.loc16: init %empty_tuple.type = call %LongLongResult.cpp_destructor.bound.loc16(%.loc16_87.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc24: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc24: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc24(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc22: = bound_method %.loc22_77.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc22: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc22(%.loc22_77.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc19: = bound_method %.loc19_101.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc19: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc19(%.loc19_101.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16: = bound_method %.loc16_87.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16(%.loc16_87.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc24_3.1(%self.param: ref %f32.9b3) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_3.1(%self.param: ref %f32.9b3) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_3.2(%self.param: ref %f32.c73) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc24_3.1(%self.param: ref %f32.9b3) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc24_3.2(%self.param: ref %f32.c73) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_3.2(%self.param: ref %f32.c73) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc24_3.2(%self.param: ref %f32.c73) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc24_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_3.3(%self.param: ref %array_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc24_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc22(%self.param: ref %LongResult) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc22(%self.param: ref %LongResult) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %LongResult.cpp_destructor.call: init %empty_tuple.type = call imports.%LongResult.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc19(%self.param: ref %LongLongResult) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc19(%self.param: ref %LongLongResult) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.5(%self.param) +// CHECK:STDOUT: %LongLongResult.cpp_destructor.call: init %empty_tuple.type = call imports.%LongLongResult.cpp_destructor.decl(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1315,8 +1645,28 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %.252: type = fn_type_with_self_type %Copy.WithSelf.Op.type.1b6, %Copy.facet [concrete] // CHECK:STDOUT: %Cpp.long_long.as.Copy.impl.Op.type: type = fn_type @Cpp.long_long.as.Copy.impl.Op [concrete] // CHECK:STDOUT: %Cpp.long_long.as.Copy.impl.Op: %Cpp.long_long.as.Copy.impl.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.e13: type = pattern_type %i64.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.7d9: %pattern_type.e13 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.bb9: %pattern_type.e13 = wrapper_binding_pattern self, %self.param_patt.7d9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc9_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.f57: type = pattern_type %i64 [concrete] +// CHECK:STDOUT: %self.param_patt.108: %pattern_type.f57 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.5f4: %pattern_type.f57 = wrapper_binding_pattern self, %self.param_patt.108 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.7e1: %pattern_type.d58 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.718: %pattern_type.d58 = wrapper_binding_pattern self, %self.param_patt.7e1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc9_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1330,6 +1680,51 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %Copy.impl_witness_table.d10 = impl_witness_table (%Core.import_ref.9c3), @Cpp.long_long.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e13 = ref_param_pattern [concrete = constants.%self.param_patt.7d9] +// CHECK:STDOUT: %self.patt: %pattern_type.e13 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.bb9] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i64.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i64.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc9_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e13 = ref_param_pattern [concrete = constants.%self.param_patt.7d9] +// CHECK:STDOUT: %self.patt: %pattern_type.e13 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.bb9] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i64.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i64.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f57 = ref_param_pattern [concrete = constants.%self.param_patt.108] +// CHECK:STDOUT: %self.patt: %pattern_type.f57 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.5f4] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i64 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i64 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc9_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f57 = ref_param_pattern [concrete = constants.%self.param_patt.108] +// CHECK:STDOUT: %self.patt: %pattern_type.f57 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.5f4] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i64 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i64 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.d58 = ref_param_pattern [concrete = constants.%self.param_patt.7e1] +// CHECK:STDOUT: %self.patt: %pattern_type.d58 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.718] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Cpp.long_long = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Cpp.long_long = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc9_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.d58 = ref_param_pattern [concrete = constants.%self.param_patt.7e1] +// CHECK:STDOUT: %self.patt: %pattern_type.d58 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.718] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Cpp.long_long = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Cpp.long_long = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @CopyLongLong() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.var: ref %Cpp.long_long = var_storage %a.var_patt @@ -1364,22 +1759,49 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %b.patt: %pattern_type.d58 = ref_binding_pattern b [concrete = constants.%b.patt] // CHECK:STDOUT: %b.var_patt: %pattern_type.d58 = var_pattern %b.patt [concrete = constants.%b.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc9: = bound_method %b.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc9(%b.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc8: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc8(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc9: = bound_method %b.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc9(%b.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.1(%self.param: ref %i64.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.1(%self.param: ref %i64.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.2(%self.param: ref %i64) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.1(%self.param: ref %i64.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.2(%self.param: ref %i64) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.3(%self.param: ref %Cpp.long_long) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.2(%self.param: ref %i64) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.2(%self.param: ref %i64) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.3(%self.param: ref %Cpp.long_long) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.3(%self.param: ref %Cpp.long_long) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.3(%self.param: ref %Cpp.long_long) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2483,6 +2905,8 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %Cpp.long_long.as.AddAssignWith.impl.Op.8f0746.1: %Cpp.long_long.as.AddAssignWith.impl.Op.type.524923.1 = struct_value () [symbolic] // CHECK:STDOUT: %Cpp.long_long.as.AddAssignWith.impl.Op.type.524923.2: type = fn_type @Cpp.long_long.as.AddAssignWith.impl.Op.2, @Cpp.long_long.as.AddAssignWith.impl(%U.bf2) [symbolic] // CHECK:STDOUT: %Cpp.long_long.as.AddAssignWith.impl.Op.8f0746.2: %Cpp.long_long.as.AddAssignWith.impl.Op.type.524923.2 = struct_value () [symbolic] +// CHECK:STDOUT: %self.param_patt.7e1: %pattern_type.d58 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.718: %pattern_type.d58 = wrapper_binding_pattern self, %self.param_patt.7e1 [concrete] // CHECK:STDOUT: %Copy.impl_witness.1ae: = impl_witness imports.%Copy.impl_witness_table.d10 [concrete] // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %Cpp.long_long, (%Copy.impl_witness.1ae) [concrete] // CHECK:STDOUT: %ImplicitAs.impl_witness.9c2: = impl_witness imports.%ImplicitAs.impl_witness_table.fac, @T.as_type.as.ImplicitAs.impl(%Copy.facet) [concrete] @@ -2632,8 +3056,26 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %.b01: type = fn_type_with_self_type %RightShiftAssignWith.WithSelf.Op.type.3ee, %RightShiftAssignWith.facet.926 [concrete] // CHECK:STDOUT: %Cpp.long_long.as.RightShiftAssignWith.impl.Op.specific_fn.ddd122.1: = specific_function %Cpp.long_long.as.RightShiftAssignWith.impl.Op.5eb4a1.2, @Cpp.long_long.as.RightShiftAssignWith.impl.Op.1(%ImplicitAs.facet.bc8) [concrete] // CHECK:STDOUT: %Cpp.long_long.as.RightShiftAssignWith.impl.Op.specific_fn.ddd122.2: = specific_function %Cpp.long_long.as.RightShiftAssignWith.impl.Op.5eb4a1.1, @Cpp.long_long.as.RightShiftAssignWith.impl.Op.2(%ImplicitAs.facet.bc8) [concrete] +// CHECK:STDOUT: %pattern_type.e13: type = pattern_type %i64.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.7d9: %pattern_type.e13 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.bb9: %pattern_type.e13 = wrapper_binding_pattern self, %self.param_patt.7d9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc9_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.f57: type = pattern_type %i64 [concrete] +// CHECK:STDOUT: %self.param_patt.108: %pattern_type.f57 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.5f4: %pattern_type.f57 = wrapper_binding_pattern self, %self.param_patt.108 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc9_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] // CHECK:STDOUT: %Cpp.long_long.as.Copy.impl.Op.type: type = fn_type @Cpp.long_long.as.Copy.impl.Op [concrete] // CHECK:STDOUT: %Cpp.long_long.as.Copy.impl.Op: %Cpp.long_long.as.Copy.impl.Op.type = struct_value () [concrete] // CHECK:STDOUT: } @@ -2681,6 +3123,51 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %Core.Op.77b: @Cpp.long_long.as.RightShiftAssignWith.impl.%Cpp.long_long.as.RightShiftAssignWith.impl.Op.type.1 (%Cpp.long_long.as.RightShiftAssignWith.impl.Op.type.2a7c37.2) = import_ref Core//prelude/types/cpp/int, Op, loaded [symbolic = @Cpp.long_long.as.RightShiftAssignWith.impl.%Cpp.long_long.as.RightShiftAssignWith.impl.Op.1 (constants.%Cpp.long_long.as.RightShiftAssignWith.impl.Op.9744e0.2)] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e13 = ref_param_pattern [concrete = constants.%self.param_patt.7d9] +// CHECK:STDOUT: %self.patt: %pattern_type.e13 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.bb9] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i64.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i64.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc9_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e13 = ref_param_pattern [concrete = constants.%self.param_patt.7d9] +// CHECK:STDOUT: %self.patt: %pattern_type.e13 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.bb9] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i64.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i64.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f57 = ref_param_pattern [concrete = constants.%self.param_patt.108] +// CHECK:STDOUT: %self.patt: %pattern_type.f57 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.5f4] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i64 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i64 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc9_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f57 = ref_param_pattern [concrete = constants.%self.param_patt.108] +// CHECK:STDOUT: %self.patt: %pattern_type.f57 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.5f4] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i64 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i64 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.d58 = ref_param_pattern [concrete = constants.%self.param_patt.7e1] +// CHECK:STDOUT: %self.patt: %pattern_type.d58 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.718] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Cpp.long_long = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Cpp.long_long = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc9_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.d58 = ref_param_pattern [concrete = constants.%self.param_patt.7e1] +// CHECK:STDOUT: %self.patt: %pattern_type.d58 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.718] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Cpp.long_long = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Cpp.long_long = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @CompoundAssignmentHomogeneousLongLong() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.var: ref %Cpp.long_long = var_storage %a.var_patt @@ -2885,22 +3372,49 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %Cpp.long_long.as.RightShiftAssignWith.impl.Op.specific_fn: = specific_function %Op.ref.loc21, @Cpp.long_long.as.RightShiftAssignWith.impl.Op.2(constants.%ImplicitAs.facet.bc8) [concrete = constants.%Cpp.long_long.as.RightShiftAssignWith.impl.Op.specific_fn.ddd122.2] // CHECK:STDOUT: %bound_method.loc21_5.3: = bound_method %a.ref.loc21, %Cpp.long_long.as.RightShiftAssignWith.impl.Op.specific_fn // CHECK:STDOUT: %Cpp.long_long.as.RightShiftAssignWith.impl.Op.call: init %empty_tuple.type = call %bound_method.loc21_5.3(%a.ref.loc21, %.loc21_9) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc9: = bound_method %b.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc9(%b.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc8: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc8(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc9: = bound_method %b.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc9(%b.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.1(%self.param: ref %i64.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.1(%self.param: ref %i64.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.2(%self.param: ref %i64) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.1(%self.param: ref %i64.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.2(%self.param: ref %i64) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.3(%self.param: ref %Cpp.long_long) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.2(%self.param: ref %i64) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.2(%self.param: ref %i64) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.3(%self.param: ref %Cpp.long_long) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.3(%self.param: ref %Cpp.long_long) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.3(%self.param: ref %Cpp.long_long) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2912,6 +3426,7 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete] // CHECK:STDOUT: %i64: type = class_type @Int, @Int(%int_64) [concrete] // CHECK:STDOUT: %i64.builtin: type = int_type signed, %int_64 [concrete] +// CHECK:STDOUT: %pattern_type.f57: type = pattern_type %i64 [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %Cpp.long_long: type = class_type @LongLong64 [concrete] // CHECK:STDOUT: %pattern_type.d58: type = pattern_type %Cpp.long_long [concrete] @@ -2932,6 +3447,8 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %Cpp.long_long.as.AddAssignWith.impl.Op.8f0746.1: %Cpp.long_long.as.AddAssignWith.impl.Op.type.524923.1 = struct_value () [symbolic] // CHECK:STDOUT: %Cpp.long_long.as.AddAssignWith.impl.Op.type.524923.2: type = fn_type @Cpp.long_long.as.AddAssignWith.impl.Op.2, @Cpp.long_long.as.AddAssignWith.impl(%U.bf2) [symbolic] // CHECK:STDOUT: %Cpp.long_long.as.AddAssignWith.impl.Op.8f0746.2: %Cpp.long_long.as.AddAssignWith.impl.Op.type.524923.2 = struct_value () [symbolic] +// CHECK:STDOUT: %self.param_patt.7e1: %pattern_type.d58 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.718: %pattern_type.d58 = wrapper_binding_pattern self, %self.param_patt.7e1 [concrete] // CHECK:STDOUT: %ImplicitAs.impl_witness.b39: = impl_witness imports.%ImplicitAs.impl_witness_table.527 [concrete] // CHECK:STDOUT: %ImplicitAs.facet.2d9: %ImplicitAs.type.0ec = facet_value %i64, (%ImplicitAs.impl_witness.b39) [concrete] // CHECK:STDOUT: %AddAssignWith.impl_witness.057: = impl_witness imports.%AddAssignWith.impl_witness_table.24b, @Cpp.long_long.as.AddAssignWith.impl(%ImplicitAs.facet.2d9) [concrete] @@ -3083,8 +3600,25 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %.b40: type = fn_type_with_self_type %RightShiftAssignWith.WithSelf.Op.type.6c4, %RightShiftAssignWith.facet.004 [concrete] // CHECK:STDOUT: %Cpp.long_long.as.RightShiftAssignWith.impl.Op.specific_fn.9385c3.1: = specific_function %Cpp.long_long.as.RightShiftAssignWith.impl.Op.110511.2, @Cpp.long_long.as.RightShiftAssignWith.impl.Op.1(%ImplicitAs.facet.2d9) [concrete] // CHECK:STDOUT: %Cpp.long_long.as.RightShiftAssignWith.impl.Op.specific_fn.9385c3.2: = specific_function %Cpp.long_long.as.RightShiftAssignWith.impl.Op.110511.1, @Cpp.long_long.as.RightShiftAssignWith.impl.Op.2(%ImplicitAs.facet.2d9) [concrete] +// CHECK:STDOUT: %pattern_type.e13: type = pattern_type %i64.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.7d9: %pattern_type.e13 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.bb9: %pattern_type.e13 = wrapper_binding_pattern self, %self.param_patt.7d9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc9_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.108: %pattern_type.f57 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.5f4: %pattern_type.f57 = wrapper_binding_pattern self, %self.param_patt.108 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc9_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -3128,6 +3662,51 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %Core.Op.77b: @Cpp.long_long.as.RightShiftAssignWith.impl.%Cpp.long_long.as.RightShiftAssignWith.impl.Op.type.1 (%Cpp.long_long.as.RightShiftAssignWith.impl.Op.type.2a7c37.2) = import_ref Core//prelude/types/cpp/int, Op, loaded [symbolic = @Cpp.long_long.as.RightShiftAssignWith.impl.%Cpp.long_long.as.RightShiftAssignWith.impl.Op.1 (constants.%Cpp.long_long.as.RightShiftAssignWith.impl.Op.9744e0.2)] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e13 = ref_param_pattern [concrete = constants.%self.param_patt.7d9] +// CHECK:STDOUT: %self.patt: %pattern_type.e13 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.bb9] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i64.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i64.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc9_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e13 = ref_param_pattern [concrete = constants.%self.param_patt.7d9] +// CHECK:STDOUT: %self.patt: %pattern_type.e13 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.bb9] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i64.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i64.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f57 = ref_param_pattern [concrete = constants.%self.param_patt.108] +// CHECK:STDOUT: %self.patt: %pattern_type.f57 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.5f4] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i64 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i64 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc9_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f57 = ref_param_pattern [concrete = constants.%self.param_patt.108] +// CHECK:STDOUT: %self.patt: %pattern_type.f57 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.5f4] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i64 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i64 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.d58 = ref_param_pattern [concrete = constants.%self.param_patt.7e1] +// CHECK:STDOUT: %self.patt: %pattern_type.d58 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.718] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Cpp.long_long = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Cpp.long_long = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc9_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.d58 = ref_param_pattern [concrete = constants.%self.param_patt.7e1] +// CHECK:STDOUT: %self.patt: %pattern_type.d58 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.718] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Cpp.long_long = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Cpp.long_long = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @CompoundAssignmentLongLongAndI64() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: @@ -3357,20 +3936,47 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %.loc20_9.1: %Cpp.long_long = value_of_initializer %i64.as.ImplicitAs.impl.Convert.call.loc20 // CHECK:STDOUT: %.loc20_9.2: %Cpp.long_long = converted %b.ref.loc20, %.loc20_9.1 // CHECK:STDOUT: %Cpp.long_long.as.RightShiftAssignWith.impl.Op.call: init %empty_tuple.type = call %bound_method.loc20_5.3(%a.ref.loc20, %.loc20_9.2) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.1(%self.param: ref %i64.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.1(%self.param: ref %i64.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.2(%self.param: ref %i64) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.1(%self.param: ref %i64.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.2(%self.param: ref %i64) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.3(%self.param: ref %Cpp.long_long) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.2(%self.param: ref %i64) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.2(%self.param: ref %i64) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.3(%self.param: ref %Cpp.long_long) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.3(%self.param: ref %Cpp.long_long) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.3(%self.param: ref %Cpp.long_long) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3402,6 +4008,8 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %Cpp.long_long.as.AddAssignWith.impl.Op.8f0746.1: %Cpp.long_long.as.AddAssignWith.impl.Op.type.524923.1 = struct_value () [symbolic] // CHECK:STDOUT: %Cpp.long_long.as.AddAssignWith.impl.Op.type.524923.2: type = fn_type @Cpp.long_long.as.AddAssignWith.impl.Op.2, @Cpp.long_long.as.AddAssignWith.impl(%U.bf2) [symbolic] // CHECK:STDOUT: %Cpp.long_long.as.AddAssignWith.impl.Op.8f0746.2: %Cpp.long_long.as.AddAssignWith.impl.Op.type.524923.2 = struct_value () [symbolic] +// CHECK:STDOUT: %self.param_patt.7e1: %pattern_type.d58 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.718: %pattern_type.d58 = wrapper_binding_pattern self, %self.param_patt.7e1 [concrete] // CHECK:STDOUT: %AddAssignWith.impl_witness.022: = impl_witness imports.%AddAssignWith.impl_witness_table.24b, @Cpp.long_long.as.AddAssignWith.impl(%ImplicitAs.facet) [concrete] // CHECK:STDOUT: %Cpp.long_long.as.AddAssignWith.impl.Op.type.01ebb2.1: type = fn_type @Cpp.long_long.as.AddAssignWith.impl.Op.2, @Cpp.long_long.as.AddAssignWith.impl(%ImplicitAs.facet) [concrete] // CHECK:STDOUT: %Cpp.long_long.as.AddAssignWith.impl.Op.0ea592.1: %Cpp.long_long.as.AddAssignWith.impl.Op.type.01ebb2.1 = struct_value () [concrete] @@ -3412,8 +4020,26 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %.9a6: type = fn_type_with_self_type %AddAssignWith.WithSelf.Op.type.498, %AddAssignWith.facet.ff3 [concrete] // CHECK:STDOUT: %Cpp.long_long.as.AddAssignWith.impl.Op.specific_fn.cb43dd.1: = specific_function %Cpp.long_long.as.AddAssignWith.impl.Op.0ea592.2, @Cpp.long_long.as.AddAssignWith.impl.Op.1(%ImplicitAs.facet) [concrete] // CHECK:STDOUT: %Cpp.long_long.as.AddAssignWith.impl.Op.specific_fn.cb43dd.2: = specific_function %Cpp.long_long.as.AddAssignWith.impl.Op.0ea592.1, @Cpp.long_long.as.AddAssignWith.impl.Op.2(%ImplicitAs.facet) [concrete] +// CHECK:STDOUT: %pattern_type.e13: type = pattern_type %i64.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.7d9: %pattern_type.e13 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.bb9: %pattern_type.e13 = wrapper_binding_pattern self, %self.param_patt.7d9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc8_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.f57: type = pattern_type %i64 [concrete] +// CHECK:STDOUT: %self.param_patt.108: %pattern_type.f57 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.5f4: %pattern_type.f57 = wrapper_binding_pattern self, %self.param_patt.108 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc8_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc8_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -3428,6 +4054,51 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %Core.Op.c11: @Cpp.long_long.as.AddAssignWith.impl.%Cpp.long_long.as.AddAssignWith.impl.Op.type.1 (%Cpp.long_long.as.AddAssignWith.impl.Op.type.524923.2) = import_ref Core//prelude/types/cpp/int, Op, loaded [symbolic = @Cpp.long_long.as.AddAssignWith.impl.%Cpp.long_long.as.AddAssignWith.impl.Op.1 (constants.%Cpp.long_long.as.AddAssignWith.impl.Op.8f0746.2)] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e13 = ref_param_pattern [concrete = constants.%self.param_patt.7d9] +// CHECK:STDOUT: %self.patt: %pattern_type.e13 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.bb9] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i64.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i64.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc8_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e13 = ref_param_pattern [concrete = constants.%self.param_patt.7d9] +// CHECK:STDOUT: %self.patt: %pattern_type.e13 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.bb9] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i64.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i64.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f57 = ref_param_pattern [concrete = constants.%self.param_patt.108] +// CHECK:STDOUT: %self.patt: %pattern_type.f57 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.5f4] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i64 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i64 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc8_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f57 = ref_param_pattern [concrete = constants.%self.param_patt.108] +// CHECK:STDOUT: %self.patt: %pattern_type.f57 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.5f4] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i64 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i64 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.d58 = ref_param_pattern [concrete = constants.%self.param_patt.7e1] +// CHECK:STDOUT: %self.patt: %pattern_type.d58 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.718] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Cpp.long_long = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Cpp.long_long = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc8_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.d58 = ref_param_pattern [concrete = constants.%self.param_patt.7e1] +// CHECK:STDOUT: %self.patt: %pattern_type.d58 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.718] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Cpp.long_long = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Cpp.long_long = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @CompoundAssignmentLongLongAndIntLiteral() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.var: ref %Cpp.long_long = var_storage %a.var_patt @@ -3467,20 +4138,47 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %.loc9_8.1: %Cpp.long_long = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9 [concrete = constants.%int_1.b19] // CHECK:STDOUT: %.loc9_8.2: %Cpp.long_long = converted %int_1.loc9, %.loc9_8.1 [concrete = constants.%int_1.b19] // CHECK:STDOUT: %Cpp.long_long.as.AddAssignWith.impl.Op.call: init %empty_tuple.type = call %bound_method.loc9_5.3(%a.ref, %.loc9_8.2) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.1(%self.param: ref %i64.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.1(%self.param: ref %i64.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.2(%self.param: ref %i64) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.1(%self.param: ref %i64.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.2(%self.param: ref %i64) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.3(%self.param: ref %Cpp.long_long) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.2(%self.param: ref %i64) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.2(%self.param: ref %i64) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.3(%self.param: ref %Cpp.long_long) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.3(%self.param: ref %Cpp.long_long) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.3(%self.param: ref %Cpp.long_long) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3528,6 +4226,8 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %Cpp.long_long.as.AddAssignWith.impl.Op.8f0746.1: %Cpp.long_long.as.AddAssignWith.impl.Op.type.524923.1 = struct_value () [symbolic] // CHECK:STDOUT: %Cpp.long_long.as.AddAssignWith.impl.Op.type.524923.2: type = fn_type @Cpp.long_long.as.AddAssignWith.impl.Op.2, @Cpp.long_long.as.AddAssignWith.impl(%U.bf2) [symbolic] // CHECK:STDOUT: %Cpp.long_long.as.AddAssignWith.impl.Op.8f0746.2: %Cpp.long_long.as.AddAssignWith.impl.Op.type.524923.2 = struct_value () [symbolic] +// CHECK:STDOUT: %self.param_patt.7e1: %pattern_type.d58 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.718: %pattern_type.d58 = wrapper_binding_pattern self, %self.param_patt.7e1 [concrete] // CHECK:STDOUT: %ImplicitAs.impl_witness.b39: = impl_witness imports.%ImplicitAs.impl_witness_table.527 [concrete] // CHECK:STDOUT: %ImplicitAs.facet.2d9: %ImplicitAs.type.0ec = facet_value %i64, (%ImplicitAs.impl_witness.b39) [concrete] // CHECK:STDOUT: %AddAssignWith.impl_witness.057: = impl_witness imports.%AddAssignWith.impl_witness_table.24b, @Cpp.long_long.as.AddAssignWith.impl(%ImplicitAs.facet.2d9) [concrete] @@ -3544,8 +4244,25 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %.c2b: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.561, %ImplicitAs.facet.2d9 [concrete] // CHECK:STDOUT: %i64.as.ImplicitAs.impl.Convert.type: type = fn_type @i64.as.ImplicitAs.impl.Convert [concrete] // CHECK:STDOUT: %i64.as.ImplicitAs.impl.Convert: %i64.as.ImplicitAs.impl.Convert.type = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.e13: type = pattern_type %i64.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.7d9: %pattern_type.e13 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.bb9: %pattern_type.e13 = wrapper_binding_pattern self, %self.param_patt.7d9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc8_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.108: %pattern_type.f57 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.5f4: %pattern_type.f57 = wrapper_binding_pattern self, %self.param_patt.108 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc8_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc8_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -3564,6 +4281,51 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %ImplicitAs.impl_witness_table.527 = impl_witness_table (%Core.import_ref.06c923.2), @i64.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e13 = ref_param_pattern [concrete = constants.%self.param_patt.7d9] +// CHECK:STDOUT: %self.patt: %pattern_type.e13 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.bb9] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i64.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i64.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc8_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e13 = ref_param_pattern [concrete = constants.%self.param_patt.7d9] +// CHECK:STDOUT: %self.patt: %pattern_type.e13 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.bb9] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i64.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i64.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f57 = ref_param_pattern [concrete = constants.%self.param_patt.108] +// CHECK:STDOUT: %self.patt: %pattern_type.f57 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.5f4] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i64 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i64 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc8_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f57 = ref_param_pattern [concrete = constants.%self.param_patt.108] +// CHECK:STDOUT: %self.patt: %pattern_type.f57 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.5f4] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i64 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i64 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.d58 = ref_param_pattern [concrete = constants.%self.param_patt.7e1] +// CHECK:STDOUT: %self.patt: %pattern_type.d58 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.718] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Cpp.long_long = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Cpp.long_long = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc8_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.d58 = ref_param_pattern [concrete = constants.%self.param_patt.7e1] +// CHECK:STDOUT: %self.patt: %pattern_type.d58 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.718] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Cpp.long_long = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Cpp.long_long = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @CompoundAssignmentLongLongAndRuntimeI64() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.var: ref %Cpp.long_long = var_storage %a.var_patt @@ -3616,20 +4378,47 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %.loc10_8.1: %Cpp.long_long = value_of_initializer %i64.as.ImplicitAs.impl.Convert.call // CHECK:STDOUT: %.loc10_8.2: %Cpp.long_long = converted %b.ref, %.loc10_8.1 // CHECK:STDOUT: %Cpp.long_long.as.AddAssignWith.impl.Op.call: init %empty_tuple.type = call %bound_method.loc10_5.3(%a.ref, %.loc10_8.2) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.1(%self.param: ref %i64.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.1(%self.param: ref %i64.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.2(%self.param: ref %i64) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.1(%self.param: ref %i64.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.2(%self.param: ref %i64) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.3(%self.param: ref %Cpp.long_long) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.2(%self.param: ref %i64) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.2(%self.param: ref %i64) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.3(%self.param: ref %Cpp.long_long) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.3(%self.param: ref %Cpp.long_long) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.3(%self.param: ref %Cpp.long_long) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3662,6 +4451,8 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %.471: type = fn_type_with_self_type %Inc.WithSelf.Op.type.d92, %Inc.facet [concrete] // CHECK:STDOUT: %Cpp.long_long.as.Inc.impl.Op.type: type = fn_type @Cpp.long_long.as.Inc.impl.Op [concrete] // CHECK:STDOUT: %Cpp.long_long.as.Inc.impl.Op: %Cpp.long_long.as.Inc.impl.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.7e1: %pattern_type.d58 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.718: %pattern_type.d58 = wrapper_binding_pattern self, %self.param_patt.7e1 [concrete] // CHECK:STDOUT: %Dec.type: type = facet_type <@Dec> [concrete] // CHECK:STDOUT: %Dec.impl_witness: = impl_witness imports.%Dec.impl_witness_table [concrete] // CHECK:STDOUT: %Dec.facet: %Dec.type = facet_value %Cpp.long_long, (%Dec.impl_witness) [concrete] @@ -3669,8 +4460,26 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %.89c: type = fn_type_with_self_type %Dec.WithSelf.Op.type.22e, %Dec.facet [concrete] // CHECK:STDOUT: %Cpp.long_long.as.Dec.impl.Op.type: type = fn_type @Cpp.long_long.as.Dec.impl.Op [concrete] // CHECK:STDOUT: %Cpp.long_long.as.Dec.impl.Op: %Cpp.long_long.as.Dec.impl.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.e13: type = pattern_type %i64.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.7d9: %pattern_type.e13 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.bb9: %pattern_type.e13 = wrapper_binding_pattern self, %self.param_patt.7d9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc8_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.f57: type = pattern_type %i64 [concrete] +// CHECK:STDOUT: %self.param_patt.108: %pattern_type.f57 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.5f4: %pattern_type.f57 = wrapper_binding_pattern self, %self.param_patt.108 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc8_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc8_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -3686,6 +4495,51 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %Dec.impl_witness_table = impl_witness_table (%Core.import_ref.9c3475.2), @Cpp.long_long.as.Dec.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e13 = ref_param_pattern [concrete = constants.%self.param_patt.7d9] +// CHECK:STDOUT: %self.patt: %pattern_type.e13 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.bb9] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i64.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i64.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc8_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e13 = ref_param_pattern [concrete = constants.%self.param_patt.7d9] +// CHECK:STDOUT: %self.patt: %pattern_type.e13 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.bb9] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i64.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i64.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f57 = ref_param_pattern [concrete = constants.%self.param_patt.108] +// CHECK:STDOUT: %self.patt: %pattern_type.f57 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.5f4] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i64 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i64 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc8_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f57 = ref_param_pattern [concrete = constants.%self.param_patt.108] +// CHECK:STDOUT: %self.patt: %pattern_type.f57 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.5f4] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i64 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i64 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.d58 = ref_param_pattern [concrete = constants.%self.param_patt.7e1] +// CHECK:STDOUT: %self.patt: %pattern_type.d58 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.718] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Cpp.long_long = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Cpp.long_long = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc8_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.d58 = ref_param_pattern [concrete = constants.%self.param_patt.7e1] +// CHECK:STDOUT: %self.patt: %pattern_type.d58 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.718] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Cpp.long_long = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Cpp.long_long = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @IncrementDecrementLongLong() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.var: ref %Cpp.long_long = var_storage %a.var_patt @@ -3712,20 +4566,47 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %impl.elem0.loc10: %.89c = impl_witness_access constants.%Dec.impl_witness, element0 [concrete = constants.%Cpp.long_long.as.Dec.impl.Op] // CHECK:STDOUT: %bound_method.loc10: = bound_method %a.ref.loc10, %impl.elem0.loc10 // CHECK:STDOUT: %Cpp.long_long.as.Dec.impl.Op.call: init %empty_tuple.type = call %bound_method.loc10(%a.ref.loc10) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.1(%self.param: ref %i64.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.1(%self.param: ref %i64.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.2(%self.param: ref %i64) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.1(%self.param: ref %i64.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.2(%self.param: ref %i64) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.3(%self.param: ref %Cpp.long_long) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.2(%self.param: ref %i64) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.2(%self.param: ref %i64) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.3(%self.param: ref %Cpp.long_long) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.3(%self.param: ref %Cpp.long_long) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.3(%self.param: ref %Cpp.long_long) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3827,17 +4708,49 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.7cb: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%f32.c73, %ImplicitAs.facet.fcd) [concrete] // CHECK:STDOUT: %.7fe: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.7cb, %ImplicitAs.facet.fcd [concrete] // CHECK:STDOUT: %Core.FloatLiteral.as.ImplicitAs.impl.Convert.bound: = bound_method %float.6da, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.b37 [concrete] +// CHECK:STDOUT: %pattern_type.240: type = pattern_type %f32.c73 [concrete] // CHECK:STDOUT: %Core.FloatLiteral.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Core.FloatLiteral.as.ImplicitAs.impl.Convert.b37, @Core.FloatLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete] // CHECK:STDOUT: %bound_method.3e4: = bound_method %float.6da, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %float.943: %f32.c73 = float_value 1 [concrete] // CHECK:STDOUT: %array: %array_type = tuple_value (%float.943) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.945: type = pattern_type %f32.9b3 [concrete] +// CHECK:STDOUT: %self.param_patt.755: %pattern_type.945 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.17e: %pattern_type.945 = wrapper_binding_pattern self, %self.param_patt.755 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc24_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc24_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.c62: %pattern_type.240 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.ed0: %pattern_type.240 = wrapper_binding_pattern self, %self.param_patt.c62 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc24_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc24_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.c06: %pattern_type.18b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.a67: %pattern_type.18b = wrapper_binding_pattern self, %self.param_patt.c06 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc24_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc24_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc24_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.116: %pattern_type.97f = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.eb6: %pattern_type.97f = wrapper_binding_pattern self, %self.param_patt.116 [concrete] // CHECK:STDOUT: %ULongResult.cpp_destructor.type: type = fn_type @ULongResult.cpp_destructor [concrete] // CHECK:STDOUT: %ULongResult.cpp_destructor: %ULongResult.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc22 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc22 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.2ef: %pattern_type.97e = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.a5a: %pattern_type.97e = wrapper_binding_pattern self, %self.param_patt.2ef [concrete] // CHECK:STDOUT: %ULongLongResult.cpp_destructor.type: type = fn_type @ULongLongResult.cpp_destructor [concrete] // CHECK:STDOUT: %ULongLongResult.cpp_destructor: %ULongLongResult.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.5: type = fn_type @Destroy.WithSelf.Op.loc19 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.5: %Destroy.WithSelf.Op.type.ef016f.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5: type = fn_type @Destroy.WithSelf.SelfDestruct.loc19 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.5: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -3893,6 +4806,75 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %Core.import_ref.c4c: @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type (%Core.FloatLiteral.as.ImplicitAs.impl.Convert.type.063) = import_ref Core//prelude/types/float, loc{{\d+_\d+}}, loaded [symbolic = @Core.FloatLiteral.as.ImplicitAs.impl.%Core.FloatLiteral.as.ImplicitAs.impl.Convert (constants.%Core.FloatLiteral.as.ImplicitAs.impl.Convert.d4f)] // CHECK:STDOUT: %ImplicitAs.impl_witness_table.1e0 = impl_witness_table (%Core.import_ref.c4c), @Core.FloatLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/destroy, Destroy, loaded [concrete = constants.%Destroy.type] +// CHECK:STDOUT: %ULongResult.cpp_destructor.decl: %ULongResult.cpp_destructor.type = fn_decl @ULongResult.cpp_destructor [concrete = constants.%ULongResult.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: %ULongLongResult.cpp_destructor.decl: %ULongLongResult.cpp_destructor.type = fn_decl @ULongLongResult.cpp_destructor [concrete = constants.%ULongLongResult.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc24_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.945 = ref_param_pattern [concrete = constants.%self.param_patt.755] +// CHECK:STDOUT: %self.patt: %pattern_type.945 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.17e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.9b3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.9b3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc24_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.945 = ref_param_pattern [concrete = constants.%self.param_patt.755] +// CHECK:STDOUT: %self.patt: %pattern_type.945 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.17e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.9b3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.9b3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc24_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.240 = ref_param_pattern [concrete = constants.%self.param_patt.c62] +// CHECK:STDOUT: %self.patt: %pattern_type.240 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ed0] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.c73 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.c73 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc24_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.240 = ref_param_pattern [concrete = constants.%self.param_patt.c62] +// CHECK:STDOUT: %self.patt: %pattern_type.240 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ed0] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f32.c73 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f32.c73 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc24_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.18b = ref_param_pattern [concrete = constants.%self.param_patt.c06] +// CHECK:STDOUT: %self.patt: %pattern_type.18b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a67] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc24_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.18b = ref_param_pattern [concrete = constants.%self.param_patt.c06] +// CHECK:STDOUT: %self.patt: %pattern_type.18b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a67] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc22 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.97f = ref_param_pattern [concrete = constants.%self.param_patt.116] +// CHECK:STDOUT: %self.patt: %pattern_type.97f = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.eb6] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ULongResult = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ULongResult = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.5: %Destroy.WithSelf.Op.type.ef016f.5 = fn_decl @Destroy.WithSelf.Op.loc19 [concrete = constants.%Destroy.WithSelf.Op.403171.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.97e = ref_param_pattern [concrete = constants.%self.param_patt.2ef] +// CHECK:STDOUT: %self.patt: %pattern_type.97e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a5a] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ULongLongResult = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ULongLongResult = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -4022,26 +5004,71 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %a.patt: %pattern_type.18b = ref_binding_pattern a [concrete = constants.%a.patt] // CHECK:STDOUT: %a.var_patt: %pattern_type.18b = var_pattern %a.patt [concrete = constants.%a.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%a.var) -// CHECK:STDOUT: %ULongResult.cpp_destructor.bound: = bound_method %.loc22_79.3, constants.%ULongResult.cpp_destructor -// CHECK:STDOUT: %ULongResult.cpp_destructor.call: init %empty_tuple.type = call %ULongResult.cpp_destructor.bound(%.loc22_79.3) -// CHECK:STDOUT: %ULongLongResult.cpp_destructor.bound.loc19: = bound_method %.loc19_105.3, constants.%ULongLongResult.cpp_destructor -// CHECK:STDOUT: %ULongLongResult.cpp_destructor.call.loc19: init %empty_tuple.type = call %ULongLongResult.cpp_destructor.bound.loc19(%.loc19_105.3) -// CHECK:STDOUT: %ULongLongResult.cpp_destructor.bound.loc16: = bound_method %.loc16_107.3, constants.%ULongLongResult.cpp_destructor -// CHECK:STDOUT: %ULongLongResult.cpp_destructor.call.loc16: init %empty_tuple.type = call %ULongLongResult.cpp_destructor.bound.loc16(%.loc16_107.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc24: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc24: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc24(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc22: = bound_method %.loc22_79.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc22: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc22(%.loc22_79.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc19: = bound_method %.loc19_105.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc19: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc19(%.loc19_105.3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16: = bound_method %.loc16_107.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16(%.loc16_107.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc24_3.1(%self.param: ref %f32.9b3) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_3.1(%self.param: ref %f32.9b3) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_3.2(%self.param: ref %f32.c73) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc24_3.1(%self.param: ref %f32.9b3) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc24_3.2(%self.param: ref %f32.c73) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_3.2(%self.param: ref %f32.c73) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc24_3.2(%self.param: ref %f32.c73) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc24_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_3.3(%self.param: ref %array_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc24_3.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc22(%self.param: ref %ULongResult) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc22(%self.param: ref %ULongResult) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %ULongResult.cpp_destructor.call: init %empty_tuple.type = call imports.%ULongResult.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc19(%self.param: ref %ULongLongResult) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc19(%self.param: ref %ULongLongResult) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.5(%self.param) +// CHECK:STDOUT: %ULongLongResult.cpp_destructor.call: init %empty_tuple.type = call imports.%ULongLongResult.cpp_destructor.decl(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -4076,8 +5103,28 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %.e48: type = fn_type_with_self_type %Copy.WithSelf.Op.type.761, %Copy.facet [concrete] // CHECK:STDOUT: %Cpp.unsigned_long_long.as.Copy.impl.Op.type: type = fn_type @Cpp.unsigned_long_long.as.Copy.impl.Op [concrete] // CHECK:STDOUT: %Cpp.unsigned_long_long.as.Copy.impl.Op: %Cpp.unsigned_long_long.as.Copy.impl.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.844: type = pattern_type %u64.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.e64: %pattern_type.844 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.7e0: %pattern_type.844 = wrapper_binding_pattern self, %self.param_patt.e64 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc9_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.b35: type = pattern_type %u64 [concrete] +// CHECK:STDOUT: %self.param_patt.3f1: %pattern_type.b35 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.842: %pattern_type.b35 = wrapper_binding_pattern self, %self.param_patt.3f1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.1ea: %pattern_type.4cd = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.919: %pattern_type.4cd = wrapper_binding_pattern self, %self.param_patt.1ea [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc9_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -4091,6 +5138,51 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %Copy.impl_witness_table.6d7 = impl_witness_table (%Core.import_ref.9c3), @Cpp.unsigned_long_long.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.844 = ref_param_pattern [concrete = constants.%self.param_patt.e64] +// CHECK:STDOUT: %self.patt: %pattern_type.844 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.7e0] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %u64.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %u64.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc9_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.844 = ref_param_pattern [concrete = constants.%self.param_patt.e64] +// CHECK:STDOUT: %self.patt: %pattern_type.844 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.7e0] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %u64.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %u64.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b35 = ref_param_pattern [concrete = constants.%self.param_patt.3f1] +// CHECK:STDOUT: %self.patt: %pattern_type.b35 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.842] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %u64 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %u64 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc9_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b35 = ref_param_pattern [concrete = constants.%self.param_patt.3f1] +// CHECK:STDOUT: %self.patt: %pattern_type.b35 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.842] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %u64 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %u64 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.4cd = ref_param_pattern [concrete = constants.%self.param_patt.1ea] +// CHECK:STDOUT: %self.patt: %pattern_type.4cd = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.919] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Cpp.unsigned_long_long = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Cpp.unsigned_long_long = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc9_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.4cd = ref_param_pattern [concrete = constants.%self.param_patt.1ea] +// CHECK:STDOUT: %self.patt: %pattern_type.4cd = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.919] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Cpp.unsigned_long_long = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Cpp.unsigned_long_long = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @CopyUnsignedLongLong() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.var: ref %Cpp.unsigned_long_long = var_storage %a.var_patt @@ -4125,22 +5217,49 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %b.patt: %pattern_type.4cd = ref_binding_pattern b [concrete = constants.%b.patt] // CHECK:STDOUT: %b.var_patt: %pattern_type.4cd = var_pattern %b.patt [concrete = constants.%b.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc9: = bound_method %b.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc9(%b.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc8: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc8(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc9: = bound_method %b.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc9(%b.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.1(%self.param: ref %u64.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.1(%self.param: ref %u64.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.2(%self.param: ref %u64) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.1(%self.param: ref %u64.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.2(%self.param: ref %u64) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.3(%self.param: ref %Cpp.unsigned_long_long) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.2(%self.param: ref %u64) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.2(%self.param: ref %u64) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.3(%self.param: ref %Cpp.unsigned_long_long) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.3(%self.param: ref %Cpp.unsigned_long_long) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.3(%self.param: ref %Cpp.unsigned_long_long) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/range_for.carbon b/toolchain/check/testdata/interop/cpp/range_for.carbon index edb824e7d706..7a2ae04f25ea 100644 --- a/toolchain/check/testdata/interop/cpp/range_for.carbon +++ b/toolchain/check/testdata/interop/cpp/range_for.carbon @@ -794,6 +794,7 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: type: type = facet_type [concrete] // CHECK:STDOUT: %Iterate.type: type = facet_type <@Iterate> [concrete] // CHECK:STDOUT: %OptionalStorage.type: type = facet_type <@OptionalStorage> [concrete] +// CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %facet_type.f48: type = facet_type <@Destroy & @Copy> [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] @@ -817,10 +818,14 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %Int.67af24.1: type = class_type @Int, @Int(%N.fe9) [symbolic] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %pattern_type.6b6: type = pattern_type %i32 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.6c4ec3.1: = custom_witness (%Destroy.WithSelf.Op.403171.1), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.6de: %Destroy.type = facet_value %i32, (%custom_witness.6c4ec3.1) [concrete] +// CHECK:STDOUT: %custom_witness.f8f19d.1: = custom_witness (%Destroy.WithSelf.Op.403171.1, %Destroy.WithSelf.SubobjectDestroy.d01daf.1, %Destroy.WithSelf.SelfDestruct.db3fdb.1), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.b41: %Destroy.type = facet_value %i32, (%custom_witness.f8f19d.1) [concrete] // CHECK:STDOUT: %.Self.500: %Iterate.type = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic] // CHECK:STDOUT: %Int.67af24.2: type = class_type @Int, @Int(%To) [symbolic] @@ -851,48 +856,49 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %Int.as.Copy.impl.Op.type.ac8: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N.fe9) [symbolic] // CHECK:STDOUT: %Int.as.Copy.impl.Op.5e0: %Int.as.Copy.impl.Op.type.ac8 = struct_value () [symbolic] // CHECK:STDOUT: %Copy.impl_witness.b51: = impl_witness imports.%Copy.impl_witness_table.8d2, @Int.as.Copy.impl(%int_32) [concrete] -// CHECK:STDOUT: %facet_value.e3e: %facet_type.f48 = facet_value %i32, (%custom_witness.6c4ec3.1, %Copy.impl_witness.b51) [concrete] +// CHECK:STDOUT: %facet_value.178: %facet_type.f48 = facet_value %i32, (%custom_witness.f8f19d.1, %Copy.impl_witness.b51) [concrete] // CHECK:STDOUT: %Iterate.lookup_impl_witness.1d8: = lookup_impl_witness %.Self.500, @Iterate [symbolic_self] // CHECK:STDOUT: %impl.elem0.294: %facet_type.f48 = impl_witness_access %Iterate.lookup_impl_witness.1d8, element0 [symbolic_self] -// CHECK:STDOUT: %Iterate_where.type.bdc: type = facet_type <@Iterate where %impl.elem0.294 = %facet_value.e3e> [concrete] -// CHECK:STDOUT: %pattern_type.d05: type = pattern_type %Iterate_where.type.bdc [concrete] -// CHECK:STDOUT: %R.patt: %pattern_type.d05 = symbolic_binding_pattern R, 0 [symbolic] -// CHECK:STDOUT: %R: %Iterate_where.type.bdc = symbolic_binding R, 0 [symbolic] +// CHECK:STDOUT: %Iterate_where.type.16e: type = facet_type <@Iterate where %impl.elem0.294 = %facet_value.178> [concrete] +// CHECK:STDOUT: %pattern_type.c32: type = pattern_type %Iterate_where.type.16e [concrete] +// CHECK:STDOUT: %R.patt: %pattern_type.c32 = symbolic_binding_pattern R, 0 [symbolic] +// CHECK:STDOUT: %R: %Iterate_where.type.16e = symbolic_binding R, 0 [symbolic] // CHECK:STDOUT: %R.as_type: type = facet_access_type %R [symbolic] -// CHECK:STDOUT: %pattern_type.007: type = pattern_type %R.as_type [symbolic] -// CHECK:STDOUT: %r.param_patt.737: %pattern_type.007 = value_param_pattern [symbolic] -// CHECK:STDOUT: %r.patt.06b: %pattern_type.007 = wrapper_binding_pattern r, %r.param_patt.737 [symbolic] +// CHECK:STDOUT: %pattern_type.6f9: type = pattern_type %R.as_type [symbolic] +// CHECK:STDOUT: %r.param_patt.170: %pattern_type.6f9 = value_param_pattern [symbolic] +// CHECK:STDOUT: %r.patt.893: %pattern_type.6f9 = wrapper_binding_pattern r, %r.param_patt.170 [symbolic] // CHECK:STDOUT: %facet_type.037: type = facet_type <@IntFitsIn, @IntFitsIn(%Int.67af24.2) & @AnyInt> [symbolic] // CHECK:STDOUT: %From.6a4: %facet_type.037 = symbolic_binding From, 1 [symbolic] // CHECK:STDOUT: %From.as_type.as.ImplicitAs.impl.Convert.type.7fa: type = fn_type @From.as_type.as.ImplicitAs.impl.Convert, @From.as_type.as.ImplicitAs.impl(%To, %From.6a4) [symbolic] // CHECK:STDOUT: %From.as_type.as.ImplicitAs.impl.Convert.643: %From.as_type.as.ImplicitAs.impl.Convert.type.7fa = struct_value () [symbolic] // CHECK:STDOUT: %i.patt: %pattern_type.6b6 = value_binding_pattern i [concrete] -// CHECK:STDOUT: %Iterate.lookup_impl_witness.332: = lookup_impl_witness %R, @Iterate [symbolic] -// CHECK:STDOUT: %Iterate.facet.71c: %Iterate.type = facet_value %R.as_type, (%Iterate.lookup_impl_witness.332) [symbolic] -// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.b85: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.71c) [symbolic] -// CHECK:STDOUT: %Iterate.WithSelf.Next.type.7c1: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.71c) [symbolic] -// CHECK:STDOUT: %.c2f7: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.b85, %Iterate.facet.71c [symbolic] -// CHECK:STDOUT: %impl.elem2.176: %.c2f7 = impl_witness_access %Iterate.lookup_impl_witness.332, element2 [symbolic] -// CHECK:STDOUT: %impl.elem1.862: %Destroy.type = impl_witness_access %Iterate.lookup_impl_witness.332, element1 [symbolic] -// CHECK:STDOUT: %as_type.3aa: type = facet_access_type %impl.elem1.862 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.c8e: = specific_impl_function %impl.elem2.176, @Iterate.WithSelf.NewCursor(%Iterate.facet.71c) [symbolic] -// CHECK:STDOUT: %ptr.e4d: type = ptr_type %as_type.3aa [symbolic] -// CHECK:STDOUT: %.5c4: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.7c1, %Iterate.facet.71c [symbolic] -// CHECK:STDOUT: %impl.elem3.4ed: %.5c4 = impl_witness_access %Iterate.lookup_impl_witness.332, element3 [symbolic] -// CHECK:STDOUT: %DefaultOptionalStorage.99e: type = class_type @DefaultOptionalStorage, @DefaultOptionalStorage(%facet_value.e3e) [concrete] -// CHECK:STDOUT: %OptionalStorage.impl_witness.da9: = impl_witness imports.%OptionalStorage.impl_witness_table.460, @T.as_type.as.OptionalStorage.impl(%facet_value.e3e) [concrete] -// CHECK:STDOUT: %OptionalStorage.facet.375: %OptionalStorage.type = facet_value %i32, (%OptionalStorage.impl_witness.da9) [concrete] -// CHECK:STDOUT: %Optional.6f7: type = class_type @Optional, @Optional(%OptionalStorage.facet.375) [concrete] -// CHECK:STDOUT: %specific_impl_fn.902: = specific_impl_function %impl.elem3.4ed, @Iterate.WithSelf.Next(%Iterate.facet.71c) [symbolic] -// CHECK:STDOUT: %Optional.HasValue.type.818: type = fn_type @Optional.HasValue, @Optional(%OptionalStorage.facet.375) [concrete] -// CHECK:STDOUT: %Optional.HasValue.655: %Optional.HasValue.type.818 = struct_value () [concrete] -// CHECK:STDOUT: %Optional.Get.type.054: type = fn_type @Optional.Get, @Optional(%OptionalStorage.facet.375) [concrete] -// CHECK:STDOUT: %Optional.Get.a58: %Optional.Get.type.054 = struct_value () [concrete] -// CHECK:STDOUT: %MaybeUnformed.c1d: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.6de) [concrete] +// CHECK:STDOUT: %Iterate.lookup_impl_witness.462: = lookup_impl_witness %R, @Iterate [symbolic] +// CHECK:STDOUT: %Iterate.facet.e5e: %Iterate.type = facet_value %R.as_type, (%Iterate.lookup_impl_witness.462) [symbolic] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.62b: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.e5e) [symbolic] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type.6c3: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.e5e) [symbolic] +// CHECK:STDOUT: %.1a4: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.62b, %Iterate.facet.e5e [symbolic] +// CHECK:STDOUT: %impl.elem2.3eb: %.1a4 = impl_witness_access %Iterate.lookup_impl_witness.462, element2 [symbolic] +// CHECK:STDOUT: %impl.elem1.a11: %Destroy.type = impl_witness_access %Iterate.lookup_impl_witness.462, element1 [symbolic] +// CHECK:STDOUT: %as_type.f79: type = facet_access_type %impl.elem1.a11 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.a09: = specific_impl_function %impl.elem2.3eb, @Iterate.WithSelf.NewCursor(%Iterate.facet.e5e) [symbolic] +// CHECK:STDOUT: %ptr.b18: type = ptr_type %as_type.f79 [symbolic] +// CHECK:STDOUT: %.218: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.6c3, %Iterate.facet.e5e [symbolic] +// CHECK:STDOUT: %impl.elem3.b50: %.218 = impl_witness_access %Iterate.lookup_impl_witness.462, element3 [symbolic] +// CHECK:STDOUT: %DefaultOptionalStorage.9f1: type = class_type @DefaultOptionalStorage, @DefaultOptionalStorage(%facet_value.178) [concrete] +// CHECK:STDOUT: %OptionalStorage.impl_witness.3c7: = impl_witness imports.%OptionalStorage.impl_witness_table.460, @T.as_type.as.OptionalStorage.impl(%facet_value.178) [concrete] +// CHECK:STDOUT: %OptionalStorage.facet.6c5: %OptionalStorage.type = facet_value %i32, (%OptionalStorage.impl_witness.3c7) [concrete] +// CHECK:STDOUT: %Optional.0ac: type = class_type @Optional, @Optional(%OptionalStorage.facet.6c5) [concrete] +// CHECK:STDOUT: %pattern_type.022: type = pattern_type %Optional.0ac [concrete] +// CHECK:STDOUT: %specific_impl_fn.598: = specific_impl_function %impl.elem3.b50, @Iterate.WithSelf.Next(%Iterate.facet.e5e) [symbolic] +// CHECK:STDOUT: %Optional.HasValue.type.dbd: type = fn_type @Optional.HasValue, @Optional(%OptionalStorage.facet.6c5) [concrete] +// CHECK:STDOUT: %Optional.HasValue.ed9: %Optional.HasValue.type.dbd = struct_value () [concrete] +// CHECK:STDOUT: %Optional.Get.type.2b4: type = fn_type @Optional.Get, @Optional(%OptionalStorage.facet.6c5) [concrete] +// CHECK:STDOUT: %Optional.Get.529: %Optional.Get.type.2b4 = struct_value () [concrete] +// CHECK:STDOUT: %MaybeUnformed.515: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.b41) [concrete] // CHECK:STDOUT: %.1d6a7: type = maybe_unformed_type %i32 [concrete] -// CHECK:STDOUT: %struct_type.value.has_value.271: type = struct_type {.value: %MaybeUnformed.c1d, .has_value: bool} [concrete] -// CHECK:STDOUT: %Optional.HasValue.specific_fn.551: = specific_function %Optional.HasValue.655, @Optional.HasValue(%OptionalStorage.facet.375) [concrete] -// CHECK:STDOUT: %Optional.Get.specific_fn.326: = specific_function %Optional.Get.a58, @Optional.Get(%OptionalStorage.facet.375) [concrete] +// CHECK:STDOUT: %struct_type.value.has_value.f6a: type = struct_type {.value: %MaybeUnformed.515, .has_value: bool} [concrete] +// CHECK:STDOUT: %Optional.HasValue.specific_fn.15f: = specific_function %Optional.HasValue.ed9, @Optional.HasValue(%OptionalStorage.facet.6c5) [concrete] +// CHECK:STDOUT: %Optional.Get.specific_fn.0dd: = specific_function %Optional.Get.529, @Optional.Get(%OptionalStorage.facet.6c5) [concrete] // CHECK:STDOUT: %AddAssignWith.type.941: type = facet_type <@AddAssignWith, @AddAssignWith(%i32)> [concrete] // CHECK:STDOUT: %ImplicitAs.type.f7de31.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Int.67af24.1)> [symbolic] // CHECK:STDOUT: %U.4e6: %ImplicitAs.type.f7de31.2 = symbolic_binding U, 1 [symbolic] @@ -918,13 +924,53 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %.004: type = fn_type_with_self_type %AddAssignWith.WithSelf.Op.type.640, %AddAssignWith.facet.e5e [concrete] // CHECK:STDOUT: %Int.as.AddAssignWith.impl.Op.specific_fn.d76216.1: = specific_function %Int.as.AddAssignWith.impl.Op.d34738.2, @Int.as.AddAssignWith.impl.Op.1(%int_32, %ImplicitAs.facet.e88) [concrete] // CHECK:STDOUT: %Int.as.AddAssignWith.impl.Op.specific_fn.d76216.2: = specific_function %Int.as.AddAssignWith.impl.Op.d34738.1, @Int.as.AddAssignWith.impl.Op.2(%int_32, %ImplicitAs.facet.e88) [concrete] +// CHECK:STDOUT: %pattern_type.f40: type = pattern_type %.1d6a7 [concrete] +// CHECK:STDOUT: %self.param_patt.af3: %pattern_type.f40 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.18f: %pattern_type.f40 = wrapper_binding_pattern self, %self.param_patt.af3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc34_19.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc34_19.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.7cb: type = pattern_type %MaybeUnformed.515 [concrete] +// CHECK:STDOUT: %self.param_patt.5b1: %pattern_type.7cb = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.797: %pattern_type.7cb = wrapper_binding_pattern self, %self.param_patt.5b1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc34_19.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc34_19.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.40d: %pattern_type.831 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.560: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt.40d [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc34_19.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.5: type = fn_type @Destroy.WithSelf.Op.loc34_19.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.5: %Destroy.WithSelf.Op.type.ef016f.5 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.260: type = pattern_type %struct_type.value.has_value.f6a [concrete] +// CHECK:STDOUT: %self.param_patt.e1f: %pattern_type.260 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.d8d: %pattern_type.260 = wrapper_binding_pattern self, %self.param_patt.e1f [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc34_19.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.6: type = fn_type @Destroy.WithSelf.Op.loc34_19.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.6: %Destroy.WithSelf.Op.type.ef016f.6 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.96a: type = pattern_type %DefaultOptionalStorage.9f1 [concrete] +// CHECK:STDOUT: %self.param_patt.333: %pattern_type.96a = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.00e: %pattern_type.96a = wrapper_binding_pattern self, %self.param_patt.333 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc34_19.5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.7: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.7: type = fn_type @Destroy.WithSelf.Op.loc34_19.5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.7: %Destroy.WithSelf.Op.type.ef016f.7 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.d39: %pattern_type.022 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.046: %pattern_type.022 = wrapper_binding_pattern self, %self.param_patt.d39 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.8: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc34_19.6 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.8: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.8 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.8: type = fn_type @Destroy.WithSelf.Op.loc34_19.6 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.8: %Destroy.WithSelf.Op.type.ef016f.8 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.lookup_impl_witness.51e: = lookup_impl_witness %impl.elem1.862, @Destroy [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ec9: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%impl.elem1.862) [symbolic] -// CHECK:STDOUT: %.44e: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.ec9, %impl.elem1.862 [symbolic] -// CHECK:STDOUT: %impl.elem0.818: %.44e = impl_witness_access %Destroy.lookup_impl_witness.51e, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.ca7: = specific_impl_function %impl.elem0.818, @Destroy.WithSelf.Op.1(%impl.elem1.862) [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.8: type = fn_type @Destroy.WithSelf.SelfDestruct.loc34_19.6 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.8: %Destroy.WithSelf.SelfDestruct.type.fbceb5.8 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.lookup_impl_witness.caf: = lookup_impl_witness %impl.elem1.a11, @Destroy [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.041: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%impl.elem1.a11) [symbolic] +// CHECK:STDOUT: %.b28: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.041, %impl.elem1.a11 [symbolic] +// CHECK:STDOUT: %impl.elem2.9a0: %.b28 = impl_witness_access %Destroy.lookup_impl_witness.caf, element2 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.ea2: = specific_impl_function %impl.elem2.9a0, @Destroy.WithSelf.SelfDestruct.1(%impl.elem1.a11) [symbolic] // CHECK:STDOUT: %MutableRange: type = class_type @MutableRange [concrete] // CHECK:STDOUT: %pattern_type.e635: type = pattern_type %MutableRange [concrete] // CHECK:STDOUT: %ConstRange: type = class_type @ConstRange [concrete] @@ -940,30 +986,38 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %Iterator.Op.type.0aed5d.1: type = fn_type @Iterator.Op.1 [concrete] // CHECK:STDOUT: %Iterator.Op.a2a866.1: %Iterator.Op.type.0aed5d.1 = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.ef8: = custom_witness (%i32, %Iterator.Op.a2a866.1), @CppUnsafeDeref [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.9: type = fn_type @Destroy.WithSelf.Op.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.9: %Destroy.WithSelf.Op.type.ef016f.9 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.9: type = fn_type @Destroy.WithSelf.SelfDestruct.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.9: %Destroy.WithSelf.SelfDestruct.type.fbceb5.9 = struct_value () [concrete] +// CHECK:STDOUT: %Iterator.SubobjectDestroy.type.9ec: type = fn_type @Iterator.SubobjectDestroy.1 [concrete] +// CHECK:STDOUT: %Iterator.SubobjectDestroy.e52: %Iterator.SubobjectDestroy.type.9ec = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.8e1: = custom_witness (%Destroy.WithSelf.Op.403171.9, %Iterator.SubobjectDestroy.e52, %Destroy.WithSelf.SelfDestruct.db3fdb.9), @Destroy [concrete] // CHECK:STDOUT: %Iterator.Op.type.0aed5d.2: type = fn_type @Iterator.Op.2 [concrete] // CHECK:STDOUT: %Iterator.Op.a2a866.2: %Iterator.Op.type.0aed5d.2 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.955: = custom_witness (%Iterator.Op.a2a866.2), @Destroy [concrete] -// CHECK:STDOUT: %Iterator.Op.type.0aed5d.3: type = fn_type @Iterator.Op.3 [concrete] -// CHECK:STDOUT: %Iterator.Op.a2a866.3: %Iterator.Op.type.0aed5d.3 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.444: = custom_witness (%Iterator.Op.a2a866.3), @Inc [concrete] +// CHECK:STDOUT: %custom_witness.444: = custom_witness (%Iterator.Op.a2a866.2), @Inc [concrete] // CHECK:STDOUT: %Equal.type.ca8475.1: type = fn_type @Equal.1 [concrete] // CHECK:STDOUT: %Equal.285b15.1: %Equal.type.ca8475.1 = struct_value () [concrete] // CHECK:STDOUT: %NotEqual.type.53d9ee.1: type = fn_type @NotEqual.1 [concrete] // CHECK:STDOUT: %NotEqual.119263.1: %NotEqual.type.53d9ee.1 = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.981: = custom_witness (%Equal.285b15.1, %NotEqual.119263.1), @EqWith, @EqWith(%Iterator.3ee) [concrete] -// CHECK:STDOUT: %facet_value.df3: %CppRange_where.type.d682d6.1 = facet_value %MutableRange, (%custom_witness.6c4ec3.1, %Copy.impl_witness.b51, %custom_witness.ed3, %custom_witness.955, %custom_witness.ef8, %custom_witness.444, %custom_witness.981) [concrete] +// CHECK:STDOUT: %facet_value.474: %CppRange_where.type.d682d6.1 = facet_value %MutableRange, (%custom_witness.f8f19d.1, %Copy.impl_witness.b51, %custom_witness.ed3, %custom_witness.8e1, %custom_witness.ef8, %custom_witness.444, %custom_witness.981) [concrete] // CHECK:STDOUT: %tuple.type.508: type = tuple_type (%Iterator.3ee, %Iterator.3ee) [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.9: type = fn_type @Destroy.WithSelf.Op.3 [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.9: %Destroy.WithSelf.Op.type.ef016f.9 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.6c4ec3.9: = custom_witness (%Destroy.WithSelf.Op.403171.9), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.45a: %Destroy.type = facet_value %tuple.type.508, (%custom_witness.6c4ec3.9) [concrete] -// CHECK:STDOUT: %Iterate.impl_witness.589: = impl_witness imports.%Iterate.impl_witness_table.121, @T.as_type.as.Iterate.impl(%facet_value.df3) [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.type.578: type = fn_type @T.as_type.as.Iterate.impl.NewCursor, @T.as_type.as.Iterate.impl(%facet_value.df3) [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.e2d: %T.as_type.as.Iterate.impl.NewCursor.type.578 = struct_value () [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.type.d15: type = fn_type @T.as_type.as.Iterate.impl.Next, @T.as_type.as.Iterate.impl(%facet_value.df3) [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.fd1: %T.as_type.as.Iterate.impl.Next.type.d15 = struct_value () [concrete] -// CHECK:STDOUT: %Iterate.facet.9b1: %Iterate.type = facet_value %MutableRange, (%Iterate.impl_witness.589) [concrete] -// CHECK:STDOUT: %facet_value.5eb: %Iterate_where.type.bdc = facet_value %MutableRange, (%Iterate.impl_witness.589) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.9: type = fn_type @Destroy.WithSelf.SubobjectDestroy.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.9: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.9 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.10: type = fn_type @Destroy.WithSelf.Op.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.10: %Destroy.WithSelf.Op.type.ef016f.10 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.10: type = fn_type @Destroy.WithSelf.SelfDestruct.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.10: %Destroy.WithSelf.SelfDestruct.type.fbceb5.10 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f8f19d.9: = custom_witness (%Destroy.WithSelf.Op.403171.10, %Destroy.WithSelf.SubobjectDestroy.d01daf.9, %Destroy.WithSelf.SelfDestruct.db3fdb.10), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.0fe: %Destroy.type = facet_value %tuple.type.508, (%custom_witness.f8f19d.9) [concrete] +// CHECK:STDOUT: %Iterate.impl_witness.2bb: = impl_witness imports.%Iterate.impl_witness_table.121, @T.as_type.as.Iterate.impl(%facet_value.474) [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.type.2c7: type = fn_type @T.as_type.as.Iterate.impl.NewCursor, @T.as_type.as.Iterate.impl(%facet_value.474) [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.e00: %T.as_type.as.Iterate.impl.NewCursor.type.2c7 = struct_value () [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.type.245: type = fn_type @T.as_type.as.Iterate.impl.Next, @T.as_type.as.Iterate.impl(%facet_value.474) [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.311: %T.as_type.as.Iterate.impl.Next.type.245 = struct_value () [concrete] +// CHECK:STDOUT: %Iterate.facet.854: %Iterate.type = facet_value %MutableRange, (%Iterate.impl_witness.2bb) [concrete] +// CHECK:STDOUT: %facet_value.26c: %Iterate_where.type.16e = facet_value %MutableRange, (%Iterate.impl_witness.2bb) [concrete] // CHECK:STDOUT: %r.param_patt.c79: %pattern_type.e635 = value_param_pattern [concrete] // CHECK:STDOUT: %r.patt.94f: %pattern_type.e635 = wrapper_binding_pattern r, %r.param_patt.c79 [concrete] // CHECK:STDOUT: %Iterator.260: type = class_type @Iterator.2 [concrete] @@ -972,53 +1026,61 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %ConstRange.End.type: type = fn_type @ConstRange.End [concrete] // CHECK:STDOUT: %ConstRange.End: %ConstRange.End.type = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.23e: = custom_witness (%Iterator.260, %Iterator.260, %ConstRange.Begin, %ConstRange.End), @CppRangeForIterate [concrete] -// CHECK:STDOUT: %Iterator.Op.type.0f34b8.1: type = fn_type @Iterator.Op.4 [concrete] +// CHECK:STDOUT: %Iterator.Op.type.0f34b8.1: type = fn_type @Iterator.Op.3 [concrete] // CHECK:STDOUT: %Iterator.Op.1c3e4a.1: %Iterator.Op.type.0f34b8.1 = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.adb: = custom_witness (%i32, %Iterator.Op.1c3e4a.1), @CppUnsafeDeref [concrete] -// CHECK:STDOUT: %Iterator.Op.type.0f34b8.2: type = fn_type @Iterator.Op.5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.11: type = fn_type @Destroy.WithSelf.Op.5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.11: %Destroy.WithSelf.Op.type.ef016f.11 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.11: type = fn_type @Destroy.WithSelf.SelfDestruct.5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.11: %Destroy.WithSelf.SelfDestruct.type.fbceb5.11 = struct_value () [concrete] +// CHECK:STDOUT: %Iterator.SubobjectDestroy.type.128: type = fn_type @Iterator.SubobjectDestroy.2 [concrete] +// CHECK:STDOUT: %Iterator.SubobjectDestroy.37b: %Iterator.SubobjectDestroy.type.128 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.0f3: = custom_witness (%Destroy.WithSelf.Op.403171.11, %Iterator.SubobjectDestroy.37b, %Destroy.WithSelf.SelfDestruct.db3fdb.11), @Destroy [concrete] +// CHECK:STDOUT: %Iterator.Op.type.0f34b8.2: type = fn_type @Iterator.Op.4 [concrete] // CHECK:STDOUT: %Iterator.Op.1c3e4a.2: %Iterator.Op.type.0f34b8.2 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.6e8: = custom_witness (%Iterator.Op.1c3e4a.2), @Destroy [concrete] -// CHECK:STDOUT: %Iterator.Op.type.0f34b8.3: type = fn_type @Iterator.Op.6 [concrete] -// CHECK:STDOUT: %Iterator.Op.1c3e4a.3: %Iterator.Op.type.0f34b8.3 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.746: = custom_witness (%Iterator.Op.1c3e4a.3), @Inc [concrete] +// CHECK:STDOUT: %custom_witness.746: = custom_witness (%Iterator.Op.1c3e4a.2), @Inc [concrete] // CHECK:STDOUT: %Equal.type.ca8475.2: type = fn_type @Equal.2 [concrete] // CHECK:STDOUT: %Equal.285b15.2: %Equal.type.ca8475.2 = struct_value () [concrete] // CHECK:STDOUT: %NotEqual.type.53d9ee.2: type = fn_type @NotEqual.2 [concrete] // CHECK:STDOUT: %NotEqual.119263.2: %NotEqual.type.53d9ee.2 = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.941: = custom_witness (%Equal.285b15.2, %NotEqual.119263.2), @EqWith, @EqWith(%Iterator.260) [concrete] -// CHECK:STDOUT: %facet_value.b82: %CppRange_where.type.d682d6.1 = facet_value %ConstRange, (%custom_witness.6c4ec3.1, %Copy.impl_witness.b51, %custom_witness.23e, %custom_witness.6e8, %custom_witness.adb, %custom_witness.746, %custom_witness.941) [concrete] +// CHECK:STDOUT: %facet_value.3e1: %CppRange_where.type.d682d6.1 = facet_value %ConstRange, (%custom_witness.f8f19d.1, %Copy.impl_witness.b51, %custom_witness.23e, %custom_witness.0f3, %custom_witness.adb, %custom_witness.746, %custom_witness.941) [concrete] // CHECK:STDOUT: %tuple.type.69f: type = tuple_type (%Iterator.260, %Iterator.260) [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.10: type = fn_type @Destroy.WithSelf.Op.4 [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.10: %Destroy.WithSelf.Op.type.ef016f.10 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.6c4ec3.10: = custom_witness (%Destroy.WithSelf.Op.403171.10), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.e08: %Destroy.type = facet_value %tuple.type.69f, (%custom_witness.6c4ec3.10) [concrete] -// CHECK:STDOUT: %Iterate.impl_witness.978: = impl_witness imports.%Iterate.impl_witness_table.121, @T.as_type.as.Iterate.impl(%facet_value.b82) [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.type.52c: type = fn_type @T.as_type.as.Iterate.impl.NewCursor, @T.as_type.as.Iterate.impl(%facet_value.b82) [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.f99: %T.as_type.as.Iterate.impl.NewCursor.type.52c = struct_value () [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.type.c83: type = fn_type @T.as_type.as.Iterate.impl.Next, @T.as_type.as.Iterate.impl(%facet_value.b82) [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.231: %T.as_type.as.Iterate.impl.Next.type.c83 = struct_value () [concrete] -// CHECK:STDOUT: %Iterate.facet.6bf: %Iterate.type = facet_value %ConstRange, (%Iterate.impl_witness.978) [concrete] -// CHECK:STDOUT: %facet_value.cd8: %Iterate_where.type.bdc = facet_value %ConstRange, (%Iterate.impl_witness.978) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.10: type = fn_type @Destroy.WithSelf.SubobjectDestroy.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.10: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.10 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.12: type = fn_type @Destroy.WithSelf.Op.6 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.12: %Destroy.WithSelf.Op.type.ef016f.12 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.12: type = fn_type @Destroy.WithSelf.SelfDestruct.6 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.12: %Destroy.WithSelf.SelfDestruct.type.fbceb5.12 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f8f19d.10: = custom_witness (%Destroy.WithSelf.Op.403171.12, %Destroy.WithSelf.SubobjectDestroy.d01daf.10, %Destroy.WithSelf.SelfDestruct.db3fdb.12), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.c6d: %Destroy.type = facet_value %tuple.type.69f, (%custom_witness.f8f19d.10) [concrete] +// CHECK:STDOUT: %Iterate.impl_witness.1a6: = impl_witness imports.%Iterate.impl_witness_table.121, @T.as_type.as.Iterate.impl(%facet_value.3e1) [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.type.31f: type = fn_type @T.as_type.as.Iterate.impl.NewCursor, @T.as_type.as.Iterate.impl(%facet_value.3e1) [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.19e: %T.as_type.as.Iterate.impl.NewCursor.type.31f = struct_value () [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.type.aeb: type = fn_type @T.as_type.as.Iterate.impl.Next, @T.as_type.as.Iterate.impl(%facet_value.3e1) [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.372: %T.as_type.as.Iterate.impl.Next.type.aeb = struct_value () [concrete] +// CHECK:STDOUT: %Iterate.facet.7d1: %Iterate.type = facet_value %ConstRange, (%Iterate.impl_witness.1a6) [concrete] +// CHECK:STDOUT: %facet_value.75e: %Iterate_where.type.16e = facet_value %ConstRange, (%Iterate.impl_witness.1a6) [concrete] // CHECK:STDOUT: %r.param_patt.83e: %pattern_type.0ba = value_param_pattern [concrete] // CHECK:STDOUT: %r.patt.c21: %pattern_type.0ba = wrapper_binding_pattern r, %r.param_patt.83e [concrete] -// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.6ac: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.9b1) [concrete] -// CHECK:STDOUT: %Iterate.WithSelf.Next.type.5b5: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.9b1) [concrete] -// CHECK:STDOUT: %.03d: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.6ac, %Iterate.facet.9b1 [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.specific_fn.a90: = specific_function %T.as_type.as.Iterate.impl.NewCursor.e2d, @T.as_type.as.Iterate.impl.NewCursor(%facet_value.df3) [concrete] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.4e8: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.854) [concrete] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type.713: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.854) [concrete] +// CHECK:STDOUT: %.cad: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.4e8, %Iterate.facet.854 [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.specific_fn.ac2: = specific_function %T.as_type.as.Iterate.impl.NewCursor.e00, @T.as_type.as.Iterate.impl.NewCursor(%facet_value.474) [concrete] // CHECK:STDOUT: %ptr.45c: type = ptr_type %tuple.type.508 [concrete] -// CHECK:STDOUT: %.cd1: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.5b5, %Iterate.facet.9b1 [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.specific_fn.e2f: = specific_function %T.as_type.as.Iterate.impl.Next.fd1, @T.as_type.as.Iterate.impl.Next(%facet_value.df3) [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.4bb: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Destroy.facet.45a) [concrete] -// CHECK:STDOUT: %.7a2: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.4bb, %Destroy.facet.45a [concrete] -// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.147: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.6bf) [concrete] -// CHECK:STDOUT: %Iterate.WithSelf.Next.type.e99: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.6bf) [concrete] -// CHECK:STDOUT: %.e7e: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.147, %Iterate.facet.6bf [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.specific_fn.574: = specific_function %T.as_type.as.Iterate.impl.NewCursor.f99, @T.as_type.as.Iterate.impl.NewCursor(%facet_value.b82) [concrete] +// CHECK:STDOUT: %.640: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.713, %Iterate.facet.854 [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.specific_fn.b01: = specific_function %T.as_type.as.Iterate.impl.Next.311, @T.as_type.as.Iterate.impl.Next(%facet_value.474) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.471: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.0fe) [concrete] +// CHECK:STDOUT: %.463: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.471, %Destroy.facet.0fe [concrete] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.488: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.7d1) [concrete] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type.aee: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.7d1) [concrete] +// CHECK:STDOUT: %.312: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.488, %Iterate.facet.7d1 [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.specific_fn.91a: = specific_function %T.as_type.as.Iterate.impl.NewCursor.19e, @T.as_type.as.Iterate.impl.NewCursor(%facet_value.3e1) [concrete] // CHECK:STDOUT: %ptr.c5c: type = ptr_type %tuple.type.69f [concrete] -// CHECK:STDOUT: %.6b3: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.e99, %Iterate.facet.6bf [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.specific_fn.faf: = specific_function %T.as_type.as.Iterate.impl.Next.231, @T.as_type.as.Iterate.impl.Next(%facet_value.b82) [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.f64: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Destroy.facet.e08) [concrete] -// CHECK:STDOUT: %.dc2: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.f64, %Destroy.facet.e08 [concrete] +// CHECK:STDOUT: %.5b5: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.aee, %Iterate.facet.7d1 [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.specific_fn.5ef: = specific_function %T.as_type.as.Iterate.impl.Next.372, @T.as_type.as.Iterate.impl.Next(%facet_value.3e1) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.c53: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.c6d) [concrete] +// CHECK:STDOUT: %.331: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.c53, %Destroy.facet.c6d [concrete] // CHECK:STDOUT: %complete_type.c28: = complete_type_witness %tuple.type.508 [concrete] // CHECK:STDOUT: %complete_type.8d5: = complete_type_witness %tuple.type.69f [concrete] // CHECK:STDOUT: } @@ -1050,28 +1112,115 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %AnyInt.impl_witness_table = impl_witness_table (%Core.import_ref.47b, %Core.import_ref.49b), @Int.as.AnyInt.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @TestIterate(%R.loc30_17.2: %Iterate_where.type.bdc) { +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc34_19.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f40 = ref_param_pattern [concrete = constants.%self.param_patt.af3] +// CHECK:STDOUT: %self.patt: %pattern_type.f40 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.18f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %.1d6a7 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %.1d6a7 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc34_19.1 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f40 = ref_param_pattern [concrete = constants.%self.param_patt.af3] +// CHECK:STDOUT: %self.patt: %pattern_type.f40 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.18f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %.1d6a7 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %.1d6a7 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc34_19.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.7cb = ref_param_pattern [concrete = constants.%self.param_patt.5b1] +// CHECK:STDOUT: %self.patt: %pattern_type.7cb = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.797] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %MaybeUnformed.515 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %MaybeUnformed.515 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc34_19.2 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.7cb = ref_param_pattern [concrete = constants.%self.param_patt.5b1] +// CHECK:STDOUT: %self.patt: %pattern_type.7cb = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.797] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %MaybeUnformed.515 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %MaybeUnformed.515 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc34_19.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d] +// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0 +// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.5 = fn_decl @Destroy.WithSelf.Op.loc34_19.3 [concrete = constants.%Destroy.WithSelf.Op.403171.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d] +// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0 +// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc34_19.4 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.260 = ref_param_pattern [concrete = constants.%self.param_patt.e1f] +// CHECK:STDOUT: %self.patt: %pattern_type.260 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d8d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.value.has_value.f6a = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.value.has_value.f6a = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.5: %Destroy.WithSelf.Op.type.ef016f.6 = fn_decl @Destroy.WithSelf.Op.loc34_19.4 [concrete = constants.%Destroy.WithSelf.Op.403171.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.260 = ref_param_pattern [concrete = constants.%self.param_patt.e1f] +// CHECK:STDOUT: %self.patt: %pattern_type.260 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d8d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.value.has_value.f6a = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.value.has_value.f6a = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc34_19.5 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.7] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.96a = ref_param_pattern [concrete = constants.%self.param_patt.333] +// CHECK:STDOUT: %self.patt: %pattern_type.96a = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.00e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %DefaultOptionalStorage.9f1 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %DefaultOptionalStorage.9f1 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.6: %Destroy.WithSelf.Op.type.ef016f.7 = fn_decl @Destroy.WithSelf.Op.loc34_19.5 [concrete = constants.%Destroy.WithSelf.Op.403171.7] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.96a = ref_param_pattern [concrete = constants.%self.param_patt.333] +// CHECK:STDOUT: %self.patt: %pattern_type.96a = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.00e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %DefaultOptionalStorage.9f1 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %DefaultOptionalStorage.9f1 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.7: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.8 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc34_19.6 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.8] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.022 = ref_param_pattern [concrete = constants.%self.param_patt.d39] +// CHECK:STDOUT: %self.patt: %pattern_type.022 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.046] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Optional.0ac = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Optional.0ac = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.7: %Destroy.WithSelf.Op.type.ef016f.8 = fn_decl @Destroy.WithSelf.Op.loc34_19.6 [concrete = constants.%Destroy.WithSelf.Op.403171.8] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.022 = ref_param_pattern [concrete = constants.%self.param_patt.d39] +// CHECK:STDOUT: %self.patt: %pattern_type.022 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.046] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Optional.0ac = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Optional.0ac = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @TestIterate(%R.loc30_17.2: %Iterate_where.type.16e) { // CHECK:STDOUT: // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: %Iterate.lookup_impl_witness: = lookup_impl_witness %R.loc30_17.1, @Iterate [symbolic = %Iterate.lookup_impl_witness (constants.%Iterate.lookup_impl_witness.332)] -// CHECK:STDOUT: %Iterate.facet.loc34_19.5: %Iterate.type = facet_value %R.as_type.loc30_61.1, (%Iterate.lookup_impl_witness) [symbolic = %Iterate.facet.loc34_19.5 (constants.%Iterate.facet.71c)] -// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.loc34_19.5) [symbolic = %Iterate.WithSelf.NewCursor.type (constants.%Iterate.WithSelf.NewCursor.type.b85)] -// CHECK:STDOUT: %.loc34_19.19: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type, %Iterate.facet.loc34_19.5 [symbolic = %.loc34_19.19 (constants.%.c2f7)] -// CHECK:STDOUT: %impl.elem2.loc34_19.2: @TestIterate.%.loc34_19.19 (%.c2f7) = impl_witness_access %Iterate.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc34_19.2 (constants.%impl.elem2.176)] -// CHECK:STDOUT: %specific_impl_fn.loc34_19.4: = specific_impl_function %impl.elem2.loc34_19.2, @Iterate.WithSelf.NewCursor(%Iterate.facet.loc34_19.5) [symbolic = %specific_impl_fn.loc34_19.4 (constants.%specific_impl_fn.c8e)] +// CHECK:STDOUT: %Iterate.lookup_impl_witness: = lookup_impl_witness %R.loc30_17.1, @Iterate [symbolic = %Iterate.lookup_impl_witness (constants.%Iterate.lookup_impl_witness.462)] +// CHECK:STDOUT: %Iterate.facet.loc34_19.5: %Iterate.type = facet_value %R.as_type.loc30_61.1, (%Iterate.lookup_impl_witness) [symbolic = %Iterate.facet.loc34_19.5 (constants.%Iterate.facet.e5e)] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.loc34_19.5) [symbolic = %Iterate.WithSelf.NewCursor.type (constants.%Iterate.WithSelf.NewCursor.type.62b)] +// CHECK:STDOUT: %.loc34_19.19: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type, %Iterate.facet.loc34_19.5 [symbolic = %.loc34_19.19 (constants.%.1a4)] +// CHECK:STDOUT: %impl.elem2.loc34_19.3: @TestIterate.%.loc34_19.19 (%.1a4) = impl_witness_access %Iterate.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc34_19.3 (constants.%impl.elem2.3eb)] +// CHECK:STDOUT: %specific_impl_fn.loc34_19.4: = specific_impl_function %impl.elem2.loc34_19.3, @Iterate.WithSelf.NewCursor(%Iterate.facet.loc34_19.5) [symbolic = %specific_impl_fn.loc34_19.4 (constants.%specific_impl_fn.a09)] // CHECK:STDOUT: -// CHECK:STDOUT: %ptr: type = ptr_type %as_type [symbolic = %ptr (constants.%ptr.e4d)] -// CHECK:STDOUT: %Iterate.WithSelf.Next.type: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.loc34_19.5) [symbolic = %Iterate.WithSelf.Next.type (constants.%Iterate.WithSelf.Next.type.7c1)] -// CHECK:STDOUT: %.loc34_19.20: type = fn_type_with_self_type %Iterate.WithSelf.Next.type, %Iterate.facet.loc34_19.5 [symbolic = %.loc34_19.20 (constants.%.5c4)] -// CHECK:STDOUT: %impl.elem3.loc34_19.2: @TestIterate.%.loc34_19.20 (%.5c4) = impl_witness_access %Iterate.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc34_19.2 (constants.%impl.elem3.4ed)] -// CHECK:STDOUT: %specific_impl_fn.loc34_19.5: = specific_impl_function %impl.elem3.loc34_19.2, @Iterate.WithSelf.Next(%Iterate.facet.loc34_19.5) [symbolic = %specific_impl_fn.loc34_19.5 (constants.%specific_impl_fn.902)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%impl.elem1) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.ec9)] -// CHECK:STDOUT: %.loc34_19.21: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %impl.elem1 [symbolic = %.loc34_19.21 (constants.%.44e)] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %impl.elem1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.51e)] -// CHECK:STDOUT: %impl.elem0.loc34_19.2: @TestIterate.%.loc34_19.21 (%.44e) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc34_19.2 (constants.%impl.elem0.818)] -// CHECK:STDOUT: %specific_impl_fn.loc34_19.6: = specific_impl_function %impl.elem0.loc34_19.2, @Destroy.WithSelf.Op.1(%impl.elem1) [symbolic = %specific_impl_fn.loc34_19.6 (constants.%specific_impl_fn.ca7)] +// CHECK:STDOUT: %ptr: type = ptr_type %as_type [symbolic = %ptr (constants.%ptr.b18)] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.loc34_19.5) [symbolic = %Iterate.WithSelf.Next.type (constants.%Iterate.WithSelf.Next.type.6c3)] +// CHECK:STDOUT: %.loc34_19.20: type = fn_type_with_self_type %Iterate.WithSelf.Next.type, %Iterate.facet.loc34_19.5 [symbolic = %.loc34_19.20 (constants.%.218)] +// CHECK:STDOUT: %impl.elem3.loc34_19.2: @TestIterate.%.loc34_19.20 (%.218) = impl_witness_access %Iterate.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc34_19.2 (constants.%impl.elem3.b50)] +// CHECK:STDOUT: %specific_impl_fn.loc34_19.5: = specific_impl_function %impl.elem3.loc34_19.2, @Iterate.WithSelf.Next(%Iterate.facet.loc34_19.5) [symbolic = %specific_impl_fn.loc34_19.5 (constants.%specific_impl_fn.598)] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%impl.elem1) [symbolic = %Destroy.WithSelf.SelfDestruct.type (constants.%Destroy.WithSelf.SelfDestruct.type.041)] +// CHECK:STDOUT: %.loc34_19.21: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type, %impl.elem1 [symbolic = %.loc34_19.21 (constants.%.b28)] +// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %impl.elem1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.caf)] +// CHECK:STDOUT: %impl.elem2.loc34_19.4: @TestIterate.%.loc34_19.21 (%.b28) = impl_witness_access %Destroy.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc34_19.4 (constants.%impl.elem2.9a0)] +// CHECK:STDOUT: %specific_impl_fn.loc34_19.6: = specific_impl_function %impl.elem2.loc34_19.4, @Destroy.WithSelf.SelfDestruct.1(%impl.elem1) [symbolic = %specific_impl_fn.loc34_19.6 (constants.%specific_impl_fn.ea2)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%r.param: @TestIterate.%R.as_type.loc30_61.1 (%R.as_type)) { // CHECK:STDOUT: !entry: @@ -1080,52 +1229,52 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %i.patt: %pattern_type.6b6 = value_binding_pattern i [concrete = constants.%i.patt] // CHECK:STDOUT: } // CHECK:STDOUT: %r.ref: @TestIterate.%R.as_type.loc30_61.1 (%R.as_type) = name_ref r, %r -// CHECK:STDOUT: %impl.elem2.loc34_19.1: @TestIterate.%.loc34_19.19 (%.c2f7) = impl_witness_access constants.%Iterate.lookup_impl_witness.332, element2 [symbolic = %impl.elem2.loc34_19.2 (constants.%impl.elem2.176)] +// CHECK:STDOUT: %impl.elem2.loc34_19.1: @TestIterate.%.loc34_19.19 (%.1a4) = impl_witness_access constants.%Iterate.lookup_impl_witness.462, element2 [symbolic = %impl.elem2.loc34_19.3 (constants.%impl.elem2.3eb)] // CHECK:STDOUT: %bound_method.loc34_19.1: = bound_method %r.ref, %impl.elem2.loc34_19.1 -// CHECK:STDOUT: %Iterate.facet.loc34_19.1: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.332) [symbolic = %Iterate.facet.loc34_19.5 (constants.%Iterate.facet.71c)] -// CHECK:STDOUT: %.loc34_19.1: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc34_19.1 [symbolic = %Iterate.facet.loc34_19.5 (constants.%Iterate.facet.71c)] -// CHECK:STDOUT: %Iterate.facet.loc34_19.2: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.332) [symbolic = %Iterate.facet.loc34_19.5 (constants.%Iterate.facet.71c)] -// CHECK:STDOUT: %.loc34_19.2: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc34_19.2 [symbolic = %Iterate.facet.loc34_19.5 (constants.%Iterate.facet.71c)] -// CHECK:STDOUT: %specific_impl_fn.loc34_19.1: = specific_impl_function %impl.elem2.loc34_19.1, @Iterate.WithSelf.NewCursor(constants.%Iterate.facet.71c) [symbolic = %specific_impl_fn.loc34_19.4 (constants.%specific_impl_fn.c8e)] +// CHECK:STDOUT: %Iterate.facet.loc34_19.1: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.462) [symbolic = %Iterate.facet.loc34_19.5 (constants.%Iterate.facet.e5e)] +// CHECK:STDOUT: %.loc34_19.1: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc34_19.1 [symbolic = %Iterate.facet.loc34_19.5 (constants.%Iterate.facet.e5e)] +// CHECK:STDOUT: %Iterate.facet.loc34_19.2: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.462) [symbolic = %Iterate.facet.loc34_19.5 (constants.%Iterate.facet.e5e)] +// CHECK:STDOUT: %.loc34_19.2: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc34_19.2 [symbolic = %Iterate.facet.loc34_19.5 (constants.%Iterate.facet.e5e)] +// CHECK:STDOUT: %specific_impl_fn.loc34_19.1: = specific_impl_function %impl.elem2.loc34_19.1, @Iterate.WithSelf.NewCursor(constants.%Iterate.facet.e5e) [symbolic = %specific_impl_fn.loc34_19.4 (constants.%specific_impl_fn.a09)] // CHECK:STDOUT: %bound_method.loc34_19.2: = bound_method %r.ref, %specific_impl_fn.loc34_19.1 -// CHECK:STDOUT: %var: ref @TestIterate.%as_type (%as_type.3aa) = var_storage invalid -// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.call: init @TestIterate.%as_type (%as_type.3aa) to %var = call %bound_method.loc34_19.2(%r.ref) +// CHECK:STDOUT: %var: ref @TestIterate.%as_type (%as_type.f79) = var_storage invalid +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.call: init @TestIterate.%as_type (%as_type.f79) to %var = call %bound_method.loc34_19.2(%r.ref) // CHECK:STDOUT: assign %var, %Iterate.WithSelf.NewCursor.call // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.next: -// CHECK:STDOUT: %addr: @TestIterate.%ptr (%ptr.e4d) = addr_of %var -// CHECK:STDOUT: %impl.elem3.loc34_19.1: @TestIterate.%.loc34_19.20 (%.5c4) = impl_witness_access constants.%Iterate.lookup_impl_witness.332, element3 [symbolic = %impl.elem3.loc34_19.2 (constants.%impl.elem3.4ed)] +// CHECK:STDOUT: %addr: @TestIterate.%ptr (%ptr.b18) = addr_of %var +// CHECK:STDOUT: %impl.elem3.loc34_19.1: @TestIterate.%.loc34_19.20 (%.218) = impl_witness_access constants.%Iterate.lookup_impl_witness.462, element3 [symbolic = %impl.elem3.loc34_19.2 (constants.%impl.elem3.b50)] // CHECK:STDOUT: %bound_method.loc34_19.3: = bound_method %r.ref, %impl.elem3.loc34_19.1 -// CHECK:STDOUT: %Iterate.facet.loc34_19.3: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.332) [symbolic = %Iterate.facet.loc34_19.5 (constants.%Iterate.facet.71c)] -// CHECK:STDOUT: %.loc34_19.3: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc34_19.3 [symbolic = %Iterate.facet.loc34_19.5 (constants.%Iterate.facet.71c)] -// CHECK:STDOUT: %Iterate.facet.loc34_19.4: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.332) [symbolic = %Iterate.facet.loc34_19.5 (constants.%Iterate.facet.71c)] -// CHECK:STDOUT: %.loc34_19.4: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc34_19.4 [symbolic = %Iterate.facet.loc34_19.5 (constants.%Iterate.facet.71c)] -// CHECK:STDOUT: %.loc34_19.5: %Destroy.type = converted constants.%as_type.3aa, constants.%impl.elem1.862 [symbolic = %impl.elem1 (constants.%impl.elem1.862)] -// CHECK:STDOUT: %.loc34_19.6: %Destroy.type = converted constants.%as_type.3aa, constants.%impl.elem1.862 [symbolic = %impl.elem1 (constants.%impl.elem1.862)] -// CHECK:STDOUT: %specific_impl_fn.loc34_19.2: = specific_impl_function %impl.elem3.loc34_19.1, @Iterate.WithSelf.Next(constants.%Iterate.facet.71c) [symbolic = %specific_impl_fn.loc34_19.5 (constants.%specific_impl_fn.902)] +// CHECK:STDOUT: %Iterate.facet.loc34_19.3: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.462) [symbolic = %Iterate.facet.loc34_19.5 (constants.%Iterate.facet.e5e)] +// CHECK:STDOUT: %.loc34_19.3: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc34_19.3 [symbolic = %Iterate.facet.loc34_19.5 (constants.%Iterate.facet.e5e)] +// CHECK:STDOUT: %Iterate.facet.loc34_19.4: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.462) [symbolic = %Iterate.facet.loc34_19.5 (constants.%Iterate.facet.e5e)] +// CHECK:STDOUT: %.loc34_19.4: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc34_19.4 [symbolic = %Iterate.facet.loc34_19.5 (constants.%Iterate.facet.e5e)] +// CHECK:STDOUT: %.loc34_19.5: %Destroy.type = converted constants.%as_type.f79, constants.%impl.elem1.a11 [symbolic = %impl.elem1 (constants.%impl.elem1.a11)] +// CHECK:STDOUT: %.loc34_19.6: %Destroy.type = converted constants.%as_type.f79, constants.%impl.elem1.a11 [symbolic = %impl.elem1 (constants.%impl.elem1.a11)] +// CHECK:STDOUT: %specific_impl_fn.loc34_19.2: = specific_impl_function %impl.elem3.loc34_19.1, @Iterate.WithSelf.Next(constants.%Iterate.facet.e5e) [symbolic = %specific_impl_fn.loc34_19.5 (constants.%specific_impl_fn.598)] // CHECK:STDOUT: %bound_method.loc34_19.4: = bound_method %r.ref, %specific_impl_fn.loc34_19.2 -// CHECK:STDOUT: %.loc34_19.7: ref %Optional.6f7 = temporary_storage -// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.6f7 to %.loc34_19.7 = call %bound_method.loc34_19.4(%r.ref, %addr) -// CHECK:STDOUT: %.loc34_19.8: ref %Optional.6f7 = temporary %.loc34_19.7, %Iterate.WithSelf.Next.call -// CHECK:STDOUT: %.loc34_19.9: %Optional.HasValue.type.818 = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.375) [concrete = constants.%Optional.HasValue.655] -// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.818 = name_ref HasValue, %.loc34_19.9 [concrete = constants.%Optional.HasValue.655] +// CHECK:STDOUT: %.loc34_19.7: ref %Optional.0ac = temporary_storage +// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.0ac to %.loc34_19.7 = call %bound_method.loc34_19.4(%r.ref, %addr) +// CHECK:STDOUT: %.loc34_19.8: ref %Optional.0ac = temporary %.loc34_19.7, %Iterate.WithSelf.Next.call +// CHECK:STDOUT: %.loc34_19.9: %Optional.HasValue.type.dbd = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.6c5) [concrete = constants.%Optional.HasValue.ed9] +// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.dbd = name_ref HasValue, %.loc34_19.9 [concrete = constants.%Optional.HasValue.ed9] // CHECK:STDOUT: %Optional.HasValue.bound: = bound_method %.loc34_19.8, %HasValue.ref -// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%OptionalStorage.facet.375) [concrete = constants.%Optional.HasValue.specific_fn.551] +// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%OptionalStorage.facet.6c5) [concrete = constants.%Optional.HasValue.specific_fn.15f] // CHECK:STDOUT: %bound_method.loc34_19.5: = bound_method %.loc34_19.8, %Optional.HasValue.specific_fn -// CHECK:STDOUT: %.loc34_19.10: %Optional.6f7 = acquire_value %.loc34_19.8 +// CHECK:STDOUT: %.loc34_19.10: %Optional.0ac = acquire_value %.loc34_19.8 // CHECK:STDOUT: %Optional.HasValue.call: init bool = call %bound_method.loc34_19.5(%.loc34_19.10) // CHECK:STDOUT: %.loc34_19.11: bool = value_of_initializer %Optional.HasValue.call // CHECK:STDOUT: %.loc34_19.12: bool = converted %Optional.HasValue.call, %.loc34_19.11 // CHECK:STDOUT: if %.loc34_19.12 br !for.body else br !for.done // CHECK:STDOUT: // CHECK:STDOUT: !for.body: -// CHECK:STDOUT: %.loc34_19.13: %Optional.Get.type.054 = specific_constant imports.%Core.import_ref.dab, @Optional(constants.%OptionalStorage.facet.375) [concrete = constants.%Optional.Get.a58] -// CHECK:STDOUT: %Get.ref: %Optional.Get.type.054 = name_ref Get, %.loc34_19.13 [concrete = constants.%Optional.Get.a58] +// CHECK:STDOUT: %.loc34_19.13: %Optional.Get.type.2b4 = specific_constant imports.%Core.import_ref.dab, @Optional(constants.%OptionalStorage.facet.6c5) [concrete = constants.%Optional.Get.529] +// CHECK:STDOUT: %Get.ref: %Optional.Get.type.2b4 = name_ref Get, %.loc34_19.13 [concrete = constants.%Optional.Get.529] // CHECK:STDOUT: %Optional.Get.bound: = bound_method %.loc34_19.8, %Get.ref -// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%OptionalStorage.facet.375) [concrete = constants.%Optional.Get.specific_fn.326] +// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%OptionalStorage.facet.6c5) [concrete = constants.%Optional.Get.specific_fn.0dd] // CHECK:STDOUT: %bound_method.loc34_19.6: = bound_method %.loc34_19.8, %Optional.Get.specific_fn -// CHECK:STDOUT: %.loc34_19.14: %Optional.6f7 = acquire_value %.loc34_19.8 +// CHECK:STDOUT: %.loc34_19.14: %Optional.0ac = acquire_value %.loc34_19.8 // CHECK:STDOUT: %Optional.Get.call: init %i32 = call %bound_method.loc34_19.6(%.loc34_19.14) // CHECK:STDOUT: %.loc34_19.15: %i32 = value_of_initializer %Optional.Get.call // CHECK:STDOUT: %.loc34_19.16: %i32 = converted %Optional.Get.call, %.loc34_19.15 @@ -1143,48 +1292,102 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %Int.as.AddAssignWith.impl.Op.specific_fn: = specific_function %Op.ref, @Int.as.AddAssignWith.impl.Op.2(constants.%int_32, constants.%ImplicitAs.facet.e88) [concrete = constants.%Int.as.AddAssignWith.impl.Op.specific_fn.d76216.2] // CHECK:STDOUT: %bound_method.loc35_9.3: = bound_method %sum.ref, %Int.as.AddAssignWith.impl.Op.specific_fn // CHECK:STDOUT: %Int.as.AddAssignWith.impl.Op.call: init %empty_tuple.type = call %bound_method.loc35_9.3(%sum.ref, %i.ref) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc34_19.1: = bound_method %.loc34_19.8, constants.%Destroy.WithSelf.Op.403171.8 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc34_19.1: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc34_19.1(%.loc34_19.8) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc34_19.1: = bound_method %.loc34_19.8, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.8 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc34_19.1: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc34_19.1(%.loc34_19.8) // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.done: -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc34_19.2: = bound_method %.loc34_19.8, constants.%Destroy.WithSelf.Op.403171.8 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc34_19.2: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc34_19.2(%.loc34_19.8) -// CHECK:STDOUT: %impl.elem0.loc34_19.1: @TestIterate.%.loc34_19.21 (%.44e) = impl_witness_access constants.%Destroy.lookup_impl_witness.51e, element0 [symbolic = %impl.elem0.loc34_19.2 (constants.%impl.elem0.818)] -// CHECK:STDOUT: %bound_method.loc34_19.7: = bound_method %var, %impl.elem0.loc34_19.1 -// CHECK:STDOUT: %.loc34_19.17: %Destroy.type = converted constants.%as_type.3aa, constants.%impl.elem1.862 [symbolic = %impl.elem1 (constants.%impl.elem1.862)] -// CHECK:STDOUT: %.loc34_19.18: %Destroy.type = converted constants.%as_type.3aa, constants.%impl.elem1.862 [symbolic = %impl.elem1 (constants.%impl.elem1.862)] -// CHECK:STDOUT: %specific_impl_fn.loc34_19.3: = specific_impl_function %impl.elem0.loc34_19.1, @Destroy.WithSelf.Op.1(constants.%impl.elem1.862) [symbolic = %specific_impl_fn.loc34_19.6 (constants.%specific_impl_fn.ca7)] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc34_19.2: = bound_method %.loc34_19.8, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.8 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc34_19.2: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc34_19.2(%.loc34_19.8) +// CHECK:STDOUT: %impl.elem2.loc34_19.2: @TestIterate.%.loc34_19.21 (%.b28) = impl_witness_access constants.%Destroy.lookup_impl_witness.caf, element2 [symbolic = %impl.elem2.loc34_19.4 (constants.%impl.elem2.9a0)] +// CHECK:STDOUT: %bound_method.loc34_19.7: = bound_method %var, %impl.elem2.loc34_19.2 +// CHECK:STDOUT: %.loc34_19.17: %Destroy.type = converted constants.%as_type.f79, constants.%impl.elem1.a11 [symbolic = %impl.elem1 (constants.%impl.elem1.a11)] +// CHECK:STDOUT: %.loc34_19.18: %Destroy.type = converted constants.%as_type.f79, constants.%impl.elem1.a11 [symbolic = %impl.elem1 (constants.%impl.elem1.a11)] +// CHECK:STDOUT: %specific_impl_fn.loc34_19.3: = specific_impl_function %impl.elem2.loc34_19.2, @Destroy.WithSelf.SelfDestruct.1(constants.%impl.elem1.a11) [symbolic = %specific_impl_fn.loc34_19.6 (constants.%specific_impl_fn.ea2)] // CHECK:STDOUT: %bound_method.loc34_19.8: = bound_method %var, %specific_impl_fn.loc34_19.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc34_19.3: init %empty_tuple.type = call %bound_method.loc34_19.8(%var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc34_19.3: init %empty_tuple.type = call %bound_method.loc34_19.8(%var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc34_19.1(%self.param: ref %.1d6a7) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc34_19.1(%self.param: ref %.1d6a7) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc34_19.2(%self.param: ref %MaybeUnformed.c1d) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc34_19.1(%self.param: ref %.1d6a7) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc34_19.1(%self.param: ref %.1d6a7) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc34_19.2(%self.param: ref %MaybeUnformed.515) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc34_19.2(%self.param: ref %MaybeUnformed.515) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc34_19.2(%self.param: ref %MaybeUnformed.515) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc34_19.3(%self.param: ref bool) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc34_19.3(%self.param: ref bool) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc34_19.4(%self.param: ref %struct_type.value.has_value.271) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc34_19.3(%self.param: ref bool) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc34_19.4(%self.param: ref %struct_type.value.has_value.f6a) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc34_19.5(%self.param: ref %DefaultOptionalStorage.99e) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc34_19.4(%self.param: ref %struct_type.value.has_value.f6a) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc34_19.4(%self.param: ref %struct_type.value.has_value.f6a) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.5(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.5(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc34_19.5(%self.param: ref %DefaultOptionalStorage.9f1) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc34_19.6(%self.param: ref %Optional.6f7) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc34_19.5(%self.param: ref %DefaultOptionalStorage.9f1) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc34_19.5(%self.param: ref %DefaultOptionalStorage.9f1) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.6(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.6(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc34_19.6(%self.param: ref %Optional.0ac) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc34_19.6(%self.param: ref %Optional.0ac) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc34_19.6(%self.param: ref %Optional.0ac) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.7(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.7(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1195,13 +1398,13 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %i.patt.loc49: %pattern_type.6b6 = value_binding_pattern i [concrete = constants.%i.patt] // CHECK:STDOUT: } // CHECK:STDOUT: %m.ref: ref %MutableRange = name_ref m, %m -// CHECK:STDOUT: %impl.elem2.loc49: %.03d = impl_witness_access constants.%Iterate.impl_witness.589, element2 [concrete = constants.%T.as_type.as.Iterate.impl.NewCursor.e2d] +// CHECK:STDOUT: %impl.elem2.loc49: %.cad = impl_witness_access constants.%Iterate.impl_witness.2bb, element2 [concrete = constants.%T.as_type.as.Iterate.impl.NewCursor.e00] // CHECK:STDOUT: %bound_method.loc49_19.1: = bound_method %m.ref, %impl.elem2.loc49 -// CHECK:STDOUT: %facet_value.loc49_19.1: %CppRange_where.type.d682d6.1 = facet_value constants.%MutableRange, (constants.%custom_witness.6c4ec3.1, constants.%Copy.impl_witness.b51, constants.%custom_witness.ed3, constants.%custom_witness.955, constants.%custom_witness.ef8, constants.%custom_witness.444, constants.%custom_witness.981) [concrete = constants.%facet_value.df3] -// CHECK:STDOUT: %.loc49_19.1: %CppRange_where.type.d682d6.1 = converted constants.%MutableRange, %facet_value.loc49_19.1 [concrete = constants.%facet_value.df3] -// CHECK:STDOUT: %facet_value.loc49_19.2: %CppRange_where.type.d682d6.1 = facet_value constants.%MutableRange, (constants.%custom_witness.6c4ec3.1, constants.%Copy.impl_witness.b51, constants.%custom_witness.ed3, constants.%custom_witness.955, constants.%custom_witness.ef8, constants.%custom_witness.444, constants.%custom_witness.981) [concrete = constants.%facet_value.df3] -// CHECK:STDOUT: %.loc49_19.2: %CppRange_where.type.d682d6.1 = converted constants.%MutableRange, %facet_value.loc49_19.2 [concrete = constants.%facet_value.df3] -// CHECK:STDOUT: %specific_fn.loc49_19.1: = specific_function %impl.elem2.loc49, @T.as_type.as.Iterate.impl.NewCursor(constants.%facet_value.df3) [concrete = constants.%T.as_type.as.Iterate.impl.NewCursor.specific_fn.a90] +// CHECK:STDOUT: %facet_value.loc49_19.1: %CppRange_where.type.d682d6.1 = facet_value constants.%MutableRange, (constants.%custom_witness.f8f19d.1, constants.%Copy.impl_witness.b51, constants.%custom_witness.ed3, constants.%custom_witness.8e1, constants.%custom_witness.ef8, constants.%custom_witness.444, constants.%custom_witness.981) [concrete = constants.%facet_value.474] +// CHECK:STDOUT: %.loc49_19.1: %CppRange_where.type.d682d6.1 = converted constants.%MutableRange, %facet_value.loc49_19.1 [concrete = constants.%facet_value.474] +// CHECK:STDOUT: %facet_value.loc49_19.2: %CppRange_where.type.d682d6.1 = facet_value constants.%MutableRange, (constants.%custom_witness.f8f19d.1, constants.%Copy.impl_witness.b51, constants.%custom_witness.ed3, constants.%custom_witness.8e1, constants.%custom_witness.ef8, constants.%custom_witness.444, constants.%custom_witness.981) [concrete = constants.%facet_value.474] +// CHECK:STDOUT: %.loc49_19.2: %CppRange_where.type.d682d6.1 = converted constants.%MutableRange, %facet_value.loc49_19.2 [concrete = constants.%facet_value.474] +// CHECK:STDOUT: %specific_fn.loc49_19.1: = specific_function %impl.elem2.loc49, @T.as_type.as.Iterate.impl.NewCursor(constants.%facet_value.474) [concrete = constants.%T.as_type.as.Iterate.impl.NewCursor.specific_fn.ac2] // CHECK:STDOUT: %bound_method.loc49_19.2: = bound_method %m.ref, %specific_fn.loc49_19.1 // CHECK:STDOUT: %var.loc49: ref %tuple.type.508 = var_storage invalid // CHECK:STDOUT: %.loc49_18.1: %MutableRange = acquire_value %m.ref @@ -1211,36 +1414,36 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: // CHECK:STDOUT: !for.next.loc49: // CHECK:STDOUT: %addr.loc49: %ptr.45c = addr_of %var.loc49 -// CHECK:STDOUT: %impl.elem3.loc49: %.cd1 = impl_witness_access constants.%Iterate.impl_witness.589, element3 [concrete = constants.%T.as_type.as.Iterate.impl.Next.fd1] +// CHECK:STDOUT: %impl.elem3.loc49: %.640 = impl_witness_access constants.%Iterate.impl_witness.2bb, element3 [concrete = constants.%T.as_type.as.Iterate.impl.Next.311] // CHECK:STDOUT: %bound_method.loc49_19.3: = bound_method %m.ref, %impl.elem3.loc49 -// CHECK:STDOUT: %facet_value.loc49_19.3: %CppRange_where.type.d682d6.1 = facet_value constants.%MutableRange, (constants.%custom_witness.6c4ec3.1, constants.%Copy.impl_witness.b51, constants.%custom_witness.ed3, constants.%custom_witness.955, constants.%custom_witness.ef8, constants.%custom_witness.444, constants.%custom_witness.981) [concrete = constants.%facet_value.df3] -// CHECK:STDOUT: %.loc49_19.3: %CppRange_where.type.d682d6.1 = converted constants.%MutableRange, %facet_value.loc49_19.3 [concrete = constants.%facet_value.df3] -// CHECK:STDOUT: %facet_value.loc49_19.4: %CppRange_where.type.d682d6.1 = facet_value constants.%MutableRange, (constants.%custom_witness.6c4ec3.1, constants.%Copy.impl_witness.b51, constants.%custom_witness.ed3, constants.%custom_witness.955, constants.%custom_witness.ef8, constants.%custom_witness.444, constants.%custom_witness.981) [concrete = constants.%facet_value.df3] -// CHECK:STDOUT: %.loc49_19.4: %CppRange_where.type.d682d6.1 = converted constants.%MutableRange, %facet_value.loc49_19.4 [concrete = constants.%facet_value.df3] -// CHECK:STDOUT: %specific_fn.loc49_19.2: = specific_function %impl.elem3.loc49, @T.as_type.as.Iterate.impl.Next(constants.%facet_value.df3) [concrete = constants.%T.as_type.as.Iterate.impl.Next.specific_fn.e2f] +// CHECK:STDOUT: %facet_value.loc49_19.3: %CppRange_where.type.d682d6.1 = facet_value constants.%MutableRange, (constants.%custom_witness.f8f19d.1, constants.%Copy.impl_witness.b51, constants.%custom_witness.ed3, constants.%custom_witness.8e1, constants.%custom_witness.ef8, constants.%custom_witness.444, constants.%custom_witness.981) [concrete = constants.%facet_value.474] +// CHECK:STDOUT: %.loc49_19.3: %CppRange_where.type.d682d6.1 = converted constants.%MutableRange, %facet_value.loc49_19.3 [concrete = constants.%facet_value.474] +// CHECK:STDOUT: %facet_value.loc49_19.4: %CppRange_where.type.d682d6.1 = facet_value constants.%MutableRange, (constants.%custom_witness.f8f19d.1, constants.%Copy.impl_witness.b51, constants.%custom_witness.ed3, constants.%custom_witness.8e1, constants.%custom_witness.ef8, constants.%custom_witness.444, constants.%custom_witness.981) [concrete = constants.%facet_value.474] +// CHECK:STDOUT: %.loc49_19.4: %CppRange_where.type.d682d6.1 = converted constants.%MutableRange, %facet_value.loc49_19.4 [concrete = constants.%facet_value.474] +// CHECK:STDOUT: %specific_fn.loc49_19.2: = specific_function %impl.elem3.loc49, @T.as_type.as.Iterate.impl.Next(constants.%facet_value.474) [concrete = constants.%T.as_type.as.Iterate.impl.Next.specific_fn.b01] // CHECK:STDOUT: %bound_method.loc49_19.4: = bound_method %m.ref, %specific_fn.loc49_19.2 -// CHECK:STDOUT: %.loc49_19.5: ref %Optional.6f7 = temporary_storage +// CHECK:STDOUT: %.loc49_19.5: ref %Optional.0ac = temporary_storage // CHECK:STDOUT: %.loc49_18.2: %MutableRange = acquire_value %m.ref -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.call.loc49: init %Optional.6f7 to %.loc49_19.5 = call %bound_method.loc49_19.4(%.loc49_18.2, %addr.loc49) -// CHECK:STDOUT: %.loc49_19.6: ref %Optional.6f7 = temporary %.loc49_19.5, %T.as_type.as.Iterate.impl.Next.call.loc49 -// CHECK:STDOUT: %.loc49_19.7: %Optional.HasValue.type.818 = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.375) [concrete = constants.%Optional.HasValue.655] -// CHECK:STDOUT: %HasValue.ref.loc49: %Optional.HasValue.type.818 = name_ref HasValue, %.loc49_19.7 [concrete = constants.%Optional.HasValue.655] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.call.loc49: init %Optional.0ac to %.loc49_19.5 = call %bound_method.loc49_19.4(%.loc49_18.2, %addr.loc49) +// CHECK:STDOUT: %.loc49_19.6: ref %Optional.0ac = temporary %.loc49_19.5, %T.as_type.as.Iterate.impl.Next.call.loc49 +// CHECK:STDOUT: %.loc49_19.7: %Optional.HasValue.type.dbd = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.6c5) [concrete = constants.%Optional.HasValue.ed9] +// CHECK:STDOUT: %HasValue.ref.loc49: %Optional.HasValue.type.dbd = name_ref HasValue, %.loc49_19.7 [concrete = constants.%Optional.HasValue.ed9] // CHECK:STDOUT: %Optional.HasValue.bound.loc49: = bound_method %.loc49_19.6, %HasValue.ref.loc49 -// CHECK:STDOUT: %Optional.HasValue.specific_fn.loc49: = specific_function %HasValue.ref.loc49, @Optional.HasValue(constants.%OptionalStorage.facet.375) [concrete = constants.%Optional.HasValue.specific_fn.551] +// CHECK:STDOUT: %Optional.HasValue.specific_fn.loc49: = specific_function %HasValue.ref.loc49, @Optional.HasValue(constants.%OptionalStorage.facet.6c5) [concrete = constants.%Optional.HasValue.specific_fn.15f] // CHECK:STDOUT: %bound_method.loc49_19.5: = bound_method %.loc49_19.6, %Optional.HasValue.specific_fn.loc49 -// CHECK:STDOUT: %.loc49_19.8: %Optional.6f7 = acquire_value %.loc49_19.6 +// CHECK:STDOUT: %.loc49_19.8: %Optional.0ac = acquire_value %.loc49_19.6 // CHECK:STDOUT: %Optional.HasValue.call.loc49: init bool = call %bound_method.loc49_19.5(%.loc49_19.8) // CHECK:STDOUT: %.loc49_19.9: bool = value_of_initializer %Optional.HasValue.call.loc49 // CHECK:STDOUT: %.loc49_19.10: bool = converted %Optional.HasValue.call.loc49, %.loc49_19.9 // CHECK:STDOUT: if %.loc49_19.10 br !for.body.loc49 else br !for.done.loc49 // CHECK:STDOUT: // CHECK:STDOUT: !for.body.loc49: -// CHECK:STDOUT: %.loc49_19.11: %Optional.Get.type.054 = specific_constant imports.%Core.import_ref.dab, @Optional(constants.%OptionalStorage.facet.375) [concrete = constants.%Optional.Get.a58] -// CHECK:STDOUT: %Get.ref.loc49: %Optional.Get.type.054 = name_ref Get, %.loc49_19.11 [concrete = constants.%Optional.Get.a58] +// CHECK:STDOUT: %.loc49_19.11: %Optional.Get.type.2b4 = specific_constant imports.%Core.import_ref.dab, @Optional(constants.%OptionalStorage.facet.6c5) [concrete = constants.%Optional.Get.529] +// CHECK:STDOUT: %Get.ref.loc49: %Optional.Get.type.2b4 = name_ref Get, %.loc49_19.11 [concrete = constants.%Optional.Get.529] // CHECK:STDOUT: %Optional.Get.bound.loc49: = bound_method %.loc49_19.6, %Get.ref.loc49 -// CHECK:STDOUT: %Optional.Get.specific_fn.loc49: = specific_function %Get.ref.loc49, @Optional.Get(constants.%OptionalStorage.facet.375) [concrete = constants.%Optional.Get.specific_fn.326] +// CHECK:STDOUT: %Optional.Get.specific_fn.loc49: = specific_function %Get.ref.loc49, @Optional.Get(constants.%OptionalStorage.facet.6c5) [concrete = constants.%Optional.Get.specific_fn.0dd] // CHECK:STDOUT: %bound_method.loc49_19.6: = bound_method %.loc49_19.6, %Optional.Get.specific_fn.loc49 -// CHECK:STDOUT: %.loc49_19.12: %Optional.6f7 = acquire_value %.loc49_19.6 +// CHECK:STDOUT: %.loc49_19.12: %Optional.0ac = acquire_value %.loc49_19.6 // CHECK:STDOUT: %Optional.Get.call.loc49: init %i32 = call %bound_method.loc49_19.6(%.loc49_19.12) // CHECK:STDOUT: %.loc49_19.13: %i32 = value_of_initializer %Optional.Get.call.loc49 // CHECK:STDOUT: %.loc49_19.14: %i32 = converted %Optional.Get.call.loc49, %.loc49_19.13 @@ -1258,26 +1461,26 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %Int.as.AddAssignWith.impl.Op.specific_fn.loc50: = specific_function %Op.ref.loc50, @Int.as.AddAssignWith.impl.Op.2(constants.%int_32, constants.%ImplicitAs.facet.e88) [concrete = constants.%Int.as.AddAssignWith.impl.Op.specific_fn.d76216.2] // CHECK:STDOUT: %bound_method.loc50_9.3: = bound_method %sum.ref.loc50, %Int.as.AddAssignWith.impl.Op.specific_fn.loc50 // CHECK:STDOUT: %Int.as.AddAssignWith.impl.Op.call.loc50: init %empty_tuple.type = call %bound_method.loc50_9.3(%sum.ref.loc50, %i.ref.loc50) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc49_19.1: = bound_method %.loc49_19.6, constants.%Destroy.WithSelf.Op.403171.8 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc49_19.1: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc49_19.1(%.loc49_19.6) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc49_19.1: = bound_method %.loc49_19.6, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.8 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc49_19.1: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc49_19.1(%.loc49_19.6) // CHECK:STDOUT: br !for.next.loc49 // CHECK:STDOUT: // CHECK:STDOUT: !for.done.loc49: -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc49_19.2: = bound_method %.loc49_19.6, constants.%Destroy.WithSelf.Op.403171.8 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc49_19.2: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc49_19.2(%.loc49_19.6) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc49_19.3: = bound_method %var.loc49, constants.%Destroy.WithSelf.Op.403171.9 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc49_19.3: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc49_19.3(%var.loc49) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc49_19.2: = bound_method %.loc49_19.6, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.8 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc49_19.2: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc49_19.2(%.loc49_19.6) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc49_19.3: = bound_method %var.loc49, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.10 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc49_19.3: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc49_19.3(%var.loc49) // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %i.patt.loc55: %pattern_type.6b6 = value_binding_pattern i [concrete = constants.%i.patt] // CHECK:STDOUT: } // CHECK:STDOUT: %c.ref: %ConstRange = name_ref c, %c -// CHECK:STDOUT: %impl.elem2.loc55: %.e7e = impl_witness_access constants.%Iterate.impl_witness.978, element2 [concrete = constants.%T.as_type.as.Iterate.impl.NewCursor.f99] +// CHECK:STDOUT: %impl.elem2.loc55: %.312 = impl_witness_access constants.%Iterate.impl_witness.1a6, element2 [concrete = constants.%T.as_type.as.Iterate.impl.NewCursor.19e] // CHECK:STDOUT: %bound_method.loc55_19.1: = bound_method %c.ref, %impl.elem2.loc55 -// CHECK:STDOUT: %facet_value.loc55_19.1: %CppRange_where.type.d682d6.1 = facet_value constants.%ConstRange, (constants.%custom_witness.6c4ec3.1, constants.%Copy.impl_witness.b51, constants.%custom_witness.23e, constants.%custom_witness.6e8, constants.%custom_witness.adb, constants.%custom_witness.746, constants.%custom_witness.941) [concrete = constants.%facet_value.b82] -// CHECK:STDOUT: %.loc55_19.1: %CppRange_where.type.d682d6.1 = converted constants.%ConstRange, %facet_value.loc55_19.1 [concrete = constants.%facet_value.b82] -// CHECK:STDOUT: %facet_value.loc55_19.2: %CppRange_where.type.d682d6.1 = facet_value constants.%ConstRange, (constants.%custom_witness.6c4ec3.1, constants.%Copy.impl_witness.b51, constants.%custom_witness.23e, constants.%custom_witness.6e8, constants.%custom_witness.adb, constants.%custom_witness.746, constants.%custom_witness.941) [concrete = constants.%facet_value.b82] -// CHECK:STDOUT: %.loc55_19.2: %CppRange_where.type.d682d6.1 = converted constants.%ConstRange, %facet_value.loc55_19.2 [concrete = constants.%facet_value.b82] -// CHECK:STDOUT: %specific_fn.loc55_19.1: = specific_function %impl.elem2.loc55, @T.as_type.as.Iterate.impl.NewCursor(constants.%facet_value.b82) [concrete = constants.%T.as_type.as.Iterate.impl.NewCursor.specific_fn.574] +// CHECK:STDOUT: %facet_value.loc55_19.1: %CppRange_where.type.d682d6.1 = facet_value constants.%ConstRange, (constants.%custom_witness.f8f19d.1, constants.%Copy.impl_witness.b51, constants.%custom_witness.23e, constants.%custom_witness.0f3, constants.%custom_witness.adb, constants.%custom_witness.746, constants.%custom_witness.941) [concrete = constants.%facet_value.3e1] +// CHECK:STDOUT: %.loc55_19.1: %CppRange_where.type.d682d6.1 = converted constants.%ConstRange, %facet_value.loc55_19.1 [concrete = constants.%facet_value.3e1] +// CHECK:STDOUT: %facet_value.loc55_19.2: %CppRange_where.type.d682d6.1 = facet_value constants.%ConstRange, (constants.%custom_witness.f8f19d.1, constants.%Copy.impl_witness.b51, constants.%custom_witness.23e, constants.%custom_witness.0f3, constants.%custom_witness.adb, constants.%custom_witness.746, constants.%custom_witness.941) [concrete = constants.%facet_value.3e1] +// CHECK:STDOUT: %.loc55_19.2: %CppRange_where.type.d682d6.1 = converted constants.%ConstRange, %facet_value.loc55_19.2 [concrete = constants.%facet_value.3e1] +// CHECK:STDOUT: %specific_fn.loc55_19.1: = specific_function %impl.elem2.loc55, @T.as_type.as.Iterate.impl.NewCursor(constants.%facet_value.3e1) [concrete = constants.%T.as_type.as.Iterate.impl.NewCursor.specific_fn.91a] // CHECK:STDOUT: %bound_method.loc55_19.2: = bound_method %c.ref, %specific_fn.loc55_19.1 // CHECK:STDOUT: %var.loc55: ref %tuple.type.69f = var_storage invalid // CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.call.loc55: init %tuple.type.69f to %var.loc55 = call %bound_method.loc55_19.2(%c.ref) @@ -1286,35 +1489,35 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: // CHECK:STDOUT: !for.next.loc55: // CHECK:STDOUT: %addr.loc55: %ptr.c5c = addr_of %var.loc55 -// CHECK:STDOUT: %impl.elem3.loc55: %.6b3 = impl_witness_access constants.%Iterate.impl_witness.978, element3 [concrete = constants.%T.as_type.as.Iterate.impl.Next.231] +// CHECK:STDOUT: %impl.elem3.loc55: %.5b5 = impl_witness_access constants.%Iterate.impl_witness.1a6, element3 [concrete = constants.%T.as_type.as.Iterate.impl.Next.372] // CHECK:STDOUT: %bound_method.loc55_19.3: = bound_method %c.ref, %impl.elem3.loc55 -// CHECK:STDOUT: %facet_value.loc55_19.3: %CppRange_where.type.d682d6.1 = facet_value constants.%ConstRange, (constants.%custom_witness.6c4ec3.1, constants.%Copy.impl_witness.b51, constants.%custom_witness.23e, constants.%custom_witness.6e8, constants.%custom_witness.adb, constants.%custom_witness.746, constants.%custom_witness.941) [concrete = constants.%facet_value.b82] -// CHECK:STDOUT: %.loc55_19.3: %CppRange_where.type.d682d6.1 = converted constants.%ConstRange, %facet_value.loc55_19.3 [concrete = constants.%facet_value.b82] -// CHECK:STDOUT: %facet_value.loc55_19.4: %CppRange_where.type.d682d6.1 = facet_value constants.%ConstRange, (constants.%custom_witness.6c4ec3.1, constants.%Copy.impl_witness.b51, constants.%custom_witness.23e, constants.%custom_witness.6e8, constants.%custom_witness.adb, constants.%custom_witness.746, constants.%custom_witness.941) [concrete = constants.%facet_value.b82] -// CHECK:STDOUT: %.loc55_19.4: %CppRange_where.type.d682d6.1 = converted constants.%ConstRange, %facet_value.loc55_19.4 [concrete = constants.%facet_value.b82] -// CHECK:STDOUT: %specific_fn.loc55_19.2: = specific_function %impl.elem3.loc55, @T.as_type.as.Iterate.impl.Next(constants.%facet_value.b82) [concrete = constants.%T.as_type.as.Iterate.impl.Next.specific_fn.faf] +// CHECK:STDOUT: %facet_value.loc55_19.3: %CppRange_where.type.d682d6.1 = facet_value constants.%ConstRange, (constants.%custom_witness.f8f19d.1, constants.%Copy.impl_witness.b51, constants.%custom_witness.23e, constants.%custom_witness.0f3, constants.%custom_witness.adb, constants.%custom_witness.746, constants.%custom_witness.941) [concrete = constants.%facet_value.3e1] +// CHECK:STDOUT: %.loc55_19.3: %CppRange_where.type.d682d6.1 = converted constants.%ConstRange, %facet_value.loc55_19.3 [concrete = constants.%facet_value.3e1] +// CHECK:STDOUT: %facet_value.loc55_19.4: %CppRange_where.type.d682d6.1 = facet_value constants.%ConstRange, (constants.%custom_witness.f8f19d.1, constants.%Copy.impl_witness.b51, constants.%custom_witness.23e, constants.%custom_witness.0f3, constants.%custom_witness.adb, constants.%custom_witness.746, constants.%custom_witness.941) [concrete = constants.%facet_value.3e1] +// CHECK:STDOUT: %.loc55_19.4: %CppRange_where.type.d682d6.1 = converted constants.%ConstRange, %facet_value.loc55_19.4 [concrete = constants.%facet_value.3e1] +// CHECK:STDOUT: %specific_fn.loc55_19.2: = specific_function %impl.elem3.loc55, @T.as_type.as.Iterate.impl.Next(constants.%facet_value.3e1) [concrete = constants.%T.as_type.as.Iterate.impl.Next.specific_fn.5ef] // CHECK:STDOUT: %bound_method.loc55_19.4: = bound_method %c.ref, %specific_fn.loc55_19.2 -// CHECK:STDOUT: %.loc55_19.5: ref %Optional.6f7 = temporary_storage -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.call.loc55: init %Optional.6f7 to %.loc55_19.5 = call %bound_method.loc55_19.4(%c.ref, %addr.loc55) -// CHECK:STDOUT: %.loc55_19.6: ref %Optional.6f7 = temporary %.loc55_19.5, %T.as_type.as.Iterate.impl.Next.call.loc55 -// CHECK:STDOUT: %.loc55_19.7: %Optional.HasValue.type.818 = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.375) [concrete = constants.%Optional.HasValue.655] -// CHECK:STDOUT: %HasValue.ref.loc55: %Optional.HasValue.type.818 = name_ref HasValue, %.loc55_19.7 [concrete = constants.%Optional.HasValue.655] +// CHECK:STDOUT: %.loc55_19.5: ref %Optional.0ac = temporary_storage +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.call.loc55: init %Optional.0ac to %.loc55_19.5 = call %bound_method.loc55_19.4(%c.ref, %addr.loc55) +// CHECK:STDOUT: %.loc55_19.6: ref %Optional.0ac = temporary %.loc55_19.5, %T.as_type.as.Iterate.impl.Next.call.loc55 +// CHECK:STDOUT: %.loc55_19.7: %Optional.HasValue.type.dbd = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.6c5) [concrete = constants.%Optional.HasValue.ed9] +// CHECK:STDOUT: %HasValue.ref.loc55: %Optional.HasValue.type.dbd = name_ref HasValue, %.loc55_19.7 [concrete = constants.%Optional.HasValue.ed9] // CHECK:STDOUT: %Optional.HasValue.bound.loc55: = bound_method %.loc55_19.6, %HasValue.ref.loc55 -// CHECK:STDOUT: %Optional.HasValue.specific_fn.loc55: = specific_function %HasValue.ref.loc55, @Optional.HasValue(constants.%OptionalStorage.facet.375) [concrete = constants.%Optional.HasValue.specific_fn.551] +// CHECK:STDOUT: %Optional.HasValue.specific_fn.loc55: = specific_function %HasValue.ref.loc55, @Optional.HasValue(constants.%OptionalStorage.facet.6c5) [concrete = constants.%Optional.HasValue.specific_fn.15f] // CHECK:STDOUT: %bound_method.loc55_19.5: = bound_method %.loc55_19.6, %Optional.HasValue.specific_fn.loc55 -// CHECK:STDOUT: %.loc55_19.8: %Optional.6f7 = acquire_value %.loc55_19.6 +// CHECK:STDOUT: %.loc55_19.8: %Optional.0ac = acquire_value %.loc55_19.6 // CHECK:STDOUT: %Optional.HasValue.call.loc55: init bool = call %bound_method.loc55_19.5(%.loc55_19.8) // CHECK:STDOUT: %.loc55_19.9: bool = value_of_initializer %Optional.HasValue.call.loc55 // CHECK:STDOUT: %.loc55_19.10: bool = converted %Optional.HasValue.call.loc55, %.loc55_19.9 // CHECK:STDOUT: if %.loc55_19.10 br !for.body.loc55 else br !for.done.loc55 // CHECK:STDOUT: // CHECK:STDOUT: !for.body.loc55: -// CHECK:STDOUT: %.loc55_19.11: %Optional.Get.type.054 = specific_constant imports.%Core.import_ref.dab, @Optional(constants.%OptionalStorage.facet.375) [concrete = constants.%Optional.Get.a58] -// CHECK:STDOUT: %Get.ref.loc55: %Optional.Get.type.054 = name_ref Get, %.loc55_19.11 [concrete = constants.%Optional.Get.a58] +// CHECK:STDOUT: %.loc55_19.11: %Optional.Get.type.2b4 = specific_constant imports.%Core.import_ref.dab, @Optional(constants.%OptionalStorage.facet.6c5) [concrete = constants.%Optional.Get.529] +// CHECK:STDOUT: %Get.ref.loc55: %Optional.Get.type.2b4 = name_ref Get, %.loc55_19.11 [concrete = constants.%Optional.Get.529] // CHECK:STDOUT: %Optional.Get.bound.loc55: = bound_method %.loc55_19.6, %Get.ref.loc55 -// CHECK:STDOUT: %Optional.Get.specific_fn.loc55: = specific_function %Get.ref.loc55, @Optional.Get(constants.%OptionalStorage.facet.375) [concrete = constants.%Optional.Get.specific_fn.326] +// CHECK:STDOUT: %Optional.Get.specific_fn.loc55: = specific_function %Get.ref.loc55, @Optional.Get(constants.%OptionalStorage.facet.6c5) [concrete = constants.%Optional.Get.specific_fn.0dd] // CHECK:STDOUT: %bound_method.loc55_19.6: = bound_method %.loc55_19.6, %Optional.Get.specific_fn.loc55 -// CHECK:STDOUT: %.loc55_19.12: %Optional.6f7 = acquire_value %.loc55_19.6 +// CHECK:STDOUT: %.loc55_19.12: %Optional.0ac = acquire_value %.loc55_19.6 // CHECK:STDOUT: %Optional.Get.call.loc55: init %i32 = call %bound_method.loc55_19.6(%.loc55_19.12) // CHECK:STDOUT: %.loc55_19.13: %i32 = value_of_initializer %Optional.Get.call.loc55 // CHECK:STDOUT: %.loc55_19.14: %i32 = converted %Optional.Get.call.loc55, %.loc55_19.13 @@ -1332,15 +1535,15 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %Int.as.AddAssignWith.impl.Op.specific_fn.loc56: = specific_function %Op.ref.loc56, @Int.as.AddAssignWith.impl.Op.2(constants.%int_32, constants.%ImplicitAs.facet.e88) [concrete = constants.%Int.as.AddAssignWith.impl.Op.specific_fn.d76216.2] // CHECK:STDOUT: %bound_method.loc56_9.3: = bound_method %sum.ref.loc56, %Int.as.AddAssignWith.impl.Op.specific_fn.loc56 // CHECK:STDOUT: %Int.as.AddAssignWith.impl.Op.call.loc56: init %empty_tuple.type = call %bound_method.loc56_9.3(%sum.ref.loc56, %i.ref.loc56) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc55_19.1: = bound_method %.loc55_19.6, constants.%Destroy.WithSelf.Op.403171.8 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc55_19.1: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc55_19.1(%.loc55_19.6) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc55_19.1: = bound_method %.loc55_19.6, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.8 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc55_19.1: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc55_19.1(%.loc55_19.6) // CHECK:STDOUT: br !for.next.loc55 // CHECK:STDOUT: // CHECK:STDOUT: !for.done.loc55: -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc55_19.2: = bound_method %.loc55_19.6, constants.%Destroy.WithSelf.Op.403171.8 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc55_19.2: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc55_19.2(%.loc55_19.6) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc55_19.3: = bound_method %var.loc55, constants.%Destroy.WithSelf.Op.403171.10 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc55_19.3: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc55_19.3(%var.loc55) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc55_19.2: = bound_method %.loc55_19.6, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.8 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc55_19.2: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc55_19.2(%.loc55_19.6) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc55_19.3: = bound_method %var.loc55, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.12 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc55_19.3: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc55_19.3(%var.loc55) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1348,14 +1551,14 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %R.patt.loc30_17.2 => constants.%R.patt // CHECK:STDOUT: %R.loc30_17.1 => constants.%R // CHECK:STDOUT: %R.as_type.loc30_61.1 => constants.%R.as_type -// CHECK:STDOUT: %pattern_type => constants.%pattern_type.007 -// CHECK:STDOUT: %r.param_patt.loc30_59.2 => constants.%r.param_patt.737 -// CHECK:STDOUT: %r.patt.loc30_59.2 => constants.%r.patt.06b +// CHECK:STDOUT: %pattern_type => constants.%pattern_type.6f9 +// CHECK:STDOUT: %r.param_patt.loc30_59.2 => constants.%r.param_patt.170 +// CHECK:STDOUT: %r.patt.loc30_59.2 => constants.%r.patt.893 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @TestIterate(constants.%facet_value.5eb) { +// CHECK:STDOUT: specific @TestIterate(constants.%facet_value.26c) { // CHECK:STDOUT: %R.patt.loc30_17.2 => constants.%R.patt -// CHECK:STDOUT: %R.loc30_17.1 => constants.%facet_value.5eb +// CHECK:STDOUT: %R.loc30_17.1 => constants.%facet_value.26c // CHECK:STDOUT: %R.as_type.loc30_61.1 => constants.%MutableRange // CHECK:STDOUT: %pattern_type => constants.%pattern_type.e635 // CHECK:STDOUT: %r.param_patt.loc30_59.2 => constants.%r.param_patt.c79 @@ -1363,30 +1566,30 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc30 => constants.%complete_type.357 -// CHECK:STDOUT: %Iterate.lookup_impl_witness => constants.%Iterate.impl_witness.589 -// CHECK:STDOUT: %Iterate.facet.loc34_19.5 => constants.%Iterate.facet.9b1 -// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type => constants.%Iterate.WithSelf.NewCursor.type.6ac -// CHECK:STDOUT: %.loc34_19.19 => constants.%.03d -// CHECK:STDOUT: %impl.elem2.loc34_19.2 => constants.%T.as_type.as.Iterate.impl.NewCursor.e2d -// CHECK:STDOUT: %specific_impl_fn.loc34_19.4 => constants.%T.as_type.as.Iterate.impl.NewCursor.specific_fn.a90 -// CHECK:STDOUT: %impl.elem1 => constants.%Destroy.facet.45a +// CHECK:STDOUT: %Iterate.lookup_impl_witness => constants.%Iterate.impl_witness.2bb +// CHECK:STDOUT: %Iterate.facet.loc34_19.5 => constants.%Iterate.facet.854 +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type => constants.%Iterate.WithSelf.NewCursor.type.4e8 +// CHECK:STDOUT: %.loc34_19.19 => constants.%.cad +// CHECK:STDOUT: %impl.elem2.loc34_19.3 => constants.%T.as_type.as.Iterate.impl.NewCursor.e00 +// CHECK:STDOUT: %specific_impl_fn.loc34_19.4 => constants.%T.as_type.as.Iterate.impl.NewCursor.specific_fn.ac2 +// CHECK:STDOUT: %impl.elem1 => constants.%Destroy.facet.0fe // CHECK:STDOUT: %as_type => constants.%tuple.type.508 // CHECK:STDOUT: %require_complete.1 => constants.%complete_type.c28 // CHECK:STDOUT: %ptr => constants.%ptr.45c -// CHECK:STDOUT: %Iterate.WithSelf.Next.type => constants.%Iterate.WithSelf.Next.type.5b5 -// CHECK:STDOUT: %.loc34_19.20 => constants.%.cd1 -// CHECK:STDOUT: %impl.elem3.loc34_19.2 => constants.%T.as_type.as.Iterate.impl.Next.fd1 -// CHECK:STDOUT: %specific_impl_fn.loc34_19.5 => constants.%T.as_type.as.Iterate.impl.Next.specific_fn.e2f -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.4bb -// CHECK:STDOUT: %.loc34_19.21 => constants.%.7a2 -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.6c4ec3.9 -// CHECK:STDOUT: %impl.elem0.loc34_19.2 => constants.%Destroy.WithSelf.Op.403171.9 -// CHECK:STDOUT: %specific_impl_fn.loc34_19.6 => constants.%Destroy.WithSelf.Op.403171.9 +// CHECK:STDOUT: %Iterate.WithSelf.Next.type => constants.%Iterate.WithSelf.Next.type.713 +// CHECK:STDOUT: %.loc34_19.20 => constants.%.640 +// CHECK:STDOUT: %impl.elem3.loc34_19.2 => constants.%T.as_type.as.Iterate.impl.Next.311 +// CHECK:STDOUT: %specific_impl_fn.loc34_19.5 => constants.%T.as_type.as.Iterate.impl.Next.specific_fn.b01 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.471 +// CHECK:STDOUT: %.loc34_19.21 => constants.%.463 +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.f8f19d.9 +// CHECK:STDOUT: %impl.elem2.loc34_19.4 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.10 +// CHECK:STDOUT: %specific_impl_fn.loc34_19.6 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.10 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @TestIterate(constants.%facet_value.cd8) { +// CHECK:STDOUT: specific @TestIterate(constants.%facet_value.75e) { // CHECK:STDOUT: %R.patt.loc30_17.2 => constants.%R.patt -// CHECK:STDOUT: %R.loc30_17.1 => constants.%facet_value.cd8 +// CHECK:STDOUT: %R.loc30_17.1 => constants.%facet_value.75e // CHECK:STDOUT: %R.as_type.loc30_61.1 => constants.%ConstRange // CHECK:STDOUT: %pattern_type => constants.%pattern_type.0ba // CHECK:STDOUT: %r.param_patt.loc30_59.2 => constants.%r.param_patt.83e @@ -1394,25 +1597,25 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc30 => constants.%complete_type.357 -// CHECK:STDOUT: %Iterate.lookup_impl_witness => constants.%Iterate.impl_witness.978 -// CHECK:STDOUT: %Iterate.facet.loc34_19.5 => constants.%Iterate.facet.6bf -// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type => constants.%Iterate.WithSelf.NewCursor.type.147 -// CHECK:STDOUT: %.loc34_19.19 => constants.%.e7e -// CHECK:STDOUT: %impl.elem2.loc34_19.2 => constants.%T.as_type.as.Iterate.impl.NewCursor.f99 -// CHECK:STDOUT: %specific_impl_fn.loc34_19.4 => constants.%T.as_type.as.Iterate.impl.NewCursor.specific_fn.574 -// CHECK:STDOUT: %impl.elem1 => constants.%Destroy.facet.e08 +// CHECK:STDOUT: %Iterate.lookup_impl_witness => constants.%Iterate.impl_witness.1a6 +// CHECK:STDOUT: %Iterate.facet.loc34_19.5 => constants.%Iterate.facet.7d1 +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type => constants.%Iterate.WithSelf.NewCursor.type.488 +// CHECK:STDOUT: %.loc34_19.19 => constants.%.312 +// CHECK:STDOUT: %impl.elem2.loc34_19.3 => constants.%T.as_type.as.Iterate.impl.NewCursor.19e +// CHECK:STDOUT: %specific_impl_fn.loc34_19.4 => constants.%T.as_type.as.Iterate.impl.NewCursor.specific_fn.91a +// CHECK:STDOUT: %impl.elem1 => constants.%Destroy.facet.c6d // CHECK:STDOUT: %as_type => constants.%tuple.type.69f // CHECK:STDOUT: %require_complete.1 => constants.%complete_type.8d5 // CHECK:STDOUT: %ptr => constants.%ptr.c5c -// CHECK:STDOUT: %Iterate.WithSelf.Next.type => constants.%Iterate.WithSelf.Next.type.e99 -// CHECK:STDOUT: %.loc34_19.20 => constants.%.6b3 -// CHECK:STDOUT: %impl.elem3.loc34_19.2 => constants.%T.as_type.as.Iterate.impl.Next.231 -// CHECK:STDOUT: %specific_impl_fn.loc34_19.5 => constants.%T.as_type.as.Iterate.impl.Next.specific_fn.faf -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.f64 -// CHECK:STDOUT: %.loc34_19.21 => constants.%.dc2 -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.6c4ec3.10 -// CHECK:STDOUT: %impl.elem0.loc34_19.2 => constants.%Destroy.WithSelf.Op.403171.10 -// CHECK:STDOUT: %specific_impl_fn.loc34_19.6 => constants.%Destroy.WithSelf.Op.403171.10 +// CHECK:STDOUT: %Iterate.WithSelf.Next.type => constants.%Iterate.WithSelf.Next.type.aee +// CHECK:STDOUT: %.loc34_19.20 => constants.%.5b5 +// CHECK:STDOUT: %impl.elem3.loc34_19.2 => constants.%T.as_type.as.Iterate.impl.Next.372 +// CHECK:STDOUT: %specific_impl_fn.loc34_19.5 => constants.%T.as_type.as.Iterate.impl.Next.specific_fn.5ef +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.c53 +// CHECK:STDOUT: %.loc34_19.21 => constants.%.331 +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.f8f19d.10 +// CHECK:STDOUT: %impl.elem2.loc34_19.4 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.12 +// CHECK:STDOUT: %specific_impl_fn.loc34_19.6 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.12 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- methods_return_different_types.carbon @@ -1421,6 +1624,7 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: type: type = facet_type [concrete] // CHECK:STDOUT: %Iterate.type: type = facet_type <@Iterate> [concrete] // CHECK:STDOUT: %OptionalStorage.type: type = facet_type <@OptionalStorage> [concrete] +// CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %facet_type.f48: type = facet_type <@Destroy & @Copy> [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] @@ -1467,65 +1671,108 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %pattern_type.149: type = pattern_type %DiffValueType [concrete] -// CHECK:STDOUT: %DiffValueType.cpp_destructor.type: type = fn_type @DiffValueType.cpp_destructor [concrete] -// CHECK:STDOUT: %DiffValueType.cpp_destructor: %DiffValueType.cpp_destructor.type = struct_value () [concrete] -// CHECK:STDOUT: %DiffValueType.Op.type.83af6e.1: type = fn_type @DiffValueType.Op.1 [concrete] -// CHECK:STDOUT: %DiffValueType.Op.4dca31.1: %DiffValueType.Op.type.83af6e.1 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.e7a31c.1: = custom_witness (%DiffValueType.Op.4dca31.1), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc40_56 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc40_56 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %DiffValueType.SubobjectDestroy.type: type = fn_type @DiffValueType.SubobjectDestroy [concrete] +// CHECK:STDOUT: %DiffValueType.SubobjectDestroy: %DiffValueType.SubobjectDestroy.type = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.1bfa2a.1: = custom_witness (%Destroy.WithSelf.Op.403171.2, %DiffValueType.SubobjectDestroy, %Destroy.WithSelf.SelfDestruct.db3fdb.2), @Destroy [concrete] // CHECK:STDOUT: %const.879: type = const_type %DiffValueType [concrete] // CHECK:STDOUT: %ptr.816: type = ptr_type %const.879 [concrete] // CHECK:STDOUT: %ptr.cd0: type = ptr_type %DiffValueType [concrete] -// CHECK:STDOUT: %DiffValueType.Op.type.83af6e.2: type = fn_type @DiffValueType.Op.2 [concrete] -// CHECK:STDOUT: %DiffValueType.Op.4dca31.2: %DiffValueType.Op.type.83af6e.2 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.d0da43.1: = custom_witness (%DiffValueType.Op.4dca31.2), @Copy [concrete] -// CHECK:STDOUT: %facet_value.824: %facet_type.f48 = facet_value %DiffValueType, (%custom_witness.e7a31c.1, %custom_witness.d0da43.1) [concrete] +// CHECK:STDOUT: %DiffValueType.Op.type: type = fn_type @DiffValueType.Op [concrete] +// CHECK:STDOUT: %DiffValueType.Op: %DiffValueType.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.d0da43.1: = custom_witness (%DiffValueType.Op), @Copy [concrete] +// CHECK:STDOUT: %facet_value.cca: %facet_type.f48 = facet_value %DiffValueType, (%custom_witness.1bfa2a.1, %custom_witness.d0da43.1) [concrete] // CHECK:STDOUT: %Iterate.lookup_impl_witness.1d8: = lookup_impl_witness %.Self.500, @Iterate [symbolic_self] // CHECK:STDOUT: %impl.elem0.294: %facet_type.f48 = impl_witness_access %Iterate.lookup_impl_witness.1d8, element0 [symbolic_self] -// CHECK:STDOUT: %Iterate_where.type.3fe: type = facet_type <@Iterate where %impl.elem0.294 = %facet_value.824> [concrete] -// CHECK:STDOUT: %pattern_type.d93: type = pattern_type %Iterate_where.type.3fe [concrete] -// CHECK:STDOUT: %R.patt: %pattern_type.d93 = symbolic_binding_pattern R, 0 [symbolic] -// CHECK:STDOUT: %R: %Iterate_where.type.3fe = symbolic_binding R, 0 [symbolic] +// CHECK:STDOUT: %Iterate_where.type.b96: type = facet_type <@Iterate where %impl.elem0.294 = %facet_value.cca> [concrete] +// CHECK:STDOUT: %pattern_type.975: type = pattern_type %Iterate_where.type.b96 [concrete] +// CHECK:STDOUT: %R.patt: %pattern_type.975 = symbolic_binding_pattern R, 0 [symbolic] +// CHECK:STDOUT: %R: %Iterate_where.type.b96 = symbolic_binding R, 0 [symbolic] // CHECK:STDOUT: %R.as_type: type = facet_access_type %R [symbolic] -// CHECK:STDOUT: %pattern_type.20b: type = pattern_type %R.as_type [symbolic] -// CHECK:STDOUT: %r.patt.9f3: %pattern_type.20b = ref_binding_pattern r [symbolic] -// CHECK:STDOUT: %r.param_patt.b12: %pattern_type.20b = var_param_pattern %r.patt.9f3 [symbolic] +// CHECK:STDOUT: %pattern_type.dc2: type = pattern_type %R.as_type [symbolic] +// CHECK:STDOUT: %r.patt.917: %pattern_type.dc2 = ref_binding_pattern r [symbolic] +// CHECK:STDOUT: %r.param_patt.9a1: %pattern_type.dc2 = var_param_pattern %r.patt.917 [symbolic] // CHECK:STDOUT: %i.patt: %pattern_type.149 = value_binding_pattern i [concrete] -// CHECK:STDOUT: %Iterate.lookup_impl_witness.b8b: = lookup_impl_witness %R, @Iterate [symbolic] -// CHECK:STDOUT: %Iterate.facet.6ec: %Iterate.type = facet_value %R.as_type, (%Iterate.lookup_impl_witness.b8b) [symbolic] -// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.309: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.6ec) [symbolic] -// CHECK:STDOUT: %Iterate.WithSelf.Next.type.75a: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.6ec) [symbolic] -// CHECK:STDOUT: %.799: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.309, %Iterate.facet.6ec [symbolic] -// CHECK:STDOUT: %impl.elem2.114: %.799 = impl_witness_access %Iterate.lookup_impl_witness.b8b, element2 [symbolic] -// CHECK:STDOUT: %impl.elem1.697: %Destroy.type = impl_witness_access %Iterate.lookup_impl_witness.b8b, element1 [symbolic] -// CHECK:STDOUT: %as_type.59f: type = facet_access_type %impl.elem1.697 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.c74: = specific_impl_function %impl.elem2.114, @Iterate.WithSelf.NewCursor(%Iterate.facet.6ec) [symbolic] -// CHECK:STDOUT: %ptr.38a: type = ptr_type %as_type.59f [symbolic] -// CHECK:STDOUT: %.f06: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.75a, %Iterate.facet.6ec [symbolic] -// CHECK:STDOUT: %impl.elem3.463: %.f06 = impl_witness_access %Iterate.lookup_impl_witness.b8b, element3 [symbolic] -// CHECK:STDOUT: %DefaultOptionalStorage.5e4: type = class_type @DefaultOptionalStorage, @DefaultOptionalStorage(%facet_value.824) [concrete] -// CHECK:STDOUT: %OptionalStorage.impl_witness.313: = impl_witness imports.%OptionalStorage.impl_witness_table.460, @T.as_type.as.OptionalStorage.impl(%facet_value.824) [concrete] -// CHECK:STDOUT: %OptionalStorage.facet.c3f: %OptionalStorage.type = facet_value %DiffValueType, (%OptionalStorage.impl_witness.313) [concrete] -// CHECK:STDOUT: %Optional.15a: type = class_type @Optional, @Optional(%OptionalStorage.facet.c3f) [concrete] -// CHECK:STDOUT: %specific_impl_fn.dcf: = specific_impl_function %impl.elem3.463, @Iterate.WithSelf.Next(%Iterate.facet.6ec) [symbolic] -// CHECK:STDOUT: %Optional.HasValue.type.6f3: type = fn_type @Optional.HasValue, @Optional(%OptionalStorage.facet.c3f) [concrete] -// CHECK:STDOUT: %Optional.HasValue.038: %Optional.HasValue.type.6f3 = struct_value () [concrete] -// CHECK:STDOUT: %Optional.Get.type.d3e: type = fn_type @Optional.Get, @Optional(%OptionalStorage.facet.c3f) [concrete] -// CHECK:STDOUT: %Optional.Get.57f: %Optional.Get.type.d3e = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.facet.82e: %Destroy.type = facet_value %DiffValueType, (%custom_witness.e7a31c.1) [concrete] -// CHECK:STDOUT: %MaybeUnformed.923: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.82e) [concrete] +// CHECK:STDOUT: %Iterate.lookup_impl_witness.d00: = lookup_impl_witness %R, @Iterate [symbolic] +// CHECK:STDOUT: %Iterate.facet.f03: %Iterate.type = facet_value %R.as_type, (%Iterate.lookup_impl_witness.d00) [symbolic] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.de8: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.f03) [symbolic] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type.e6f: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.f03) [symbolic] +// CHECK:STDOUT: %.c20: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.de8, %Iterate.facet.f03 [symbolic] +// CHECK:STDOUT: %impl.elem2.7d0: %.c20 = impl_witness_access %Iterate.lookup_impl_witness.d00, element2 [symbolic] +// CHECK:STDOUT: %impl.elem1.fbc: %Destroy.type = impl_witness_access %Iterate.lookup_impl_witness.d00, element1 [symbolic] +// CHECK:STDOUT: %as_type.389: type = facet_access_type %impl.elem1.fbc [symbolic] +// CHECK:STDOUT: %specific_impl_fn.1c3: = specific_impl_function %impl.elem2.7d0, @Iterate.WithSelf.NewCursor(%Iterate.facet.f03) [symbolic] +// CHECK:STDOUT: %ptr.02d: type = ptr_type %as_type.389 [symbolic] +// CHECK:STDOUT: %.89f: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.e6f, %Iterate.facet.f03 [symbolic] +// CHECK:STDOUT: %impl.elem3.73e: %.89f = impl_witness_access %Iterate.lookup_impl_witness.d00, element3 [symbolic] +// CHECK:STDOUT: %DefaultOptionalStorage.9a0: type = class_type @DefaultOptionalStorage, @DefaultOptionalStorage(%facet_value.cca) [concrete] +// CHECK:STDOUT: %OptionalStorage.impl_witness.e8d: = impl_witness imports.%OptionalStorage.impl_witness_table.460, @T.as_type.as.OptionalStorage.impl(%facet_value.cca) [concrete] +// CHECK:STDOUT: %OptionalStorage.facet.beb: %OptionalStorage.type = facet_value %DiffValueType, (%OptionalStorage.impl_witness.e8d) [concrete] +// CHECK:STDOUT: %Optional.d06: type = class_type @Optional, @Optional(%OptionalStorage.facet.beb) [concrete] +// CHECK:STDOUT: %pattern_type.196: type = pattern_type %Optional.d06 [concrete] +// CHECK:STDOUT: %specific_impl_fn.73e: = specific_impl_function %impl.elem3.73e, @Iterate.WithSelf.Next(%Iterate.facet.f03) [symbolic] +// CHECK:STDOUT: %Optional.HasValue.type.821: type = fn_type @Optional.HasValue, @Optional(%OptionalStorage.facet.beb) [concrete] +// CHECK:STDOUT: %Optional.HasValue.960: %Optional.HasValue.type.821 = struct_value () [concrete] +// CHECK:STDOUT: %Optional.Get.type.f9c: type = fn_type @Optional.Get, @Optional(%OptionalStorage.facet.beb) [concrete] +// CHECK:STDOUT: %Optional.Get.294: %Optional.Get.type.f9c = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.facet.be4: %Destroy.type = facet_value %DiffValueType, (%custom_witness.1bfa2a.1) [concrete] +// CHECK:STDOUT: %MaybeUnformed.632: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.be4) [concrete] // CHECK:STDOUT: %.a18: type = maybe_unformed_type %DiffValueType [concrete] -// CHECK:STDOUT: %struct_type.value.has_value.3cf: type = struct_type {.value: %MaybeUnformed.923, .has_value: bool} [concrete] -// CHECK:STDOUT: %Optional.HasValue.specific_fn.bc4: = specific_function %Optional.HasValue.038, @Optional.HasValue(%OptionalStorage.facet.c3f) [concrete] -// CHECK:STDOUT: %Optional.Get.specific_fn.c49: = specific_function %Optional.Get.57f, @Optional.Get(%OptionalStorage.facet.c3f) [concrete] +// CHECK:STDOUT: %struct_type.value.has_value.851: type = struct_type {.value: %MaybeUnformed.632, .has_value: bool} [concrete] +// CHECK:STDOUT: %Optional.HasValue.specific_fn.a20: = specific_function %Optional.HasValue.960, @Optional.HasValue(%OptionalStorage.facet.beb) [concrete] +// CHECK:STDOUT: %Optional.Get.specific_fn.084: = specific_function %Optional.Get.294, @Optional.Get(%OptionalStorage.facet.beb) [concrete] // CHECK:STDOUT: %operator_PlusEqual__carbon_thunk.type: type = fn_type @operator_PlusEqual__carbon_thunk [concrete] // CHECK:STDOUT: %operator_PlusEqual__carbon_thunk: %operator_PlusEqual__carbon_thunk.type = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.7: type = fn_type @Destroy.WithSelf.Op.loc44_33.6 [concrete] +// CHECK:STDOUT: %pattern_type.98c: type = pattern_type %.a18 [concrete] +// CHECK:STDOUT: %self.param_patt.47c: %pattern_type.98c = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.90b: %pattern_type.98c = wrapper_binding_pattern self, %self.param_patt.47c [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc44_33.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc44_33.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.ea0: type = pattern_type %MaybeUnformed.632 [concrete] +// CHECK:STDOUT: %self.param_patt.4d6: %pattern_type.ea0 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.5e0: %pattern_type.ea0 = wrapper_binding_pattern self, %self.param_patt.4d6 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc44_33.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc44_33.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.40d: %pattern_type.831 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.560: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt.40d [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc44_33.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.5: type = fn_type @Destroy.WithSelf.Op.loc44_33.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.5: %Destroy.WithSelf.Op.type.ef016f.5 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.f90: type = pattern_type %struct_type.value.has_value.851 [concrete] +// CHECK:STDOUT: %self.param_patt.067: %pattern_type.f90 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.fc6: %pattern_type.f90 = wrapper_binding_pattern self, %self.param_patt.067 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc44_33.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.6: type = fn_type @Destroy.WithSelf.Op.loc44_33.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.6: %Destroy.WithSelf.Op.type.ef016f.6 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.fe2: type = pattern_type %DefaultOptionalStorage.9a0 [concrete] +// CHECK:STDOUT: %self.param_patt.566: %pattern_type.fe2 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.691: %pattern_type.fe2 = wrapper_binding_pattern self, %self.param_patt.566 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc44_33.5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.7: type = fn_type @Destroy.WithSelf.Op.loc44_33.5 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.7: %Destroy.WithSelf.Op.type.ef016f.7 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.lookup_impl_witness.38d: = lookup_impl_witness %impl.elem1.697, @Destroy [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.dbc: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%impl.elem1.697) [symbolic] -// CHECK:STDOUT: %.763: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.dbc, %impl.elem1.697 [symbolic] -// CHECK:STDOUT: %impl.elem0.891: %.763 = impl_witness_access %Destroy.lookup_impl_witness.38d, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.b52: = specific_impl_function %impl.elem0.891, @Destroy.WithSelf.Op.1(%impl.elem1.697) [symbolic] +// CHECK:STDOUT: %self.param_patt.be1: %pattern_type.196 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.763: %pattern_type.196 = wrapper_binding_pattern self, %self.param_patt.be1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc44_33.6 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.7: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.8: type = fn_type @Destroy.WithSelf.Op.loc44_33.6 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.8: %Destroy.WithSelf.Op.type.ef016f.8 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.8: type = fn_type @Destroy.WithSelf.SelfDestruct.loc44_33.6 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.8: %Destroy.WithSelf.SelfDestruct.type.fbceb5.8 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.lookup_impl_witness.662: = lookup_impl_witness %impl.elem1.fbc, @Destroy [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.51e: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%impl.elem1.fbc) [symbolic] +// CHECK:STDOUT: %.6f9: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.51e, %impl.elem1.fbc [symbolic] +// CHECK:STDOUT: %impl.elem2.a34: %.6f9 = impl_witness_access %Destroy.lookup_impl_witness.662, element2 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.f40: = specific_impl_function %impl.elem2.a34, @Destroy.WithSelf.SelfDestruct.1(%impl.elem1.fbc) [symbolic] // CHECK:STDOUT: %DiffMutableRange: type = class_type @DiffMutableRange [concrete] // CHECK:STDOUT: %pattern_type.611: type = pattern_type %DiffMutableRange [concrete] // CHECK:STDOUT: %DiffConstRange: type = class_type @DiffConstRange [concrete] @@ -1540,33 +1787,45 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %Iterator.Op.type.41bbea.1: type = fn_type @Iterator.Op.1 [concrete] // CHECK:STDOUT: %Iterator.Op.1caa36.1: %Iterator.Op.type.41bbea.1 = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.392: = custom_witness (%DiffValueType, %Iterator.Op.1caa36.1), @CppUnsafeDeref [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.9: type = fn_type @Destroy.WithSelf.Op.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.9: %Destroy.WithSelf.Op.type.ef016f.9 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.9: type = fn_type @Destroy.WithSelf.SelfDestruct.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.9: %Destroy.WithSelf.SelfDestruct.type.fbceb5.9 = struct_value () [concrete] +// CHECK:STDOUT: %Iterator.SubobjectDestroy.type.45a: type = fn_type @Iterator.SubobjectDestroy.1 [concrete] +// CHECK:STDOUT: %Iterator.SubobjectDestroy.d6a: %Iterator.SubobjectDestroy.type.45a = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.db9baa.1: = custom_witness (%Destroy.WithSelf.Op.403171.9, %Iterator.SubobjectDestroy.d6a, %Destroy.WithSelf.SelfDestruct.db3fdb.9), @Destroy [concrete] // CHECK:STDOUT: %Iterator.Op.type.41bbea.2: type = fn_type @Iterator.Op.2 [concrete] // CHECK:STDOUT: %Iterator.Op.1caa36.2: %Iterator.Op.type.41bbea.2 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.9bb15e.1: = custom_witness (%Iterator.Op.1caa36.2), @Destroy [concrete] -// CHECK:STDOUT: %Iterator.Op.type.41bbea.3: type = fn_type @Iterator.Op.3 [concrete] -// CHECK:STDOUT: %Iterator.Op.1caa36.3: %Iterator.Op.type.41bbea.3 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.1c9: = custom_witness (%Iterator.Op.1caa36.3), @Inc [concrete] +// CHECK:STDOUT: %custom_witness.1c9: = custom_witness (%Iterator.Op.1caa36.2), @Inc [concrete] // CHECK:STDOUT: %Equal.type.ca8475.1: type = fn_type @Equal.1 [concrete] // CHECK:STDOUT: %Equal.285b15.1: %Equal.type.ca8475.1 = struct_value () [concrete] // CHECK:STDOUT: %NotEqual.type.53d9ee.1: type = fn_type @NotEqual.1 [concrete] // CHECK:STDOUT: %NotEqual.119263.1: %NotEqual.type.53d9ee.1 = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.723: = custom_witness (%Equal.285b15.1, %NotEqual.119263.1), @EqWith, @EqWith(%Sentinel.b4c) [concrete] -// CHECK:STDOUT: %Sentinel.Op.type.41b: type = fn_type @Sentinel.Op.1 [concrete] -// CHECK:STDOUT: %Sentinel.Op.1ca: %Sentinel.Op.type.41b = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.9bb15e.2: = custom_witness (%Sentinel.Op.1ca), @Destroy [concrete] -// CHECK:STDOUT: %facet_value.0a7: %CppRange_where.type.d682d6.1 = facet_value %DiffMutableRange, (%custom_witness.e7a31c.1, %custom_witness.d0da43.1, %custom_witness.aa8, %custom_witness.9bb15e.1, %custom_witness.392, %custom_witness.1c9, %custom_witness.723, %custom_witness.9bb15e.2) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.10: type = fn_type @Destroy.WithSelf.Op.loc51 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.10: %Destroy.WithSelf.Op.type.ef016f.10 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.10: type = fn_type @Destroy.WithSelf.SelfDestruct.loc51 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.10: %Destroy.WithSelf.SelfDestruct.type.fbceb5.10 = struct_value () [concrete] +// CHECK:STDOUT: %Sentinel.SubobjectDestroy.type.45a: type = fn_type @Sentinel.SubobjectDestroy.1 [concrete] +// CHECK:STDOUT: %Sentinel.SubobjectDestroy.d6a: %Sentinel.SubobjectDestroy.type.45a = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.db9baa.2: = custom_witness (%Destroy.WithSelf.Op.403171.10, %Sentinel.SubobjectDestroy.d6a, %Destroy.WithSelf.SelfDestruct.db3fdb.10), @Destroy [concrete] +// CHECK:STDOUT: %facet_value.39a: %CppRange_where.type.d682d6.1 = facet_value %DiffMutableRange, (%custom_witness.1bfa2a.1, %custom_witness.d0da43.1, %custom_witness.aa8, %custom_witness.db9baa.1, %custom_witness.392, %custom_witness.1c9, %custom_witness.723, %custom_witness.db9baa.2) [concrete] // CHECK:STDOUT: %tuple.type.b18: type = tuple_type (%Iterator.f25, %Sentinel.b4c) [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.8: type = fn_type @Destroy.WithSelf.Op.3 [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.8: %Destroy.WithSelf.Op.type.ef016f.8 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.6c4ec3.8: = custom_witness (%Destroy.WithSelf.Op.403171.8), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.ef9: %Destroy.type = facet_value %tuple.type.b18, (%custom_witness.6c4ec3.8) [concrete] -// CHECK:STDOUT: %Iterate.impl_witness.747: = impl_witness imports.%Iterate.impl_witness_table.121, @T.as_type.as.Iterate.impl(%facet_value.0a7) [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.type.096: type = fn_type @T.as_type.as.Iterate.impl.NewCursor, @T.as_type.as.Iterate.impl(%facet_value.0a7) [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.136: %T.as_type.as.Iterate.impl.NewCursor.type.096 = struct_value () [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.type.185: type = fn_type @T.as_type.as.Iterate.impl.Next, @T.as_type.as.Iterate.impl(%facet_value.0a7) [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.31b: %T.as_type.as.Iterate.impl.Next.type.185 = struct_value () [concrete] -// CHECK:STDOUT: %Iterate.facet.68a: %Iterate.type = facet_value %DiffMutableRange, (%Iterate.impl_witness.747) [concrete] -// CHECK:STDOUT: %facet_value.753: %Iterate_where.type.3fe = facet_value %DiffMutableRange, (%Iterate.impl_witness.747) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.8: type = fn_type @Destroy.WithSelf.SubobjectDestroy.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.8: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.8 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.11: type = fn_type @Destroy.WithSelf.Op.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.11: %Destroy.WithSelf.Op.type.ef016f.11 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.11: type = fn_type @Destroy.WithSelf.SelfDestruct.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.11: %Destroy.WithSelf.SelfDestruct.type.fbceb5.11 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f8f19d.8: = custom_witness (%Destroy.WithSelf.Op.403171.11, %Destroy.WithSelf.SubobjectDestroy.d01daf.8, %Destroy.WithSelf.SelfDestruct.db3fdb.11), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.645: %Destroy.type = facet_value %tuple.type.b18, (%custom_witness.f8f19d.8) [concrete] +// CHECK:STDOUT: %Iterate.impl_witness.dbb: = impl_witness imports.%Iterate.impl_witness_table.121, @T.as_type.as.Iterate.impl(%facet_value.39a) [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.type.0c6: type = fn_type @T.as_type.as.Iterate.impl.NewCursor, @T.as_type.as.Iterate.impl(%facet_value.39a) [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.755: %T.as_type.as.Iterate.impl.NewCursor.type.0c6 = struct_value () [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.type.f5a: type = fn_type @T.as_type.as.Iterate.impl.Next, @T.as_type.as.Iterate.impl(%facet_value.39a) [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.8e7: %T.as_type.as.Iterate.impl.Next.type.f5a = struct_value () [concrete] +// CHECK:STDOUT: %Iterate.facet.9e0: %Iterate.type = facet_value %DiffMutableRange, (%Iterate.impl_witness.dbb) [concrete] +// CHECK:STDOUT: %facet_value.70f: %Iterate_where.type.b96 = facet_value %DiffMutableRange, (%Iterate.impl_witness.dbb) [concrete] // CHECK:STDOUT: %r.patt.5fe: %pattern_type.611 = ref_binding_pattern r [concrete] // CHECK:STDOUT: %r.param_patt.a4b: %pattern_type.611 = var_param_pattern %r.patt.5fe [concrete] // CHECK:STDOUT: %Iterator.a59: type = class_type @Iterator.2 [concrete] @@ -1576,56 +1835,68 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %DiffConstRange.End.type: type = fn_type @DiffConstRange.End [concrete] // CHECK:STDOUT: %DiffConstRange.End: %DiffConstRange.End.type = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.7b4: = custom_witness (%Iterator.a59, %Sentinel.b33, %DiffConstRange.Begin, %DiffConstRange.End), @CppRangeForIterate [concrete] -// CHECK:STDOUT: %Iterator.Op.type.b7ae80.1: type = fn_type @Iterator.Op.4 [concrete] +// CHECK:STDOUT: %Iterator.Op.type.b7ae80.1: type = fn_type @Iterator.Op.3 [concrete] // CHECK:STDOUT: %Iterator.Op.690fee.1: %Iterator.Op.type.b7ae80.1 = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.0c0: = custom_witness (%DiffValueType, %Iterator.Op.690fee.1), @CppUnsafeDeref [concrete] -// CHECK:STDOUT: %Iterator.Op.type.b7ae80.2: type = fn_type @Iterator.Op.5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.13: type = fn_type @Destroy.WithSelf.Op.5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.13: %Destroy.WithSelf.Op.type.ef016f.13 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.13: type = fn_type @Destroy.WithSelf.SelfDestruct.5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.13: %Destroy.WithSelf.SelfDestruct.type.fbceb5.13 = struct_value () [concrete] +// CHECK:STDOUT: %Iterator.SubobjectDestroy.type.e2b: type = fn_type @Iterator.SubobjectDestroy.2 [concrete] +// CHECK:STDOUT: %Iterator.SubobjectDestroy.21a: %Iterator.SubobjectDestroy.type.e2b = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.48b6e9.1: = custom_witness (%Destroy.WithSelf.Op.403171.13, %Iterator.SubobjectDestroy.21a, %Destroy.WithSelf.SelfDestruct.db3fdb.13), @Destroy [concrete] +// CHECK:STDOUT: %Iterator.Op.type.b7ae80.2: type = fn_type @Iterator.Op.4 [concrete] // CHECK:STDOUT: %Iterator.Op.690fee.2: %Iterator.Op.type.b7ae80.2 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.f7d4ff.1: = custom_witness (%Iterator.Op.690fee.2), @Destroy [concrete] -// CHECK:STDOUT: %Iterator.Op.type.b7ae80.3: type = fn_type @Iterator.Op.6 [concrete] -// CHECK:STDOUT: %Iterator.Op.690fee.3: %Iterator.Op.type.b7ae80.3 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.ffb: = custom_witness (%Iterator.Op.690fee.3), @Inc [concrete] +// CHECK:STDOUT: %custom_witness.ffb: = custom_witness (%Iterator.Op.690fee.2), @Inc [concrete] // CHECK:STDOUT: %Equal.type.ca8475.2: type = fn_type @Equal.2 [concrete] // CHECK:STDOUT: %Equal.285b15.2: %Equal.type.ca8475.2 = struct_value () [concrete] // CHECK:STDOUT: %NotEqual.type.53d9ee.2: type = fn_type @NotEqual.2 [concrete] // CHECK:STDOUT: %NotEqual.119263.2: %NotEqual.type.53d9ee.2 = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.a26: = custom_witness (%Equal.285b15.2, %NotEqual.119263.2), @EqWith, @EqWith(%Sentinel.b33) [concrete] -// CHECK:STDOUT: %Sentinel.Op.type.b7a: type = fn_type @Sentinel.Op.2 [concrete] -// CHECK:STDOUT: %Sentinel.Op.690: %Sentinel.Op.type.b7a = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.f7d4ff.2: = custom_witness (%Sentinel.Op.690), @Destroy [concrete] -// CHECK:STDOUT: %facet_value.733: %CppRange_where.type.d682d6.1 = facet_value %DiffConstRange, (%custom_witness.e7a31c.1, %custom_witness.d0da43.1, %custom_witness.7b4, %custom_witness.f7d4ff.1, %custom_witness.0c0, %custom_witness.ffb, %custom_witness.a26, %custom_witness.f7d4ff.2) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.14: type = fn_type @Destroy.WithSelf.Op.loc52 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.14: %Destroy.WithSelf.Op.type.ef016f.14 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.14: type = fn_type @Destroy.WithSelf.SelfDestruct.loc52 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.14: %Destroy.WithSelf.SelfDestruct.type.fbceb5.14 = struct_value () [concrete] +// CHECK:STDOUT: %Sentinel.SubobjectDestroy.type.e2b: type = fn_type @Sentinel.SubobjectDestroy.2 [concrete] +// CHECK:STDOUT: %Sentinel.SubobjectDestroy.21a: %Sentinel.SubobjectDestroy.type.e2b = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.48b6e9.2: = custom_witness (%Destroy.WithSelf.Op.403171.14, %Sentinel.SubobjectDestroy.21a, %Destroy.WithSelf.SelfDestruct.db3fdb.14), @Destroy [concrete] +// CHECK:STDOUT: %facet_value.9a7: %CppRange_where.type.d682d6.1 = facet_value %DiffConstRange, (%custom_witness.1bfa2a.1, %custom_witness.d0da43.1, %custom_witness.7b4, %custom_witness.48b6e9.1, %custom_witness.0c0, %custom_witness.ffb, %custom_witness.a26, %custom_witness.48b6e9.2) [concrete] // CHECK:STDOUT: %tuple.type.df5: type = tuple_type (%Iterator.a59, %Sentinel.b33) [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.9: type = fn_type @Destroy.WithSelf.Op.4 [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.9: %Destroy.WithSelf.Op.type.ef016f.9 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.6c4ec3.9: = custom_witness (%Destroy.WithSelf.Op.403171.9), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.71f: %Destroy.type = facet_value %tuple.type.df5, (%custom_witness.6c4ec3.9) [concrete] -// CHECK:STDOUT: %Iterate.impl_witness.f7f: = impl_witness imports.%Iterate.impl_witness_table.121, @T.as_type.as.Iterate.impl(%facet_value.733) [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.type.2bd: type = fn_type @T.as_type.as.Iterate.impl.NewCursor, @T.as_type.as.Iterate.impl(%facet_value.733) [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.1a9: %T.as_type.as.Iterate.impl.NewCursor.type.2bd = struct_value () [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.type.e26: type = fn_type @T.as_type.as.Iterate.impl.Next, @T.as_type.as.Iterate.impl(%facet_value.733) [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.59a: %T.as_type.as.Iterate.impl.Next.type.e26 = struct_value () [concrete] -// CHECK:STDOUT: %Iterate.facet.608: %Iterate.type = facet_value %DiffConstRange, (%Iterate.impl_witness.f7f) [concrete] -// CHECK:STDOUT: %facet_value.1e4: %Iterate_where.type.3fe = facet_value %DiffConstRange, (%Iterate.impl_witness.f7f) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.9: type = fn_type @Destroy.WithSelf.SubobjectDestroy.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.9: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.9 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.15: type = fn_type @Destroy.WithSelf.Op.6 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.15: %Destroy.WithSelf.Op.type.ef016f.15 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.15: type = fn_type @Destroy.WithSelf.SelfDestruct.6 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.15: %Destroy.WithSelf.SelfDestruct.type.fbceb5.15 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f8f19d.9: = custom_witness (%Destroy.WithSelf.Op.403171.15, %Destroy.WithSelf.SubobjectDestroy.d01daf.9, %Destroy.WithSelf.SelfDestruct.db3fdb.15), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.206: %Destroy.type = facet_value %tuple.type.df5, (%custom_witness.f8f19d.9) [concrete] +// CHECK:STDOUT: %Iterate.impl_witness.1bb: = impl_witness imports.%Iterate.impl_witness_table.121, @T.as_type.as.Iterate.impl(%facet_value.9a7) [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.type.b08: type = fn_type @T.as_type.as.Iterate.impl.NewCursor, @T.as_type.as.Iterate.impl(%facet_value.9a7) [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.094: %T.as_type.as.Iterate.impl.NewCursor.type.b08 = struct_value () [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.type.dc8: type = fn_type @T.as_type.as.Iterate.impl.Next, @T.as_type.as.Iterate.impl(%facet_value.9a7) [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.33b: %T.as_type.as.Iterate.impl.Next.type.dc8 = struct_value () [concrete] +// CHECK:STDOUT: %Iterate.facet.873: %Iterate.type = facet_value %DiffConstRange, (%Iterate.impl_witness.1bb) [concrete] +// CHECK:STDOUT: %facet_value.4ce: %Iterate_where.type.b96 = facet_value %DiffConstRange, (%Iterate.impl_witness.1bb) [concrete] // CHECK:STDOUT: %r.patt.9c0: %pattern_type.7dd = ref_binding_pattern r [concrete] // CHECK:STDOUT: %r.param_patt.992: %pattern_type.7dd = var_param_pattern %r.patt.9c0 [concrete] -// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.e9c: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.68a) [concrete] -// CHECK:STDOUT: %Iterate.WithSelf.Next.type.a94: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.68a) [concrete] -// CHECK:STDOUT: %.cbf: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.e9c, %Iterate.facet.68a [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.specific_fn.7b5: = specific_function %T.as_type.as.Iterate.impl.NewCursor.136, @T.as_type.as.Iterate.impl.NewCursor(%facet_value.0a7) [concrete] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.d66: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.9e0) [concrete] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type.37e: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.9e0) [concrete] +// CHECK:STDOUT: %.ae2: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.d66, %Iterate.facet.9e0 [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.specific_fn.210: = specific_function %T.as_type.as.Iterate.impl.NewCursor.755, @T.as_type.as.Iterate.impl.NewCursor(%facet_value.39a) [concrete] // CHECK:STDOUT: %ptr.3ce: type = ptr_type %tuple.type.b18 [concrete] -// CHECK:STDOUT: %.922: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.a94, %Iterate.facet.68a [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.specific_fn.a81: = specific_function %T.as_type.as.Iterate.impl.Next.31b, @T.as_type.as.Iterate.impl.Next(%facet_value.0a7) [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.5f3: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Destroy.facet.ef9) [concrete] -// CHECK:STDOUT: %.74d: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.5f3, %Destroy.facet.ef9 [concrete] -// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.185: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.608) [concrete] -// CHECK:STDOUT: %Iterate.WithSelf.Next.type.f38: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.608) [concrete] -// CHECK:STDOUT: %.f70: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.185, %Iterate.facet.608 [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.specific_fn.f9d: = specific_function %T.as_type.as.Iterate.impl.NewCursor.1a9, @T.as_type.as.Iterate.impl.NewCursor(%facet_value.733) [concrete] +// CHECK:STDOUT: %.0f5: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.37e, %Iterate.facet.9e0 [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.specific_fn.f32: = specific_function %T.as_type.as.Iterate.impl.Next.8e7, @T.as_type.as.Iterate.impl.Next(%facet_value.39a) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.690: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.645) [concrete] +// CHECK:STDOUT: %.95e: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.690, %Destroy.facet.645 [concrete] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.7e8: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.873) [concrete] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type.b3c: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.873) [concrete] +// CHECK:STDOUT: %.88e: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.7e8, %Iterate.facet.873 [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.specific_fn.ac7: = specific_function %T.as_type.as.Iterate.impl.NewCursor.094, @T.as_type.as.Iterate.impl.NewCursor(%facet_value.9a7) [concrete] // CHECK:STDOUT: %ptr.310: type = ptr_type %tuple.type.df5 [concrete] -// CHECK:STDOUT: %.802: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.f38, %Iterate.facet.608 [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.specific_fn.2ac: = specific_function %T.as_type.as.Iterate.impl.Next.59a, @T.as_type.as.Iterate.impl.Next(%facet_value.733) [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.eb1: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Destroy.facet.71f) [concrete] -// CHECK:STDOUT: %.236: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.eb1, %Destroy.facet.71f [concrete] +// CHECK:STDOUT: %.0fb: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.b3c, %Iterate.facet.873 [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.specific_fn.53e: = specific_function %T.as_type.as.Iterate.impl.Next.33b, @T.as_type.as.Iterate.impl.Next(%facet_value.9a7) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.8c6: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.206) [concrete] +// CHECK:STDOUT: %.426: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.8c6, %Destroy.facet.206 [concrete] // CHECK:STDOUT: %complete_type.bfe: = complete_type_witness %tuple.type.b18 [concrete] // CHECK:STDOUT: %complete_type.ad6: = complete_type_witness %tuple.type.df5 [concrete] // CHECK:STDOUT: } @@ -1652,11 +1923,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %Core.import_ref.273: @T.as_type.as.Iterate.impl.%T.as_type.as.Iterate.impl.Next.type (%T.as_type.as.Iterate.impl.Next.type.b36) = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [symbolic = @T.as_type.as.Iterate.impl.%T.as_type.as.Iterate.impl.Next (constants.%T.as_type.as.Iterate.impl.Next.d6b)] // CHECK:STDOUT: %Iterate.impl_witness_table.121 = impl_witness_table (%Core.import_ref.eef, %Core.import_ref.fcc, %Core.import_ref.fd1, %Core.import_ref.273), @T.as_type.as.Iterate.impl [concrete] // CHECK:STDOUT: %DiffValueType.decl: type = class_decl @DiffValueType [concrete = constants.%DiffValueType] {} {} -// CHECK:STDOUT: %DiffValueType.cpp_destructor.decl: %DiffValueType.cpp_destructor.type = fn_decl @DiffValueType.cpp_destructor [concrete = constants.%DiffValueType.cpp_destructor] { -// CHECK:STDOUT: -// CHECK:STDOUT: } { -// CHECK:STDOUT: -// CHECK:STDOUT: } // CHECK:STDOUT: %operator_PlusEqual__carbon_thunk.decl: %operator_PlusEqual__carbon_thunk.type = fn_decl @operator_PlusEqual__carbon_thunk [concrete = constants.%operator_PlusEqual__carbon_thunk] { // CHECK:STDOUT: // CHECK:STDOUT: } { @@ -1666,28 +1932,115 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %DiffConstRange.decl: type = class_decl @DiffConstRange [concrete = constants.%DiffConstRange] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @TestIterate(%R.loc40_17.2: %Iterate_where.type.3fe) { +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc44_33.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98c = ref_param_pattern [concrete = constants.%self.param_patt.47c] +// CHECK:STDOUT: %self.patt: %pattern_type.98c = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.90b] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %.a18 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %.a18 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc44_33.1 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98c = ref_param_pattern [concrete = constants.%self.param_patt.47c] +// CHECK:STDOUT: %self.patt: %pattern_type.98c = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.90b] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %.a18 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %.a18 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc44_33.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.ea0 = ref_param_pattern [concrete = constants.%self.param_patt.4d6] +// CHECK:STDOUT: %self.patt: %pattern_type.ea0 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.5e0] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %MaybeUnformed.632 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %MaybeUnformed.632 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc44_33.2 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.ea0 = ref_param_pattern [concrete = constants.%self.param_patt.4d6] +// CHECK:STDOUT: %self.patt: %pattern_type.ea0 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.5e0] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %MaybeUnformed.632 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %MaybeUnformed.632 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc44_33.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d] +// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0 +// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.5 = fn_decl @Destroy.WithSelf.Op.loc44_33.3 [concrete = constants.%Destroy.WithSelf.Op.403171.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d] +// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0 +// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc44_33.4 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f90 = ref_param_pattern [concrete = constants.%self.param_patt.067] +// CHECK:STDOUT: %self.patt: %pattern_type.f90 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.fc6] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.value.has_value.851 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.value.has_value.851 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.5: %Destroy.WithSelf.Op.type.ef016f.6 = fn_decl @Destroy.WithSelf.Op.loc44_33.4 [concrete = constants.%Destroy.WithSelf.Op.403171.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f90 = ref_param_pattern [concrete = constants.%self.param_patt.067] +// CHECK:STDOUT: %self.patt: %pattern_type.f90 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.fc6] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.value.has_value.851 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.value.has_value.851 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc44_33.5 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.fe2 = ref_param_pattern [concrete = constants.%self.param_patt.566] +// CHECK:STDOUT: %self.patt: %pattern_type.fe2 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.691] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %DefaultOptionalStorage.9a0 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %DefaultOptionalStorage.9a0 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.6: %Destroy.WithSelf.Op.type.ef016f.7 = fn_decl @Destroy.WithSelf.Op.loc44_33.5 [concrete = constants.%Destroy.WithSelf.Op.403171.7] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.fe2 = ref_param_pattern [concrete = constants.%self.param_patt.566] +// CHECK:STDOUT: %self.patt: %pattern_type.fe2 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.691] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %DefaultOptionalStorage.9a0 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %DefaultOptionalStorage.9a0 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc44_33.6 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.7] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.196 = ref_param_pattern [concrete = constants.%self.param_patt.be1] +// CHECK:STDOUT: %self.patt: %pattern_type.196 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.763] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Optional.d06 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Optional.d06 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.7: %Destroy.WithSelf.Op.type.ef016f.8 = fn_decl @Destroy.WithSelf.Op.loc44_33.6 [concrete = constants.%Destroy.WithSelf.Op.403171.8] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.196 = ref_param_pattern [concrete = constants.%self.param_patt.be1] +// CHECK:STDOUT: %self.patt: %pattern_type.196 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.763] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Optional.d06 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Optional.d06 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @TestIterate(%R.loc40_17.2: %Iterate_where.type.b96) { // CHECK:STDOUT: // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: %Iterate.lookup_impl_witness: = lookup_impl_witness %R.loc40_17.1, @Iterate [symbolic = %Iterate.lookup_impl_witness (constants.%Iterate.lookup_impl_witness.b8b)] -// CHECK:STDOUT: %Iterate.facet.loc44_33.5: %Iterate.type = facet_value %R.as_type.loc40_79.1, (%Iterate.lookup_impl_witness) [symbolic = %Iterate.facet.loc44_33.5 (constants.%Iterate.facet.6ec)] -// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.loc44_33.5) [symbolic = %Iterate.WithSelf.NewCursor.type (constants.%Iterate.WithSelf.NewCursor.type.309)] -// CHECK:STDOUT: %.loc44_33.20: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type, %Iterate.facet.loc44_33.5 [symbolic = %.loc44_33.20 (constants.%.799)] -// CHECK:STDOUT: %impl.elem2.loc44_33.2: @TestIterate.%.loc44_33.20 (%.799) = impl_witness_access %Iterate.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc44_33.2 (constants.%impl.elem2.114)] -// CHECK:STDOUT: %specific_impl_fn.loc44_33.4: = specific_impl_function %impl.elem2.loc44_33.2, @Iterate.WithSelf.NewCursor(%Iterate.facet.loc44_33.5) [symbolic = %specific_impl_fn.loc44_33.4 (constants.%specific_impl_fn.c74)] +// CHECK:STDOUT: %Iterate.lookup_impl_witness: = lookup_impl_witness %R.loc40_17.1, @Iterate [symbolic = %Iterate.lookup_impl_witness (constants.%Iterate.lookup_impl_witness.d00)] +// CHECK:STDOUT: %Iterate.facet.loc44_33.5: %Iterate.type = facet_value %R.as_type.loc40_79.1, (%Iterate.lookup_impl_witness) [symbolic = %Iterate.facet.loc44_33.5 (constants.%Iterate.facet.f03)] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.loc44_33.5) [symbolic = %Iterate.WithSelf.NewCursor.type (constants.%Iterate.WithSelf.NewCursor.type.de8)] +// CHECK:STDOUT: %.loc44_33.20: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type, %Iterate.facet.loc44_33.5 [symbolic = %.loc44_33.20 (constants.%.c20)] +// CHECK:STDOUT: %impl.elem2.loc44_33.3: @TestIterate.%.loc44_33.20 (%.c20) = impl_witness_access %Iterate.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc44_33.3 (constants.%impl.elem2.7d0)] +// CHECK:STDOUT: %specific_impl_fn.loc44_33.4: = specific_impl_function %impl.elem2.loc44_33.3, @Iterate.WithSelf.NewCursor(%Iterate.facet.loc44_33.5) [symbolic = %specific_impl_fn.loc44_33.4 (constants.%specific_impl_fn.1c3)] // CHECK:STDOUT: -// CHECK:STDOUT: %ptr: type = ptr_type %as_type [symbolic = %ptr (constants.%ptr.38a)] -// CHECK:STDOUT: %Iterate.WithSelf.Next.type: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.loc44_33.5) [symbolic = %Iterate.WithSelf.Next.type (constants.%Iterate.WithSelf.Next.type.75a)] -// CHECK:STDOUT: %.loc44_33.21: type = fn_type_with_self_type %Iterate.WithSelf.Next.type, %Iterate.facet.loc44_33.5 [symbolic = %.loc44_33.21 (constants.%.f06)] -// CHECK:STDOUT: %impl.elem3.loc44_33.2: @TestIterate.%.loc44_33.21 (%.f06) = impl_witness_access %Iterate.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc44_33.2 (constants.%impl.elem3.463)] -// CHECK:STDOUT: %specific_impl_fn.loc44_33.5: = specific_impl_function %impl.elem3.loc44_33.2, @Iterate.WithSelf.Next(%Iterate.facet.loc44_33.5) [symbolic = %specific_impl_fn.loc44_33.5 (constants.%specific_impl_fn.dcf)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%impl.elem1) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.dbc)] -// CHECK:STDOUT: %.loc44_33.22: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %impl.elem1 [symbolic = %.loc44_33.22 (constants.%.763)] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %impl.elem1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.38d)] -// CHECK:STDOUT: %impl.elem0.loc44_33.2: @TestIterate.%.loc44_33.22 (%.763) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc44_33.2 (constants.%impl.elem0.891)] -// CHECK:STDOUT: %specific_impl_fn.loc44_33.6: = specific_impl_function %impl.elem0.loc44_33.2, @Destroy.WithSelf.Op.1(%impl.elem1) [symbolic = %specific_impl_fn.loc44_33.6 (constants.%specific_impl_fn.b52)] +// CHECK:STDOUT: %ptr: type = ptr_type %as_type [symbolic = %ptr (constants.%ptr.02d)] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.loc44_33.5) [symbolic = %Iterate.WithSelf.Next.type (constants.%Iterate.WithSelf.Next.type.e6f)] +// CHECK:STDOUT: %.loc44_33.21: type = fn_type_with_self_type %Iterate.WithSelf.Next.type, %Iterate.facet.loc44_33.5 [symbolic = %.loc44_33.21 (constants.%.89f)] +// CHECK:STDOUT: %impl.elem3.loc44_33.2: @TestIterate.%.loc44_33.21 (%.89f) = impl_witness_access %Iterate.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc44_33.2 (constants.%impl.elem3.73e)] +// CHECK:STDOUT: %specific_impl_fn.loc44_33.5: = specific_impl_function %impl.elem3.loc44_33.2, @Iterate.WithSelf.Next(%Iterate.facet.loc44_33.5) [symbolic = %specific_impl_fn.loc44_33.5 (constants.%specific_impl_fn.73e)] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%impl.elem1) [symbolic = %Destroy.WithSelf.SelfDestruct.type (constants.%Destroy.WithSelf.SelfDestruct.type.51e)] +// CHECK:STDOUT: %.loc44_33.22: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type, %impl.elem1 [symbolic = %.loc44_33.22 (constants.%.6f9)] +// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %impl.elem1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.662)] +// CHECK:STDOUT: %impl.elem2.loc44_33.4: @TestIterate.%.loc44_33.22 (%.6f9) = impl_witness_access %Destroy.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc44_33.4 (constants.%impl.elem2.a34)] +// CHECK:STDOUT: %specific_impl_fn.loc44_33.6: = specific_impl_function %impl.elem2.loc44_33.4, @Destroy.WithSelf.SelfDestruct.1(%impl.elem1) [symbolic = %specific_impl_fn.loc44_33.6 (constants.%specific_impl_fn.f40)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%r.param: ref @TestIterate.%R.as_type.loc40_79.1 (%R.as_type)) { // CHECK:STDOUT: !entry: @@ -1696,55 +2049,55 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %i.patt: %pattern_type.149 = value_binding_pattern i [concrete = constants.%i.patt] // CHECK:STDOUT: } // CHECK:STDOUT: %r.ref: ref @TestIterate.%R.as_type.loc40_79.1 (%R.as_type) = name_ref r, %r -// CHECK:STDOUT: %impl.elem2.loc44_33.1: @TestIterate.%.loc44_33.20 (%.799) = impl_witness_access constants.%Iterate.lookup_impl_witness.b8b, element2 [symbolic = %impl.elem2.loc44_33.2 (constants.%impl.elem2.114)] +// CHECK:STDOUT: %impl.elem2.loc44_33.1: @TestIterate.%.loc44_33.20 (%.c20) = impl_witness_access constants.%Iterate.lookup_impl_witness.d00, element2 [symbolic = %impl.elem2.loc44_33.3 (constants.%impl.elem2.7d0)] // CHECK:STDOUT: %bound_method.loc44_33.1: = bound_method %r.ref, %impl.elem2.loc44_33.1 -// CHECK:STDOUT: %Iterate.facet.loc44_33.1: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.b8b) [symbolic = %Iterate.facet.loc44_33.5 (constants.%Iterate.facet.6ec)] -// CHECK:STDOUT: %.loc44_33.1: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc44_33.1 [symbolic = %Iterate.facet.loc44_33.5 (constants.%Iterate.facet.6ec)] -// CHECK:STDOUT: %Iterate.facet.loc44_33.2: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.b8b) [symbolic = %Iterate.facet.loc44_33.5 (constants.%Iterate.facet.6ec)] -// CHECK:STDOUT: %.loc44_33.2: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc44_33.2 [symbolic = %Iterate.facet.loc44_33.5 (constants.%Iterate.facet.6ec)] -// CHECK:STDOUT: %specific_impl_fn.loc44_33.1: = specific_impl_function %impl.elem2.loc44_33.1, @Iterate.WithSelf.NewCursor(constants.%Iterate.facet.6ec) [symbolic = %specific_impl_fn.loc44_33.4 (constants.%specific_impl_fn.c74)] +// CHECK:STDOUT: %Iterate.facet.loc44_33.1: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.d00) [symbolic = %Iterate.facet.loc44_33.5 (constants.%Iterate.facet.f03)] +// CHECK:STDOUT: %.loc44_33.1: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc44_33.1 [symbolic = %Iterate.facet.loc44_33.5 (constants.%Iterate.facet.f03)] +// CHECK:STDOUT: %Iterate.facet.loc44_33.2: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.d00) [symbolic = %Iterate.facet.loc44_33.5 (constants.%Iterate.facet.f03)] +// CHECK:STDOUT: %.loc44_33.2: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc44_33.2 [symbolic = %Iterate.facet.loc44_33.5 (constants.%Iterate.facet.f03)] +// CHECK:STDOUT: %specific_impl_fn.loc44_33.1: = specific_impl_function %impl.elem2.loc44_33.1, @Iterate.WithSelf.NewCursor(constants.%Iterate.facet.f03) [symbolic = %specific_impl_fn.loc44_33.4 (constants.%specific_impl_fn.1c3)] // CHECK:STDOUT: %bound_method.loc44_33.2: = bound_method %r.ref, %specific_impl_fn.loc44_33.1 -// CHECK:STDOUT: %var: ref @TestIterate.%as_type (%as_type.59f) = var_storage invalid +// CHECK:STDOUT: %var: ref @TestIterate.%as_type (%as_type.389) = var_storage invalid // CHECK:STDOUT: %.loc44_32.1: @TestIterate.%R.as_type.loc40_79.1 (%R.as_type) = acquire_value %r.ref -// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.call: init @TestIterate.%as_type (%as_type.59f) to %var = call %bound_method.loc44_33.2(%.loc44_32.1) +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.call: init @TestIterate.%as_type (%as_type.389) to %var = call %bound_method.loc44_33.2(%.loc44_32.1) // CHECK:STDOUT: assign %var, %Iterate.WithSelf.NewCursor.call // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.next: -// CHECK:STDOUT: %addr.loc44: @TestIterate.%ptr (%ptr.38a) = addr_of %var -// CHECK:STDOUT: %impl.elem3.loc44_33.1: @TestIterate.%.loc44_33.21 (%.f06) = impl_witness_access constants.%Iterate.lookup_impl_witness.b8b, element3 [symbolic = %impl.elem3.loc44_33.2 (constants.%impl.elem3.463)] +// CHECK:STDOUT: %addr.loc44: @TestIterate.%ptr (%ptr.02d) = addr_of %var +// CHECK:STDOUT: %impl.elem3.loc44_33.1: @TestIterate.%.loc44_33.21 (%.89f) = impl_witness_access constants.%Iterate.lookup_impl_witness.d00, element3 [symbolic = %impl.elem3.loc44_33.2 (constants.%impl.elem3.73e)] // CHECK:STDOUT: %bound_method.loc44_33.3: = bound_method %r.ref, %impl.elem3.loc44_33.1 -// CHECK:STDOUT: %Iterate.facet.loc44_33.3: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.b8b) [symbolic = %Iterate.facet.loc44_33.5 (constants.%Iterate.facet.6ec)] -// CHECK:STDOUT: %.loc44_33.3: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc44_33.3 [symbolic = %Iterate.facet.loc44_33.5 (constants.%Iterate.facet.6ec)] -// CHECK:STDOUT: %Iterate.facet.loc44_33.4: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.b8b) [symbolic = %Iterate.facet.loc44_33.5 (constants.%Iterate.facet.6ec)] -// CHECK:STDOUT: %.loc44_33.4: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc44_33.4 [symbolic = %Iterate.facet.loc44_33.5 (constants.%Iterate.facet.6ec)] -// CHECK:STDOUT: %.loc44_33.5: %Destroy.type = converted constants.%as_type.59f, constants.%impl.elem1.697 [symbolic = %impl.elem1 (constants.%impl.elem1.697)] -// CHECK:STDOUT: %.loc44_33.6: %Destroy.type = converted constants.%as_type.59f, constants.%impl.elem1.697 [symbolic = %impl.elem1 (constants.%impl.elem1.697)] -// CHECK:STDOUT: %specific_impl_fn.loc44_33.2: = specific_impl_function %impl.elem3.loc44_33.1, @Iterate.WithSelf.Next(constants.%Iterate.facet.6ec) [symbolic = %specific_impl_fn.loc44_33.5 (constants.%specific_impl_fn.dcf)] +// CHECK:STDOUT: %Iterate.facet.loc44_33.3: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.d00) [symbolic = %Iterate.facet.loc44_33.5 (constants.%Iterate.facet.f03)] +// CHECK:STDOUT: %.loc44_33.3: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc44_33.3 [symbolic = %Iterate.facet.loc44_33.5 (constants.%Iterate.facet.f03)] +// CHECK:STDOUT: %Iterate.facet.loc44_33.4: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.d00) [symbolic = %Iterate.facet.loc44_33.5 (constants.%Iterate.facet.f03)] +// CHECK:STDOUT: %.loc44_33.4: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc44_33.4 [symbolic = %Iterate.facet.loc44_33.5 (constants.%Iterate.facet.f03)] +// CHECK:STDOUT: %.loc44_33.5: %Destroy.type = converted constants.%as_type.389, constants.%impl.elem1.fbc [symbolic = %impl.elem1 (constants.%impl.elem1.fbc)] +// CHECK:STDOUT: %.loc44_33.6: %Destroy.type = converted constants.%as_type.389, constants.%impl.elem1.fbc [symbolic = %impl.elem1 (constants.%impl.elem1.fbc)] +// CHECK:STDOUT: %specific_impl_fn.loc44_33.2: = specific_impl_function %impl.elem3.loc44_33.1, @Iterate.WithSelf.Next(constants.%Iterate.facet.f03) [symbolic = %specific_impl_fn.loc44_33.5 (constants.%specific_impl_fn.73e)] // CHECK:STDOUT: %bound_method.loc44_33.4: = bound_method %r.ref, %specific_impl_fn.loc44_33.2 -// CHECK:STDOUT: %.loc44_33.7: ref %Optional.15a = temporary_storage +// CHECK:STDOUT: %.loc44_33.7: ref %Optional.d06 = temporary_storage // CHECK:STDOUT: %.loc44_32.2: @TestIterate.%R.as_type.loc40_79.1 (%R.as_type) = acquire_value %r.ref -// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.15a to %.loc44_33.7 = call %bound_method.loc44_33.4(%.loc44_32.2, %addr.loc44) -// CHECK:STDOUT: %.loc44_33.8: ref %Optional.15a = temporary %.loc44_33.7, %Iterate.WithSelf.Next.call -// CHECK:STDOUT: %.loc44_33.9: %Optional.HasValue.type.6f3 = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.c3f) [concrete = constants.%Optional.HasValue.038] -// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.6f3 = name_ref HasValue, %.loc44_33.9 [concrete = constants.%Optional.HasValue.038] +// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.d06 to %.loc44_33.7 = call %bound_method.loc44_33.4(%.loc44_32.2, %addr.loc44) +// CHECK:STDOUT: %.loc44_33.8: ref %Optional.d06 = temporary %.loc44_33.7, %Iterate.WithSelf.Next.call +// CHECK:STDOUT: %.loc44_33.9: %Optional.HasValue.type.821 = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.beb) [concrete = constants.%Optional.HasValue.960] +// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.821 = name_ref HasValue, %.loc44_33.9 [concrete = constants.%Optional.HasValue.960] // CHECK:STDOUT: %Optional.HasValue.bound: = bound_method %.loc44_33.8, %HasValue.ref -// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%OptionalStorage.facet.c3f) [concrete = constants.%Optional.HasValue.specific_fn.bc4] +// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%OptionalStorage.facet.beb) [concrete = constants.%Optional.HasValue.specific_fn.a20] // CHECK:STDOUT: %bound_method.loc44_33.5: = bound_method %.loc44_33.8, %Optional.HasValue.specific_fn -// CHECK:STDOUT: %.loc44_33.10: %Optional.15a = acquire_value %.loc44_33.8 +// CHECK:STDOUT: %.loc44_33.10: %Optional.d06 = acquire_value %.loc44_33.8 // CHECK:STDOUT: %Optional.HasValue.call: init bool = call %bound_method.loc44_33.5(%.loc44_33.10) // CHECK:STDOUT: %.loc44_33.11: bool = value_of_initializer %Optional.HasValue.call // CHECK:STDOUT: %.loc44_33.12: bool = converted %Optional.HasValue.call, %.loc44_33.11 // CHECK:STDOUT: if %.loc44_33.12 br !for.body else br !for.done // CHECK:STDOUT: // CHECK:STDOUT: !for.body: -// CHECK:STDOUT: %.loc44_33.13: %Optional.Get.type.d3e = specific_constant imports.%Core.import_ref.dab, @Optional(constants.%OptionalStorage.facet.c3f) [concrete = constants.%Optional.Get.57f] -// CHECK:STDOUT: %Get.ref: %Optional.Get.type.d3e = name_ref Get, %.loc44_33.13 [concrete = constants.%Optional.Get.57f] +// CHECK:STDOUT: %.loc44_33.13: %Optional.Get.type.f9c = specific_constant imports.%Core.import_ref.dab, @Optional(constants.%OptionalStorage.facet.beb) [concrete = constants.%Optional.Get.294] +// CHECK:STDOUT: %Get.ref: %Optional.Get.type.f9c = name_ref Get, %.loc44_33.13 [concrete = constants.%Optional.Get.294] // CHECK:STDOUT: %Optional.Get.bound: = bound_method %.loc44_33.8, %Get.ref -// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%OptionalStorage.facet.c3f) [concrete = constants.%Optional.Get.specific_fn.c49] +// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%OptionalStorage.facet.beb) [concrete = constants.%Optional.Get.specific_fn.084] // CHECK:STDOUT: %bound_method.loc44_33.6: = bound_method %.loc44_33.8, %Optional.Get.specific_fn // CHECK:STDOUT: %.loc44_33.14: ref %DiffValueType = temporary_storage -// CHECK:STDOUT: %.loc44_33.15: %Optional.15a = acquire_value %.loc44_33.8 +// CHECK:STDOUT: %.loc44_33.15: %Optional.d06 = acquire_value %.loc44_33.8 // CHECK:STDOUT: %Optional.Get.call: init %DiffValueType to %.loc44_33.14 = call %bound_method.loc44_33.6(%.loc44_33.15) // CHECK:STDOUT: %.loc44_33.16: ref %DiffValueType = temporary %.loc44_33.14, %Optional.Get.call // CHECK:STDOUT: %.loc44_33.17: %DiffValueType = acquire_value %.loc44_33.16 @@ -1760,52 +2113,104 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %.loc45_9.1: %ptr.816 = as_compatible %addr.loc45 // CHECK:STDOUT: %.loc45_9.2: %ptr.816 = converted %addr.loc45, %.loc45_9.1 // CHECK:STDOUT: %operator_PlusEqual__carbon_thunk.call: ref %DiffValueType = call imports.%operator_PlusEqual__carbon_thunk.decl(%sum.ref, %.loc45_9.2) -// CHECK:STDOUT: %DiffValueType.Op.bound.loc44: = bound_method %.loc44_33.16, constants.%DiffValueType.Op.4dca31.1 -// CHECK:STDOUT: %Op.ref.loc44: %DiffValueType.cpp_destructor.type = name_ref Op, imports.%DiffValueType.cpp_destructor.decl [concrete = constants.%DiffValueType.cpp_destructor] -// CHECK:STDOUT: %DiffValueType.cpp_destructor.bound.loc44: = bound_method %.loc44_33.16, %Op.ref.loc44 -// CHECK:STDOUT: %DiffValueType.cpp_destructor.call.loc44: init %empty_tuple.type = call %DiffValueType.cpp_destructor.bound.loc44(%.loc44_33.16) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc44_33.1: = bound_method %.loc44_33.8, constants.%Destroy.WithSelf.Op.403171.7 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc44_33.1: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc44_33.1(%.loc44_33.8) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc44_33.1: = bound_method %.loc44_33.16, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc44_33.1: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc44_33.1(%.loc44_33.16) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc44_33.2: = bound_method %.loc44_33.8, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.8 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc44_33.2: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc44_33.2(%.loc44_33.8) // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.done: -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc44_33.2: = bound_method %.loc44_33.8, constants.%Destroy.WithSelf.Op.403171.7 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc44_33.2: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc44_33.2(%.loc44_33.8) -// CHECK:STDOUT: %impl.elem0.loc44_33.1: @TestIterate.%.loc44_33.22 (%.763) = impl_witness_access constants.%Destroy.lookup_impl_witness.38d, element0 [symbolic = %impl.elem0.loc44_33.2 (constants.%impl.elem0.891)] -// CHECK:STDOUT: %bound_method.loc44_33.7: = bound_method %var, %impl.elem0.loc44_33.1 -// CHECK:STDOUT: %.loc44_33.18: %Destroy.type = converted constants.%as_type.59f, constants.%impl.elem1.697 [symbolic = %impl.elem1 (constants.%impl.elem1.697)] -// CHECK:STDOUT: %.loc44_33.19: %Destroy.type = converted constants.%as_type.59f, constants.%impl.elem1.697 [symbolic = %impl.elem1 (constants.%impl.elem1.697)] -// CHECK:STDOUT: %specific_impl_fn.loc44_33.3: = specific_impl_function %impl.elem0.loc44_33.1, @Destroy.WithSelf.Op.1(constants.%impl.elem1.697) [symbolic = %specific_impl_fn.loc44_33.6 (constants.%specific_impl_fn.b52)] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc44_33.3: = bound_method %.loc44_33.8, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.8 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc44_33.3: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc44_33.3(%.loc44_33.8) +// CHECK:STDOUT: %impl.elem2.loc44_33.2: @TestIterate.%.loc44_33.22 (%.6f9) = impl_witness_access constants.%Destroy.lookup_impl_witness.662, element2 [symbolic = %impl.elem2.loc44_33.4 (constants.%impl.elem2.a34)] +// CHECK:STDOUT: %bound_method.loc44_33.7: = bound_method %var, %impl.elem2.loc44_33.2 +// CHECK:STDOUT: %.loc44_33.18: %Destroy.type = converted constants.%as_type.389, constants.%impl.elem1.fbc [symbolic = %impl.elem1 (constants.%impl.elem1.fbc)] +// CHECK:STDOUT: %.loc44_33.19: %Destroy.type = converted constants.%as_type.389, constants.%impl.elem1.fbc [symbolic = %impl.elem1 (constants.%impl.elem1.fbc)] +// CHECK:STDOUT: %specific_impl_fn.loc44_33.3: = specific_impl_function %impl.elem2.loc44_33.2, @Destroy.WithSelf.SelfDestruct.1(constants.%impl.elem1.fbc) [symbolic = %specific_impl_fn.loc44_33.6 (constants.%specific_impl_fn.f40)] // CHECK:STDOUT: %bound_method.loc44_33.8: = bound_method %var, %specific_impl_fn.loc44_33.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc44_33.3: init %empty_tuple.type = call %bound_method.loc44_33.8(%var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc44_33.4: init %empty_tuple.type = call %bound_method.loc44_33.8(%var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc44_33.1(%self.param: ref %.a18) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc44_33.1(%self.param: ref %.a18) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc44_33.2(%self.param: ref %MaybeUnformed.923) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc44_33.1(%self.param: ref %.a18) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc44_33.1(%self.param: ref %.a18) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc44_33.2(%self.param: ref %MaybeUnformed.632) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc44_33.2(%self.param: ref %MaybeUnformed.632) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc44_33.2(%self.param: ref %MaybeUnformed.632) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc44_33.3(%self.param: ref bool) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc44_33.3(%self.param: ref bool) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc44_33.4(%self.param: ref %struct_type.value.has_value.3cf) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc44_33.3(%self.param: ref bool) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc44_33.4(%self.param: ref %struct_type.value.has_value.851) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc44_33.5(%self.param: ref %DefaultOptionalStorage.5e4) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc44_33.4(%self.param: ref %struct_type.value.has_value.851) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc44_33.4(%self.param: ref %struct_type.value.has_value.851) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.5(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc44_33.5(%self.param: ref %DefaultOptionalStorage.9a0) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc44_33.6(%self.param: ref %Optional.15a) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc44_33.5(%self.param: ref %DefaultOptionalStorage.9a0) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc44_33.5(%self.param: ref %DefaultOptionalStorage.9a0) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.6(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.5(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc44_33.6(%self.param: ref %Optional.d06) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc44_33.6(%self.param: ref %Optional.d06) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc44_33.6(%self.param: ref %Optional.d06) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.7(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.6(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1816,13 +2221,13 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %i.patt.loc59: %pattern_type.149 = value_binding_pattern i [concrete = constants.%i.patt] // CHECK:STDOUT: } // CHECK:STDOUT: %m.ref: ref %DiffMutableRange = name_ref m, %m -// CHECK:STDOUT: %impl.elem2.loc59: %.cbf = impl_witness_access constants.%Iterate.impl_witness.747, element2 [concrete = constants.%T.as_type.as.Iterate.impl.NewCursor.136] +// CHECK:STDOUT: %impl.elem2.loc59: %.ae2 = impl_witness_access constants.%Iterate.impl_witness.dbb, element2 [concrete = constants.%T.as_type.as.Iterate.impl.NewCursor.755] // CHECK:STDOUT: %bound_method.loc59_33.1: = bound_method %m.ref, %impl.elem2.loc59 -// CHECK:STDOUT: %facet_value.loc59_33.1: %CppRange_where.type.d682d6.1 = facet_value constants.%DiffMutableRange, (constants.%custom_witness.e7a31c.1, constants.%custom_witness.d0da43.1, constants.%custom_witness.aa8, constants.%custom_witness.9bb15e.1, constants.%custom_witness.392, constants.%custom_witness.1c9, constants.%custom_witness.723, constants.%custom_witness.9bb15e.2) [concrete = constants.%facet_value.0a7] -// CHECK:STDOUT: %.loc59_33.1: %CppRange_where.type.d682d6.1 = converted constants.%DiffMutableRange, %facet_value.loc59_33.1 [concrete = constants.%facet_value.0a7] -// CHECK:STDOUT: %facet_value.loc59_33.2: %CppRange_where.type.d682d6.1 = facet_value constants.%DiffMutableRange, (constants.%custom_witness.e7a31c.1, constants.%custom_witness.d0da43.1, constants.%custom_witness.aa8, constants.%custom_witness.9bb15e.1, constants.%custom_witness.392, constants.%custom_witness.1c9, constants.%custom_witness.723, constants.%custom_witness.9bb15e.2) [concrete = constants.%facet_value.0a7] -// CHECK:STDOUT: %.loc59_33.2: %CppRange_where.type.d682d6.1 = converted constants.%DiffMutableRange, %facet_value.loc59_33.2 [concrete = constants.%facet_value.0a7] -// CHECK:STDOUT: %specific_fn.loc59_33.1: = specific_function %impl.elem2.loc59, @T.as_type.as.Iterate.impl.NewCursor(constants.%facet_value.0a7) [concrete = constants.%T.as_type.as.Iterate.impl.NewCursor.specific_fn.7b5] +// CHECK:STDOUT: %facet_value.loc59_33.1: %CppRange_where.type.d682d6.1 = facet_value constants.%DiffMutableRange, (constants.%custom_witness.1bfa2a.1, constants.%custom_witness.d0da43.1, constants.%custom_witness.aa8, constants.%custom_witness.db9baa.1, constants.%custom_witness.392, constants.%custom_witness.1c9, constants.%custom_witness.723, constants.%custom_witness.db9baa.2) [concrete = constants.%facet_value.39a] +// CHECK:STDOUT: %.loc59_33.1: %CppRange_where.type.d682d6.1 = converted constants.%DiffMutableRange, %facet_value.loc59_33.1 [concrete = constants.%facet_value.39a] +// CHECK:STDOUT: %facet_value.loc59_33.2: %CppRange_where.type.d682d6.1 = facet_value constants.%DiffMutableRange, (constants.%custom_witness.1bfa2a.1, constants.%custom_witness.d0da43.1, constants.%custom_witness.aa8, constants.%custom_witness.db9baa.1, constants.%custom_witness.392, constants.%custom_witness.1c9, constants.%custom_witness.723, constants.%custom_witness.db9baa.2) [concrete = constants.%facet_value.39a] +// CHECK:STDOUT: %.loc59_33.2: %CppRange_where.type.d682d6.1 = converted constants.%DiffMutableRange, %facet_value.loc59_33.2 [concrete = constants.%facet_value.39a] +// CHECK:STDOUT: %specific_fn.loc59_33.1: = specific_function %impl.elem2.loc59, @T.as_type.as.Iterate.impl.NewCursor(constants.%facet_value.39a) [concrete = constants.%T.as_type.as.Iterate.impl.NewCursor.specific_fn.210] // CHECK:STDOUT: %bound_method.loc59_33.2: = bound_method %m.ref, %specific_fn.loc59_33.1 // CHECK:STDOUT: %var.loc59: ref %tuple.type.b18 = var_storage invalid // CHECK:STDOUT: %.loc59_32.1: %DiffMutableRange = acquire_value %m.ref @@ -1832,37 +2237,37 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: // CHECK:STDOUT: !for.next.loc59: // CHECK:STDOUT: %addr.loc59: %ptr.3ce = addr_of %var.loc59 -// CHECK:STDOUT: %impl.elem3.loc59: %.922 = impl_witness_access constants.%Iterate.impl_witness.747, element3 [concrete = constants.%T.as_type.as.Iterate.impl.Next.31b] +// CHECK:STDOUT: %impl.elem3.loc59: %.0f5 = impl_witness_access constants.%Iterate.impl_witness.dbb, element3 [concrete = constants.%T.as_type.as.Iterate.impl.Next.8e7] // CHECK:STDOUT: %bound_method.loc59_33.3: = bound_method %m.ref, %impl.elem3.loc59 -// CHECK:STDOUT: %facet_value.loc59_33.3: %CppRange_where.type.d682d6.1 = facet_value constants.%DiffMutableRange, (constants.%custom_witness.e7a31c.1, constants.%custom_witness.d0da43.1, constants.%custom_witness.aa8, constants.%custom_witness.9bb15e.1, constants.%custom_witness.392, constants.%custom_witness.1c9, constants.%custom_witness.723, constants.%custom_witness.9bb15e.2) [concrete = constants.%facet_value.0a7] -// CHECK:STDOUT: %.loc59_33.3: %CppRange_where.type.d682d6.1 = converted constants.%DiffMutableRange, %facet_value.loc59_33.3 [concrete = constants.%facet_value.0a7] -// CHECK:STDOUT: %facet_value.loc59_33.4: %CppRange_where.type.d682d6.1 = facet_value constants.%DiffMutableRange, (constants.%custom_witness.e7a31c.1, constants.%custom_witness.d0da43.1, constants.%custom_witness.aa8, constants.%custom_witness.9bb15e.1, constants.%custom_witness.392, constants.%custom_witness.1c9, constants.%custom_witness.723, constants.%custom_witness.9bb15e.2) [concrete = constants.%facet_value.0a7] -// CHECK:STDOUT: %.loc59_33.4: %CppRange_where.type.d682d6.1 = converted constants.%DiffMutableRange, %facet_value.loc59_33.4 [concrete = constants.%facet_value.0a7] -// CHECK:STDOUT: %specific_fn.loc59_33.2: = specific_function %impl.elem3.loc59, @T.as_type.as.Iterate.impl.Next(constants.%facet_value.0a7) [concrete = constants.%T.as_type.as.Iterate.impl.Next.specific_fn.a81] +// CHECK:STDOUT: %facet_value.loc59_33.3: %CppRange_where.type.d682d6.1 = facet_value constants.%DiffMutableRange, (constants.%custom_witness.1bfa2a.1, constants.%custom_witness.d0da43.1, constants.%custom_witness.aa8, constants.%custom_witness.db9baa.1, constants.%custom_witness.392, constants.%custom_witness.1c9, constants.%custom_witness.723, constants.%custom_witness.db9baa.2) [concrete = constants.%facet_value.39a] +// CHECK:STDOUT: %.loc59_33.3: %CppRange_where.type.d682d6.1 = converted constants.%DiffMutableRange, %facet_value.loc59_33.3 [concrete = constants.%facet_value.39a] +// CHECK:STDOUT: %facet_value.loc59_33.4: %CppRange_where.type.d682d6.1 = facet_value constants.%DiffMutableRange, (constants.%custom_witness.1bfa2a.1, constants.%custom_witness.d0da43.1, constants.%custom_witness.aa8, constants.%custom_witness.db9baa.1, constants.%custom_witness.392, constants.%custom_witness.1c9, constants.%custom_witness.723, constants.%custom_witness.db9baa.2) [concrete = constants.%facet_value.39a] +// CHECK:STDOUT: %.loc59_33.4: %CppRange_where.type.d682d6.1 = converted constants.%DiffMutableRange, %facet_value.loc59_33.4 [concrete = constants.%facet_value.39a] +// CHECK:STDOUT: %specific_fn.loc59_33.2: = specific_function %impl.elem3.loc59, @T.as_type.as.Iterate.impl.Next(constants.%facet_value.39a) [concrete = constants.%T.as_type.as.Iterate.impl.Next.specific_fn.f32] // CHECK:STDOUT: %bound_method.loc59_33.4: = bound_method %m.ref, %specific_fn.loc59_33.2 -// CHECK:STDOUT: %.loc59_33.5: ref %Optional.15a = temporary_storage +// CHECK:STDOUT: %.loc59_33.5: ref %Optional.d06 = temporary_storage // CHECK:STDOUT: %.loc59_32.2: %DiffMutableRange = acquire_value %m.ref -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.call.loc59: init %Optional.15a to %.loc59_33.5 = call %bound_method.loc59_33.4(%.loc59_32.2, %addr.loc59) -// CHECK:STDOUT: %.loc59_33.6: ref %Optional.15a = temporary %.loc59_33.5, %T.as_type.as.Iterate.impl.Next.call.loc59 -// CHECK:STDOUT: %.loc59_33.7: %Optional.HasValue.type.6f3 = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.c3f) [concrete = constants.%Optional.HasValue.038] -// CHECK:STDOUT: %HasValue.ref.loc59: %Optional.HasValue.type.6f3 = name_ref HasValue, %.loc59_33.7 [concrete = constants.%Optional.HasValue.038] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.call.loc59: init %Optional.d06 to %.loc59_33.5 = call %bound_method.loc59_33.4(%.loc59_32.2, %addr.loc59) +// CHECK:STDOUT: %.loc59_33.6: ref %Optional.d06 = temporary %.loc59_33.5, %T.as_type.as.Iterate.impl.Next.call.loc59 +// CHECK:STDOUT: %.loc59_33.7: %Optional.HasValue.type.821 = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.beb) [concrete = constants.%Optional.HasValue.960] +// CHECK:STDOUT: %HasValue.ref.loc59: %Optional.HasValue.type.821 = name_ref HasValue, %.loc59_33.7 [concrete = constants.%Optional.HasValue.960] // CHECK:STDOUT: %Optional.HasValue.bound.loc59: = bound_method %.loc59_33.6, %HasValue.ref.loc59 -// CHECK:STDOUT: %Optional.HasValue.specific_fn.loc59: = specific_function %HasValue.ref.loc59, @Optional.HasValue(constants.%OptionalStorage.facet.c3f) [concrete = constants.%Optional.HasValue.specific_fn.bc4] +// CHECK:STDOUT: %Optional.HasValue.specific_fn.loc59: = specific_function %HasValue.ref.loc59, @Optional.HasValue(constants.%OptionalStorage.facet.beb) [concrete = constants.%Optional.HasValue.specific_fn.a20] // CHECK:STDOUT: %bound_method.loc59_33.5: = bound_method %.loc59_33.6, %Optional.HasValue.specific_fn.loc59 -// CHECK:STDOUT: %.loc59_33.8: %Optional.15a = acquire_value %.loc59_33.6 +// CHECK:STDOUT: %.loc59_33.8: %Optional.d06 = acquire_value %.loc59_33.6 // CHECK:STDOUT: %Optional.HasValue.call.loc59: init bool = call %bound_method.loc59_33.5(%.loc59_33.8) // CHECK:STDOUT: %.loc59_33.9: bool = value_of_initializer %Optional.HasValue.call.loc59 // CHECK:STDOUT: %.loc59_33.10: bool = converted %Optional.HasValue.call.loc59, %.loc59_33.9 // CHECK:STDOUT: if %.loc59_33.10 br !for.body.loc59 else br !for.done.loc59 // CHECK:STDOUT: // CHECK:STDOUT: !for.body.loc59: -// CHECK:STDOUT: %.loc59_33.11: %Optional.Get.type.d3e = specific_constant imports.%Core.import_ref.dab, @Optional(constants.%OptionalStorage.facet.c3f) [concrete = constants.%Optional.Get.57f] -// CHECK:STDOUT: %Get.ref.loc59: %Optional.Get.type.d3e = name_ref Get, %.loc59_33.11 [concrete = constants.%Optional.Get.57f] +// CHECK:STDOUT: %.loc59_33.11: %Optional.Get.type.f9c = specific_constant imports.%Core.import_ref.dab, @Optional(constants.%OptionalStorage.facet.beb) [concrete = constants.%Optional.Get.294] +// CHECK:STDOUT: %Get.ref.loc59: %Optional.Get.type.f9c = name_ref Get, %.loc59_33.11 [concrete = constants.%Optional.Get.294] // CHECK:STDOUT: %Optional.Get.bound.loc59: = bound_method %.loc59_33.6, %Get.ref.loc59 -// CHECK:STDOUT: %Optional.Get.specific_fn.loc59: = specific_function %Get.ref.loc59, @Optional.Get(constants.%OptionalStorage.facet.c3f) [concrete = constants.%Optional.Get.specific_fn.c49] +// CHECK:STDOUT: %Optional.Get.specific_fn.loc59: = specific_function %Get.ref.loc59, @Optional.Get(constants.%OptionalStorage.facet.beb) [concrete = constants.%Optional.Get.specific_fn.084] // CHECK:STDOUT: %bound_method.loc59_33.6: = bound_method %.loc59_33.6, %Optional.Get.specific_fn.loc59 // CHECK:STDOUT: %.loc59_33.12: ref %DiffValueType = temporary_storage -// CHECK:STDOUT: %.loc59_33.13: %Optional.15a = acquire_value %.loc59_33.6 +// CHECK:STDOUT: %.loc59_33.13: %Optional.d06 = acquire_value %.loc59_33.6 // CHECK:STDOUT: %Optional.Get.call.loc59: init %DiffValueType to %.loc59_33.12 = call %bound_method.loc59_33.6(%.loc59_33.13) // CHECK:STDOUT: %.loc59_33.14: ref %DiffValueType = temporary %.loc59_33.12, %Optional.Get.call.loc59 // CHECK:STDOUT: %.loc59_33.15: %DiffValueType = acquire_value %.loc59_33.14 @@ -1878,30 +2283,28 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %.loc60_9.1: %ptr.816 = as_compatible %addr.loc60 // CHECK:STDOUT: %.loc60_9.2: %ptr.816 = converted %addr.loc60, %.loc60_9.1 // CHECK:STDOUT: %operator_PlusEqual__carbon_thunk.call.loc60: ref %DiffValueType = call imports.%operator_PlusEqual__carbon_thunk.decl(%sum.ref.loc60, %.loc60_9.2) -// CHECK:STDOUT: %DiffValueType.Op.bound.loc59: = bound_method %.loc59_33.14, constants.%DiffValueType.Op.4dca31.1 -// CHECK:STDOUT: %Op.ref.loc59: %DiffValueType.cpp_destructor.type = name_ref Op, imports.%DiffValueType.cpp_destructor.decl [concrete = constants.%DiffValueType.cpp_destructor] -// CHECK:STDOUT: %DiffValueType.cpp_destructor.bound.loc59: = bound_method %.loc59_33.14, %Op.ref.loc59 -// CHECK:STDOUT: %DiffValueType.cpp_destructor.call.loc59: init %empty_tuple.type = call %DiffValueType.cpp_destructor.bound.loc59(%.loc59_33.14) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc59_33.1: = bound_method %.loc59_33.6, constants.%Destroy.WithSelf.Op.403171.7 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc59_33.1: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc59_33.1(%.loc59_33.6) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc59_33.1: = bound_method %.loc59_33.14, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc59_33.1: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc59_33.1(%.loc59_33.14) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc59_33.2: = bound_method %.loc59_33.6, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.8 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc59_33.2: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc59_33.2(%.loc59_33.6) // CHECK:STDOUT: br !for.next.loc59 // CHECK:STDOUT: // CHECK:STDOUT: !for.done.loc59: -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc59_33.2: = bound_method %.loc59_33.6, constants.%Destroy.WithSelf.Op.403171.7 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc59_33.2: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc59_33.2(%.loc59_33.6) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc59_33.3: = bound_method %var.loc59, constants.%Destroy.WithSelf.Op.403171.8 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc59_33.3: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc59_33.3(%var.loc59) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc59_33.3: = bound_method %.loc59_33.6, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.8 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc59_33.3: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc59_33.3(%.loc59_33.6) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc59_33.4: = bound_method %var.loc59, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.11 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc59_33.4: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc59_33.4(%var.loc59) // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %i.patt.loc63: %pattern_type.149 = value_binding_pattern i [concrete = constants.%i.patt] // CHECK:STDOUT: } // CHECK:STDOUT: %c.ref: %DiffConstRange = name_ref c, %c -// CHECK:STDOUT: %impl.elem2.loc63: %.f70 = impl_witness_access constants.%Iterate.impl_witness.f7f, element2 [concrete = constants.%T.as_type.as.Iterate.impl.NewCursor.1a9] +// CHECK:STDOUT: %impl.elem2.loc63: %.88e = impl_witness_access constants.%Iterate.impl_witness.1bb, element2 [concrete = constants.%T.as_type.as.Iterate.impl.NewCursor.094] // CHECK:STDOUT: %bound_method.loc63_33.1: = bound_method %c.ref, %impl.elem2.loc63 -// CHECK:STDOUT: %facet_value.loc63_33.1: %CppRange_where.type.d682d6.1 = facet_value constants.%DiffConstRange, (constants.%custom_witness.e7a31c.1, constants.%custom_witness.d0da43.1, constants.%custom_witness.7b4, constants.%custom_witness.f7d4ff.1, constants.%custom_witness.0c0, constants.%custom_witness.ffb, constants.%custom_witness.a26, constants.%custom_witness.f7d4ff.2) [concrete = constants.%facet_value.733] -// CHECK:STDOUT: %.loc63_33.1: %CppRange_where.type.d682d6.1 = converted constants.%DiffConstRange, %facet_value.loc63_33.1 [concrete = constants.%facet_value.733] -// CHECK:STDOUT: %facet_value.loc63_33.2: %CppRange_where.type.d682d6.1 = facet_value constants.%DiffConstRange, (constants.%custom_witness.e7a31c.1, constants.%custom_witness.d0da43.1, constants.%custom_witness.7b4, constants.%custom_witness.f7d4ff.1, constants.%custom_witness.0c0, constants.%custom_witness.ffb, constants.%custom_witness.a26, constants.%custom_witness.f7d4ff.2) [concrete = constants.%facet_value.733] -// CHECK:STDOUT: %.loc63_33.2: %CppRange_where.type.d682d6.1 = converted constants.%DiffConstRange, %facet_value.loc63_33.2 [concrete = constants.%facet_value.733] -// CHECK:STDOUT: %specific_fn.loc63_33.1: = specific_function %impl.elem2.loc63, @T.as_type.as.Iterate.impl.NewCursor(constants.%facet_value.733) [concrete = constants.%T.as_type.as.Iterate.impl.NewCursor.specific_fn.f9d] +// CHECK:STDOUT: %facet_value.loc63_33.1: %CppRange_where.type.d682d6.1 = facet_value constants.%DiffConstRange, (constants.%custom_witness.1bfa2a.1, constants.%custom_witness.d0da43.1, constants.%custom_witness.7b4, constants.%custom_witness.48b6e9.1, constants.%custom_witness.0c0, constants.%custom_witness.ffb, constants.%custom_witness.a26, constants.%custom_witness.48b6e9.2) [concrete = constants.%facet_value.9a7] +// CHECK:STDOUT: %.loc63_33.1: %CppRange_where.type.d682d6.1 = converted constants.%DiffConstRange, %facet_value.loc63_33.1 [concrete = constants.%facet_value.9a7] +// CHECK:STDOUT: %facet_value.loc63_33.2: %CppRange_where.type.d682d6.1 = facet_value constants.%DiffConstRange, (constants.%custom_witness.1bfa2a.1, constants.%custom_witness.d0da43.1, constants.%custom_witness.7b4, constants.%custom_witness.48b6e9.1, constants.%custom_witness.0c0, constants.%custom_witness.ffb, constants.%custom_witness.a26, constants.%custom_witness.48b6e9.2) [concrete = constants.%facet_value.9a7] +// CHECK:STDOUT: %.loc63_33.2: %CppRange_where.type.d682d6.1 = converted constants.%DiffConstRange, %facet_value.loc63_33.2 [concrete = constants.%facet_value.9a7] +// CHECK:STDOUT: %specific_fn.loc63_33.1: = specific_function %impl.elem2.loc63, @T.as_type.as.Iterate.impl.NewCursor(constants.%facet_value.9a7) [concrete = constants.%T.as_type.as.Iterate.impl.NewCursor.specific_fn.ac7] // CHECK:STDOUT: %bound_method.loc63_33.2: = bound_method %c.ref, %specific_fn.loc63_33.1 // CHECK:STDOUT: %var.loc63: ref %tuple.type.df5 = var_storage invalid // CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.call.loc63: init %tuple.type.df5 to %var.loc63 = call %bound_method.loc63_33.2(%c.ref) @@ -1910,36 +2313,36 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: // CHECK:STDOUT: !for.next.loc63: // CHECK:STDOUT: %addr.loc63: %ptr.310 = addr_of %var.loc63 -// CHECK:STDOUT: %impl.elem3.loc63: %.802 = impl_witness_access constants.%Iterate.impl_witness.f7f, element3 [concrete = constants.%T.as_type.as.Iterate.impl.Next.59a] +// CHECK:STDOUT: %impl.elem3.loc63: %.0fb = impl_witness_access constants.%Iterate.impl_witness.1bb, element3 [concrete = constants.%T.as_type.as.Iterate.impl.Next.33b] // CHECK:STDOUT: %bound_method.loc63_33.3: = bound_method %c.ref, %impl.elem3.loc63 -// CHECK:STDOUT: %facet_value.loc63_33.3: %CppRange_where.type.d682d6.1 = facet_value constants.%DiffConstRange, (constants.%custom_witness.e7a31c.1, constants.%custom_witness.d0da43.1, constants.%custom_witness.7b4, constants.%custom_witness.f7d4ff.1, constants.%custom_witness.0c0, constants.%custom_witness.ffb, constants.%custom_witness.a26, constants.%custom_witness.f7d4ff.2) [concrete = constants.%facet_value.733] -// CHECK:STDOUT: %.loc63_33.3: %CppRange_where.type.d682d6.1 = converted constants.%DiffConstRange, %facet_value.loc63_33.3 [concrete = constants.%facet_value.733] -// CHECK:STDOUT: %facet_value.loc63_33.4: %CppRange_where.type.d682d6.1 = facet_value constants.%DiffConstRange, (constants.%custom_witness.e7a31c.1, constants.%custom_witness.d0da43.1, constants.%custom_witness.7b4, constants.%custom_witness.f7d4ff.1, constants.%custom_witness.0c0, constants.%custom_witness.ffb, constants.%custom_witness.a26, constants.%custom_witness.f7d4ff.2) [concrete = constants.%facet_value.733] -// CHECK:STDOUT: %.loc63_33.4: %CppRange_where.type.d682d6.1 = converted constants.%DiffConstRange, %facet_value.loc63_33.4 [concrete = constants.%facet_value.733] -// CHECK:STDOUT: %specific_fn.loc63_33.2: = specific_function %impl.elem3.loc63, @T.as_type.as.Iterate.impl.Next(constants.%facet_value.733) [concrete = constants.%T.as_type.as.Iterate.impl.Next.specific_fn.2ac] +// CHECK:STDOUT: %facet_value.loc63_33.3: %CppRange_where.type.d682d6.1 = facet_value constants.%DiffConstRange, (constants.%custom_witness.1bfa2a.1, constants.%custom_witness.d0da43.1, constants.%custom_witness.7b4, constants.%custom_witness.48b6e9.1, constants.%custom_witness.0c0, constants.%custom_witness.ffb, constants.%custom_witness.a26, constants.%custom_witness.48b6e9.2) [concrete = constants.%facet_value.9a7] +// CHECK:STDOUT: %.loc63_33.3: %CppRange_where.type.d682d6.1 = converted constants.%DiffConstRange, %facet_value.loc63_33.3 [concrete = constants.%facet_value.9a7] +// CHECK:STDOUT: %facet_value.loc63_33.4: %CppRange_where.type.d682d6.1 = facet_value constants.%DiffConstRange, (constants.%custom_witness.1bfa2a.1, constants.%custom_witness.d0da43.1, constants.%custom_witness.7b4, constants.%custom_witness.48b6e9.1, constants.%custom_witness.0c0, constants.%custom_witness.ffb, constants.%custom_witness.a26, constants.%custom_witness.48b6e9.2) [concrete = constants.%facet_value.9a7] +// CHECK:STDOUT: %.loc63_33.4: %CppRange_where.type.d682d6.1 = converted constants.%DiffConstRange, %facet_value.loc63_33.4 [concrete = constants.%facet_value.9a7] +// CHECK:STDOUT: %specific_fn.loc63_33.2: = specific_function %impl.elem3.loc63, @T.as_type.as.Iterate.impl.Next(constants.%facet_value.9a7) [concrete = constants.%T.as_type.as.Iterate.impl.Next.specific_fn.53e] // CHECK:STDOUT: %bound_method.loc63_33.4: = bound_method %c.ref, %specific_fn.loc63_33.2 -// CHECK:STDOUT: %.loc63_33.5: ref %Optional.15a = temporary_storage -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.call.loc63: init %Optional.15a to %.loc63_33.5 = call %bound_method.loc63_33.4(%c.ref, %addr.loc63) -// CHECK:STDOUT: %.loc63_33.6: ref %Optional.15a = temporary %.loc63_33.5, %T.as_type.as.Iterate.impl.Next.call.loc63 -// CHECK:STDOUT: %.loc63_33.7: %Optional.HasValue.type.6f3 = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.c3f) [concrete = constants.%Optional.HasValue.038] -// CHECK:STDOUT: %HasValue.ref.loc63: %Optional.HasValue.type.6f3 = name_ref HasValue, %.loc63_33.7 [concrete = constants.%Optional.HasValue.038] +// CHECK:STDOUT: %.loc63_33.5: ref %Optional.d06 = temporary_storage +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.call.loc63: init %Optional.d06 to %.loc63_33.5 = call %bound_method.loc63_33.4(%c.ref, %addr.loc63) +// CHECK:STDOUT: %.loc63_33.6: ref %Optional.d06 = temporary %.loc63_33.5, %T.as_type.as.Iterate.impl.Next.call.loc63 +// CHECK:STDOUT: %.loc63_33.7: %Optional.HasValue.type.821 = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.beb) [concrete = constants.%Optional.HasValue.960] +// CHECK:STDOUT: %HasValue.ref.loc63: %Optional.HasValue.type.821 = name_ref HasValue, %.loc63_33.7 [concrete = constants.%Optional.HasValue.960] // CHECK:STDOUT: %Optional.HasValue.bound.loc63: = bound_method %.loc63_33.6, %HasValue.ref.loc63 -// CHECK:STDOUT: %Optional.HasValue.specific_fn.loc63: = specific_function %HasValue.ref.loc63, @Optional.HasValue(constants.%OptionalStorage.facet.c3f) [concrete = constants.%Optional.HasValue.specific_fn.bc4] +// CHECK:STDOUT: %Optional.HasValue.specific_fn.loc63: = specific_function %HasValue.ref.loc63, @Optional.HasValue(constants.%OptionalStorage.facet.beb) [concrete = constants.%Optional.HasValue.specific_fn.a20] // CHECK:STDOUT: %bound_method.loc63_33.5: = bound_method %.loc63_33.6, %Optional.HasValue.specific_fn.loc63 -// CHECK:STDOUT: %.loc63_33.8: %Optional.15a = acquire_value %.loc63_33.6 +// CHECK:STDOUT: %.loc63_33.8: %Optional.d06 = acquire_value %.loc63_33.6 // CHECK:STDOUT: %Optional.HasValue.call.loc63: init bool = call %bound_method.loc63_33.5(%.loc63_33.8) // CHECK:STDOUT: %.loc63_33.9: bool = value_of_initializer %Optional.HasValue.call.loc63 // CHECK:STDOUT: %.loc63_33.10: bool = converted %Optional.HasValue.call.loc63, %.loc63_33.9 // CHECK:STDOUT: if %.loc63_33.10 br !for.body.loc63 else br !for.done.loc63 // CHECK:STDOUT: // CHECK:STDOUT: !for.body.loc63: -// CHECK:STDOUT: %.loc63_33.11: %Optional.Get.type.d3e = specific_constant imports.%Core.import_ref.dab, @Optional(constants.%OptionalStorage.facet.c3f) [concrete = constants.%Optional.Get.57f] -// CHECK:STDOUT: %Get.ref.loc63: %Optional.Get.type.d3e = name_ref Get, %.loc63_33.11 [concrete = constants.%Optional.Get.57f] +// CHECK:STDOUT: %.loc63_33.11: %Optional.Get.type.f9c = specific_constant imports.%Core.import_ref.dab, @Optional(constants.%OptionalStorage.facet.beb) [concrete = constants.%Optional.Get.294] +// CHECK:STDOUT: %Get.ref.loc63: %Optional.Get.type.f9c = name_ref Get, %.loc63_33.11 [concrete = constants.%Optional.Get.294] // CHECK:STDOUT: %Optional.Get.bound.loc63: = bound_method %.loc63_33.6, %Get.ref.loc63 -// CHECK:STDOUT: %Optional.Get.specific_fn.loc63: = specific_function %Get.ref.loc63, @Optional.Get(constants.%OptionalStorage.facet.c3f) [concrete = constants.%Optional.Get.specific_fn.c49] +// CHECK:STDOUT: %Optional.Get.specific_fn.loc63: = specific_function %Get.ref.loc63, @Optional.Get(constants.%OptionalStorage.facet.beb) [concrete = constants.%Optional.Get.specific_fn.084] // CHECK:STDOUT: %bound_method.loc63_33.6: = bound_method %.loc63_33.6, %Optional.Get.specific_fn.loc63 // CHECK:STDOUT: %.loc63_33.12: ref %DiffValueType = temporary_storage -// CHECK:STDOUT: %.loc63_33.13: %Optional.15a = acquire_value %.loc63_33.6 +// CHECK:STDOUT: %.loc63_33.13: %Optional.d06 = acquire_value %.loc63_33.6 // CHECK:STDOUT: %Optional.Get.call.loc63: init %DiffValueType to %.loc63_33.12 = call %bound_method.loc63_33.6(%.loc63_33.13) // CHECK:STDOUT: %.loc63_33.14: ref %DiffValueType = temporary %.loc63_33.12, %Optional.Get.call.loc63 // CHECK:STDOUT: %.loc63_33.15: %DiffValueType = acquire_value %.loc63_33.14 @@ -1955,19 +2358,17 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %.loc64_9.1: %ptr.816 = as_compatible %addr.loc64 // CHECK:STDOUT: %.loc64_9.2: %ptr.816 = converted %addr.loc64, %.loc64_9.1 // CHECK:STDOUT: %operator_PlusEqual__carbon_thunk.call.loc64: ref %DiffValueType = call imports.%operator_PlusEqual__carbon_thunk.decl(%sum.ref.loc64, %.loc64_9.2) -// CHECK:STDOUT: %DiffValueType.Op.bound.loc63: = bound_method %.loc63_33.14, constants.%DiffValueType.Op.4dca31.1 -// CHECK:STDOUT: %Op.ref.loc63: %DiffValueType.cpp_destructor.type = name_ref Op, imports.%DiffValueType.cpp_destructor.decl [concrete = constants.%DiffValueType.cpp_destructor] -// CHECK:STDOUT: %DiffValueType.cpp_destructor.bound.loc63: = bound_method %.loc63_33.14, %Op.ref.loc63 -// CHECK:STDOUT: %DiffValueType.cpp_destructor.call.loc63: init %empty_tuple.type = call %DiffValueType.cpp_destructor.bound.loc63(%.loc63_33.14) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc63_33.1: = bound_method %.loc63_33.6, constants.%Destroy.WithSelf.Op.403171.7 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc63_33.1: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc63_33.1(%.loc63_33.6) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc63_33.1: = bound_method %.loc63_33.14, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc63_33.1: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc63_33.1(%.loc63_33.14) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc63_33.2: = bound_method %.loc63_33.6, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.8 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc63_33.2: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc63_33.2(%.loc63_33.6) // CHECK:STDOUT: br !for.next.loc63 // CHECK:STDOUT: // CHECK:STDOUT: !for.done.loc63: -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc63_33.2: = bound_method %.loc63_33.6, constants.%Destroy.WithSelf.Op.403171.7 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc63_33.2: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc63_33.2(%.loc63_33.6) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc63_33.3: = bound_method %var.loc63, constants.%Destroy.WithSelf.Op.403171.9 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc63_33.3: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc63_33.3(%var.loc63) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc63_33.3: = bound_method %.loc63_33.6, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.8 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc63_33.3: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc63_33.3(%.loc63_33.6) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc63_33.4: = bound_method %var.loc63, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.15 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc63_33.4: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc63_33.4(%var.loc63) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1975,14 +2376,14 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %R.patt.loc40_17.2 => constants.%R.patt // CHECK:STDOUT: %R.loc40_17.1 => constants.%R // CHECK:STDOUT: %R.as_type.loc40_79.1 => constants.%R.as_type -// CHECK:STDOUT: %pattern_type => constants.%pattern_type.20b -// CHECK:STDOUT: %r.patt.loc40_77.2 => constants.%r.patt.9f3 -// CHECK:STDOUT: %r.param_patt.loc40_72.2 => constants.%r.param_patt.b12 +// CHECK:STDOUT: %pattern_type => constants.%pattern_type.dc2 +// CHECK:STDOUT: %r.patt.loc40_77.2 => constants.%r.patt.917 +// CHECK:STDOUT: %r.param_patt.loc40_72.2 => constants.%r.param_patt.9a1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @TestIterate(constants.%facet_value.753) { +// CHECK:STDOUT: specific @TestIterate(constants.%facet_value.70f) { // CHECK:STDOUT: %R.patt.loc40_17.2 => constants.%R.patt -// CHECK:STDOUT: %R.loc40_17.1 => constants.%facet_value.753 +// CHECK:STDOUT: %R.loc40_17.1 => constants.%facet_value.70f // CHECK:STDOUT: %R.as_type.loc40_79.1 => constants.%DiffMutableRange // CHECK:STDOUT: %pattern_type => constants.%pattern_type.611 // CHECK:STDOUT: %r.patt.loc40_77.2 => constants.%r.patt.5fe @@ -1990,30 +2391,30 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc40 => constants.%complete_type.357 -// CHECK:STDOUT: %Iterate.lookup_impl_witness => constants.%Iterate.impl_witness.747 -// CHECK:STDOUT: %Iterate.facet.loc44_33.5 => constants.%Iterate.facet.68a -// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type => constants.%Iterate.WithSelf.NewCursor.type.e9c -// CHECK:STDOUT: %.loc44_33.20 => constants.%.cbf -// CHECK:STDOUT: %impl.elem2.loc44_33.2 => constants.%T.as_type.as.Iterate.impl.NewCursor.136 -// CHECK:STDOUT: %specific_impl_fn.loc44_33.4 => constants.%T.as_type.as.Iterate.impl.NewCursor.specific_fn.7b5 -// CHECK:STDOUT: %impl.elem1 => constants.%Destroy.facet.ef9 +// CHECK:STDOUT: %Iterate.lookup_impl_witness => constants.%Iterate.impl_witness.dbb +// CHECK:STDOUT: %Iterate.facet.loc44_33.5 => constants.%Iterate.facet.9e0 +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type => constants.%Iterate.WithSelf.NewCursor.type.d66 +// CHECK:STDOUT: %.loc44_33.20 => constants.%.ae2 +// CHECK:STDOUT: %impl.elem2.loc44_33.3 => constants.%T.as_type.as.Iterate.impl.NewCursor.755 +// CHECK:STDOUT: %specific_impl_fn.loc44_33.4 => constants.%T.as_type.as.Iterate.impl.NewCursor.specific_fn.210 +// CHECK:STDOUT: %impl.elem1 => constants.%Destroy.facet.645 // CHECK:STDOUT: %as_type => constants.%tuple.type.b18 // CHECK:STDOUT: %require_complete.1 => constants.%complete_type.bfe // CHECK:STDOUT: %ptr => constants.%ptr.3ce -// CHECK:STDOUT: %Iterate.WithSelf.Next.type => constants.%Iterate.WithSelf.Next.type.a94 -// CHECK:STDOUT: %.loc44_33.21 => constants.%.922 -// CHECK:STDOUT: %impl.elem3.loc44_33.2 => constants.%T.as_type.as.Iterate.impl.Next.31b -// CHECK:STDOUT: %specific_impl_fn.loc44_33.5 => constants.%T.as_type.as.Iterate.impl.Next.specific_fn.a81 -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.5f3 -// CHECK:STDOUT: %.loc44_33.22 => constants.%.74d -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.6c4ec3.8 -// CHECK:STDOUT: %impl.elem0.loc44_33.2 => constants.%Destroy.WithSelf.Op.403171.8 -// CHECK:STDOUT: %specific_impl_fn.loc44_33.6 => constants.%Destroy.WithSelf.Op.403171.8 +// CHECK:STDOUT: %Iterate.WithSelf.Next.type => constants.%Iterate.WithSelf.Next.type.37e +// CHECK:STDOUT: %.loc44_33.21 => constants.%.0f5 +// CHECK:STDOUT: %impl.elem3.loc44_33.2 => constants.%T.as_type.as.Iterate.impl.Next.8e7 +// CHECK:STDOUT: %specific_impl_fn.loc44_33.5 => constants.%T.as_type.as.Iterate.impl.Next.specific_fn.f32 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.690 +// CHECK:STDOUT: %.loc44_33.22 => constants.%.95e +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.f8f19d.8 +// CHECK:STDOUT: %impl.elem2.loc44_33.4 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.11 +// CHECK:STDOUT: %specific_impl_fn.loc44_33.6 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.11 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @TestIterate(constants.%facet_value.1e4) { +// CHECK:STDOUT: specific @TestIterate(constants.%facet_value.4ce) { // CHECK:STDOUT: %R.patt.loc40_17.2 => constants.%R.patt -// CHECK:STDOUT: %R.loc40_17.1 => constants.%facet_value.1e4 +// CHECK:STDOUT: %R.loc40_17.1 => constants.%facet_value.4ce // CHECK:STDOUT: %R.as_type.loc40_79.1 => constants.%DiffConstRange // CHECK:STDOUT: %pattern_type => constants.%pattern_type.7dd // CHECK:STDOUT: %r.patt.loc40_77.2 => constants.%r.patt.9c0 @@ -2021,25 +2422,25 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc40 => constants.%complete_type.357 -// CHECK:STDOUT: %Iterate.lookup_impl_witness => constants.%Iterate.impl_witness.f7f -// CHECK:STDOUT: %Iterate.facet.loc44_33.5 => constants.%Iterate.facet.608 -// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type => constants.%Iterate.WithSelf.NewCursor.type.185 -// CHECK:STDOUT: %.loc44_33.20 => constants.%.f70 -// CHECK:STDOUT: %impl.elem2.loc44_33.2 => constants.%T.as_type.as.Iterate.impl.NewCursor.1a9 -// CHECK:STDOUT: %specific_impl_fn.loc44_33.4 => constants.%T.as_type.as.Iterate.impl.NewCursor.specific_fn.f9d -// CHECK:STDOUT: %impl.elem1 => constants.%Destroy.facet.71f +// CHECK:STDOUT: %Iterate.lookup_impl_witness => constants.%Iterate.impl_witness.1bb +// CHECK:STDOUT: %Iterate.facet.loc44_33.5 => constants.%Iterate.facet.873 +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type => constants.%Iterate.WithSelf.NewCursor.type.7e8 +// CHECK:STDOUT: %.loc44_33.20 => constants.%.88e +// CHECK:STDOUT: %impl.elem2.loc44_33.3 => constants.%T.as_type.as.Iterate.impl.NewCursor.094 +// CHECK:STDOUT: %specific_impl_fn.loc44_33.4 => constants.%T.as_type.as.Iterate.impl.NewCursor.specific_fn.ac7 +// CHECK:STDOUT: %impl.elem1 => constants.%Destroy.facet.206 // CHECK:STDOUT: %as_type => constants.%tuple.type.df5 // CHECK:STDOUT: %require_complete.1 => constants.%complete_type.ad6 // CHECK:STDOUT: %ptr => constants.%ptr.310 -// CHECK:STDOUT: %Iterate.WithSelf.Next.type => constants.%Iterate.WithSelf.Next.type.f38 -// CHECK:STDOUT: %.loc44_33.21 => constants.%.802 -// CHECK:STDOUT: %impl.elem3.loc44_33.2 => constants.%T.as_type.as.Iterate.impl.Next.59a -// CHECK:STDOUT: %specific_impl_fn.loc44_33.5 => constants.%T.as_type.as.Iterate.impl.Next.specific_fn.2ac -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.eb1 -// CHECK:STDOUT: %.loc44_33.22 => constants.%.236 -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.6c4ec3.9 -// CHECK:STDOUT: %impl.elem0.loc44_33.2 => constants.%Destroy.WithSelf.Op.403171.9 -// CHECK:STDOUT: %specific_impl_fn.loc44_33.6 => constants.%Destroy.WithSelf.Op.403171.9 +// CHECK:STDOUT: %Iterate.WithSelf.Next.type => constants.%Iterate.WithSelf.Next.type.b3c +// CHECK:STDOUT: %.loc44_33.21 => constants.%.0fb +// CHECK:STDOUT: %impl.elem3.loc44_33.2 => constants.%T.as_type.as.Iterate.impl.Next.33b +// CHECK:STDOUT: %specific_impl_fn.loc44_33.5 => constants.%T.as_type.as.Iterate.impl.Next.specific_fn.53e +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.8c6 +// CHECK:STDOUT: %.loc44_33.22 => constants.%.426 +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.f8f19d.9 +// CHECK:STDOUT: %impl.elem2.loc44_33.4 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.15 +// CHECK:STDOUT: %specific_impl_fn.loc44_33.6 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.15 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- method_overloads.carbon @@ -2048,6 +2449,7 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: type: type = facet_type [concrete] // CHECK:STDOUT: %Iterate.type: type = facet_type <@Iterate> [concrete] // CHECK:STDOUT: %OptionalStorage.type: type = facet_type <@OptionalStorage> [concrete] +// CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %facet_type.f48: type = facet_type <@Destroy & @Copy> [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] @@ -2094,60 +2496,103 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %pattern_type.804: type = pattern_type %OverloadValueType [concrete] -// CHECK:STDOUT: %OverloadValueType.cpp_destructor.type: type = fn_type @OverloadValueType.cpp_destructor [concrete] -// CHECK:STDOUT: %OverloadValueType.cpp_destructor: %OverloadValueType.cpp_destructor.type = struct_value () [concrete] -// CHECK:STDOUT: %OverloadValueType.Op.type.83af6e.1: type = fn_type @OverloadValueType.Op.1 [concrete] -// CHECK:STDOUT: %OverloadValueType.Op.4dca31.1: %OverloadValueType.Op.type.83af6e.1 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.e7a31c.1: = custom_witness (%OverloadValueType.Op.4dca31.1), @Destroy [concrete] -// CHECK:STDOUT: %OverloadValueType.Op.type.83af6e.2: type = fn_type @OverloadValueType.Op.2 [concrete] -// CHECK:STDOUT: %OverloadValueType.Op.4dca31.2: %OverloadValueType.Op.type.83af6e.2 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.d0da43.1: = custom_witness (%OverloadValueType.Op.4dca31.2), @Copy [concrete] -// CHECK:STDOUT: %facet_value.437: %facet_type.f48 = facet_value %OverloadValueType, (%custom_witness.e7a31c.1, %custom_witness.d0da43.1) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc25_56 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc25_56 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %OverloadValueType.SubobjectDestroy.type: type = fn_type @OverloadValueType.SubobjectDestroy [concrete] +// CHECK:STDOUT: %OverloadValueType.SubobjectDestroy: %OverloadValueType.SubobjectDestroy.type = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.1bfa2a.1: = custom_witness (%Destroy.WithSelf.Op.403171.2, %OverloadValueType.SubobjectDestroy, %Destroy.WithSelf.SelfDestruct.db3fdb.2), @Destroy [concrete] +// CHECK:STDOUT: %OverloadValueType.Op.type: type = fn_type @OverloadValueType.Op [concrete] +// CHECK:STDOUT: %OverloadValueType.Op: %OverloadValueType.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.d0da43.1: = custom_witness (%OverloadValueType.Op), @Copy [concrete] +// CHECK:STDOUT: %facet_value.8be: %facet_type.f48 = facet_value %OverloadValueType, (%custom_witness.1bfa2a.1, %custom_witness.d0da43.1) [concrete] // CHECK:STDOUT: %Iterate.lookup_impl_witness.1d8: = lookup_impl_witness %.Self.500, @Iterate [symbolic_self] // CHECK:STDOUT: %impl.elem0.294: %facet_type.f48 = impl_witness_access %Iterate.lookup_impl_witness.1d8, element0 [symbolic_self] -// CHECK:STDOUT: %Iterate_where.type.494: type = facet_type <@Iterate where %impl.elem0.294 = %facet_value.437> [concrete] -// CHECK:STDOUT: %pattern_type.aac: type = pattern_type %Iterate_where.type.494 [concrete] -// CHECK:STDOUT: %R.patt: %pattern_type.aac = symbolic_binding_pattern R, 0 [symbolic] -// CHECK:STDOUT: %R: %Iterate_where.type.494 = symbolic_binding R, 0 [symbolic] +// CHECK:STDOUT: %Iterate_where.type.2ee: type = facet_type <@Iterate where %impl.elem0.294 = %facet_value.8be> [concrete] +// CHECK:STDOUT: %pattern_type.e15: type = pattern_type %Iterate_where.type.2ee [concrete] +// CHECK:STDOUT: %R.patt: %pattern_type.e15 = symbolic_binding_pattern R, 0 [symbolic] +// CHECK:STDOUT: %R: %Iterate_where.type.2ee = symbolic_binding R, 0 [symbolic] // CHECK:STDOUT: %R.as_type: type = facet_access_type %R [symbolic] -// CHECK:STDOUT: %pattern_type.def: type = pattern_type %R.as_type [symbolic] -// CHECK:STDOUT: %r.patt.bb3: %pattern_type.def = ref_binding_pattern r [symbolic] -// CHECK:STDOUT: %r.param_patt.9b2: %pattern_type.def = var_param_pattern %r.patt.bb3 [symbolic] +// CHECK:STDOUT: %pattern_type.a47: type = pattern_type %R.as_type [symbolic] +// CHECK:STDOUT: %r.patt.24d: %pattern_type.a47 = ref_binding_pattern r [symbolic] +// CHECK:STDOUT: %r.param_patt.d5b: %pattern_type.a47 = var_param_pattern %r.patt.24d [symbolic] // CHECK:STDOUT: %_.patt.a10: %pattern_type.804 = value_binding_pattern _ [concrete] -// CHECK:STDOUT: %Iterate.lookup_impl_witness.eca: = lookup_impl_witness %R, @Iterate [symbolic] -// CHECK:STDOUT: %Iterate.facet.bb8: %Iterate.type = facet_value %R.as_type, (%Iterate.lookup_impl_witness.eca) [symbolic] -// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.c6e: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.bb8) [symbolic] -// CHECK:STDOUT: %Iterate.WithSelf.Next.type.76f: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.bb8) [symbolic] -// CHECK:STDOUT: %.426: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.c6e, %Iterate.facet.bb8 [symbolic] -// CHECK:STDOUT: %impl.elem2.82f: %.426 = impl_witness_access %Iterate.lookup_impl_witness.eca, element2 [symbolic] -// CHECK:STDOUT: %impl.elem1.424: %Destroy.type = impl_witness_access %Iterate.lookup_impl_witness.eca, element1 [symbolic] -// CHECK:STDOUT: %as_type.810: type = facet_access_type %impl.elem1.424 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.5f9: = specific_impl_function %impl.elem2.82f, @Iterate.WithSelf.NewCursor(%Iterate.facet.bb8) [symbolic] -// CHECK:STDOUT: %ptr.a41: type = ptr_type %as_type.810 [symbolic] -// CHECK:STDOUT: %.474: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.76f, %Iterate.facet.bb8 [symbolic] -// CHECK:STDOUT: %impl.elem3.316: %.474 = impl_witness_access %Iterate.lookup_impl_witness.eca, element3 [symbolic] -// CHECK:STDOUT: %DefaultOptionalStorage.799: type = class_type @DefaultOptionalStorage, @DefaultOptionalStorage(%facet_value.437) [concrete] -// CHECK:STDOUT: %OptionalStorage.impl_witness.1e9: = impl_witness imports.%OptionalStorage.impl_witness_table.460, @T.as_type.as.OptionalStorage.impl(%facet_value.437) [concrete] -// CHECK:STDOUT: %OptionalStorage.facet.496: %OptionalStorage.type = facet_value %OverloadValueType, (%OptionalStorage.impl_witness.1e9) [concrete] -// CHECK:STDOUT: %Optional.4e9: type = class_type @Optional, @Optional(%OptionalStorage.facet.496) [concrete] -// CHECK:STDOUT: %specific_impl_fn.754: = specific_impl_function %impl.elem3.316, @Iterate.WithSelf.Next(%Iterate.facet.bb8) [symbolic] -// CHECK:STDOUT: %Optional.HasValue.type.59f: type = fn_type @Optional.HasValue, @Optional(%OptionalStorage.facet.496) [concrete] -// CHECK:STDOUT: %Optional.HasValue.91a: %Optional.HasValue.type.59f = struct_value () [concrete] -// CHECK:STDOUT: %Optional.Get.type.cab: type = fn_type @Optional.Get, @Optional(%OptionalStorage.facet.496) [concrete] -// CHECK:STDOUT: %Optional.Get.2d3: %Optional.Get.type.cab = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.facet.7ac: %Destroy.type = facet_value %OverloadValueType, (%custom_witness.e7a31c.1) [concrete] -// CHECK:STDOUT: %MaybeUnformed.59c: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.7ac) [concrete] +// CHECK:STDOUT: %Iterate.lookup_impl_witness.e07: = lookup_impl_witness %R, @Iterate [symbolic] +// CHECK:STDOUT: %Iterate.facet.8b0: %Iterate.type = facet_value %R.as_type, (%Iterate.lookup_impl_witness.e07) [symbolic] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.d55: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.8b0) [symbolic] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type.627: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.8b0) [symbolic] +// CHECK:STDOUT: %.489: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.d55, %Iterate.facet.8b0 [symbolic] +// CHECK:STDOUT: %impl.elem2.348: %.489 = impl_witness_access %Iterate.lookup_impl_witness.e07, element2 [symbolic] +// CHECK:STDOUT: %impl.elem1.0e3: %Destroy.type = impl_witness_access %Iterate.lookup_impl_witness.e07, element1 [symbolic] +// CHECK:STDOUT: %as_type.400: type = facet_access_type %impl.elem1.0e3 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.e06: = specific_impl_function %impl.elem2.348, @Iterate.WithSelf.NewCursor(%Iterate.facet.8b0) [symbolic] +// CHECK:STDOUT: %ptr.196: type = ptr_type %as_type.400 [symbolic] +// CHECK:STDOUT: %.fd2: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.627, %Iterate.facet.8b0 [symbolic] +// CHECK:STDOUT: %impl.elem3.bb6: %.fd2 = impl_witness_access %Iterate.lookup_impl_witness.e07, element3 [symbolic] +// CHECK:STDOUT: %DefaultOptionalStorage.fbc: type = class_type @DefaultOptionalStorage, @DefaultOptionalStorage(%facet_value.8be) [concrete] +// CHECK:STDOUT: %OptionalStorage.impl_witness.bbc: = impl_witness imports.%OptionalStorage.impl_witness_table.460, @T.as_type.as.OptionalStorage.impl(%facet_value.8be) [concrete] +// CHECK:STDOUT: %OptionalStorage.facet.50c: %OptionalStorage.type = facet_value %OverloadValueType, (%OptionalStorage.impl_witness.bbc) [concrete] +// CHECK:STDOUT: %Optional.cb9: type = class_type @Optional, @Optional(%OptionalStorage.facet.50c) [concrete] +// CHECK:STDOUT: %pattern_type.042: type = pattern_type %Optional.cb9 [concrete] +// CHECK:STDOUT: %specific_impl_fn.622: = specific_impl_function %impl.elem3.bb6, @Iterate.WithSelf.Next(%Iterate.facet.8b0) [symbolic] +// CHECK:STDOUT: %Optional.HasValue.type.800: type = fn_type @Optional.HasValue, @Optional(%OptionalStorage.facet.50c) [concrete] +// CHECK:STDOUT: %Optional.HasValue.ab3: %Optional.HasValue.type.800 = struct_value () [concrete] +// CHECK:STDOUT: %Optional.Get.type.466: type = fn_type @Optional.Get, @Optional(%OptionalStorage.facet.50c) [concrete] +// CHECK:STDOUT: %Optional.Get.4ea: %Optional.Get.type.466 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.facet.d74: %Destroy.type = facet_value %OverloadValueType, (%custom_witness.1bfa2a.1) [concrete] +// CHECK:STDOUT: %MaybeUnformed.d16: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.d74) [concrete] // CHECK:STDOUT: %.8a2: type = maybe_unformed_type %OverloadValueType [concrete] -// CHECK:STDOUT: %struct_type.value.has_value.3e8: type = struct_type {.value: %MaybeUnformed.59c, .has_value: bool} [concrete] -// CHECK:STDOUT: %Optional.HasValue.specific_fn.bf1: = specific_function %Optional.HasValue.91a, @Optional.HasValue(%OptionalStorage.facet.496) [concrete] -// CHECK:STDOUT: %Optional.Get.specific_fn.548: = specific_function %Optional.Get.2d3, @Optional.Get(%OptionalStorage.facet.496) [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.7: type = fn_type @Destroy.WithSelf.Op.loc27_37.6 [concrete] +// CHECK:STDOUT: %struct_type.value.has_value.35f: type = struct_type {.value: %MaybeUnformed.d16, .has_value: bool} [concrete] +// CHECK:STDOUT: %Optional.HasValue.specific_fn.730: = specific_function %Optional.HasValue.ab3, @Optional.HasValue(%OptionalStorage.facet.50c) [concrete] +// CHECK:STDOUT: %Optional.Get.specific_fn.f34: = specific_function %Optional.Get.4ea, @Optional.Get(%OptionalStorage.facet.50c) [concrete] +// CHECK:STDOUT: %pattern_type.6ff: type = pattern_type %.8a2 [concrete] +// CHECK:STDOUT: %self.param_patt.b76: %pattern_type.6ff = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.079: %pattern_type.6ff = wrapper_binding_pattern self, %self.param_patt.b76 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc27_37.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc27_37.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.7a8: type = pattern_type %MaybeUnformed.d16 [concrete] +// CHECK:STDOUT: %self.param_patt.d5e0: %pattern_type.7a8 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.7ed: %pattern_type.7a8 = wrapper_binding_pattern self, %self.param_patt.d5e0 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc27_37.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc27_37.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.40d: %pattern_type.831 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.560: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt.40d [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc27_37.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.5: type = fn_type @Destroy.WithSelf.Op.loc27_37.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.5: %Destroy.WithSelf.Op.type.ef016f.5 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.d40: type = pattern_type %struct_type.value.has_value.35f [concrete] +// CHECK:STDOUT: %self.param_patt.cda: %pattern_type.d40 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.8b2: %pattern_type.d40 = wrapper_binding_pattern self, %self.param_patt.cda [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc27_37.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.6: type = fn_type @Destroy.WithSelf.Op.loc27_37.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.6: %Destroy.WithSelf.Op.type.ef016f.6 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.f46: type = pattern_type %DefaultOptionalStorage.fbc [concrete] +// CHECK:STDOUT: %self.param_patt.c8b: %pattern_type.f46 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.cf5: %pattern_type.f46 = wrapper_binding_pattern self, %self.param_patt.c8b [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc27_37.5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.7: type = fn_type @Destroy.WithSelf.Op.loc27_37.5 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.7: %Destroy.WithSelf.Op.type.ef016f.7 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.lookup_impl_witness.d2d: = lookup_impl_witness %impl.elem1.424, @Destroy [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.9de: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%impl.elem1.424) [symbolic] -// CHECK:STDOUT: %.696: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.9de, %impl.elem1.424 [symbolic] -// CHECK:STDOUT: %impl.elem0.18a: %.696 = impl_witness_access %Destroy.lookup_impl_witness.d2d, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.b04: = specific_impl_function %impl.elem0.18a, @Destroy.WithSelf.Op.1(%impl.elem1.424) [symbolic] +// CHECK:STDOUT: %self.param_patt.594: %pattern_type.042 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.4a4: %pattern_type.042 = wrapper_binding_pattern self, %self.param_patt.594 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc27_37.6 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.7: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.8: type = fn_type @Destroy.WithSelf.Op.loc27_37.6 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.8: %Destroy.WithSelf.Op.type.ef016f.8 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.8: type = fn_type @Destroy.WithSelf.SelfDestruct.loc27_37.6 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.8: %Destroy.WithSelf.SelfDestruct.type.fbceb5.8 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.lookup_impl_witness.a78: = lookup_impl_witness %impl.elem1.0e3, @Destroy [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.360: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%impl.elem1.0e3) [symbolic] +// CHECK:STDOUT: %.73a: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.360, %impl.elem1.0e3 [symbolic] +// CHECK:STDOUT: %impl.elem2.01e: %.73a = impl_witness_access %Destroy.lookup_impl_witness.a78, element2 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.dac: = specific_impl_function %impl.elem2.01e, @Destroy.WithSelf.SelfDestruct.1(%impl.elem1.0e3) [symbolic] // CHECK:STDOUT: %Range: type = class_type @Range [concrete] // CHECK:STDOUT: %pattern_type.23f: type = pattern_type %Range [concrete] // CHECK:STDOUT: %Iterator: type = class_type @Iterator.1 [concrete] @@ -2159,41 +2604,49 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %Iterator.Op.type.4232e0.1: type = fn_type @Iterator.Op.1 [concrete] // CHECK:STDOUT: %Iterator.Op.e8caec.1: %Iterator.Op.type.4232e0.1 = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.6bd: = custom_witness (%OverloadValueType, %Iterator.Op.e8caec.1), @CppUnsafeDeref [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.9: type = fn_type @Destroy.WithSelf.Op.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.9: %Destroy.WithSelf.Op.type.ef016f.9 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.9: type = fn_type @Destroy.WithSelf.SelfDestruct.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.9: %Destroy.WithSelf.SelfDestruct.type.fbceb5.9 = struct_value () [concrete] +// CHECK:STDOUT: %Iterator.SubobjectDestroy.type: type = fn_type @Iterator.SubobjectDestroy [concrete] +// CHECK:STDOUT: %Iterator.SubobjectDestroy: %Iterator.SubobjectDestroy.type = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.eaa: = custom_witness (%Destroy.WithSelf.Op.403171.9, %Iterator.SubobjectDestroy, %Destroy.WithSelf.SelfDestruct.db3fdb.9), @Destroy [concrete] // CHECK:STDOUT: %Iterator.Op.type.4232e0.2: type = fn_type @Iterator.Op.2 [concrete] // CHECK:STDOUT: %Iterator.Op.e8caec.2: %Iterator.Op.type.4232e0.2 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.f4a: = custom_witness (%Iterator.Op.e8caec.2), @Destroy [concrete] -// CHECK:STDOUT: %Iterator.Op.type.4232e0.3: type = fn_type @Iterator.Op.3 [concrete] -// CHECK:STDOUT: %Iterator.Op.e8caec.3: %Iterator.Op.type.4232e0.3 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.716: = custom_witness (%Iterator.Op.e8caec.3), @Inc [concrete] +// CHECK:STDOUT: %custom_witness.716: = custom_witness (%Iterator.Op.e8caec.2), @Inc [concrete] // CHECK:STDOUT: %Equal.type: type = fn_type @Equal [concrete] // CHECK:STDOUT: %Equal: %Equal.type = struct_value () [concrete] // CHECK:STDOUT: %NotEqual.type: type = fn_type @NotEqual [concrete] // CHECK:STDOUT: %NotEqual: %NotEqual.type = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.617: = custom_witness (%Equal, %NotEqual), @EqWith, @EqWith(%Iterator) [concrete] -// CHECK:STDOUT: %facet_value.cbe: %CppRange_where.type.d682d6.1 = facet_value %Range, (%custom_witness.e7a31c.1, %custom_witness.d0da43.1, %custom_witness.090, %custom_witness.f4a, %custom_witness.6bd, %custom_witness.716, %custom_witness.617) [concrete] +// CHECK:STDOUT: %facet_value.670: %CppRange_where.type.d682d6.1 = facet_value %Range, (%custom_witness.1bfa2a.1, %custom_witness.d0da43.1, %custom_witness.090, %custom_witness.eaa, %custom_witness.6bd, %custom_witness.716, %custom_witness.617) [concrete] // CHECK:STDOUT: %tuple.type.9ef: type = tuple_type (%Iterator, %Iterator) [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.8: type = fn_type @Destroy.WithSelf.Op.3 [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.8: %Destroy.WithSelf.Op.type.ef016f.8 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.6c4ec3.8: = custom_witness (%Destroy.WithSelf.Op.403171.8), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.6f5: %Destroy.type = facet_value %tuple.type.9ef, (%custom_witness.6c4ec3.8) [concrete] -// CHECK:STDOUT: %Iterate.impl_witness.175: = impl_witness imports.%Iterate.impl_witness_table.121, @T.as_type.as.Iterate.impl(%facet_value.cbe) [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.type.72c: type = fn_type @T.as_type.as.Iterate.impl.NewCursor, @T.as_type.as.Iterate.impl(%facet_value.cbe) [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.036: %T.as_type.as.Iterate.impl.NewCursor.type.72c = struct_value () [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.type.fb2: type = fn_type @T.as_type.as.Iterate.impl.Next, @T.as_type.as.Iterate.impl(%facet_value.cbe) [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.751: %T.as_type.as.Iterate.impl.Next.type.fb2 = struct_value () [concrete] -// CHECK:STDOUT: %Iterate.facet.cc4: %Iterate.type = facet_value %Range, (%Iterate.impl_witness.175) [concrete] -// CHECK:STDOUT: %facet_value.3af: %Iterate_where.type.494 = facet_value %Range, (%Iterate.impl_witness.175) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.8: type = fn_type @Destroy.WithSelf.SubobjectDestroy.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.8: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.8 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.10: type = fn_type @Destroy.WithSelf.Op.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.10: %Destroy.WithSelf.Op.type.ef016f.10 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.10: type = fn_type @Destroy.WithSelf.SelfDestruct.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.10: %Destroy.WithSelf.SelfDestruct.type.fbceb5.10 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f8f19d.8: = custom_witness (%Destroy.WithSelf.Op.403171.10, %Destroy.WithSelf.SubobjectDestroy.d01daf.8, %Destroy.WithSelf.SelfDestruct.db3fdb.10), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.c69: %Destroy.type = facet_value %tuple.type.9ef, (%custom_witness.f8f19d.8) [concrete] +// CHECK:STDOUT: %Iterate.impl_witness.24f: = impl_witness imports.%Iterate.impl_witness_table.121, @T.as_type.as.Iterate.impl(%facet_value.670) [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.type.1cd: type = fn_type @T.as_type.as.Iterate.impl.NewCursor, @T.as_type.as.Iterate.impl(%facet_value.670) [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.8fd: %T.as_type.as.Iterate.impl.NewCursor.type.1cd = struct_value () [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.type.ac6: type = fn_type @T.as_type.as.Iterate.impl.Next, @T.as_type.as.Iterate.impl(%facet_value.670) [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.4cb: %T.as_type.as.Iterate.impl.Next.type.ac6 = struct_value () [concrete] +// CHECK:STDOUT: %Iterate.facet.726: %Iterate.type = facet_value %Range, (%Iterate.impl_witness.24f) [concrete] +// CHECK:STDOUT: %facet_value.483: %Iterate_where.type.2ee = facet_value %Range, (%Iterate.impl_witness.24f) [concrete] // CHECK:STDOUT: %r.patt.b9f: %pattern_type.23f = ref_binding_pattern r [concrete] // CHECK:STDOUT: %r.param_patt.466: %pattern_type.23f = var_param_pattern %r.patt.b9f [concrete] -// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.a44: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.cc4) [concrete] -// CHECK:STDOUT: %Iterate.WithSelf.Next.type.1f9: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.cc4) [concrete] -// CHECK:STDOUT: %.687: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.a44, %Iterate.facet.cc4 [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.specific_fn: = specific_function %T.as_type.as.Iterate.impl.NewCursor.036, @T.as_type.as.Iterate.impl.NewCursor(%facet_value.cbe) [concrete] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.292: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.726) [concrete] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type.4f7: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.726) [concrete] +// CHECK:STDOUT: %.b72: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.292, %Iterate.facet.726 [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.specific_fn: = specific_function %T.as_type.as.Iterate.impl.NewCursor.8fd, @T.as_type.as.Iterate.impl.NewCursor(%facet_value.670) [concrete] // CHECK:STDOUT: %ptr.b18: type = ptr_type %tuple.type.9ef [concrete] -// CHECK:STDOUT: %.79c: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.1f9, %Iterate.facet.cc4 [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.specific_fn: = specific_function %T.as_type.as.Iterate.impl.Next.751, @T.as_type.as.Iterate.impl.Next(%facet_value.cbe) [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.26c: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Destroy.facet.6f5) [concrete] -// CHECK:STDOUT: %.149: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.26c, %Destroy.facet.6f5 [concrete] +// CHECK:STDOUT: %.0c0: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.4f7, %Iterate.facet.726 [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.specific_fn: = specific_function %T.as_type.as.Iterate.impl.Next.4cb, @T.as_type.as.Iterate.impl.Next(%facet_value.670) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.6ef: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.c69) [concrete] +// CHECK:STDOUT: %.a39: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.6ef, %Destroy.facet.c69 [concrete] // CHECK:STDOUT: %complete_type.e35: = complete_type_witness %tuple.type.9ef [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2218,36 +2671,118 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %Core.import_ref.273: @T.as_type.as.Iterate.impl.%T.as_type.as.Iterate.impl.Next.type (%T.as_type.as.Iterate.impl.Next.type.b36) = import_ref Core//prelude/iterate, loc{{\d+_\d+}}, loaded [symbolic = @T.as_type.as.Iterate.impl.%T.as_type.as.Iterate.impl.Next (constants.%T.as_type.as.Iterate.impl.Next.d6b)] // CHECK:STDOUT: %Iterate.impl_witness_table.121 = impl_witness_table (%Core.import_ref.eef, %Core.import_ref.fcc, %Core.import_ref.fd1, %Core.import_ref.273), @T.as_type.as.Iterate.impl [concrete] // CHECK:STDOUT: %OverloadValueType.decl: type = class_decl @OverloadValueType [concrete = constants.%OverloadValueType] {} {} -// CHECK:STDOUT: %OverloadValueType.cpp_destructor.decl: %OverloadValueType.cpp_destructor.type = fn_decl @OverloadValueType.cpp_destructor [concrete = constants.%OverloadValueType.cpp_destructor] { -// CHECK:STDOUT: -// CHECK:STDOUT: } { -// CHECK:STDOUT: -// CHECK:STDOUT: } // CHECK:STDOUT: %Range.decl: type = class_decl @Range [concrete = constants.%Range] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @TestIterate(%R.loc25_17.2: %Iterate_where.type.494) { +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc27_37.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6ff = ref_param_pattern [concrete = constants.%self.param_patt.b76] +// CHECK:STDOUT: %self.patt: %pattern_type.6ff = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.079] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %.8a2 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %.8a2 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc27_37.1 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6ff = ref_param_pattern [concrete = constants.%self.param_patt.b76] +// CHECK:STDOUT: %self.patt: %pattern_type.6ff = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.079] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %.8a2 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %.8a2 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc27_37.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.7a8 = ref_param_pattern [concrete = constants.%self.param_patt.d5e0] +// CHECK:STDOUT: %self.patt: %pattern_type.7a8 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.7ed] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %MaybeUnformed.d16 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %MaybeUnformed.d16 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc27_37.2 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.7a8 = ref_param_pattern [concrete = constants.%self.param_patt.d5e0] +// CHECK:STDOUT: %self.patt: %pattern_type.7a8 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.7ed] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %MaybeUnformed.d16 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %MaybeUnformed.d16 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc27_37.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d] +// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0 +// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.5 = fn_decl @Destroy.WithSelf.Op.loc27_37.3 [concrete = constants.%Destroy.WithSelf.Op.403171.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d] +// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0 +// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc27_37.4 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.d40 = ref_param_pattern [concrete = constants.%self.param_patt.cda] +// CHECK:STDOUT: %self.patt: %pattern_type.d40 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.8b2] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.value.has_value.35f = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.value.has_value.35f = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.5: %Destroy.WithSelf.Op.type.ef016f.6 = fn_decl @Destroy.WithSelf.Op.loc27_37.4 [concrete = constants.%Destroy.WithSelf.Op.403171.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.d40 = ref_param_pattern [concrete = constants.%self.param_patt.cda] +// CHECK:STDOUT: %self.patt: %pattern_type.d40 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.8b2] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.value.has_value.35f = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.value.has_value.35f = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc27_37.5 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f46 = ref_param_pattern [concrete = constants.%self.param_patt.c8b] +// CHECK:STDOUT: %self.patt: %pattern_type.f46 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cf5] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %DefaultOptionalStorage.fbc = ref_param call_param0 +// CHECK:STDOUT: %self: ref %DefaultOptionalStorage.fbc = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.6: %Destroy.WithSelf.Op.type.ef016f.7 = fn_decl @Destroy.WithSelf.Op.loc27_37.5 [concrete = constants.%Destroy.WithSelf.Op.403171.7] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f46 = ref_param_pattern [concrete = constants.%self.param_patt.c8b] +// CHECK:STDOUT: %self.patt: %pattern_type.f46 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cf5] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %DefaultOptionalStorage.fbc = ref_param call_param0 +// CHECK:STDOUT: %self: ref %DefaultOptionalStorage.fbc = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc27_37.6 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.7] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.042 = ref_param_pattern [concrete = constants.%self.param_patt.594] +// CHECK:STDOUT: %self.patt: %pattern_type.042 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.4a4] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Optional.cb9 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Optional.cb9 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.7: %Destroy.WithSelf.Op.type.ef016f.8 = fn_decl @Destroy.WithSelf.Op.loc27_37.6 [concrete = constants.%Destroy.WithSelf.Op.403171.8] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.042 = ref_param_pattern [concrete = constants.%self.param_patt.594] +// CHECK:STDOUT: %self.patt: %pattern_type.042 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.4a4] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Optional.cb9 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Optional.cb9 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @TestIterate(%R.loc25_17.2: %Iterate_where.type.2ee) { // CHECK:STDOUT: // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: %Iterate.lookup_impl_witness: = lookup_impl_witness %R.loc25_17.1, @Iterate [symbolic = %Iterate.lookup_impl_witness (constants.%Iterate.lookup_impl_witness.eca)] -// CHECK:STDOUT: %Iterate.facet.loc27_37.5: %Iterate.type = facet_value %R.as_type.loc25_83.1, (%Iterate.lookup_impl_witness) [symbolic = %Iterate.facet.loc27_37.5 (constants.%Iterate.facet.bb8)] -// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.loc27_37.5) [symbolic = %Iterate.WithSelf.NewCursor.type (constants.%Iterate.WithSelf.NewCursor.type.c6e)] -// CHECK:STDOUT: %.loc27_37.20: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type, %Iterate.facet.loc27_37.5 [symbolic = %.loc27_37.20 (constants.%.426)] -// CHECK:STDOUT: %impl.elem2.loc27_37.2: @TestIterate.%.loc27_37.20 (%.426) = impl_witness_access %Iterate.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc27_37.2 (constants.%impl.elem2.82f)] -// CHECK:STDOUT: %specific_impl_fn.loc27_37.4: = specific_impl_function %impl.elem2.loc27_37.2, @Iterate.WithSelf.NewCursor(%Iterate.facet.loc27_37.5) [symbolic = %specific_impl_fn.loc27_37.4 (constants.%specific_impl_fn.5f9)] +// CHECK:STDOUT: %Iterate.lookup_impl_witness: = lookup_impl_witness %R.loc25_17.1, @Iterate [symbolic = %Iterate.lookup_impl_witness (constants.%Iterate.lookup_impl_witness.e07)] +// CHECK:STDOUT: %Iterate.facet.loc27_37.5: %Iterate.type = facet_value %R.as_type.loc25_83.1, (%Iterate.lookup_impl_witness) [symbolic = %Iterate.facet.loc27_37.5 (constants.%Iterate.facet.8b0)] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.loc27_37.5) [symbolic = %Iterate.WithSelf.NewCursor.type (constants.%Iterate.WithSelf.NewCursor.type.d55)] +// CHECK:STDOUT: %.loc27_37.20: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type, %Iterate.facet.loc27_37.5 [symbolic = %.loc27_37.20 (constants.%.489)] +// CHECK:STDOUT: %impl.elem2.loc27_37.3: @TestIterate.%.loc27_37.20 (%.489) = impl_witness_access %Iterate.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc27_37.3 (constants.%impl.elem2.348)] +// CHECK:STDOUT: %specific_impl_fn.loc27_37.4: = specific_impl_function %impl.elem2.loc27_37.3, @Iterate.WithSelf.NewCursor(%Iterate.facet.loc27_37.5) [symbolic = %specific_impl_fn.loc27_37.4 (constants.%specific_impl_fn.e06)] // CHECK:STDOUT: -// CHECK:STDOUT: %ptr: type = ptr_type %as_type [symbolic = %ptr (constants.%ptr.a41)] -// CHECK:STDOUT: %Iterate.WithSelf.Next.type: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.loc27_37.5) [symbolic = %Iterate.WithSelf.Next.type (constants.%Iterate.WithSelf.Next.type.76f)] -// CHECK:STDOUT: %.loc27_37.21: type = fn_type_with_self_type %Iterate.WithSelf.Next.type, %Iterate.facet.loc27_37.5 [symbolic = %.loc27_37.21 (constants.%.474)] -// CHECK:STDOUT: %impl.elem3.loc27_37.2: @TestIterate.%.loc27_37.21 (%.474) = impl_witness_access %Iterate.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc27_37.2 (constants.%impl.elem3.316)] -// CHECK:STDOUT: %specific_impl_fn.loc27_37.5: = specific_impl_function %impl.elem3.loc27_37.2, @Iterate.WithSelf.Next(%Iterate.facet.loc27_37.5) [symbolic = %specific_impl_fn.loc27_37.5 (constants.%specific_impl_fn.754)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%impl.elem1) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.9de)] -// CHECK:STDOUT: %.loc27_37.22: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %impl.elem1 [symbolic = %.loc27_37.22 (constants.%.696)] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %impl.elem1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.d2d)] -// CHECK:STDOUT: %impl.elem0.loc27_37.2: @TestIterate.%.loc27_37.22 (%.696) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc27_37.2 (constants.%impl.elem0.18a)] -// CHECK:STDOUT: %specific_impl_fn.loc27_37.6: = specific_impl_function %impl.elem0.loc27_37.2, @Destroy.WithSelf.Op.1(%impl.elem1) [symbolic = %specific_impl_fn.loc27_37.6 (constants.%specific_impl_fn.b04)] +// CHECK:STDOUT: %ptr: type = ptr_type %as_type [symbolic = %ptr (constants.%ptr.196)] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.loc27_37.5) [symbolic = %Iterate.WithSelf.Next.type (constants.%Iterate.WithSelf.Next.type.627)] +// CHECK:STDOUT: %.loc27_37.21: type = fn_type_with_self_type %Iterate.WithSelf.Next.type, %Iterate.facet.loc27_37.5 [symbolic = %.loc27_37.21 (constants.%.fd2)] +// CHECK:STDOUT: %impl.elem3.loc27_37.2: @TestIterate.%.loc27_37.21 (%.fd2) = impl_witness_access %Iterate.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc27_37.2 (constants.%impl.elem3.bb6)] +// CHECK:STDOUT: %specific_impl_fn.loc27_37.5: = specific_impl_function %impl.elem3.loc27_37.2, @Iterate.WithSelf.Next(%Iterate.facet.loc27_37.5) [symbolic = %specific_impl_fn.loc27_37.5 (constants.%specific_impl_fn.622)] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%impl.elem1) [symbolic = %Destroy.WithSelf.SelfDestruct.type (constants.%Destroy.WithSelf.SelfDestruct.type.360)] +// CHECK:STDOUT: %.loc27_37.22: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type, %impl.elem1 [symbolic = %.loc27_37.22 (constants.%.73a)] +// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %impl.elem1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.a78)] +// CHECK:STDOUT: %impl.elem2.loc27_37.4: @TestIterate.%.loc27_37.22 (%.73a) = impl_witness_access %Destroy.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc27_37.4 (constants.%impl.elem2.01e)] +// CHECK:STDOUT: %specific_impl_fn.loc27_37.6: = specific_impl_function %impl.elem2.loc27_37.4, @Destroy.WithSelf.SelfDestruct.1(%impl.elem1) [symbolic = %specific_impl_fn.loc27_37.6 (constants.%specific_impl_fn.dac)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%r.param: ref @TestIterate.%R.as_type.loc25_83.1 (%R.as_type)) { // CHECK:STDOUT: !entry: @@ -2255,55 +2790,55 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %_.patt: %pattern_type.804 = value_binding_pattern _ [concrete = constants.%_.patt.a10] // CHECK:STDOUT: } // CHECK:STDOUT: %r.ref: ref @TestIterate.%R.as_type.loc25_83.1 (%R.as_type) = name_ref r, %r -// CHECK:STDOUT: %impl.elem2.loc27_37.1: @TestIterate.%.loc27_37.20 (%.426) = impl_witness_access constants.%Iterate.lookup_impl_witness.eca, element2 [symbolic = %impl.elem2.loc27_37.2 (constants.%impl.elem2.82f)] +// CHECK:STDOUT: %impl.elem2.loc27_37.1: @TestIterate.%.loc27_37.20 (%.489) = impl_witness_access constants.%Iterate.lookup_impl_witness.e07, element2 [symbolic = %impl.elem2.loc27_37.3 (constants.%impl.elem2.348)] // CHECK:STDOUT: %bound_method.loc27_37.1: = bound_method %r.ref, %impl.elem2.loc27_37.1 -// CHECK:STDOUT: %Iterate.facet.loc27_37.1: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.eca) [symbolic = %Iterate.facet.loc27_37.5 (constants.%Iterate.facet.bb8)] -// CHECK:STDOUT: %.loc27_37.1: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc27_37.1 [symbolic = %Iterate.facet.loc27_37.5 (constants.%Iterate.facet.bb8)] -// CHECK:STDOUT: %Iterate.facet.loc27_37.2: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.eca) [symbolic = %Iterate.facet.loc27_37.5 (constants.%Iterate.facet.bb8)] -// CHECK:STDOUT: %.loc27_37.2: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc27_37.2 [symbolic = %Iterate.facet.loc27_37.5 (constants.%Iterate.facet.bb8)] -// CHECK:STDOUT: %specific_impl_fn.loc27_37.1: = specific_impl_function %impl.elem2.loc27_37.1, @Iterate.WithSelf.NewCursor(constants.%Iterate.facet.bb8) [symbolic = %specific_impl_fn.loc27_37.4 (constants.%specific_impl_fn.5f9)] +// CHECK:STDOUT: %Iterate.facet.loc27_37.1: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.e07) [symbolic = %Iterate.facet.loc27_37.5 (constants.%Iterate.facet.8b0)] +// CHECK:STDOUT: %.loc27_37.1: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc27_37.1 [symbolic = %Iterate.facet.loc27_37.5 (constants.%Iterate.facet.8b0)] +// CHECK:STDOUT: %Iterate.facet.loc27_37.2: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.e07) [symbolic = %Iterate.facet.loc27_37.5 (constants.%Iterate.facet.8b0)] +// CHECK:STDOUT: %.loc27_37.2: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc27_37.2 [symbolic = %Iterate.facet.loc27_37.5 (constants.%Iterate.facet.8b0)] +// CHECK:STDOUT: %specific_impl_fn.loc27_37.1: = specific_impl_function %impl.elem2.loc27_37.1, @Iterate.WithSelf.NewCursor(constants.%Iterate.facet.8b0) [symbolic = %specific_impl_fn.loc27_37.4 (constants.%specific_impl_fn.e06)] // CHECK:STDOUT: %bound_method.loc27_37.2: = bound_method %r.ref, %specific_impl_fn.loc27_37.1 -// CHECK:STDOUT: %var: ref @TestIterate.%as_type (%as_type.810) = var_storage invalid +// CHECK:STDOUT: %var: ref @TestIterate.%as_type (%as_type.400) = var_storage invalid // CHECK:STDOUT: %.loc27_36.1: @TestIterate.%R.as_type.loc25_83.1 (%R.as_type) = acquire_value %r.ref -// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.call: init @TestIterate.%as_type (%as_type.810) to %var = call %bound_method.loc27_37.2(%.loc27_36.1) +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.call: init @TestIterate.%as_type (%as_type.400) to %var = call %bound_method.loc27_37.2(%.loc27_36.1) // CHECK:STDOUT: assign %var, %Iterate.WithSelf.NewCursor.call // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.next: -// CHECK:STDOUT: %addr: @TestIterate.%ptr (%ptr.a41) = addr_of %var -// CHECK:STDOUT: %impl.elem3.loc27_37.1: @TestIterate.%.loc27_37.21 (%.474) = impl_witness_access constants.%Iterate.lookup_impl_witness.eca, element3 [symbolic = %impl.elem3.loc27_37.2 (constants.%impl.elem3.316)] +// CHECK:STDOUT: %addr: @TestIterate.%ptr (%ptr.196) = addr_of %var +// CHECK:STDOUT: %impl.elem3.loc27_37.1: @TestIterate.%.loc27_37.21 (%.fd2) = impl_witness_access constants.%Iterate.lookup_impl_witness.e07, element3 [symbolic = %impl.elem3.loc27_37.2 (constants.%impl.elem3.bb6)] // CHECK:STDOUT: %bound_method.loc27_37.3: = bound_method %r.ref, %impl.elem3.loc27_37.1 -// CHECK:STDOUT: %Iterate.facet.loc27_37.3: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.eca) [symbolic = %Iterate.facet.loc27_37.5 (constants.%Iterate.facet.bb8)] -// CHECK:STDOUT: %.loc27_37.3: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc27_37.3 [symbolic = %Iterate.facet.loc27_37.5 (constants.%Iterate.facet.bb8)] -// CHECK:STDOUT: %Iterate.facet.loc27_37.4: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.eca) [symbolic = %Iterate.facet.loc27_37.5 (constants.%Iterate.facet.bb8)] -// CHECK:STDOUT: %.loc27_37.4: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc27_37.4 [symbolic = %Iterate.facet.loc27_37.5 (constants.%Iterate.facet.bb8)] -// CHECK:STDOUT: %.loc27_37.5: %Destroy.type = converted constants.%as_type.810, constants.%impl.elem1.424 [symbolic = %impl.elem1 (constants.%impl.elem1.424)] -// CHECK:STDOUT: %.loc27_37.6: %Destroy.type = converted constants.%as_type.810, constants.%impl.elem1.424 [symbolic = %impl.elem1 (constants.%impl.elem1.424)] -// CHECK:STDOUT: %specific_impl_fn.loc27_37.2: = specific_impl_function %impl.elem3.loc27_37.1, @Iterate.WithSelf.Next(constants.%Iterate.facet.bb8) [symbolic = %specific_impl_fn.loc27_37.5 (constants.%specific_impl_fn.754)] +// CHECK:STDOUT: %Iterate.facet.loc27_37.3: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.e07) [symbolic = %Iterate.facet.loc27_37.5 (constants.%Iterate.facet.8b0)] +// CHECK:STDOUT: %.loc27_37.3: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc27_37.3 [symbolic = %Iterate.facet.loc27_37.5 (constants.%Iterate.facet.8b0)] +// CHECK:STDOUT: %Iterate.facet.loc27_37.4: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.e07) [symbolic = %Iterate.facet.loc27_37.5 (constants.%Iterate.facet.8b0)] +// CHECK:STDOUT: %.loc27_37.4: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc27_37.4 [symbolic = %Iterate.facet.loc27_37.5 (constants.%Iterate.facet.8b0)] +// CHECK:STDOUT: %.loc27_37.5: %Destroy.type = converted constants.%as_type.400, constants.%impl.elem1.0e3 [symbolic = %impl.elem1 (constants.%impl.elem1.0e3)] +// CHECK:STDOUT: %.loc27_37.6: %Destroy.type = converted constants.%as_type.400, constants.%impl.elem1.0e3 [symbolic = %impl.elem1 (constants.%impl.elem1.0e3)] +// CHECK:STDOUT: %specific_impl_fn.loc27_37.2: = specific_impl_function %impl.elem3.loc27_37.1, @Iterate.WithSelf.Next(constants.%Iterate.facet.8b0) [symbolic = %specific_impl_fn.loc27_37.5 (constants.%specific_impl_fn.622)] // CHECK:STDOUT: %bound_method.loc27_37.4: = bound_method %r.ref, %specific_impl_fn.loc27_37.2 -// CHECK:STDOUT: %.loc27_37.7: ref %Optional.4e9 = temporary_storage +// CHECK:STDOUT: %.loc27_37.7: ref %Optional.cb9 = temporary_storage // CHECK:STDOUT: %.loc27_36.2: @TestIterate.%R.as_type.loc25_83.1 (%R.as_type) = acquire_value %r.ref -// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.4e9 to %.loc27_37.7 = call %bound_method.loc27_37.4(%.loc27_36.2, %addr) -// CHECK:STDOUT: %.loc27_37.8: ref %Optional.4e9 = temporary %.loc27_37.7, %Iterate.WithSelf.Next.call -// CHECK:STDOUT: %.loc27_37.9: %Optional.HasValue.type.59f = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.496) [concrete = constants.%Optional.HasValue.91a] -// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.59f = name_ref HasValue, %.loc27_37.9 [concrete = constants.%Optional.HasValue.91a] +// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.cb9 to %.loc27_37.7 = call %bound_method.loc27_37.4(%.loc27_36.2, %addr) +// CHECK:STDOUT: %.loc27_37.8: ref %Optional.cb9 = temporary %.loc27_37.7, %Iterate.WithSelf.Next.call +// CHECK:STDOUT: %.loc27_37.9: %Optional.HasValue.type.800 = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.50c) [concrete = constants.%Optional.HasValue.ab3] +// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.800 = name_ref HasValue, %.loc27_37.9 [concrete = constants.%Optional.HasValue.ab3] // CHECK:STDOUT: %Optional.HasValue.bound: = bound_method %.loc27_37.8, %HasValue.ref -// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%OptionalStorage.facet.496) [concrete = constants.%Optional.HasValue.specific_fn.bf1] +// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%OptionalStorage.facet.50c) [concrete = constants.%Optional.HasValue.specific_fn.730] // CHECK:STDOUT: %bound_method.loc27_37.5: = bound_method %.loc27_37.8, %Optional.HasValue.specific_fn -// CHECK:STDOUT: %.loc27_37.10: %Optional.4e9 = acquire_value %.loc27_37.8 +// CHECK:STDOUT: %.loc27_37.10: %Optional.cb9 = acquire_value %.loc27_37.8 // CHECK:STDOUT: %Optional.HasValue.call: init bool = call %bound_method.loc27_37.5(%.loc27_37.10) // CHECK:STDOUT: %.loc27_37.11: bool = value_of_initializer %Optional.HasValue.call // CHECK:STDOUT: %.loc27_37.12: bool = converted %Optional.HasValue.call, %.loc27_37.11 // CHECK:STDOUT: if %.loc27_37.12 br !for.body else br !for.done // CHECK:STDOUT: // CHECK:STDOUT: !for.body: -// CHECK:STDOUT: %.loc27_37.13: %Optional.Get.type.cab = specific_constant imports.%Core.import_ref.dab, @Optional(constants.%OptionalStorage.facet.496) [concrete = constants.%Optional.Get.2d3] -// CHECK:STDOUT: %Get.ref: %Optional.Get.type.cab = name_ref Get, %.loc27_37.13 [concrete = constants.%Optional.Get.2d3] +// CHECK:STDOUT: %.loc27_37.13: %Optional.Get.type.466 = specific_constant imports.%Core.import_ref.dab, @Optional(constants.%OptionalStorage.facet.50c) [concrete = constants.%Optional.Get.4ea] +// CHECK:STDOUT: %Get.ref: %Optional.Get.type.466 = name_ref Get, %.loc27_37.13 [concrete = constants.%Optional.Get.4ea] // CHECK:STDOUT: %Optional.Get.bound: = bound_method %.loc27_37.8, %Get.ref -// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%OptionalStorage.facet.496) [concrete = constants.%Optional.Get.specific_fn.548] +// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%OptionalStorage.facet.50c) [concrete = constants.%Optional.Get.specific_fn.f34] // CHECK:STDOUT: %bound_method.loc27_37.6: = bound_method %.loc27_37.8, %Optional.Get.specific_fn // CHECK:STDOUT: %.loc27_37.14: ref %OverloadValueType = temporary_storage -// CHECK:STDOUT: %.loc27_37.15: %Optional.4e9 = acquire_value %.loc27_37.8 +// CHECK:STDOUT: %.loc27_37.15: %Optional.cb9 = acquire_value %.loc27_37.8 // CHECK:STDOUT: %Optional.Get.call: init %OverloadValueType to %.loc27_37.14 = call %bound_method.loc27_37.6(%.loc27_37.15) // CHECK:STDOUT: %.loc27_37.16: ref %OverloadValueType = temporary %.loc27_37.14, %Optional.Get.call // CHECK:STDOUT: %.loc27_37.17: %OverloadValueType = acquire_value %.loc27_37.16 @@ -2312,52 +2847,104 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %OverloadValueType.ref.loc27: type = name_ref OverloadValueType, imports.%OverloadValueType.decl [concrete = constants.%OverloadValueType] // CHECK:STDOUT: } // CHECK:STDOUT: %_: %OverloadValueType = wrapper_binding _, %.loc27_37.17 -// CHECK:STDOUT: %OverloadValueType.Op.bound: = bound_method %.loc27_37.16, constants.%OverloadValueType.Op.4dca31.1 -// CHECK:STDOUT: %Op.ref: %OverloadValueType.cpp_destructor.type = name_ref Op, imports.%OverloadValueType.cpp_destructor.decl [concrete = constants.%OverloadValueType.cpp_destructor] -// CHECK:STDOUT: %OverloadValueType.cpp_destructor.bound: = bound_method %.loc27_37.16, %Op.ref -// CHECK:STDOUT: %OverloadValueType.cpp_destructor.call: init %empty_tuple.type = call %OverloadValueType.cpp_destructor.bound(%.loc27_37.16) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc27_37.1: = bound_method %.loc27_37.8, constants.%Destroy.WithSelf.Op.403171.7 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc27_37.1: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc27_37.1(%.loc27_37.8) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc27_37.1: = bound_method %.loc27_37.16, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc27_37.1: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc27_37.1(%.loc27_37.16) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc27_37.2: = bound_method %.loc27_37.8, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.8 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc27_37.2: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc27_37.2(%.loc27_37.8) // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.done: -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc27_37.2: = bound_method %.loc27_37.8, constants.%Destroy.WithSelf.Op.403171.7 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc27_37.2: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc27_37.2(%.loc27_37.8) -// CHECK:STDOUT: %impl.elem0.loc27_37.1: @TestIterate.%.loc27_37.22 (%.696) = impl_witness_access constants.%Destroy.lookup_impl_witness.d2d, element0 [symbolic = %impl.elem0.loc27_37.2 (constants.%impl.elem0.18a)] -// CHECK:STDOUT: %bound_method.loc27_37.7: = bound_method %var, %impl.elem0.loc27_37.1 -// CHECK:STDOUT: %.loc27_37.18: %Destroy.type = converted constants.%as_type.810, constants.%impl.elem1.424 [symbolic = %impl.elem1 (constants.%impl.elem1.424)] -// CHECK:STDOUT: %.loc27_37.19: %Destroy.type = converted constants.%as_type.810, constants.%impl.elem1.424 [symbolic = %impl.elem1 (constants.%impl.elem1.424)] -// CHECK:STDOUT: %specific_impl_fn.loc27_37.3: = specific_impl_function %impl.elem0.loc27_37.1, @Destroy.WithSelf.Op.1(constants.%impl.elem1.424) [symbolic = %specific_impl_fn.loc27_37.6 (constants.%specific_impl_fn.b04)] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc27_37.3: = bound_method %.loc27_37.8, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.8 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc27_37.3: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc27_37.3(%.loc27_37.8) +// CHECK:STDOUT: %impl.elem2.loc27_37.2: @TestIterate.%.loc27_37.22 (%.73a) = impl_witness_access constants.%Destroy.lookup_impl_witness.a78, element2 [symbolic = %impl.elem2.loc27_37.4 (constants.%impl.elem2.01e)] +// CHECK:STDOUT: %bound_method.loc27_37.7: = bound_method %var, %impl.elem2.loc27_37.2 +// CHECK:STDOUT: %.loc27_37.18: %Destroy.type = converted constants.%as_type.400, constants.%impl.elem1.0e3 [symbolic = %impl.elem1 (constants.%impl.elem1.0e3)] +// CHECK:STDOUT: %.loc27_37.19: %Destroy.type = converted constants.%as_type.400, constants.%impl.elem1.0e3 [symbolic = %impl.elem1 (constants.%impl.elem1.0e3)] +// CHECK:STDOUT: %specific_impl_fn.loc27_37.3: = specific_impl_function %impl.elem2.loc27_37.2, @Destroy.WithSelf.SelfDestruct.1(constants.%impl.elem1.0e3) [symbolic = %specific_impl_fn.loc27_37.6 (constants.%specific_impl_fn.dac)] // CHECK:STDOUT: %bound_method.loc27_37.8: = bound_method %var, %specific_impl_fn.loc27_37.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc27_37.3: init %empty_tuple.type = call %bound_method.loc27_37.8(%var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc27_37.4: init %empty_tuple.type = call %bound_method.loc27_37.8(%var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc27_37.1(%self.param: ref %.8a2) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc27_37.1(%self.param: ref %.8a2) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc27_37.2(%self.param: ref %MaybeUnformed.59c) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc27_37.1(%self.param: ref %.8a2) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc27_37.1(%self.param: ref %.8a2) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc27_37.2(%self.param: ref %MaybeUnformed.d16) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc27_37.2(%self.param: ref %MaybeUnformed.d16) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc27_37.2(%self.param: ref %MaybeUnformed.d16) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc27_37.3(%self.param: ref bool) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc27_37.3(%self.param: ref bool) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc27_37.4(%self.param: ref %struct_type.value.has_value.3e8) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc27_37.3(%self.param: ref bool) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc27_37.4(%self.param: ref %struct_type.value.has_value.35f) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc27_37.5(%self.param: ref %DefaultOptionalStorage.799) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc27_37.4(%self.param: ref %struct_type.value.has_value.35f) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc27_37.4(%self.param: ref %struct_type.value.has_value.35f) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.5(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc27_37.5(%self.param: ref %DefaultOptionalStorage.fbc) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc27_37.6(%self.param: ref %Optional.4e9) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc27_37.5(%self.param: ref %DefaultOptionalStorage.fbc) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc27_37.5(%self.param: ref %DefaultOptionalStorage.fbc) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.6(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.5(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc27_37.6(%self.param: ref %Optional.cb9) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc27_37.6(%self.param: ref %Optional.cb9) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc27_37.6(%self.param: ref %Optional.cb9) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.7(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.6(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2367,13 +2954,13 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %_.patt: %pattern_type.804 = value_binding_pattern _ [concrete = constants.%_.patt.a10] // CHECK:STDOUT: } // CHECK:STDOUT: %r.ref: ref %Range = name_ref r, %r -// CHECK:STDOUT: %impl.elem2: %.687 = impl_witness_access constants.%Iterate.impl_witness.175, element2 [concrete = constants.%T.as_type.as.Iterate.impl.NewCursor.036] +// CHECK:STDOUT: %impl.elem2: %.b72 = impl_witness_access constants.%Iterate.impl_witness.24f, element2 [concrete = constants.%T.as_type.as.Iterate.impl.NewCursor.8fd] // CHECK:STDOUT: %bound_method.loc37_37.1: = bound_method %r.ref, %impl.elem2 -// CHECK:STDOUT: %facet_value.loc37_37.1: %CppRange_where.type.d682d6.1 = facet_value constants.%Range, (constants.%custom_witness.e7a31c.1, constants.%custom_witness.d0da43.1, constants.%custom_witness.090, constants.%custom_witness.f4a, constants.%custom_witness.6bd, constants.%custom_witness.716, constants.%custom_witness.617) [concrete = constants.%facet_value.cbe] -// CHECK:STDOUT: %.loc37_37.1: %CppRange_where.type.d682d6.1 = converted constants.%Range, %facet_value.loc37_37.1 [concrete = constants.%facet_value.cbe] -// CHECK:STDOUT: %facet_value.loc37_37.2: %CppRange_where.type.d682d6.1 = facet_value constants.%Range, (constants.%custom_witness.e7a31c.1, constants.%custom_witness.d0da43.1, constants.%custom_witness.090, constants.%custom_witness.f4a, constants.%custom_witness.6bd, constants.%custom_witness.716, constants.%custom_witness.617) [concrete = constants.%facet_value.cbe] -// CHECK:STDOUT: %.loc37_37.2: %CppRange_where.type.d682d6.1 = converted constants.%Range, %facet_value.loc37_37.2 [concrete = constants.%facet_value.cbe] -// CHECK:STDOUT: %specific_fn.loc37_37.1: = specific_function %impl.elem2, @T.as_type.as.Iterate.impl.NewCursor(constants.%facet_value.cbe) [concrete = constants.%T.as_type.as.Iterate.impl.NewCursor.specific_fn] +// CHECK:STDOUT: %facet_value.loc37_37.1: %CppRange_where.type.d682d6.1 = facet_value constants.%Range, (constants.%custom_witness.1bfa2a.1, constants.%custom_witness.d0da43.1, constants.%custom_witness.090, constants.%custom_witness.eaa, constants.%custom_witness.6bd, constants.%custom_witness.716, constants.%custom_witness.617) [concrete = constants.%facet_value.670] +// CHECK:STDOUT: %.loc37_37.1: %CppRange_where.type.d682d6.1 = converted constants.%Range, %facet_value.loc37_37.1 [concrete = constants.%facet_value.670] +// CHECK:STDOUT: %facet_value.loc37_37.2: %CppRange_where.type.d682d6.1 = facet_value constants.%Range, (constants.%custom_witness.1bfa2a.1, constants.%custom_witness.d0da43.1, constants.%custom_witness.090, constants.%custom_witness.eaa, constants.%custom_witness.6bd, constants.%custom_witness.716, constants.%custom_witness.617) [concrete = constants.%facet_value.670] +// CHECK:STDOUT: %.loc37_37.2: %CppRange_where.type.d682d6.1 = converted constants.%Range, %facet_value.loc37_37.2 [concrete = constants.%facet_value.670] +// CHECK:STDOUT: %specific_fn.loc37_37.1: = specific_function %impl.elem2, @T.as_type.as.Iterate.impl.NewCursor(constants.%facet_value.670) [concrete = constants.%T.as_type.as.Iterate.impl.NewCursor.specific_fn] // CHECK:STDOUT: %bound_method.loc37_37.2: = bound_method %r.ref, %specific_fn.loc37_37.1 // CHECK:STDOUT: %var: ref %tuple.type.9ef = var_storage invalid // CHECK:STDOUT: %.loc37_36.1: %Range = acquire_value %r.ref @@ -2383,37 +2970,37 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: // CHECK:STDOUT: !for.next: // CHECK:STDOUT: %addr: %ptr.b18 = addr_of %var -// CHECK:STDOUT: %impl.elem3: %.79c = impl_witness_access constants.%Iterate.impl_witness.175, element3 [concrete = constants.%T.as_type.as.Iterate.impl.Next.751] +// CHECK:STDOUT: %impl.elem3: %.0c0 = impl_witness_access constants.%Iterate.impl_witness.24f, element3 [concrete = constants.%T.as_type.as.Iterate.impl.Next.4cb] // CHECK:STDOUT: %bound_method.loc37_37.3: = bound_method %r.ref, %impl.elem3 -// CHECK:STDOUT: %facet_value.loc37_37.3: %CppRange_where.type.d682d6.1 = facet_value constants.%Range, (constants.%custom_witness.e7a31c.1, constants.%custom_witness.d0da43.1, constants.%custom_witness.090, constants.%custom_witness.f4a, constants.%custom_witness.6bd, constants.%custom_witness.716, constants.%custom_witness.617) [concrete = constants.%facet_value.cbe] -// CHECK:STDOUT: %.loc37_37.3: %CppRange_where.type.d682d6.1 = converted constants.%Range, %facet_value.loc37_37.3 [concrete = constants.%facet_value.cbe] -// CHECK:STDOUT: %facet_value.loc37_37.4: %CppRange_where.type.d682d6.1 = facet_value constants.%Range, (constants.%custom_witness.e7a31c.1, constants.%custom_witness.d0da43.1, constants.%custom_witness.090, constants.%custom_witness.f4a, constants.%custom_witness.6bd, constants.%custom_witness.716, constants.%custom_witness.617) [concrete = constants.%facet_value.cbe] -// CHECK:STDOUT: %.loc37_37.4: %CppRange_where.type.d682d6.1 = converted constants.%Range, %facet_value.loc37_37.4 [concrete = constants.%facet_value.cbe] -// CHECK:STDOUT: %specific_fn.loc37_37.2: = specific_function %impl.elem3, @T.as_type.as.Iterate.impl.Next(constants.%facet_value.cbe) [concrete = constants.%T.as_type.as.Iterate.impl.Next.specific_fn] +// CHECK:STDOUT: %facet_value.loc37_37.3: %CppRange_where.type.d682d6.1 = facet_value constants.%Range, (constants.%custom_witness.1bfa2a.1, constants.%custom_witness.d0da43.1, constants.%custom_witness.090, constants.%custom_witness.eaa, constants.%custom_witness.6bd, constants.%custom_witness.716, constants.%custom_witness.617) [concrete = constants.%facet_value.670] +// CHECK:STDOUT: %.loc37_37.3: %CppRange_where.type.d682d6.1 = converted constants.%Range, %facet_value.loc37_37.3 [concrete = constants.%facet_value.670] +// CHECK:STDOUT: %facet_value.loc37_37.4: %CppRange_where.type.d682d6.1 = facet_value constants.%Range, (constants.%custom_witness.1bfa2a.1, constants.%custom_witness.d0da43.1, constants.%custom_witness.090, constants.%custom_witness.eaa, constants.%custom_witness.6bd, constants.%custom_witness.716, constants.%custom_witness.617) [concrete = constants.%facet_value.670] +// CHECK:STDOUT: %.loc37_37.4: %CppRange_where.type.d682d6.1 = converted constants.%Range, %facet_value.loc37_37.4 [concrete = constants.%facet_value.670] +// CHECK:STDOUT: %specific_fn.loc37_37.2: = specific_function %impl.elem3, @T.as_type.as.Iterate.impl.Next(constants.%facet_value.670) [concrete = constants.%T.as_type.as.Iterate.impl.Next.specific_fn] // CHECK:STDOUT: %bound_method.loc37_37.4: = bound_method %r.ref, %specific_fn.loc37_37.2 -// CHECK:STDOUT: %.loc37_37.5: ref %Optional.4e9 = temporary_storage +// CHECK:STDOUT: %.loc37_37.5: ref %Optional.cb9 = temporary_storage // CHECK:STDOUT: %.loc37_36.2: %Range = acquire_value %r.ref -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.call: init %Optional.4e9 to %.loc37_37.5 = call %bound_method.loc37_37.4(%.loc37_36.2, %addr) -// CHECK:STDOUT: %.loc37_37.6: ref %Optional.4e9 = temporary %.loc37_37.5, %T.as_type.as.Iterate.impl.Next.call -// CHECK:STDOUT: %.loc37_37.7: %Optional.HasValue.type.59f = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.496) [concrete = constants.%Optional.HasValue.91a] -// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.59f = name_ref HasValue, %.loc37_37.7 [concrete = constants.%Optional.HasValue.91a] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.call: init %Optional.cb9 to %.loc37_37.5 = call %bound_method.loc37_37.4(%.loc37_36.2, %addr) +// CHECK:STDOUT: %.loc37_37.6: ref %Optional.cb9 = temporary %.loc37_37.5, %T.as_type.as.Iterate.impl.Next.call +// CHECK:STDOUT: %.loc37_37.7: %Optional.HasValue.type.800 = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.50c) [concrete = constants.%Optional.HasValue.ab3] +// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.800 = name_ref HasValue, %.loc37_37.7 [concrete = constants.%Optional.HasValue.ab3] // CHECK:STDOUT: %Optional.HasValue.bound: = bound_method %.loc37_37.6, %HasValue.ref -// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%OptionalStorage.facet.496) [concrete = constants.%Optional.HasValue.specific_fn.bf1] +// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%OptionalStorage.facet.50c) [concrete = constants.%Optional.HasValue.specific_fn.730] // CHECK:STDOUT: %bound_method.loc37_37.5: = bound_method %.loc37_37.6, %Optional.HasValue.specific_fn -// CHECK:STDOUT: %.loc37_37.8: %Optional.4e9 = acquire_value %.loc37_37.6 +// CHECK:STDOUT: %.loc37_37.8: %Optional.cb9 = acquire_value %.loc37_37.6 // CHECK:STDOUT: %Optional.HasValue.call: init bool = call %bound_method.loc37_37.5(%.loc37_37.8) // CHECK:STDOUT: %.loc37_37.9: bool = value_of_initializer %Optional.HasValue.call // CHECK:STDOUT: %.loc37_37.10: bool = converted %Optional.HasValue.call, %.loc37_37.9 // CHECK:STDOUT: if %.loc37_37.10 br !for.body else br !for.done // CHECK:STDOUT: // CHECK:STDOUT: !for.body: -// CHECK:STDOUT: %.loc37_37.11: %Optional.Get.type.cab = specific_constant imports.%Core.import_ref.dab, @Optional(constants.%OptionalStorage.facet.496) [concrete = constants.%Optional.Get.2d3] -// CHECK:STDOUT: %Get.ref: %Optional.Get.type.cab = name_ref Get, %.loc37_37.11 [concrete = constants.%Optional.Get.2d3] +// CHECK:STDOUT: %.loc37_37.11: %Optional.Get.type.466 = specific_constant imports.%Core.import_ref.dab, @Optional(constants.%OptionalStorage.facet.50c) [concrete = constants.%Optional.Get.4ea] +// CHECK:STDOUT: %Get.ref: %Optional.Get.type.466 = name_ref Get, %.loc37_37.11 [concrete = constants.%Optional.Get.4ea] // CHECK:STDOUT: %Optional.Get.bound: = bound_method %.loc37_37.6, %Get.ref -// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%OptionalStorage.facet.496) [concrete = constants.%Optional.Get.specific_fn.548] +// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%OptionalStorage.facet.50c) [concrete = constants.%Optional.Get.specific_fn.f34] // CHECK:STDOUT: %bound_method.loc37_37.6: = bound_method %.loc37_37.6, %Optional.Get.specific_fn // CHECK:STDOUT: %.loc37_37.12: ref %OverloadValueType = temporary_storage -// CHECK:STDOUT: %.loc37_37.13: %Optional.4e9 = acquire_value %.loc37_37.6 +// CHECK:STDOUT: %.loc37_37.13: %Optional.cb9 = acquire_value %.loc37_37.6 // CHECK:STDOUT: %Optional.Get.call: init %OverloadValueType to %.loc37_37.12 = call %bound_method.loc37_37.6(%.loc37_37.13) // CHECK:STDOUT: %.loc37_37.14: ref %OverloadValueType = temporary %.loc37_37.12, %Optional.Get.call // CHECK:STDOUT: %.loc37_37.15: %OverloadValueType = acquire_value %.loc37_37.14 @@ -2422,19 +3009,17 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %OverloadValueType.ref: type = name_ref OverloadValueType, imports.%OverloadValueType.decl [concrete = constants.%OverloadValueType] // CHECK:STDOUT: } // CHECK:STDOUT: %_: %OverloadValueType = wrapper_binding _, %.loc37_37.15 -// CHECK:STDOUT: %OverloadValueType.Op.bound: = bound_method %.loc37_37.14, constants.%OverloadValueType.Op.4dca31.1 -// CHECK:STDOUT: %Op.ref: %OverloadValueType.cpp_destructor.type = name_ref Op, imports.%OverloadValueType.cpp_destructor.decl [concrete = constants.%OverloadValueType.cpp_destructor] -// CHECK:STDOUT: %OverloadValueType.cpp_destructor.bound: = bound_method %.loc37_37.14, %Op.ref -// CHECK:STDOUT: %OverloadValueType.cpp_destructor.call: init %empty_tuple.type = call %OverloadValueType.cpp_destructor.bound(%.loc37_37.14) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc37_37.1: = bound_method %.loc37_37.6, constants.%Destroy.WithSelf.Op.403171.7 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc37_37.1: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc37_37.1(%.loc37_37.6) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc37_37.1: = bound_method %.loc37_37.14, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc37_37.1: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc37_37.1(%.loc37_37.14) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc37_37.2: = bound_method %.loc37_37.6, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.8 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc37_37.2: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc37_37.2(%.loc37_37.6) // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.done: -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc37_37.2: = bound_method %.loc37_37.6, constants.%Destroy.WithSelf.Op.403171.7 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc37_37.2: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc37_37.2(%.loc37_37.6) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc37_37.3: = bound_method %var, constants.%Destroy.WithSelf.Op.403171.8 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc37_37.3: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc37_37.3(%var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc37_37.3: = bound_method %.loc37_37.6, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.8 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc37_37.3: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc37_37.3(%.loc37_37.6) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc37_37.4: = bound_method %var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.10 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc37_37.4: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc37_37.4(%var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2442,14 +3027,14 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %R.patt.loc25_17.2 => constants.%R.patt // CHECK:STDOUT: %R.loc25_17.1 => constants.%R // CHECK:STDOUT: %R.as_type.loc25_83.1 => constants.%R.as_type -// CHECK:STDOUT: %pattern_type => constants.%pattern_type.def -// CHECK:STDOUT: %r.patt.loc25_81.2 => constants.%r.patt.bb3 -// CHECK:STDOUT: %r.param_patt.loc25_76.2 => constants.%r.param_patt.9b2 +// CHECK:STDOUT: %pattern_type => constants.%pattern_type.a47 +// CHECK:STDOUT: %r.patt.loc25_81.2 => constants.%r.patt.24d +// CHECK:STDOUT: %r.param_patt.loc25_76.2 => constants.%r.param_patt.d5b // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @TestIterate(constants.%facet_value.3af) { +// CHECK:STDOUT: specific @TestIterate(constants.%facet_value.483) { // CHECK:STDOUT: %R.patt.loc25_17.2 => constants.%R.patt -// CHECK:STDOUT: %R.loc25_17.1 => constants.%facet_value.3af +// CHECK:STDOUT: %R.loc25_17.1 => constants.%facet_value.483 // CHECK:STDOUT: %R.as_type.loc25_83.1 => constants.%Range // CHECK:STDOUT: %pattern_type => constants.%pattern_type.23f // CHECK:STDOUT: %r.patt.loc25_81.2 => constants.%r.patt.b9f @@ -2457,25 +3042,25 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc25 => constants.%complete_type.357 -// CHECK:STDOUT: %Iterate.lookup_impl_witness => constants.%Iterate.impl_witness.175 -// CHECK:STDOUT: %Iterate.facet.loc27_37.5 => constants.%Iterate.facet.cc4 -// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type => constants.%Iterate.WithSelf.NewCursor.type.a44 -// CHECK:STDOUT: %.loc27_37.20 => constants.%.687 -// CHECK:STDOUT: %impl.elem2.loc27_37.2 => constants.%T.as_type.as.Iterate.impl.NewCursor.036 +// CHECK:STDOUT: %Iterate.lookup_impl_witness => constants.%Iterate.impl_witness.24f +// CHECK:STDOUT: %Iterate.facet.loc27_37.5 => constants.%Iterate.facet.726 +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type => constants.%Iterate.WithSelf.NewCursor.type.292 +// CHECK:STDOUT: %.loc27_37.20 => constants.%.b72 +// CHECK:STDOUT: %impl.elem2.loc27_37.3 => constants.%T.as_type.as.Iterate.impl.NewCursor.8fd // CHECK:STDOUT: %specific_impl_fn.loc27_37.4 => constants.%T.as_type.as.Iterate.impl.NewCursor.specific_fn -// CHECK:STDOUT: %impl.elem1 => constants.%Destroy.facet.6f5 +// CHECK:STDOUT: %impl.elem1 => constants.%Destroy.facet.c69 // CHECK:STDOUT: %as_type => constants.%tuple.type.9ef // CHECK:STDOUT: %require_complete.1 => constants.%complete_type.e35 // CHECK:STDOUT: %ptr => constants.%ptr.b18 -// CHECK:STDOUT: %Iterate.WithSelf.Next.type => constants.%Iterate.WithSelf.Next.type.1f9 -// CHECK:STDOUT: %.loc27_37.21 => constants.%.79c -// CHECK:STDOUT: %impl.elem3.loc27_37.2 => constants.%T.as_type.as.Iterate.impl.Next.751 +// CHECK:STDOUT: %Iterate.WithSelf.Next.type => constants.%Iterate.WithSelf.Next.type.4f7 +// CHECK:STDOUT: %.loc27_37.21 => constants.%.0c0 +// CHECK:STDOUT: %impl.elem3.loc27_37.2 => constants.%T.as_type.as.Iterate.impl.Next.4cb // CHECK:STDOUT: %specific_impl_fn.loc27_37.5 => constants.%T.as_type.as.Iterate.impl.Next.specific_fn -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.26c -// CHECK:STDOUT: %.loc27_37.22 => constants.%.149 -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.6c4ec3.8 -// CHECK:STDOUT: %impl.elem0.loc27_37.2 => constants.%Destroy.WithSelf.Op.403171.8 -// CHECK:STDOUT: %specific_impl_fn.loc27_37.6 => constants.%Destroy.WithSelf.Op.403171.8 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.6ef +// CHECK:STDOUT: %.loc27_37.22 => constants.%.a39 +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.f8f19d.8 +// CHECK:STDOUT: %impl.elem2.loc27_37.4 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.10 +// CHECK:STDOUT: %specific_impl_fn.loc27_37.6 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.10 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- adl_return_same_types.carbon @@ -2484,6 +3069,7 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: type: type = facet_type [concrete] // CHECK:STDOUT: %Iterate.type: type = facet_type <@Iterate> [concrete] // CHECK:STDOUT: %OptionalStorage.type: type = facet_type <@OptionalStorage> [concrete] +// CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %facet_type.f48: type = facet_type <@Destroy & @Copy> [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] @@ -2530,51 +3116,56 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete] // CHECK:STDOUT: %f64.dc1: type = class_type @Float, @Float(%int_64) [concrete] // CHECK:STDOUT: %pattern_type.fb7: type = pattern_type %f64.dc1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc20_53.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc20_53.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.6c4ec3.3: = custom_witness (%Destroy.WithSelf.Op.403171.3), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc20_53.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f8f19d.3: = custom_witness (%Destroy.WithSelf.Op.403171.3, %Destroy.WithSelf.SubobjectDestroy.d01daf.3, %Destroy.WithSelf.SelfDestruct.db3fdb.3), @Destroy [concrete] // CHECK:STDOUT: %Float.as.Copy.impl.Op.type.ff3: type = fn_type @Float.as.Copy.impl.Op, @Float.as.Copy.impl(%N.fe9) [symbolic] // CHECK:STDOUT: %Float.as.Copy.impl.Op.d93: %Float.as.Copy.impl.Op.type.ff3 = struct_value () [symbolic] // CHECK:STDOUT: %Copy.impl_witness.0d6: = impl_witness imports.%Copy.impl_witness_table.8dd, @Float.as.Copy.impl(%int_64) [concrete] -// CHECK:STDOUT: %facet_value.46e: %facet_type.f48 = facet_value %f64.dc1, (%custom_witness.6c4ec3.3, %Copy.impl_witness.0d6) [concrete] +// CHECK:STDOUT: %facet_value.b6e: %facet_type.f48 = facet_value %f64.dc1, (%custom_witness.f8f19d.3, %Copy.impl_witness.0d6) [concrete] // CHECK:STDOUT: %Iterate.lookup_impl_witness.1d8: = lookup_impl_witness %.Self.500, @Iterate [symbolic_self] // CHECK:STDOUT: %impl.elem0.294: %facet_type.f48 = impl_witness_access %Iterate.lookup_impl_witness.1d8, element0 [symbolic_self] -// CHECK:STDOUT: %Iterate_where.type.13a: type = facet_type <@Iterate where %impl.elem0.294 = %facet_value.46e> [concrete] -// CHECK:STDOUT: %pattern_type.a31: type = pattern_type %Iterate_where.type.13a [concrete] -// CHECK:STDOUT: %R.patt: %pattern_type.a31 = symbolic_binding_pattern R, 0 [symbolic] -// CHECK:STDOUT: %R: %Iterate_where.type.13a = symbolic_binding R, 0 [symbolic] +// CHECK:STDOUT: %Iterate_where.type.028: type = facet_type <@Iterate where %impl.elem0.294 = %facet_value.b6e> [concrete] +// CHECK:STDOUT: %pattern_type.522: type = pattern_type %Iterate_where.type.028 [concrete] +// CHECK:STDOUT: %R.patt: %pattern_type.522 = symbolic_binding_pattern R, 0 [symbolic] +// CHECK:STDOUT: %R: %Iterate_where.type.028 = symbolic_binding R, 0 [symbolic] // CHECK:STDOUT: %R.as_type: type = facet_access_type %R [symbolic] -// CHECK:STDOUT: %pattern_type.15f: type = pattern_type %R.as_type [symbolic] -// CHECK:STDOUT: %r.param_patt.f80: %pattern_type.15f = value_param_pattern [symbolic] -// CHECK:STDOUT: %r.patt.fdd: %pattern_type.15f = wrapper_binding_pattern r, %r.param_patt.f80 [symbolic] +// CHECK:STDOUT: %pattern_type.6f7: type = pattern_type %R.as_type [symbolic] +// CHECK:STDOUT: %r.param_patt.19a: %pattern_type.6f7 = value_param_pattern [symbolic] +// CHECK:STDOUT: %r.patt.f97: %pattern_type.6f7 = wrapper_binding_pattern r, %r.param_patt.19a [symbolic] // CHECK:STDOUT: %i.patt: %pattern_type.fb7 = value_binding_pattern i [concrete] -// CHECK:STDOUT: %Iterate.lookup_impl_witness.0cb: = lookup_impl_witness %R, @Iterate [symbolic] -// CHECK:STDOUT: %Iterate.facet.a3a: %Iterate.type = facet_value %R.as_type, (%Iterate.lookup_impl_witness.0cb) [symbolic] -// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.228: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.a3a) [symbolic] -// CHECK:STDOUT: %Iterate.WithSelf.Next.type.431: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.a3a) [symbolic] -// CHECK:STDOUT: %.bf4: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.228, %Iterate.facet.a3a [symbolic] -// CHECK:STDOUT: %impl.elem2.1a5: %.bf4 = impl_witness_access %Iterate.lookup_impl_witness.0cb, element2 [symbolic] -// CHECK:STDOUT: %impl.elem1.abd: %Destroy.type = impl_witness_access %Iterate.lookup_impl_witness.0cb, element1 [symbolic] -// CHECK:STDOUT: %as_type.033: type = facet_access_type %impl.elem1.abd [symbolic] -// CHECK:STDOUT: %specific_impl_fn.40d: = specific_impl_function %impl.elem2.1a5, @Iterate.WithSelf.NewCursor(%Iterate.facet.a3a) [symbolic] -// CHECK:STDOUT: %ptr.e53: type = ptr_type %as_type.033 [symbolic] -// CHECK:STDOUT: %.b72: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.431, %Iterate.facet.a3a [symbolic] -// CHECK:STDOUT: %impl.elem3.eef: %.b72 = impl_witness_access %Iterate.lookup_impl_witness.0cb, element3 [symbolic] -// CHECK:STDOUT: %DefaultOptionalStorage.a3f: type = class_type @DefaultOptionalStorage, @DefaultOptionalStorage(%facet_value.46e) [concrete] -// CHECK:STDOUT: %OptionalStorage.impl_witness.366: = impl_witness imports.%OptionalStorage.impl_witness_table.460, @T.as_type.as.OptionalStorage.impl(%facet_value.46e) [concrete] -// CHECK:STDOUT: %OptionalStorage.facet.1e4: %OptionalStorage.type = facet_value %f64.dc1, (%OptionalStorage.impl_witness.366) [concrete] -// CHECK:STDOUT: %Optional.72d: type = class_type @Optional, @Optional(%OptionalStorage.facet.1e4) [concrete] -// CHECK:STDOUT: %specific_impl_fn.e16: = specific_impl_function %impl.elem3.eef, @Iterate.WithSelf.Next(%Iterate.facet.a3a) [symbolic] -// CHECK:STDOUT: %Optional.HasValue.type.7a6: type = fn_type @Optional.HasValue, @Optional(%OptionalStorage.facet.1e4) [concrete] -// CHECK:STDOUT: %Optional.HasValue.afd: %Optional.HasValue.type.7a6 = struct_value () [concrete] -// CHECK:STDOUT: %Optional.Get.type.65e: type = fn_type @Optional.Get, @Optional(%OptionalStorage.facet.1e4) [concrete] -// CHECK:STDOUT: %Optional.Get.ef5: %Optional.Get.type.65e = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.facet.d8e: %Destroy.type = facet_value %f64.dc1, (%custom_witness.6c4ec3.3) [concrete] -// CHECK:STDOUT: %MaybeUnformed.5b0: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.d8e) [concrete] +// CHECK:STDOUT: %Iterate.lookup_impl_witness.9e0: = lookup_impl_witness %R, @Iterate [symbolic] +// CHECK:STDOUT: %Iterate.facet.f88: %Iterate.type = facet_value %R.as_type, (%Iterate.lookup_impl_witness.9e0) [symbolic] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.3d0: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.f88) [symbolic] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type.160: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.f88) [symbolic] +// CHECK:STDOUT: %.afc: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.3d0, %Iterate.facet.f88 [symbolic] +// CHECK:STDOUT: %impl.elem2.895: %.afc = impl_witness_access %Iterate.lookup_impl_witness.9e0, element2 [symbolic] +// CHECK:STDOUT: %impl.elem1.0cf: %Destroy.type = impl_witness_access %Iterate.lookup_impl_witness.9e0, element1 [symbolic] +// CHECK:STDOUT: %as_type.ce3: type = facet_access_type %impl.elem1.0cf [symbolic] +// CHECK:STDOUT: %specific_impl_fn.999: = specific_impl_function %impl.elem2.895, @Iterate.WithSelf.NewCursor(%Iterate.facet.f88) [symbolic] +// CHECK:STDOUT: %ptr.44a: type = ptr_type %as_type.ce3 [symbolic] +// CHECK:STDOUT: %.b00: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.160, %Iterate.facet.f88 [symbolic] +// CHECK:STDOUT: %impl.elem3.c16: %.b00 = impl_witness_access %Iterate.lookup_impl_witness.9e0, element3 [symbolic] +// CHECK:STDOUT: %DefaultOptionalStorage.3e2: type = class_type @DefaultOptionalStorage, @DefaultOptionalStorage(%facet_value.b6e) [concrete] +// CHECK:STDOUT: %OptionalStorage.impl_witness.4b3: = impl_witness imports.%OptionalStorage.impl_witness_table.460, @T.as_type.as.OptionalStorage.impl(%facet_value.b6e) [concrete] +// CHECK:STDOUT: %OptionalStorage.facet.405: %OptionalStorage.type = facet_value %f64.dc1, (%OptionalStorage.impl_witness.4b3) [concrete] +// CHECK:STDOUT: %Optional.049: type = class_type @Optional, @Optional(%OptionalStorage.facet.405) [concrete] +// CHECK:STDOUT: %pattern_type.449: type = pattern_type %Optional.049 [concrete] +// CHECK:STDOUT: %specific_impl_fn.b6b: = specific_impl_function %impl.elem3.c16, @Iterate.WithSelf.Next(%Iterate.facet.f88) [symbolic] +// CHECK:STDOUT: %Optional.HasValue.type.794: type = fn_type @Optional.HasValue, @Optional(%OptionalStorage.facet.405) [concrete] +// CHECK:STDOUT: %Optional.HasValue.776: %Optional.HasValue.type.794 = struct_value () [concrete] +// CHECK:STDOUT: %Optional.Get.type.e6c: type = fn_type @Optional.Get, @Optional(%OptionalStorage.facet.405) [concrete] +// CHECK:STDOUT: %Optional.Get.cb6: %Optional.Get.type.e6c = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.facet.d87: %Destroy.type = facet_value %f64.dc1, (%custom_witness.f8f19d.3) [concrete] +// CHECK:STDOUT: %MaybeUnformed.8ff: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.d87) [concrete] // CHECK:STDOUT: %.cc0: type = maybe_unformed_type %f64.dc1 [concrete] -// CHECK:STDOUT: %struct_type.value.has_value.a24: type = struct_type {.value: %MaybeUnformed.5b0, .has_value: bool} [concrete] -// CHECK:STDOUT: %Optional.HasValue.specific_fn.cd8: = specific_function %Optional.HasValue.afd, @Optional.HasValue(%OptionalStorage.facet.1e4) [concrete] -// CHECK:STDOUT: %Optional.Get.specific_fn.1e8: = specific_function %Optional.Get.ef5, @Optional.Get(%OptionalStorage.facet.1e4) [concrete] +// CHECK:STDOUT: %struct_type.value.has_value.58e: type = struct_type {.value: %MaybeUnformed.8ff, .has_value: bool} [concrete] +// CHECK:STDOUT: %Optional.HasValue.specific_fn.9fc: = specific_function %Optional.HasValue.776, @Optional.HasValue(%OptionalStorage.facet.405) [concrete] +// CHECK:STDOUT: %Optional.Get.specific_fn.e69: = specific_function %Optional.Get.cb6, @Optional.Get(%OptionalStorage.facet.405) [concrete] // CHECK:STDOUT: %AddAssignWith.type.ff9: type = facet_type <@AddAssignWith, @AddAssignWith(%f64.dc1)> [concrete] // CHECK:STDOUT: %Float.as.AddAssignWith.impl.Op.type.fdd: type = fn_type @Float.as.AddAssignWith.impl.Op, @Float.as.AddAssignWith.impl(%N.fe9) [symbolic] // CHECK:STDOUT: %Float.as.AddAssignWith.impl.Op.430: %Float.as.AddAssignWith.impl.Op.type.fdd = struct_value () [symbolic] @@ -2585,13 +3176,53 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %AddAssignWith.WithSelf.Op.type.d04: type = fn_type @AddAssignWith.WithSelf.Op, @AddAssignWith.WithSelf(%f64.dc1, %AddAssignWith.facet) [concrete] // CHECK:STDOUT: %.918: type = fn_type_with_self_type %AddAssignWith.WithSelf.Op.type.d04, %AddAssignWith.facet [concrete] // CHECK:STDOUT: %Float.as.AddAssignWith.impl.Op.specific_fn: = specific_function %Float.as.AddAssignWith.impl.Op.ac1, @Float.as.AddAssignWith.impl.Op(%int_64) [concrete] +// CHECK:STDOUT: %pattern_type.1fb: type = pattern_type %.cc0 [concrete] +// CHECK:STDOUT: %self.param_patt.4fd: %pattern_type.1fb = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.69f: %pattern_type.1fb = wrapper_binding_pattern self, %self.param_patt.4fd [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc24_19.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc24_19.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.80d: type = pattern_type %MaybeUnformed.8ff [concrete] +// CHECK:STDOUT: %self.param_patt.70c: %pattern_type.80d = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.120: %pattern_type.80d = wrapper_binding_pattern self, %self.param_patt.70c [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc24_19.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.5: type = fn_type @Destroy.WithSelf.Op.loc24_19.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.5: %Destroy.WithSelf.Op.type.ef016f.5 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.40d: %pattern_type.831 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.560: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt.40d [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc24_19.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.6: type = fn_type @Destroy.WithSelf.Op.loc24_19.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.6: %Destroy.WithSelf.Op.type.ef016f.6 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.00a: type = pattern_type %struct_type.value.has_value.58e [concrete] +// CHECK:STDOUT: %self.param_patt.96d: %pattern_type.00a = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.602: %pattern_type.00a = wrapper_binding_pattern self, %self.param_patt.96d [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc24_19.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.7: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.7: type = fn_type @Destroy.WithSelf.Op.loc24_19.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.7: %Destroy.WithSelf.Op.type.ef016f.7 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.406: type = pattern_type %DefaultOptionalStorage.3e2 [concrete] +// CHECK:STDOUT: %self.param_patt.73b: %pattern_type.406 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.bd7: %pattern_type.406 = wrapper_binding_pattern self, %self.param_patt.73b [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.8: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc24_19.5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.8: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.8 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.8: type = fn_type @Destroy.WithSelf.Op.loc24_19.5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.8: %Destroy.WithSelf.Op.type.ef016f.8 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.a67: %pattern_type.449 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.521: %pattern_type.449 = wrapper_binding_pattern self, %self.param_patt.a67 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.9: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc24_19.6 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.9: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.9 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.9: type = fn_type @Destroy.WithSelf.Op.loc24_19.6 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.9: %Destroy.WithSelf.Op.type.ef016f.9 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.lookup_impl_witness.303: = lookup_impl_witness %impl.elem1.abd, @Destroy [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.2e9: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%impl.elem1.abd) [symbolic] -// CHECK:STDOUT: %.fe0: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.2e9, %impl.elem1.abd [symbolic] -// CHECK:STDOUT: %impl.elem0.15f: %.fe0 = impl_witness_access %Destroy.lookup_impl_witness.303, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.2a1: = specific_impl_function %impl.elem0.15f, @Destroy.WithSelf.Op.1(%impl.elem1.abd) [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.9: type = fn_type @Destroy.WithSelf.SelfDestruct.loc24_19.6 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.9: %Destroy.WithSelf.SelfDestruct.type.fbceb5.9 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.lookup_impl_witness.068: = lookup_impl_witness %impl.elem1.0cf, @Destroy [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.b85: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%impl.elem1.0cf) [symbolic] +// CHECK:STDOUT: %.056: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.b85, %impl.elem1.0cf [symbolic] +// CHECK:STDOUT: %impl.elem2.5f8: %.056 = impl_witness_access %Destroy.lookup_impl_witness.068, element2 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.b61: = specific_impl_function %impl.elem2.5f8, @Destroy.WithSelf.SelfDestruct.1(%impl.elem1.0cf) [symbolic] // CHECK:STDOUT: %ConstRange: type = class_type @ConstRange [concrete] // CHECK:STDOUT: %pattern_type.025: type = pattern_type %ConstRange [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] @@ -2605,41 +3236,49 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %Iterator.Op.type.ac7e09.1: type = fn_type @Iterator.Op.1 [concrete] // CHECK:STDOUT: %Iterator.Op.583fda.1: %Iterator.Op.type.ac7e09.1 = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.994: = custom_witness (%f64.dc1, %Iterator.Op.583fda.1), @CppUnsafeDeref [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.10: type = fn_type @Destroy.WithSelf.Op.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.10: %Destroy.WithSelf.Op.type.ef016f.10 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.10: type = fn_type @Destroy.WithSelf.SelfDestruct.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.10: %Destroy.WithSelf.SelfDestruct.type.fbceb5.10 = struct_value () [concrete] +// CHECK:STDOUT: %Iterator.SubobjectDestroy.type: type = fn_type @Iterator.SubobjectDestroy [concrete] +// CHECK:STDOUT: %Iterator.SubobjectDestroy: %Iterator.SubobjectDestroy.type = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.b76: = custom_witness (%Destroy.WithSelf.Op.403171.10, %Iterator.SubobjectDestroy, %Destroy.WithSelf.SelfDestruct.db3fdb.10), @Destroy [concrete] // CHECK:STDOUT: %Iterator.Op.type.ac7e09.2: type = fn_type @Iterator.Op.2 [concrete] // CHECK:STDOUT: %Iterator.Op.583fda.2: %Iterator.Op.type.ac7e09.2 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.213: = custom_witness (%Iterator.Op.583fda.2), @Destroy [concrete] -// CHECK:STDOUT: %Iterator.Op.type.ac7e09.3: type = fn_type @Iterator.Op.3 [concrete] -// CHECK:STDOUT: %Iterator.Op.583fda.3: %Iterator.Op.type.ac7e09.3 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.393: = custom_witness (%Iterator.Op.583fda.3), @Inc [concrete] +// CHECK:STDOUT: %custom_witness.393: = custom_witness (%Iterator.Op.583fda.2), @Inc [concrete] // CHECK:STDOUT: %Equal.type: type = fn_type @Equal [concrete] // CHECK:STDOUT: %Equal: %Equal.type = struct_value () [concrete] // CHECK:STDOUT: %NotEqual.type: type = fn_type @NotEqual [concrete] // CHECK:STDOUT: %NotEqual: %NotEqual.type = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.821: = custom_witness (%Equal, %NotEqual), @EqWith, @EqWith(%Iterator) [concrete] -// CHECK:STDOUT: %facet_value.fd3: %CppRange_where.type.d682d6.1 = facet_value %ConstRange, (%custom_witness.6c4ec3.3, %Copy.impl_witness.0d6, %custom_witness.5d5, %custom_witness.213, %custom_witness.994, %custom_witness.393, %custom_witness.821) [concrete] +// CHECK:STDOUT: %facet_value.e81: %CppRange_where.type.d682d6.1 = facet_value %ConstRange, (%custom_witness.f8f19d.3, %Copy.impl_witness.0d6, %custom_witness.5d5, %custom_witness.b76, %custom_witness.994, %custom_witness.393, %custom_witness.821) [concrete] // CHECK:STDOUT: %tuple.type.005: type = tuple_type (%Iterator, %Iterator) [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.10: type = fn_type @Destroy.WithSelf.Op.3 [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.10: %Destroy.WithSelf.Op.type.ef016f.10 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.6c4ec3.10: = custom_witness (%Destroy.WithSelf.Op.403171.10), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.16ee: %Destroy.type = facet_value %tuple.type.005, (%custom_witness.6c4ec3.10) [concrete] -// CHECK:STDOUT: %Iterate.impl_witness.e1c: = impl_witness imports.%Iterate.impl_witness_table.121, @T.as_type.as.Iterate.impl(%facet_value.fd3) [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.type.e0d: type = fn_type @T.as_type.as.Iterate.impl.NewCursor, @T.as_type.as.Iterate.impl(%facet_value.fd3) [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.89a: %T.as_type.as.Iterate.impl.NewCursor.type.e0d = struct_value () [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.type.4d9: type = fn_type @T.as_type.as.Iterate.impl.Next, @T.as_type.as.Iterate.impl(%facet_value.fd3) [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.ac9: %T.as_type.as.Iterate.impl.Next.type.4d9 = struct_value () [concrete] -// CHECK:STDOUT: %Iterate.facet.b4e: %Iterate.type = facet_value %ConstRange, (%Iterate.impl_witness.e1c) [concrete] -// CHECK:STDOUT: %facet_value.d3b: %Iterate_where.type.13a = facet_value %ConstRange, (%Iterate.impl_witness.e1c) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.10: type = fn_type @Destroy.WithSelf.SubobjectDestroy.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.10: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.10 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.11: type = fn_type @Destroy.WithSelf.Op.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.11: %Destroy.WithSelf.Op.type.ef016f.11 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.11: type = fn_type @Destroy.WithSelf.SelfDestruct.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.11: %Destroy.WithSelf.SelfDestruct.type.fbceb5.11 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f8f19d.10: = custom_witness (%Destroy.WithSelf.Op.403171.11, %Destroy.WithSelf.SubobjectDestroy.d01daf.10, %Destroy.WithSelf.SelfDestruct.db3fdb.11), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.362: %Destroy.type = facet_value %tuple.type.005, (%custom_witness.f8f19d.10) [concrete] +// CHECK:STDOUT: %Iterate.impl_witness.2d1: = impl_witness imports.%Iterate.impl_witness_table.121, @T.as_type.as.Iterate.impl(%facet_value.e81) [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.type.2c9: type = fn_type @T.as_type.as.Iterate.impl.NewCursor, @T.as_type.as.Iterate.impl(%facet_value.e81) [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.c9a: %T.as_type.as.Iterate.impl.NewCursor.type.2c9 = struct_value () [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.type.08d: type = fn_type @T.as_type.as.Iterate.impl.Next, @T.as_type.as.Iterate.impl(%facet_value.e81) [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.751: %T.as_type.as.Iterate.impl.Next.type.08d = struct_value () [concrete] +// CHECK:STDOUT: %Iterate.facet.e86: %Iterate.type = facet_value %ConstRange, (%Iterate.impl_witness.2d1) [concrete] +// CHECK:STDOUT: %facet_value.58e: %Iterate_where.type.028 = facet_value %ConstRange, (%Iterate.impl_witness.2d1) [concrete] // CHECK:STDOUT: %r.param_patt.a73: %pattern_type.025 = value_param_pattern [concrete] // CHECK:STDOUT: %r.patt.0b5: %pattern_type.025 = wrapper_binding_pattern r, %r.param_patt.a73 [concrete] -// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.408: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.b4e) [concrete] -// CHECK:STDOUT: %Iterate.WithSelf.Next.type.01a: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.b4e) [concrete] -// CHECK:STDOUT: %.608: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.408, %Iterate.facet.b4e [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.specific_fn: = specific_function %T.as_type.as.Iterate.impl.NewCursor.89a, @T.as_type.as.Iterate.impl.NewCursor(%facet_value.fd3) [concrete] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.bcd: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.e86) [concrete] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type.44e: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.e86) [concrete] +// CHECK:STDOUT: %.3f0: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.bcd, %Iterate.facet.e86 [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.specific_fn: = specific_function %T.as_type.as.Iterate.impl.NewCursor.c9a, @T.as_type.as.Iterate.impl.NewCursor(%facet_value.e81) [concrete] // CHECK:STDOUT: %ptr.d1a: type = ptr_type %tuple.type.005 [concrete] -// CHECK:STDOUT: %.ced: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.01a, %Iterate.facet.b4e [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.specific_fn: = specific_function %T.as_type.as.Iterate.impl.Next.ac9, @T.as_type.as.Iterate.impl.Next(%facet_value.fd3) [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.e14: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Destroy.facet.16ee) [concrete] -// CHECK:STDOUT: %.3d8: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.e14, %Destroy.facet.16ee [concrete] +// CHECK:STDOUT: %.343: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.44e, %Iterate.facet.e86 [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.specific_fn: = specific_function %T.as_type.as.Iterate.impl.Next.751, @T.as_type.as.Iterate.impl.Next(%facet_value.e81) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.873: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.362) [concrete] +// CHECK:STDOUT: %.9a7: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.873, %Destroy.facet.362 [concrete] // CHECK:STDOUT: %complete_type.320: = complete_type_witness %tuple.type.005 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2664,28 +3303,115 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %AddAssignWith.impl_witness_table = impl_witness_table (%Core.import_ref.cb3), @Float.as.AddAssignWith.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @TestIterate(%R.loc20_17.2: %Iterate_where.type.13a) { +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc24_19.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.1fb = ref_param_pattern [concrete = constants.%self.param_patt.4fd] +// CHECK:STDOUT: %self.patt: %pattern_type.1fb = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.69f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %.cc0 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %.cc0 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc24_19.1 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.1fb = ref_param_pattern [concrete = constants.%self.param_patt.4fd] +// CHECK:STDOUT: %self.patt: %pattern_type.1fb = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.69f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %.cc0 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %.cc0 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc24_19.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.80d = ref_param_pattern [concrete = constants.%self.param_patt.70c] +// CHECK:STDOUT: %self.patt: %pattern_type.80d = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.120] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %MaybeUnformed.8ff = ref_param call_param0 +// CHECK:STDOUT: %self: ref %MaybeUnformed.8ff = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.5 = fn_decl @Destroy.WithSelf.Op.loc24_19.2 [concrete = constants.%Destroy.WithSelf.Op.403171.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.80d = ref_param_pattern [concrete = constants.%self.param_patt.70c] +// CHECK:STDOUT: %self.patt: %pattern_type.80d = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.120] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %MaybeUnformed.8ff = ref_param call_param0 +// CHECK:STDOUT: %self: ref %MaybeUnformed.8ff = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc24_19.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d] +// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0 +// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.5: %Destroy.WithSelf.Op.type.ef016f.6 = fn_decl @Destroy.WithSelf.Op.loc24_19.3 [concrete = constants.%Destroy.WithSelf.Op.403171.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d] +// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0 +// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc24_19.4 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.7] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.00a = ref_param_pattern [concrete = constants.%self.param_patt.96d] +// CHECK:STDOUT: %self.patt: %pattern_type.00a = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.602] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.value.has_value.58e = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.value.has_value.58e = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.6: %Destroy.WithSelf.Op.type.ef016f.7 = fn_decl @Destroy.WithSelf.Op.loc24_19.4 [concrete = constants.%Destroy.WithSelf.Op.403171.7] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.00a = ref_param_pattern [concrete = constants.%self.param_patt.96d] +// CHECK:STDOUT: %self.patt: %pattern_type.00a = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.602] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.value.has_value.58e = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.value.has_value.58e = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.7: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.8 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc24_19.5 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.8] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.406 = ref_param_pattern [concrete = constants.%self.param_patt.73b] +// CHECK:STDOUT: %self.patt: %pattern_type.406 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.bd7] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %DefaultOptionalStorage.3e2 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %DefaultOptionalStorage.3e2 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.7: %Destroy.WithSelf.Op.type.ef016f.8 = fn_decl @Destroy.WithSelf.Op.loc24_19.5 [concrete = constants.%Destroy.WithSelf.Op.403171.8] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.406 = ref_param_pattern [concrete = constants.%self.param_patt.73b] +// CHECK:STDOUT: %self.patt: %pattern_type.406 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.bd7] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %DefaultOptionalStorage.3e2 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %DefaultOptionalStorage.3e2 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.8: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.9 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc24_19.6 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.9] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.449 = ref_param_pattern [concrete = constants.%self.param_patt.a67] +// CHECK:STDOUT: %self.patt: %pattern_type.449 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.521] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Optional.049 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Optional.049 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.8: %Destroy.WithSelf.Op.type.ef016f.9 = fn_decl @Destroy.WithSelf.Op.loc24_19.6 [concrete = constants.%Destroy.WithSelf.Op.403171.9] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.449 = ref_param_pattern [concrete = constants.%self.param_patt.a67] +// CHECK:STDOUT: %self.patt: %pattern_type.449 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.521] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Optional.049 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Optional.049 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @TestIterate(%R.loc20_17.2: %Iterate_where.type.028) { // CHECK:STDOUT: // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: %Iterate.lookup_impl_witness: = lookup_impl_witness %R.loc20_17.1, @Iterate [symbolic = %Iterate.lookup_impl_witness (constants.%Iterate.lookup_impl_witness.0cb)] -// CHECK:STDOUT: %Iterate.facet.loc24_19.5: %Iterate.type = facet_value %R.as_type.loc20_61.1, (%Iterate.lookup_impl_witness) [symbolic = %Iterate.facet.loc24_19.5 (constants.%Iterate.facet.a3a)] -// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.loc24_19.5) [symbolic = %Iterate.WithSelf.NewCursor.type (constants.%Iterate.WithSelf.NewCursor.type.228)] -// CHECK:STDOUT: %.loc24_19.19: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type, %Iterate.facet.loc24_19.5 [symbolic = %.loc24_19.19 (constants.%.bf4)] -// CHECK:STDOUT: %impl.elem2.loc24_19.2: @TestIterate.%.loc24_19.19 (%.bf4) = impl_witness_access %Iterate.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc24_19.2 (constants.%impl.elem2.1a5)] -// CHECK:STDOUT: %specific_impl_fn.loc24_19.4: = specific_impl_function %impl.elem2.loc24_19.2, @Iterate.WithSelf.NewCursor(%Iterate.facet.loc24_19.5) [symbolic = %specific_impl_fn.loc24_19.4 (constants.%specific_impl_fn.40d)] +// CHECK:STDOUT: %Iterate.lookup_impl_witness: = lookup_impl_witness %R.loc20_17.1, @Iterate [symbolic = %Iterate.lookup_impl_witness (constants.%Iterate.lookup_impl_witness.9e0)] +// CHECK:STDOUT: %Iterate.facet.loc24_19.5: %Iterate.type = facet_value %R.as_type.loc20_61.1, (%Iterate.lookup_impl_witness) [symbolic = %Iterate.facet.loc24_19.5 (constants.%Iterate.facet.f88)] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.loc24_19.5) [symbolic = %Iterate.WithSelf.NewCursor.type (constants.%Iterate.WithSelf.NewCursor.type.3d0)] +// CHECK:STDOUT: %.loc24_19.19: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type, %Iterate.facet.loc24_19.5 [symbolic = %.loc24_19.19 (constants.%.afc)] +// CHECK:STDOUT: %impl.elem2.loc24_19.3: @TestIterate.%.loc24_19.19 (%.afc) = impl_witness_access %Iterate.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc24_19.3 (constants.%impl.elem2.895)] +// CHECK:STDOUT: %specific_impl_fn.loc24_19.4: = specific_impl_function %impl.elem2.loc24_19.3, @Iterate.WithSelf.NewCursor(%Iterate.facet.loc24_19.5) [symbolic = %specific_impl_fn.loc24_19.4 (constants.%specific_impl_fn.999)] // CHECK:STDOUT: -// CHECK:STDOUT: %ptr: type = ptr_type %as_type [symbolic = %ptr (constants.%ptr.e53)] -// CHECK:STDOUT: %Iterate.WithSelf.Next.type: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.loc24_19.5) [symbolic = %Iterate.WithSelf.Next.type (constants.%Iterate.WithSelf.Next.type.431)] -// CHECK:STDOUT: %.loc24_19.20: type = fn_type_with_self_type %Iterate.WithSelf.Next.type, %Iterate.facet.loc24_19.5 [symbolic = %.loc24_19.20 (constants.%.b72)] -// CHECK:STDOUT: %impl.elem3.loc24_19.2: @TestIterate.%.loc24_19.20 (%.b72) = impl_witness_access %Iterate.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc24_19.2 (constants.%impl.elem3.eef)] -// CHECK:STDOUT: %specific_impl_fn.loc24_19.5: = specific_impl_function %impl.elem3.loc24_19.2, @Iterate.WithSelf.Next(%Iterate.facet.loc24_19.5) [symbolic = %specific_impl_fn.loc24_19.5 (constants.%specific_impl_fn.e16)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%impl.elem1) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.2e9)] -// CHECK:STDOUT: %.loc24_19.21: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %impl.elem1 [symbolic = %.loc24_19.21 (constants.%.fe0)] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %impl.elem1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.303)] -// CHECK:STDOUT: %impl.elem0.loc24_19.2: @TestIterate.%.loc24_19.21 (%.fe0) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc24_19.2 (constants.%impl.elem0.15f)] -// CHECK:STDOUT: %specific_impl_fn.loc24_19.6: = specific_impl_function %impl.elem0.loc24_19.2, @Destroy.WithSelf.Op.1(%impl.elem1) [symbolic = %specific_impl_fn.loc24_19.6 (constants.%specific_impl_fn.2a1)] +// CHECK:STDOUT: %ptr: type = ptr_type %as_type [symbolic = %ptr (constants.%ptr.44a)] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.loc24_19.5) [symbolic = %Iterate.WithSelf.Next.type (constants.%Iterate.WithSelf.Next.type.160)] +// CHECK:STDOUT: %.loc24_19.20: type = fn_type_with_self_type %Iterate.WithSelf.Next.type, %Iterate.facet.loc24_19.5 [symbolic = %.loc24_19.20 (constants.%.b00)] +// CHECK:STDOUT: %impl.elem3.loc24_19.2: @TestIterate.%.loc24_19.20 (%.b00) = impl_witness_access %Iterate.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc24_19.2 (constants.%impl.elem3.c16)] +// CHECK:STDOUT: %specific_impl_fn.loc24_19.5: = specific_impl_function %impl.elem3.loc24_19.2, @Iterate.WithSelf.Next(%Iterate.facet.loc24_19.5) [symbolic = %specific_impl_fn.loc24_19.5 (constants.%specific_impl_fn.b6b)] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%impl.elem1) [symbolic = %Destroy.WithSelf.SelfDestruct.type (constants.%Destroy.WithSelf.SelfDestruct.type.b85)] +// CHECK:STDOUT: %.loc24_19.21: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type, %impl.elem1 [symbolic = %.loc24_19.21 (constants.%.056)] +// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %impl.elem1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.068)] +// CHECK:STDOUT: %impl.elem2.loc24_19.4: @TestIterate.%.loc24_19.21 (%.056) = impl_witness_access %Destroy.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc24_19.4 (constants.%impl.elem2.5f8)] +// CHECK:STDOUT: %specific_impl_fn.loc24_19.6: = specific_impl_function %impl.elem2.loc24_19.4, @Destroy.WithSelf.SelfDestruct.1(%impl.elem1) [symbolic = %specific_impl_fn.loc24_19.6 (constants.%specific_impl_fn.b61)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%r.param: @TestIterate.%R.as_type.loc20_61.1 (%R.as_type)) { // CHECK:STDOUT: !entry: @@ -2694,52 +3420,52 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %i.patt: %pattern_type.fb7 = value_binding_pattern i [concrete = constants.%i.patt] // CHECK:STDOUT: } // CHECK:STDOUT: %r.ref: @TestIterate.%R.as_type.loc20_61.1 (%R.as_type) = name_ref r, %r -// CHECK:STDOUT: %impl.elem2.loc24_19.1: @TestIterate.%.loc24_19.19 (%.bf4) = impl_witness_access constants.%Iterate.lookup_impl_witness.0cb, element2 [symbolic = %impl.elem2.loc24_19.2 (constants.%impl.elem2.1a5)] +// CHECK:STDOUT: %impl.elem2.loc24_19.1: @TestIterate.%.loc24_19.19 (%.afc) = impl_witness_access constants.%Iterate.lookup_impl_witness.9e0, element2 [symbolic = %impl.elem2.loc24_19.3 (constants.%impl.elem2.895)] // CHECK:STDOUT: %bound_method.loc24_19.1: = bound_method %r.ref, %impl.elem2.loc24_19.1 -// CHECK:STDOUT: %Iterate.facet.loc24_19.1: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.0cb) [symbolic = %Iterate.facet.loc24_19.5 (constants.%Iterate.facet.a3a)] -// CHECK:STDOUT: %.loc24_19.1: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc24_19.1 [symbolic = %Iterate.facet.loc24_19.5 (constants.%Iterate.facet.a3a)] -// CHECK:STDOUT: %Iterate.facet.loc24_19.2: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.0cb) [symbolic = %Iterate.facet.loc24_19.5 (constants.%Iterate.facet.a3a)] -// CHECK:STDOUT: %.loc24_19.2: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc24_19.2 [symbolic = %Iterate.facet.loc24_19.5 (constants.%Iterate.facet.a3a)] -// CHECK:STDOUT: %specific_impl_fn.loc24_19.1: = specific_impl_function %impl.elem2.loc24_19.1, @Iterate.WithSelf.NewCursor(constants.%Iterate.facet.a3a) [symbolic = %specific_impl_fn.loc24_19.4 (constants.%specific_impl_fn.40d)] +// CHECK:STDOUT: %Iterate.facet.loc24_19.1: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.9e0) [symbolic = %Iterate.facet.loc24_19.5 (constants.%Iterate.facet.f88)] +// CHECK:STDOUT: %.loc24_19.1: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc24_19.1 [symbolic = %Iterate.facet.loc24_19.5 (constants.%Iterate.facet.f88)] +// CHECK:STDOUT: %Iterate.facet.loc24_19.2: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.9e0) [symbolic = %Iterate.facet.loc24_19.5 (constants.%Iterate.facet.f88)] +// CHECK:STDOUT: %.loc24_19.2: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc24_19.2 [symbolic = %Iterate.facet.loc24_19.5 (constants.%Iterate.facet.f88)] +// CHECK:STDOUT: %specific_impl_fn.loc24_19.1: = specific_impl_function %impl.elem2.loc24_19.1, @Iterate.WithSelf.NewCursor(constants.%Iterate.facet.f88) [symbolic = %specific_impl_fn.loc24_19.4 (constants.%specific_impl_fn.999)] // CHECK:STDOUT: %bound_method.loc24_19.2: = bound_method %r.ref, %specific_impl_fn.loc24_19.1 -// CHECK:STDOUT: %var: ref @TestIterate.%as_type (%as_type.033) = var_storage invalid -// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.call: init @TestIterate.%as_type (%as_type.033) to %var = call %bound_method.loc24_19.2(%r.ref) +// CHECK:STDOUT: %var: ref @TestIterate.%as_type (%as_type.ce3) = var_storage invalid +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.call: init @TestIterate.%as_type (%as_type.ce3) to %var = call %bound_method.loc24_19.2(%r.ref) // CHECK:STDOUT: assign %var, %Iterate.WithSelf.NewCursor.call // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.next: -// CHECK:STDOUT: %addr: @TestIterate.%ptr (%ptr.e53) = addr_of %var -// CHECK:STDOUT: %impl.elem3.loc24_19.1: @TestIterate.%.loc24_19.20 (%.b72) = impl_witness_access constants.%Iterate.lookup_impl_witness.0cb, element3 [symbolic = %impl.elem3.loc24_19.2 (constants.%impl.elem3.eef)] +// CHECK:STDOUT: %addr: @TestIterate.%ptr (%ptr.44a) = addr_of %var +// CHECK:STDOUT: %impl.elem3.loc24_19.1: @TestIterate.%.loc24_19.20 (%.b00) = impl_witness_access constants.%Iterate.lookup_impl_witness.9e0, element3 [symbolic = %impl.elem3.loc24_19.2 (constants.%impl.elem3.c16)] // CHECK:STDOUT: %bound_method.loc24_19.3: = bound_method %r.ref, %impl.elem3.loc24_19.1 -// CHECK:STDOUT: %Iterate.facet.loc24_19.3: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.0cb) [symbolic = %Iterate.facet.loc24_19.5 (constants.%Iterate.facet.a3a)] -// CHECK:STDOUT: %.loc24_19.3: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc24_19.3 [symbolic = %Iterate.facet.loc24_19.5 (constants.%Iterate.facet.a3a)] -// CHECK:STDOUT: %Iterate.facet.loc24_19.4: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.0cb) [symbolic = %Iterate.facet.loc24_19.5 (constants.%Iterate.facet.a3a)] -// CHECK:STDOUT: %.loc24_19.4: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc24_19.4 [symbolic = %Iterate.facet.loc24_19.5 (constants.%Iterate.facet.a3a)] -// CHECK:STDOUT: %.loc24_19.5: %Destroy.type = converted constants.%as_type.033, constants.%impl.elem1.abd [symbolic = %impl.elem1 (constants.%impl.elem1.abd)] -// CHECK:STDOUT: %.loc24_19.6: %Destroy.type = converted constants.%as_type.033, constants.%impl.elem1.abd [symbolic = %impl.elem1 (constants.%impl.elem1.abd)] -// CHECK:STDOUT: %specific_impl_fn.loc24_19.2: = specific_impl_function %impl.elem3.loc24_19.1, @Iterate.WithSelf.Next(constants.%Iterate.facet.a3a) [symbolic = %specific_impl_fn.loc24_19.5 (constants.%specific_impl_fn.e16)] +// CHECK:STDOUT: %Iterate.facet.loc24_19.3: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.9e0) [symbolic = %Iterate.facet.loc24_19.5 (constants.%Iterate.facet.f88)] +// CHECK:STDOUT: %.loc24_19.3: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc24_19.3 [symbolic = %Iterate.facet.loc24_19.5 (constants.%Iterate.facet.f88)] +// CHECK:STDOUT: %Iterate.facet.loc24_19.4: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.9e0) [symbolic = %Iterate.facet.loc24_19.5 (constants.%Iterate.facet.f88)] +// CHECK:STDOUT: %.loc24_19.4: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc24_19.4 [symbolic = %Iterate.facet.loc24_19.5 (constants.%Iterate.facet.f88)] +// CHECK:STDOUT: %.loc24_19.5: %Destroy.type = converted constants.%as_type.ce3, constants.%impl.elem1.0cf [symbolic = %impl.elem1 (constants.%impl.elem1.0cf)] +// CHECK:STDOUT: %.loc24_19.6: %Destroy.type = converted constants.%as_type.ce3, constants.%impl.elem1.0cf [symbolic = %impl.elem1 (constants.%impl.elem1.0cf)] +// CHECK:STDOUT: %specific_impl_fn.loc24_19.2: = specific_impl_function %impl.elem3.loc24_19.1, @Iterate.WithSelf.Next(constants.%Iterate.facet.f88) [symbolic = %specific_impl_fn.loc24_19.5 (constants.%specific_impl_fn.b6b)] // CHECK:STDOUT: %bound_method.loc24_19.4: = bound_method %r.ref, %specific_impl_fn.loc24_19.2 -// CHECK:STDOUT: %.loc24_19.7: ref %Optional.72d = temporary_storage -// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.72d to %.loc24_19.7 = call %bound_method.loc24_19.4(%r.ref, %addr) -// CHECK:STDOUT: %.loc24_19.8: ref %Optional.72d = temporary %.loc24_19.7, %Iterate.WithSelf.Next.call -// CHECK:STDOUT: %.loc24_19.9: %Optional.HasValue.type.7a6 = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.1e4) [concrete = constants.%Optional.HasValue.afd] -// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.7a6 = name_ref HasValue, %.loc24_19.9 [concrete = constants.%Optional.HasValue.afd] +// CHECK:STDOUT: %.loc24_19.7: ref %Optional.049 = temporary_storage +// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.049 to %.loc24_19.7 = call %bound_method.loc24_19.4(%r.ref, %addr) +// CHECK:STDOUT: %.loc24_19.8: ref %Optional.049 = temporary %.loc24_19.7, %Iterate.WithSelf.Next.call +// CHECK:STDOUT: %.loc24_19.9: %Optional.HasValue.type.794 = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.405) [concrete = constants.%Optional.HasValue.776] +// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.794 = name_ref HasValue, %.loc24_19.9 [concrete = constants.%Optional.HasValue.776] // CHECK:STDOUT: %Optional.HasValue.bound: = bound_method %.loc24_19.8, %HasValue.ref -// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%OptionalStorage.facet.1e4) [concrete = constants.%Optional.HasValue.specific_fn.cd8] +// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%OptionalStorage.facet.405) [concrete = constants.%Optional.HasValue.specific_fn.9fc] // CHECK:STDOUT: %bound_method.loc24_19.5: = bound_method %.loc24_19.8, %Optional.HasValue.specific_fn -// CHECK:STDOUT: %.loc24_19.10: %Optional.72d = acquire_value %.loc24_19.8 +// CHECK:STDOUT: %.loc24_19.10: %Optional.049 = acquire_value %.loc24_19.8 // CHECK:STDOUT: %Optional.HasValue.call: init bool = call %bound_method.loc24_19.5(%.loc24_19.10) // CHECK:STDOUT: %.loc24_19.11: bool = value_of_initializer %Optional.HasValue.call // CHECK:STDOUT: %.loc24_19.12: bool = converted %Optional.HasValue.call, %.loc24_19.11 // CHECK:STDOUT: if %.loc24_19.12 br !for.body else br !for.done // CHECK:STDOUT: // CHECK:STDOUT: !for.body: -// CHECK:STDOUT: %.loc24_19.13: %Optional.Get.type.65e = specific_constant imports.%Core.import_ref.dab, @Optional(constants.%OptionalStorage.facet.1e4) [concrete = constants.%Optional.Get.ef5] -// CHECK:STDOUT: %Get.ref: %Optional.Get.type.65e = name_ref Get, %.loc24_19.13 [concrete = constants.%Optional.Get.ef5] +// CHECK:STDOUT: %.loc24_19.13: %Optional.Get.type.e6c = specific_constant imports.%Core.import_ref.dab, @Optional(constants.%OptionalStorage.facet.405) [concrete = constants.%Optional.Get.cb6] +// CHECK:STDOUT: %Get.ref: %Optional.Get.type.e6c = name_ref Get, %.loc24_19.13 [concrete = constants.%Optional.Get.cb6] // CHECK:STDOUT: %Optional.Get.bound: = bound_method %.loc24_19.8, %Get.ref -// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%OptionalStorage.facet.1e4) [concrete = constants.%Optional.Get.specific_fn.1e8] +// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%OptionalStorage.facet.405) [concrete = constants.%Optional.Get.specific_fn.e69] // CHECK:STDOUT: %bound_method.loc24_19.6: = bound_method %.loc24_19.8, %Optional.Get.specific_fn -// CHECK:STDOUT: %.loc24_19.14: %Optional.72d = acquire_value %.loc24_19.8 +// CHECK:STDOUT: %.loc24_19.14: %Optional.049 = acquire_value %.loc24_19.8 // CHECK:STDOUT: %Optional.Get.call: init %f64.dc1 = call %bound_method.loc24_19.6(%.loc24_19.14) // CHECK:STDOUT: %.loc24_19.15: %f64.dc1 = value_of_initializer %Optional.Get.call // CHECK:STDOUT: %.loc24_19.16: %f64.dc1 = converted %Optional.Get.call, %.loc24_19.15 @@ -2752,48 +3478,102 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %specific_fn.loc25: = specific_function %impl.elem0.loc25, @Float.as.AddAssignWith.impl.Op(constants.%int_64) [concrete = constants.%Float.as.AddAssignWith.impl.Op.specific_fn] // CHECK:STDOUT: %bound_method.loc25_9.2: = bound_method %sum.ref, %specific_fn.loc25 // CHECK:STDOUT: %Float.as.AddAssignWith.impl.Op.call: init %empty_tuple.type = call %bound_method.loc25_9.2(%sum.ref, %i.ref) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc24_19.1: = bound_method %.loc24_19.8, constants.%Destroy.WithSelf.Op.403171.9 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc24_19.1: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc24_19.1(%.loc24_19.8) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc24_19.1: = bound_method %.loc24_19.8, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.9 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc24_19.1: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc24_19.1(%.loc24_19.8) // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.done: -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc24_19.2: = bound_method %.loc24_19.8, constants.%Destroy.WithSelf.Op.403171.9 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc24_19.2: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc24_19.2(%.loc24_19.8) -// CHECK:STDOUT: %impl.elem0.loc24_19.1: @TestIterate.%.loc24_19.21 (%.fe0) = impl_witness_access constants.%Destroy.lookup_impl_witness.303, element0 [symbolic = %impl.elem0.loc24_19.2 (constants.%impl.elem0.15f)] -// CHECK:STDOUT: %bound_method.loc24_19.7: = bound_method %var, %impl.elem0.loc24_19.1 -// CHECK:STDOUT: %.loc24_19.17: %Destroy.type = converted constants.%as_type.033, constants.%impl.elem1.abd [symbolic = %impl.elem1 (constants.%impl.elem1.abd)] -// CHECK:STDOUT: %.loc24_19.18: %Destroy.type = converted constants.%as_type.033, constants.%impl.elem1.abd [symbolic = %impl.elem1 (constants.%impl.elem1.abd)] -// CHECK:STDOUT: %specific_impl_fn.loc24_19.3: = specific_impl_function %impl.elem0.loc24_19.1, @Destroy.WithSelf.Op.1(constants.%impl.elem1.abd) [symbolic = %specific_impl_fn.loc24_19.6 (constants.%specific_impl_fn.2a1)] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc24_19.2: = bound_method %.loc24_19.8, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.9 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc24_19.2: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc24_19.2(%.loc24_19.8) +// CHECK:STDOUT: %impl.elem2.loc24_19.2: @TestIterate.%.loc24_19.21 (%.056) = impl_witness_access constants.%Destroy.lookup_impl_witness.068, element2 [symbolic = %impl.elem2.loc24_19.4 (constants.%impl.elem2.5f8)] +// CHECK:STDOUT: %bound_method.loc24_19.7: = bound_method %var, %impl.elem2.loc24_19.2 +// CHECK:STDOUT: %.loc24_19.17: %Destroy.type = converted constants.%as_type.ce3, constants.%impl.elem1.0cf [symbolic = %impl.elem1 (constants.%impl.elem1.0cf)] +// CHECK:STDOUT: %.loc24_19.18: %Destroy.type = converted constants.%as_type.ce3, constants.%impl.elem1.0cf [symbolic = %impl.elem1 (constants.%impl.elem1.0cf)] +// CHECK:STDOUT: %specific_impl_fn.loc24_19.3: = specific_impl_function %impl.elem2.loc24_19.2, @Destroy.WithSelf.SelfDestruct.1(constants.%impl.elem1.0cf) [symbolic = %specific_impl_fn.loc24_19.6 (constants.%specific_impl_fn.b61)] // CHECK:STDOUT: %bound_method.loc24_19.8: = bound_method %var, %specific_impl_fn.loc24_19.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc24_19.3: init %empty_tuple.type = call %bound_method.loc24_19.8(%var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc24_19.3: init %empty_tuple.type = call %bound_method.loc24_19.8(%var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_19.1(%self.param: ref %.cc0) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc24_19.1(%self.param: ref %.cc0) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_19.2(%self.param: ref %MaybeUnformed.5b0) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_19.1(%self.param: ref %.cc0) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc24_19.1(%self.param: ref %.cc0) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc24_19.2(%self.param: ref %MaybeUnformed.8ff) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_19.2(%self.param: ref %MaybeUnformed.8ff) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc24_19.2(%self.param: ref %MaybeUnformed.8ff) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc24_19.3(%self.param: ref bool) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_19.3(%self.param: ref bool) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_19.4(%self.param: ref %struct_type.value.has_value.a24) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc24_19.3(%self.param: ref bool) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.5(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.5(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc24_19.4(%self.param: ref %struct_type.value.has_value.58e) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_19.5(%self.param: ref %DefaultOptionalStorage.a3f) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_19.4(%self.param: ref %struct_type.value.has_value.58e) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc24_19.4(%self.param: ref %struct_type.value.has_value.58e) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.6(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.6(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc24_19.5(%self.param: ref %DefaultOptionalStorage.3e2) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_19.6(%self.param: ref %Optional.72d) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_19.5(%self.param: ref %DefaultOptionalStorage.3e2) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc24_19.5(%self.param: ref %DefaultOptionalStorage.3e2) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.7(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.7(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc24_19.6(%self.param: ref %Optional.049) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24_19.6(%self.param: ref %Optional.049) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc24_19.6(%self.param: ref %Optional.049) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.8(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.8(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2804,13 +3584,13 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %i.patt: %pattern_type.fb7 = value_binding_pattern i [concrete = constants.%i.patt] // CHECK:STDOUT: } // CHECK:STDOUT: %c.ref: %ConstRange = name_ref c, %c -// CHECK:STDOUT: %impl.elem2: %.608 = impl_witness_access constants.%Iterate.impl_witness.e1c, element2 [concrete = constants.%T.as_type.as.Iterate.impl.NewCursor.89a] +// CHECK:STDOUT: %impl.elem2: %.3f0 = impl_witness_access constants.%Iterate.impl_witness.2d1, element2 [concrete = constants.%T.as_type.as.Iterate.impl.NewCursor.c9a] // CHECK:STDOUT: %bound_method.loc38_19.1: = bound_method %c.ref, %impl.elem2 -// CHECK:STDOUT: %facet_value.loc38_19.1: %CppRange_where.type.d682d6.1 = facet_value constants.%ConstRange, (constants.%custom_witness.6c4ec3.3, constants.%Copy.impl_witness.0d6, constants.%custom_witness.5d5, constants.%custom_witness.213, constants.%custom_witness.994, constants.%custom_witness.393, constants.%custom_witness.821) [concrete = constants.%facet_value.fd3] -// CHECK:STDOUT: %.loc38_19.1: %CppRange_where.type.d682d6.1 = converted constants.%ConstRange, %facet_value.loc38_19.1 [concrete = constants.%facet_value.fd3] -// CHECK:STDOUT: %facet_value.loc38_19.2: %CppRange_where.type.d682d6.1 = facet_value constants.%ConstRange, (constants.%custom_witness.6c4ec3.3, constants.%Copy.impl_witness.0d6, constants.%custom_witness.5d5, constants.%custom_witness.213, constants.%custom_witness.994, constants.%custom_witness.393, constants.%custom_witness.821) [concrete = constants.%facet_value.fd3] -// CHECK:STDOUT: %.loc38_19.2: %CppRange_where.type.d682d6.1 = converted constants.%ConstRange, %facet_value.loc38_19.2 [concrete = constants.%facet_value.fd3] -// CHECK:STDOUT: %specific_fn.loc38_19.1: = specific_function %impl.elem2, @T.as_type.as.Iterate.impl.NewCursor(constants.%facet_value.fd3) [concrete = constants.%T.as_type.as.Iterate.impl.NewCursor.specific_fn] +// CHECK:STDOUT: %facet_value.loc38_19.1: %CppRange_where.type.d682d6.1 = facet_value constants.%ConstRange, (constants.%custom_witness.f8f19d.3, constants.%Copy.impl_witness.0d6, constants.%custom_witness.5d5, constants.%custom_witness.b76, constants.%custom_witness.994, constants.%custom_witness.393, constants.%custom_witness.821) [concrete = constants.%facet_value.e81] +// CHECK:STDOUT: %.loc38_19.1: %CppRange_where.type.d682d6.1 = converted constants.%ConstRange, %facet_value.loc38_19.1 [concrete = constants.%facet_value.e81] +// CHECK:STDOUT: %facet_value.loc38_19.2: %CppRange_where.type.d682d6.1 = facet_value constants.%ConstRange, (constants.%custom_witness.f8f19d.3, constants.%Copy.impl_witness.0d6, constants.%custom_witness.5d5, constants.%custom_witness.b76, constants.%custom_witness.994, constants.%custom_witness.393, constants.%custom_witness.821) [concrete = constants.%facet_value.e81] +// CHECK:STDOUT: %.loc38_19.2: %CppRange_where.type.d682d6.1 = converted constants.%ConstRange, %facet_value.loc38_19.2 [concrete = constants.%facet_value.e81] +// CHECK:STDOUT: %specific_fn.loc38_19.1: = specific_function %impl.elem2, @T.as_type.as.Iterate.impl.NewCursor(constants.%facet_value.e81) [concrete = constants.%T.as_type.as.Iterate.impl.NewCursor.specific_fn] // CHECK:STDOUT: %bound_method.loc38_19.2: = bound_method %c.ref, %specific_fn.loc38_19.1 // CHECK:STDOUT: %var: ref %tuple.type.005 = var_storage invalid // CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.call: init %tuple.type.005 to %var = call %bound_method.loc38_19.2(%c.ref) @@ -2819,35 +3599,35 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: // CHECK:STDOUT: !for.next: // CHECK:STDOUT: %addr: %ptr.d1a = addr_of %var -// CHECK:STDOUT: %impl.elem3: %.ced = impl_witness_access constants.%Iterate.impl_witness.e1c, element3 [concrete = constants.%T.as_type.as.Iterate.impl.Next.ac9] +// CHECK:STDOUT: %impl.elem3: %.343 = impl_witness_access constants.%Iterate.impl_witness.2d1, element3 [concrete = constants.%T.as_type.as.Iterate.impl.Next.751] // CHECK:STDOUT: %bound_method.loc38_19.3: = bound_method %c.ref, %impl.elem3 -// CHECK:STDOUT: %facet_value.loc38_19.3: %CppRange_where.type.d682d6.1 = facet_value constants.%ConstRange, (constants.%custom_witness.6c4ec3.3, constants.%Copy.impl_witness.0d6, constants.%custom_witness.5d5, constants.%custom_witness.213, constants.%custom_witness.994, constants.%custom_witness.393, constants.%custom_witness.821) [concrete = constants.%facet_value.fd3] -// CHECK:STDOUT: %.loc38_19.3: %CppRange_where.type.d682d6.1 = converted constants.%ConstRange, %facet_value.loc38_19.3 [concrete = constants.%facet_value.fd3] -// CHECK:STDOUT: %facet_value.loc38_19.4: %CppRange_where.type.d682d6.1 = facet_value constants.%ConstRange, (constants.%custom_witness.6c4ec3.3, constants.%Copy.impl_witness.0d6, constants.%custom_witness.5d5, constants.%custom_witness.213, constants.%custom_witness.994, constants.%custom_witness.393, constants.%custom_witness.821) [concrete = constants.%facet_value.fd3] -// CHECK:STDOUT: %.loc38_19.4: %CppRange_where.type.d682d6.1 = converted constants.%ConstRange, %facet_value.loc38_19.4 [concrete = constants.%facet_value.fd3] -// CHECK:STDOUT: %specific_fn.loc38_19.2: = specific_function %impl.elem3, @T.as_type.as.Iterate.impl.Next(constants.%facet_value.fd3) [concrete = constants.%T.as_type.as.Iterate.impl.Next.specific_fn] +// CHECK:STDOUT: %facet_value.loc38_19.3: %CppRange_where.type.d682d6.1 = facet_value constants.%ConstRange, (constants.%custom_witness.f8f19d.3, constants.%Copy.impl_witness.0d6, constants.%custom_witness.5d5, constants.%custom_witness.b76, constants.%custom_witness.994, constants.%custom_witness.393, constants.%custom_witness.821) [concrete = constants.%facet_value.e81] +// CHECK:STDOUT: %.loc38_19.3: %CppRange_where.type.d682d6.1 = converted constants.%ConstRange, %facet_value.loc38_19.3 [concrete = constants.%facet_value.e81] +// CHECK:STDOUT: %facet_value.loc38_19.4: %CppRange_where.type.d682d6.1 = facet_value constants.%ConstRange, (constants.%custom_witness.f8f19d.3, constants.%Copy.impl_witness.0d6, constants.%custom_witness.5d5, constants.%custom_witness.b76, constants.%custom_witness.994, constants.%custom_witness.393, constants.%custom_witness.821) [concrete = constants.%facet_value.e81] +// CHECK:STDOUT: %.loc38_19.4: %CppRange_where.type.d682d6.1 = converted constants.%ConstRange, %facet_value.loc38_19.4 [concrete = constants.%facet_value.e81] +// CHECK:STDOUT: %specific_fn.loc38_19.2: = specific_function %impl.elem3, @T.as_type.as.Iterate.impl.Next(constants.%facet_value.e81) [concrete = constants.%T.as_type.as.Iterate.impl.Next.specific_fn] // CHECK:STDOUT: %bound_method.loc38_19.4: = bound_method %c.ref, %specific_fn.loc38_19.2 -// CHECK:STDOUT: %.loc38_19.5: ref %Optional.72d = temporary_storage -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.call: init %Optional.72d to %.loc38_19.5 = call %bound_method.loc38_19.4(%c.ref, %addr) -// CHECK:STDOUT: %.loc38_19.6: ref %Optional.72d = temporary %.loc38_19.5, %T.as_type.as.Iterate.impl.Next.call -// CHECK:STDOUT: %.loc38_19.7: %Optional.HasValue.type.7a6 = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.1e4) [concrete = constants.%Optional.HasValue.afd] -// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.7a6 = name_ref HasValue, %.loc38_19.7 [concrete = constants.%Optional.HasValue.afd] +// CHECK:STDOUT: %.loc38_19.5: ref %Optional.049 = temporary_storage +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.call: init %Optional.049 to %.loc38_19.5 = call %bound_method.loc38_19.4(%c.ref, %addr) +// CHECK:STDOUT: %.loc38_19.6: ref %Optional.049 = temporary %.loc38_19.5, %T.as_type.as.Iterate.impl.Next.call +// CHECK:STDOUT: %.loc38_19.7: %Optional.HasValue.type.794 = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.405) [concrete = constants.%Optional.HasValue.776] +// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.794 = name_ref HasValue, %.loc38_19.7 [concrete = constants.%Optional.HasValue.776] // CHECK:STDOUT: %Optional.HasValue.bound: = bound_method %.loc38_19.6, %HasValue.ref -// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%OptionalStorage.facet.1e4) [concrete = constants.%Optional.HasValue.specific_fn.cd8] +// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%OptionalStorage.facet.405) [concrete = constants.%Optional.HasValue.specific_fn.9fc] // CHECK:STDOUT: %bound_method.loc38_19.5: = bound_method %.loc38_19.6, %Optional.HasValue.specific_fn -// CHECK:STDOUT: %.loc38_19.8: %Optional.72d = acquire_value %.loc38_19.6 +// CHECK:STDOUT: %.loc38_19.8: %Optional.049 = acquire_value %.loc38_19.6 // CHECK:STDOUT: %Optional.HasValue.call: init bool = call %bound_method.loc38_19.5(%.loc38_19.8) // CHECK:STDOUT: %.loc38_19.9: bool = value_of_initializer %Optional.HasValue.call // CHECK:STDOUT: %.loc38_19.10: bool = converted %Optional.HasValue.call, %.loc38_19.9 // CHECK:STDOUT: if %.loc38_19.10 br !for.body else br !for.done // CHECK:STDOUT: // CHECK:STDOUT: !for.body: -// CHECK:STDOUT: %.loc38_19.11: %Optional.Get.type.65e = specific_constant imports.%Core.import_ref.dab, @Optional(constants.%OptionalStorage.facet.1e4) [concrete = constants.%Optional.Get.ef5] -// CHECK:STDOUT: %Get.ref: %Optional.Get.type.65e = name_ref Get, %.loc38_19.11 [concrete = constants.%Optional.Get.ef5] +// CHECK:STDOUT: %.loc38_19.11: %Optional.Get.type.e6c = specific_constant imports.%Core.import_ref.dab, @Optional(constants.%OptionalStorage.facet.405) [concrete = constants.%Optional.Get.cb6] +// CHECK:STDOUT: %Get.ref: %Optional.Get.type.e6c = name_ref Get, %.loc38_19.11 [concrete = constants.%Optional.Get.cb6] // CHECK:STDOUT: %Optional.Get.bound: = bound_method %.loc38_19.6, %Get.ref -// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%OptionalStorage.facet.1e4) [concrete = constants.%Optional.Get.specific_fn.1e8] +// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%OptionalStorage.facet.405) [concrete = constants.%Optional.Get.specific_fn.e69] // CHECK:STDOUT: %bound_method.loc38_19.6: = bound_method %.loc38_19.6, %Optional.Get.specific_fn -// CHECK:STDOUT: %.loc38_19.12: %Optional.72d = acquire_value %.loc38_19.6 +// CHECK:STDOUT: %.loc38_19.12: %Optional.049 = acquire_value %.loc38_19.6 // CHECK:STDOUT: %Optional.Get.call: init %f64.dc1 = call %bound_method.loc38_19.6(%.loc38_19.12) // CHECK:STDOUT: %.loc38_19.13: %f64.dc1 = value_of_initializer %Optional.Get.call // CHECK:STDOUT: %.loc38_19.14: %f64.dc1 = converted %Optional.Get.call, %.loc38_19.13 @@ -2860,15 +3640,15 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %specific_fn.loc39: = specific_function %impl.elem0.loc39, @Float.as.AddAssignWith.impl.Op(constants.%int_64) [concrete = constants.%Float.as.AddAssignWith.impl.Op.specific_fn] // CHECK:STDOUT: %bound_method.loc39_9.2: = bound_method %sum.ref, %specific_fn.loc39 // CHECK:STDOUT: %Float.as.AddAssignWith.impl.Op.call: init %empty_tuple.type = call %bound_method.loc39_9.2(%sum.ref, %i.ref) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc38_19.1: = bound_method %.loc38_19.6, constants.%Destroy.WithSelf.Op.403171.9 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc38_19.1: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc38_19.1(%.loc38_19.6) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc38_19.1: = bound_method %.loc38_19.6, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.9 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc38_19.1: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc38_19.1(%.loc38_19.6) // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.done: -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc38_19.2: = bound_method %.loc38_19.6, constants.%Destroy.WithSelf.Op.403171.9 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc38_19.2: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc38_19.2(%.loc38_19.6) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc38_19.3: = bound_method %var, constants.%Destroy.WithSelf.Op.403171.10 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc38_19.3: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc38_19.3(%var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc38_19.2: = bound_method %.loc38_19.6, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.9 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc38_19.2: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc38_19.2(%.loc38_19.6) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc38_19.3: = bound_method %var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.11 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc38_19.3: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc38_19.3(%var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2876,14 +3656,14 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %R.patt.loc20_17.2 => constants.%R.patt // CHECK:STDOUT: %R.loc20_17.1 => constants.%R // CHECK:STDOUT: %R.as_type.loc20_61.1 => constants.%R.as_type -// CHECK:STDOUT: %pattern_type => constants.%pattern_type.15f -// CHECK:STDOUT: %r.param_patt.loc20_59.2 => constants.%r.param_patt.f80 -// CHECK:STDOUT: %r.patt.loc20_59.2 => constants.%r.patt.fdd +// CHECK:STDOUT: %pattern_type => constants.%pattern_type.6f7 +// CHECK:STDOUT: %r.param_patt.loc20_59.2 => constants.%r.param_patt.19a +// CHECK:STDOUT: %r.patt.loc20_59.2 => constants.%r.patt.f97 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @TestIterate(constants.%facet_value.d3b) { +// CHECK:STDOUT: specific @TestIterate(constants.%facet_value.58e) { // CHECK:STDOUT: %R.patt.loc20_17.2 => constants.%R.patt -// CHECK:STDOUT: %R.loc20_17.1 => constants.%facet_value.d3b +// CHECK:STDOUT: %R.loc20_17.1 => constants.%facet_value.58e // CHECK:STDOUT: %R.as_type.loc20_61.1 => constants.%ConstRange // CHECK:STDOUT: %pattern_type => constants.%pattern_type.025 // CHECK:STDOUT: %r.param_patt.loc20_59.2 => constants.%r.param_patt.a73 @@ -2891,25 +3671,25 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc20 => constants.%complete_type.357 -// CHECK:STDOUT: %Iterate.lookup_impl_witness => constants.%Iterate.impl_witness.e1c -// CHECK:STDOUT: %Iterate.facet.loc24_19.5 => constants.%Iterate.facet.b4e -// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type => constants.%Iterate.WithSelf.NewCursor.type.408 -// CHECK:STDOUT: %.loc24_19.19 => constants.%.608 -// CHECK:STDOUT: %impl.elem2.loc24_19.2 => constants.%T.as_type.as.Iterate.impl.NewCursor.89a +// CHECK:STDOUT: %Iterate.lookup_impl_witness => constants.%Iterate.impl_witness.2d1 +// CHECK:STDOUT: %Iterate.facet.loc24_19.5 => constants.%Iterate.facet.e86 +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type => constants.%Iterate.WithSelf.NewCursor.type.bcd +// CHECK:STDOUT: %.loc24_19.19 => constants.%.3f0 +// CHECK:STDOUT: %impl.elem2.loc24_19.3 => constants.%T.as_type.as.Iterate.impl.NewCursor.c9a // CHECK:STDOUT: %specific_impl_fn.loc24_19.4 => constants.%T.as_type.as.Iterate.impl.NewCursor.specific_fn -// CHECK:STDOUT: %impl.elem1 => constants.%Destroy.facet.16ee +// CHECK:STDOUT: %impl.elem1 => constants.%Destroy.facet.362 // CHECK:STDOUT: %as_type => constants.%tuple.type.005 // CHECK:STDOUT: %require_complete.1 => constants.%complete_type.320 // CHECK:STDOUT: %ptr => constants.%ptr.d1a -// CHECK:STDOUT: %Iterate.WithSelf.Next.type => constants.%Iterate.WithSelf.Next.type.01a -// CHECK:STDOUT: %.loc24_19.20 => constants.%.ced -// CHECK:STDOUT: %impl.elem3.loc24_19.2 => constants.%T.as_type.as.Iterate.impl.Next.ac9 +// CHECK:STDOUT: %Iterate.WithSelf.Next.type => constants.%Iterate.WithSelf.Next.type.44e +// CHECK:STDOUT: %.loc24_19.20 => constants.%.343 +// CHECK:STDOUT: %impl.elem3.loc24_19.2 => constants.%T.as_type.as.Iterate.impl.Next.751 // CHECK:STDOUT: %specific_impl_fn.loc24_19.5 => constants.%T.as_type.as.Iterate.impl.Next.specific_fn -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.e14 -// CHECK:STDOUT: %.loc24_19.21 => constants.%.3d8 -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.6c4ec3.10 -// CHECK:STDOUT: %impl.elem0.loc24_19.2 => constants.%Destroy.WithSelf.Op.403171.10 -// CHECK:STDOUT: %specific_impl_fn.loc24_19.6 => constants.%Destroy.WithSelf.Op.403171.10 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.873 +// CHECK:STDOUT: %.loc24_19.21 => constants.%.9a7 +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.f8f19d.10 +// CHECK:STDOUT: %impl.elem2.loc24_19.4 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.11 +// CHECK:STDOUT: %specific_impl_fn.loc24_19.6 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.11 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_adl_returns_same_types_mutable.carbon @@ -2918,6 +3698,7 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: type: type = facet_type [concrete] // CHECK:STDOUT: %Iterate.type: type = facet_type <@Iterate> [concrete] // CHECK:STDOUT: %OptionalStorage.type: type = facet_type <@OptionalStorage> [concrete] +// CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %facet_type.f48: type = facet_type <@Destroy & @Copy> [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] @@ -2964,51 +3745,56 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete] // CHECK:STDOUT: %f64.dc1: type = class_type @Float, @Float(%int_64) [concrete] // CHECK:STDOUT: %pattern_type.fb7: type = pattern_type %f64.dc1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc22_53.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc22_53.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.6c4ec3.3: = custom_witness (%Destroy.WithSelf.Op.403171.3), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc22_53.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f8f19d.3: = custom_witness (%Destroy.WithSelf.Op.403171.3, %Destroy.WithSelf.SubobjectDestroy.d01daf.3, %Destroy.WithSelf.SelfDestruct.db3fdb.3), @Destroy [concrete] // CHECK:STDOUT: %Float.as.Copy.impl.Op.type.ff3: type = fn_type @Float.as.Copy.impl.Op, @Float.as.Copy.impl(%N.fe9) [symbolic] // CHECK:STDOUT: %Float.as.Copy.impl.Op.d93: %Float.as.Copy.impl.Op.type.ff3 = struct_value () [symbolic] // CHECK:STDOUT: %Copy.impl_witness.0d6: = impl_witness imports.%Copy.impl_witness_table.8dd, @Float.as.Copy.impl(%int_64) [concrete] -// CHECK:STDOUT: %facet_value.46e: %facet_type.f48 = facet_value %f64.dc1, (%custom_witness.6c4ec3.3, %Copy.impl_witness.0d6) [concrete] +// CHECK:STDOUT: %facet_value.b6e: %facet_type.f48 = facet_value %f64.dc1, (%custom_witness.f8f19d.3, %Copy.impl_witness.0d6) [concrete] // CHECK:STDOUT: %Iterate.lookup_impl_witness.1d8: = lookup_impl_witness %.Self.500, @Iterate [symbolic_self] // CHECK:STDOUT: %impl.elem0.294: %facet_type.f48 = impl_witness_access %Iterate.lookup_impl_witness.1d8, element0 [symbolic_self] -// CHECK:STDOUT: %Iterate_where.type.13a: type = facet_type <@Iterate where %impl.elem0.294 = %facet_value.46e> [concrete] -// CHECK:STDOUT: %pattern_type.a31: type = pattern_type %Iterate_where.type.13a [concrete] -// CHECK:STDOUT: %R.patt: %pattern_type.a31 = symbolic_binding_pattern R, 0 [symbolic] -// CHECK:STDOUT: %R: %Iterate_where.type.13a = symbolic_binding R, 0 [symbolic] +// CHECK:STDOUT: %Iterate_where.type.028: type = facet_type <@Iterate where %impl.elem0.294 = %facet_value.b6e> [concrete] +// CHECK:STDOUT: %pattern_type.522: type = pattern_type %Iterate_where.type.028 [concrete] +// CHECK:STDOUT: %R.patt: %pattern_type.522 = symbolic_binding_pattern R, 0 [symbolic] +// CHECK:STDOUT: %R: %Iterate_where.type.028 = symbolic_binding R, 0 [symbolic] // CHECK:STDOUT: %R.as_type: type = facet_access_type %R [symbolic] -// CHECK:STDOUT: %pattern_type.15f: type = pattern_type %R.as_type [symbolic] -// CHECK:STDOUT: %r.param_patt.f80: %pattern_type.15f = value_param_pattern [symbolic] -// CHECK:STDOUT: %r.patt.fdd: %pattern_type.15f = wrapper_binding_pattern r, %r.param_patt.f80 [symbolic] +// CHECK:STDOUT: %pattern_type.6f7: type = pattern_type %R.as_type [symbolic] +// CHECK:STDOUT: %r.param_patt.19a: %pattern_type.6f7 = value_param_pattern [symbolic] +// CHECK:STDOUT: %r.patt.f97: %pattern_type.6f7 = wrapper_binding_pattern r, %r.param_patt.19a [symbolic] // CHECK:STDOUT: %i.patt: %pattern_type.fb7 = value_binding_pattern i [concrete] -// CHECK:STDOUT: %Iterate.lookup_impl_witness.0cb: = lookup_impl_witness %R, @Iterate [symbolic] -// CHECK:STDOUT: %Iterate.facet.a3a: %Iterate.type = facet_value %R.as_type, (%Iterate.lookup_impl_witness.0cb) [symbolic] -// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.228: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.a3a) [symbolic] -// CHECK:STDOUT: %Iterate.WithSelf.Next.type.431: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.a3a) [symbolic] -// CHECK:STDOUT: %.bf4: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.228, %Iterate.facet.a3a [symbolic] -// CHECK:STDOUT: %impl.elem2.1a5: %.bf4 = impl_witness_access %Iterate.lookup_impl_witness.0cb, element2 [symbolic] -// CHECK:STDOUT: %impl.elem1.abd: %Destroy.type = impl_witness_access %Iterate.lookup_impl_witness.0cb, element1 [symbolic] -// CHECK:STDOUT: %as_type.033: type = facet_access_type %impl.elem1.abd [symbolic] -// CHECK:STDOUT: %specific_impl_fn.40d: = specific_impl_function %impl.elem2.1a5, @Iterate.WithSelf.NewCursor(%Iterate.facet.a3a) [symbolic] -// CHECK:STDOUT: %ptr.e53: type = ptr_type %as_type.033 [symbolic] -// CHECK:STDOUT: %.b72: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.431, %Iterate.facet.a3a [symbolic] -// CHECK:STDOUT: %impl.elem3.eef: %.b72 = impl_witness_access %Iterate.lookup_impl_witness.0cb, element3 [symbolic] -// CHECK:STDOUT: %DefaultOptionalStorage.a3f: type = class_type @DefaultOptionalStorage, @DefaultOptionalStorage(%facet_value.46e) [concrete] -// CHECK:STDOUT: %OptionalStorage.impl_witness.366: = impl_witness imports.%OptionalStorage.impl_witness_table.460, @T.as_type.as.OptionalStorage.impl(%facet_value.46e) [concrete] -// CHECK:STDOUT: %OptionalStorage.facet.1e4: %OptionalStorage.type = facet_value %f64.dc1, (%OptionalStorage.impl_witness.366) [concrete] -// CHECK:STDOUT: %Optional.72d: type = class_type @Optional, @Optional(%OptionalStorage.facet.1e4) [concrete] -// CHECK:STDOUT: %specific_impl_fn.e16: = specific_impl_function %impl.elem3.eef, @Iterate.WithSelf.Next(%Iterate.facet.a3a) [symbolic] -// CHECK:STDOUT: %Optional.HasValue.type.7a6: type = fn_type @Optional.HasValue, @Optional(%OptionalStorage.facet.1e4) [concrete] -// CHECK:STDOUT: %Optional.HasValue.afd: %Optional.HasValue.type.7a6 = struct_value () [concrete] -// CHECK:STDOUT: %Optional.Get.type.65e: type = fn_type @Optional.Get, @Optional(%OptionalStorage.facet.1e4) [concrete] -// CHECK:STDOUT: %Optional.Get.ef5: %Optional.Get.type.65e = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.facet.d8e: %Destroy.type = facet_value %f64.dc1, (%custom_witness.6c4ec3.3) [concrete] -// CHECK:STDOUT: %MaybeUnformed.5b0: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.d8e) [concrete] +// CHECK:STDOUT: %Iterate.lookup_impl_witness.9e0: = lookup_impl_witness %R, @Iterate [symbolic] +// CHECK:STDOUT: %Iterate.facet.f88: %Iterate.type = facet_value %R.as_type, (%Iterate.lookup_impl_witness.9e0) [symbolic] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.3d0: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.f88) [symbolic] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type.160: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.f88) [symbolic] +// CHECK:STDOUT: %.afc: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.3d0, %Iterate.facet.f88 [symbolic] +// CHECK:STDOUT: %impl.elem2.895: %.afc = impl_witness_access %Iterate.lookup_impl_witness.9e0, element2 [symbolic] +// CHECK:STDOUT: %impl.elem1.0cf: %Destroy.type = impl_witness_access %Iterate.lookup_impl_witness.9e0, element1 [symbolic] +// CHECK:STDOUT: %as_type.ce3: type = facet_access_type %impl.elem1.0cf [symbolic] +// CHECK:STDOUT: %specific_impl_fn.999: = specific_impl_function %impl.elem2.895, @Iterate.WithSelf.NewCursor(%Iterate.facet.f88) [symbolic] +// CHECK:STDOUT: %ptr.44a: type = ptr_type %as_type.ce3 [symbolic] +// CHECK:STDOUT: %.b00: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.160, %Iterate.facet.f88 [symbolic] +// CHECK:STDOUT: %impl.elem3.c16: %.b00 = impl_witness_access %Iterate.lookup_impl_witness.9e0, element3 [symbolic] +// CHECK:STDOUT: %DefaultOptionalStorage.3e2: type = class_type @DefaultOptionalStorage, @DefaultOptionalStorage(%facet_value.b6e) [concrete] +// CHECK:STDOUT: %OptionalStorage.impl_witness.4b3: = impl_witness imports.%OptionalStorage.impl_witness_table.460, @T.as_type.as.OptionalStorage.impl(%facet_value.b6e) [concrete] +// CHECK:STDOUT: %OptionalStorage.facet.405: %OptionalStorage.type = facet_value %f64.dc1, (%OptionalStorage.impl_witness.4b3) [concrete] +// CHECK:STDOUT: %Optional.049: type = class_type @Optional, @Optional(%OptionalStorage.facet.405) [concrete] +// CHECK:STDOUT: %pattern_type.449: type = pattern_type %Optional.049 [concrete] +// CHECK:STDOUT: %specific_impl_fn.b6b: = specific_impl_function %impl.elem3.c16, @Iterate.WithSelf.Next(%Iterate.facet.f88) [symbolic] +// CHECK:STDOUT: %Optional.HasValue.type.794: type = fn_type @Optional.HasValue, @Optional(%OptionalStorage.facet.405) [concrete] +// CHECK:STDOUT: %Optional.HasValue.776: %Optional.HasValue.type.794 = struct_value () [concrete] +// CHECK:STDOUT: %Optional.Get.type.e6c: type = fn_type @Optional.Get, @Optional(%OptionalStorage.facet.405) [concrete] +// CHECK:STDOUT: %Optional.Get.cb6: %Optional.Get.type.e6c = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.facet.d87: %Destroy.type = facet_value %f64.dc1, (%custom_witness.f8f19d.3) [concrete] +// CHECK:STDOUT: %MaybeUnformed.8ff: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.d87) [concrete] // CHECK:STDOUT: %.cc0: type = maybe_unformed_type %f64.dc1 [concrete] -// CHECK:STDOUT: %struct_type.value.has_value.a24: type = struct_type {.value: %MaybeUnformed.5b0, .has_value: bool} [concrete] -// CHECK:STDOUT: %Optional.HasValue.specific_fn.cd8: = specific_function %Optional.HasValue.afd, @Optional.HasValue(%OptionalStorage.facet.1e4) [concrete] -// CHECK:STDOUT: %Optional.Get.specific_fn.1e8: = specific_function %Optional.Get.ef5, @Optional.Get(%OptionalStorage.facet.1e4) [concrete] +// CHECK:STDOUT: %struct_type.value.has_value.58e: type = struct_type {.value: %MaybeUnformed.8ff, .has_value: bool} [concrete] +// CHECK:STDOUT: %Optional.HasValue.specific_fn.9fc: = specific_function %Optional.HasValue.776, @Optional.HasValue(%OptionalStorage.facet.405) [concrete] +// CHECK:STDOUT: %Optional.Get.specific_fn.e69: = specific_function %Optional.Get.cb6, @Optional.Get(%OptionalStorage.facet.405) [concrete] // CHECK:STDOUT: %AddAssignWith.type.ff9: type = facet_type <@AddAssignWith, @AddAssignWith(%f64.dc1)> [concrete] // CHECK:STDOUT: %Float.as.AddAssignWith.impl.Op.type.fdd: type = fn_type @Float.as.AddAssignWith.impl.Op, @Float.as.AddAssignWith.impl(%N.fe9) [symbolic] // CHECK:STDOUT: %Float.as.AddAssignWith.impl.Op.430: %Float.as.AddAssignWith.impl.Op.type.fdd = struct_value () [symbolic] @@ -3019,13 +3805,53 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %AddAssignWith.WithSelf.Op.type.d04: type = fn_type @AddAssignWith.WithSelf.Op, @AddAssignWith.WithSelf(%f64.dc1, %AddAssignWith.facet) [concrete] // CHECK:STDOUT: %.918: type = fn_type_with_self_type %AddAssignWith.WithSelf.Op.type.d04, %AddAssignWith.facet [concrete] // CHECK:STDOUT: %Float.as.AddAssignWith.impl.Op.specific_fn: = specific_function %Float.as.AddAssignWith.impl.Op.ac1, @Float.as.AddAssignWith.impl.Op(%int_64) [concrete] +// CHECK:STDOUT: %pattern_type.1fb: type = pattern_type %.cc0 [concrete] +// CHECK:STDOUT: %self.param_patt.4fd: %pattern_type.1fb = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.69f: %pattern_type.1fb = wrapper_binding_pattern self, %self.param_patt.4fd [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc26_19.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc26_19.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.80d: type = pattern_type %MaybeUnformed.8ff [concrete] +// CHECK:STDOUT: %self.param_patt.70c: %pattern_type.80d = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.120: %pattern_type.80d = wrapper_binding_pattern self, %self.param_patt.70c [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc26_19.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.5: type = fn_type @Destroy.WithSelf.Op.loc26_19.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.5: %Destroy.WithSelf.Op.type.ef016f.5 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.40d: %pattern_type.831 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.560: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt.40d [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc26_19.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.6: type = fn_type @Destroy.WithSelf.Op.loc26_19.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.6: %Destroy.WithSelf.Op.type.ef016f.6 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.00a: type = pattern_type %struct_type.value.has_value.58e [concrete] +// CHECK:STDOUT: %self.param_patt.96d: %pattern_type.00a = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.602: %pattern_type.00a = wrapper_binding_pattern self, %self.param_patt.96d [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc26_19.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.7: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.7: type = fn_type @Destroy.WithSelf.Op.loc26_19.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.7: %Destroy.WithSelf.Op.type.ef016f.7 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.406: type = pattern_type %DefaultOptionalStorage.3e2 [concrete] +// CHECK:STDOUT: %self.param_patt.73b: %pattern_type.406 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.bd7: %pattern_type.406 = wrapper_binding_pattern self, %self.param_patt.73b [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.8: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc26_19.5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.8: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.8 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.8: type = fn_type @Destroy.WithSelf.Op.loc26_19.5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.8: %Destroy.WithSelf.Op.type.ef016f.8 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.a67: %pattern_type.449 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.521: %pattern_type.449 = wrapper_binding_pattern self, %self.param_patt.a67 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.9: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc26_19.6 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.9: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.9 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.9: type = fn_type @Destroy.WithSelf.Op.loc26_19.6 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.9: %Destroy.WithSelf.Op.type.ef016f.9 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.lookup_impl_witness.303: = lookup_impl_witness %impl.elem1.abd, @Destroy [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.2e9: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%impl.elem1.abd) [symbolic] -// CHECK:STDOUT: %.fe0: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.2e9, %impl.elem1.abd [symbolic] -// CHECK:STDOUT: %impl.elem0.15f: %.fe0 = impl_witness_access %Destroy.lookup_impl_witness.303, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.2a1: = specific_impl_function %impl.elem0.15f, @Destroy.WithSelf.Op.1(%impl.elem1.abd) [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.9: type = fn_type @Destroy.WithSelf.SelfDestruct.loc26_19.6 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.9: %Destroy.WithSelf.SelfDestruct.type.fbceb5.9 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.lookup_impl_witness.068: = lookup_impl_witness %impl.elem1.0cf, @Destroy [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.b85: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%impl.elem1.0cf) [symbolic] +// CHECK:STDOUT: %.056: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.b85, %impl.elem1.0cf [symbolic] +// CHECK:STDOUT: %impl.elem2.5f8: %.056 = impl_witness_access %Destroy.lookup_impl_witness.068, element2 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.b61: = specific_impl_function %impl.elem2.5f8, @Destroy.WithSelf.SelfDestruct.1(%impl.elem1.0cf) [symbolic] // CHECK:STDOUT: %MutableRange: type = class_type @MutableRange [concrete] // CHECK:STDOUT: %pattern_type.992: type = pattern_type %MutableRange [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] @@ -3039,41 +3865,49 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %Iterator.Op.type.b9731e.1: type = fn_type @Iterator.Op.1 [concrete] // CHECK:STDOUT: %Iterator.Op.ac6aad.1: %Iterator.Op.type.b9731e.1 = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.05b: = custom_witness (%f64.dc1, %Iterator.Op.ac6aad.1), @CppUnsafeDeref [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.10: type = fn_type @Destroy.WithSelf.Op.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.10: %Destroy.WithSelf.Op.type.ef016f.10 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.10: type = fn_type @Destroy.WithSelf.SelfDestruct.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.10: %Destroy.WithSelf.SelfDestruct.type.fbceb5.10 = struct_value () [concrete] +// CHECK:STDOUT: %Iterator.SubobjectDestroy.type: type = fn_type @Iterator.SubobjectDestroy [concrete] +// CHECK:STDOUT: %Iterator.SubobjectDestroy: %Iterator.SubobjectDestroy.type = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.e74: = custom_witness (%Destroy.WithSelf.Op.403171.10, %Iterator.SubobjectDestroy, %Destroy.WithSelf.SelfDestruct.db3fdb.10), @Destroy [concrete] // CHECK:STDOUT: %Iterator.Op.type.b9731e.2: type = fn_type @Iterator.Op.2 [concrete] // CHECK:STDOUT: %Iterator.Op.ac6aad.2: %Iterator.Op.type.b9731e.2 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.c08: = custom_witness (%Iterator.Op.ac6aad.2), @Destroy [concrete] -// CHECK:STDOUT: %Iterator.Op.type.b9731e.3: type = fn_type @Iterator.Op.3 [concrete] -// CHECK:STDOUT: %Iterator.Op.ac6aad.3: %Iterator.Op.type.b9731e.3 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.491: = custom_witness (%Iterator.Op.ac6aad.3), @Inc [concrete] +// CHECK:STDOUT: %custom_witness.491: = custom_witness (%Iterator.Op.ac6aad.2), @Inc [concrete] // CHECK:STDOUT: %Equal.type: type = fn_type @Equal [concrete] // CHECK:STDOUT: %Equal: %Equal.type = struct_value () [concrete] // CHECK:STDOUT: %NotEqual.type: type = fn_type @NotEqual [concrete] // CHECK:STDOUT: %NotEqual: %NotEqual.type = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.ed8: = custom_witness (%Equal, %NotEqual), @EqWith, @EqWith(%Iterator) [concrete] -// CHECK:STDOUT: %facet_value.ca9: %CppRange_where.type.d682d6.1 = facet_value %MutableRange, (%custom_witness.6c4ec3.3, %Copy.impl_witness.0d6, %custom_witness.902, %custom_witness.c08, %custom_witness.05b, %custom_witness.491, %custom_witness.ed8) [concrete] +// CHECK:STDOUT: %facet_value.efd: %CppRange_where.type.d682d6.1 = facet_value %MutableRange, (%custom_witness.f8f19d.3, %Copy.impl_witness.0d6, %custom_witness.902, %custom_witness.e74, %custom_witness.05b, %custom_witness.491, %custom_witness.ed8) [concrete] // CHECK:STDOUT: %tuple.type.dd0: type = tuple_type (%Iterator, %Iterator) [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.10: type = fn_type @Destroy.WithSelf.Op.3 [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.10: %Destroy.WithSelf.Op.type.ef016f.10 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.6c4ec3.10: = custom_witness (%Destroy.WithSelf.Op.403171.10), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.193: %Destroy.type = facet_value %tuple.type.dd0, (%custom_witness.6c4ec3.10) [concrete] -// CHECK:STDOUT: %Iterate.impl_witness.083: = impl_witness imports.%Iterate.impl_witness_table.121, @T.as_type.as.Iterate.impl(%facet_value.ca9) [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.type.c16: type = fn_type @T.as_type.as.Iterate.impl.NewCursor, @T.as_type.as.Iterate.impl(%facet_value.ca9) [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.d12: %T.as_type.as.Iterate.impl.NewCursor.type.c16 = struct_value () [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.type.738: type = fn_type @T.as_type.as.Iterate.impl.Next, @T.as_type.as.Iterate.impl(%facet_value.ca9) [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.e47: %T.as_type.as.Iterate.impl.Next.type.738 = struct_value () [concrete] -// CHECK:STDOUT: %Iterate.facet.1aa: %Iterate.type = facet_value %MutableRange, (%Iterate.impl_witness.083) [concrete] -// CHECK:STDOUT: %facet_value.f44: %Iterate_where.type.13a = facet_value %MutableRange, (%Iterate.impl_witness.083) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.10: type = fn_type @Destroy.WithSelf.SubobjectDestroy.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.10: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.10 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.11: type = fn_type @Destroy.WithSelf.Op.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.11: %Destroy.WithSelf.Op.type.ef016f.11 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.11: type = fn_type @Destroy.WithSelf.SelfDestruct.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.11: %Destroy.WithSelf.SelfDestruct.type.fbceb5.11 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f8f19d.10: = custom_witness (%Destroy.WithSelf.Op.403171.11, %Destroy.WithSelf.SubobjectDestroy.d01daf.10, %Destroy.WithSelf.SelfDestruct.db3fdb.11), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.f0b: %Destroy.type = facet_value %tuple.type.dd0, (%custom_witness.f8f19d.10) [concrete] +// CHECK:STDOUT: %Iterate.impl_witness.6cb: = impl_witness imports.%Iterate.impl_witness_table.121, @T.as_type.as.Iterate.impl(%facet_value.efd) [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.type.eb5: type = fn_type @T.as_type.as.Iterate.impl.NewCursor, @T.as_type.as.Iterate.impl(%facet_value.efd) [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.fcd: %T.as_type.as.Iterate.impl.NewCursor.type.eb5 = struct_value () [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.type.ebe: type = fn_type @T.as_type.as.Iterate.impl.Next, @T.as_type.as.Iterate.impl(%facet_value.efd) [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.c88: %T.as_type.as.Iterate.impl.Next.type.ebe = struct_value () [concrete] +// CHECK:STDOUT: %Iterate.facet.d07: %Iterate.type = facet_value %MutableRange, (%Iterate.impl_witness.6cb) [concrete] +// CHECK:STDOUT: %facet_value.30f: %Iterate_where.type.028 = facet_value %MutableRange, (%Iterate.impl_witness.6cb) [concrete] // CHECK:STDOUT: %r.param_patt.aeb: %pattern_type.992 = value_param_pattern [concrete] // CHECK:STDOUT: %r.patt.892: %pattern_type.992 = wrapper_binding_pattern r, %r.param_patt.aeb [concrete] -// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.ee3: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.1aa) [concrete] -// CHECK:STDOUT: %Iterate.WithSelf.Next.type.ab1: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.1aa) [concrete] -// CHECK:STDOUT: %.d89: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.ee3, %Iterate.facet.1aa [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.specific_fn: = specific_function %T.as_type.as.Iterate.impl.NewCursor.d12, @T.as_type.as.Iterate.impl.NewCursor(%facet_value.ca9) [concrete] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.0ef: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.d07) [concrete] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type.7af: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.d07) [concrete] +// CHECK:STDOUT: %.698: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.0ef, %Iterate.facet.d07 [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.specific_fn: = specific_function %T.as_type.as.Iterate.impl.NewCursor.fcd, @T.as_type.as.Iterate.impl.NewCursor(%facet_value.efd) [concrete] // CHECK:STDOUT: %ptr.a4f: type = ptr_type %tuple.type.dd0 [concrete] -// CHECK:STDOUT: %.6e6: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.ab1, %Iterate.facet.1aa [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.specific_fn: = specific_function %T.as_type.as.Iterate.impl.Next.e47, @T.as_type.as.Iterate.impl.Next(%facet_value.ca9) [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ada: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Destroy.facet.193) [concrete] -// CHECK:STDOUT: %.183: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.ada, %Destroy.facet.193 [concrete] +// CHECK:STDOUT: %.782: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.7af, %Iterate.facet.d07 [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.specific_fn: = specific_function %T.as_type.as.Iterate.impl.Next.c88, @T.as_type.as.Iterate.impl.Next(%facet_value.efd) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.e6e: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.f0b) [concrete] +// CHECK:STDOUT: %.94d: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.e6e, %Destroy.facet.f0b [concrete] // CHECK:STDOUT: %complete_type.843: = complete_type_witness %tuple.type.dd0 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3098,28 +3932,115 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %AddAssignWith.impl_witness_table = impl_witness_table (%Core.import_ref.cb3), @Float.as.AddAssignWith.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @TestIterate(%R.loc22_17.2: %Iterate_where.type.13a) { +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc26_19.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.1fb = ref_param_pattern [concrete = constants.%self.param_patt.4fd] +// CHECK:STDOUT: %self.patt: %pattern_type.1fb = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.69f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %.cc0 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %.cc0 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc26_19.1 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.1fb = ref_param_pattern [concrete = constants.%self.param_patt.4fd] +// CHECK:STDOUT: %self.patt: %pattern_type.1fb = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.69f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %.cc0 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %.cc0 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc26_19.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.80d = ref_param_pattern [concrete = constants.%self.param_patt.70c] +// CHECK:STDOUT: %self.patt: %pattern_type.80d = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.120] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %MaybeUnformed.8ff = ref_param call_param0 +// CHECK:STDOUT: %self: ref %MaybeUnformed.8ff = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.5 = fn_decl @Destroy.WithSelf.Op.loc26_19.2 [concrete = constants.%Destroy.WithSelf.Op.403171.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.80d = ref_param_pattern [concrete = constants.%self.param_patt.70c] +// CHECK:STDOUT: %self.patt: %pattern_type.80d = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.120] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %MaybeUnformed.8ff = ref_param call_param0 +// CHECK:STDOUT: %self: ref %MaybeUnformed.8ff = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc26_19.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d] +// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0 +// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.5: %Destroy.WithSelf.Op.type.ef016f.6 = fn_decl @Destroy.WithSelf.Op.loc26_19.3 [concrete = constants.%Destroy.WithSelf.Op.403171.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d] +// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0 +// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc26_19.4 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.7] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.00a = ref_param_pattern [concrete = constants.%self.param_patt.96d] +// CHECK:STDOUT: %self.patt: %pattern_type.00a = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.602] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.value.has_value.58e = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.value.has_value.58e = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.6: %Destroy.WithSelf.Op.type.ef016f.7 = fn_decl @Destroy.WithSelf.Op.loc26_19.4 [concrete = constants.%Destroy.WithSelf.Op.403171.7] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.00a = ref_param_pattern [concrete = constants.%self.param_patt.96d] +// CHECK:STDOUT: %self.patt: %pattern_type.00a = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.602] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.value.has_value.58e = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.value.has_value.58e = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.7: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.8 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc26_19.5 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.8] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.406 = ref_param_pattern [concrete = constants.%self.param_patt.73b] +// CHECK:STDOUT: %self.patt: %pattern_type.406 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.bd7] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %DefaultOptionalStorage.3e2 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %DefaultOptionalStorage.3e2 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.7: %Destroy.WithSelf.Op.type.ef016f.8 = fn_decl @Destroy.WithSelf.Op.loc26_19.5 [concrete = constants.%Destroy.WithSelf.Op.403171.8] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.406 = ref_param_pattern [concrete = constants.%self.param_patt.73b] +// CHECK:STDOUT: %self.patt: %pattern_type.406 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.bd7] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %DefaultOptionalStorage.3e2 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %DefaultOptionalStorage.3e2 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.8: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.9 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc26_19.6 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.9] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.449 = ref_param_pattern [concrete = constants.%self.param_patt.a67] +// CHECK:STDOUT: %self.patt: %pattern_type.449 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.521] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Optional.049 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Optional.049 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.8: %Destroy.WithSelf.Op.type.ef016f.9 = fn_decl @Destroy.WithSelf.Op.loc26_19.6 [concrete = constants.%Destroy.WithSelf.Op.403171.9] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.449 = ref_param_pattern [concrete = constants.%self.param_patt.a67] +// CHECK:STDOUT: %self.patt: %pattern_type.449 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.521] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Optional.049 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Optional.049 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @TestIterate(%R.loc22_17.2: %Iterate_where.type.028) { // CHECK:STDOUT: // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: %Iterate.lookup_impl_witness: = lookup_impl_witness %R.loc22_17.1, @Iterate [symbolic = %Iterate.lookup_impl_witness (constants.%Iterate.lookup_impl_witness.0cb)] -// CHECK:STDOUT: %Iterate.facet.loc26_19.5: %Iterate.type = facet_value %R.as_type.loc22_61.1, (%Iterate.lookup_impl_witness) [symbolic = %Iterate.facet.loc26_19.5 (constants.%Iterate.facet.a3a)] -// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.loc26_19.5) [symbolic = %Iterate.WithSelf.NewCursor.type (constants.%Iterate.WithSelf.NewCursor.type.228)] -// CHECK:STDOUT: %.loc26_19.19: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type, %Iterate.facet.loc26_19.5 [symbolic = %.loc26_19.19 (constants.%.bf4)] -// CHECK:STDOUT: %impl.elem2.loc26_19.2: @TestIterate.%.loc26_19.19 (%.bf4) = impl_witness_access %Iterate.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc26_19.2 (constants.%impl.elem2.1a5)] -// CHECK:STDOUT: %specific_impl_fn.loc26_19.4: = specific_impl_function %impl.elem2.loc26_19.2, @Iterate.WithSelf.NewCursor(%Iterate.facet.loc26_19.5) [symbolic = %specific_impl_fn.loc26_19.4 (constants.%specific_impl_fn.40d)] +// CHECK:STDOUT: %Iterate.lookup_impl_witness: = lookup_impl_witness %R.loc22_17.1, @Iterate [symbolic = %Iterate.lookup_impl_witness (constants.%Iterate.lookup_impl_witness.9e0)] +// CHECK:STDOUT: %Iterate.facet.loc26_19.5: %Iterate.type = facet_value %R.as_type.loc22_61.1, (%Iterate.lookup_impl_witness) [symbolic = %Iterate.facet.loc26_19.5 (constants.%Iterate.facet.f88)] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.loc26_19.5) [symbolic = %Iterate.WithSelf.NewCursor.type (constants.%Iterate.WithSelf.NewCursor.type.3d0)] +// CHECK:STDOUT: %.loc26_19.19: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type, %Iterate.facet.loc26_19.5 [symbolic = %.loc26_19.19 (constants.%.afc)] +// CHECK:STDOUT: %impl.elem2.loc26_19.3: @TestIterate.%.loc26_19.19 (%.afc) = impl_witness_access %Iterate.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc26_19.3 (constants.%impl.elem2.895)] +// CHECK:STDOUT: %specific_impl_fn.loc26_19.4: = specific_impl_function %impl.elem2.loc26_19.3, @Iterate.WithSelf.NewCursor(%Iterate.facet.loc26_19.5) [symbolic = %specific_impl_fn.loc26_19.4 (constants.%specific_impl_fn.999)] // CHECK:STDOUT: -// CHECK:STDOUT: %ptr: type = ptr_type %as_type [symbolic = %ptr (constants.%ptr.e53)] -// CHECK:STDOUT: %Iterate.WithSelf.Next.type: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.loc26_19.5) [symbolic = %Iterate.WithSelf.Next.type (constants.%Iterate.WithSelf.Next.type.431)] -// CHECK:STDOUT: %.loc26_19.20: type = fn_type_with_self_type %Iterate.WithSelf.Next.type, %Iterate.facet.loc26_19.5 [symbolic = %.loc26_19.20 (constants.%.b72)] -// CHECK:STDOUT: %impl.elem3.loc26_19.2: @TestIterate.%.loc26_19.20 (%.b72) = impl_witness_access %Iterate.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc26_19.2 (constants.%impl.elem3.eef)] -// CHECK:STDOUT: %specific_impl_fn.loc26_19.5: = specific_impl_function %impl.elem3.loc26_19.2, @Iterate.WithSelf.Next(%Iterate.facet.loc26_19.5) [symbolic = %specific_impl_fn.loc26_19.5 (constants.%specific_impl_fn.e16)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%impl.elem1) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.2e9)] -// CHECK:STDOUT: %.loc26_19.21: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %impl.elem1 [symbolic = %.loc26_19.21 (constants.%.fe0)] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %impl.elem1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.303)] -// CHECK:STDOUT: %impl.elem0.loc26_19.2: @TestIterate.%.loc26_19.21 (%.fe0) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc26_19.2 (constants.%impl.elem0.15f)] -// CHECK:STDOUT: %specific_impl_fn.loc26_19.6: = specific_impl_function %impl.elem0.loc26_19.2, @Destroy.WithSelf.Op.1(%impl.elem1) [symbolic = %specific_impl_fn.loc26_19.6 (constants.%specific_impl_fn.2a1)] +// CHECK:STDOUT: %ptr: type = ptr_type %as_type [symbolic = %ptr (constants.%ptr.44a)] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.loc26_19.5) [symbolic = %Iterate.WithSelf.Next.type (constants.%Iterate.WithSelf.Next.type.160)] +// CHECK:STDOUT: %.loc26_19.20: type = fn_type_with_self_type %Iterate.WithSelf.Next.type, %Iterate.facet.loc26_19.5 [symbolic = %.loc26_19.20 (constants.%.b00)] +// CHECK:STDOUT: %impl.elem3.loc26_19.2: @TestIterate.%.loc26_19.20 (%.b00) = impl_witness_access %Iterate.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc26_19.2 (constants.%impl.elem3.c16)] +// CHECK:STDOUT: %specific_impl_fn.loc26_19.5: = specific_impl_function %impl.elem3.loc26_19.2, @Iterate.WithSelf.Next(%Iterate.facet.loc26_19.5) [symbolic = %specific_impl_fn.loc26_19.5 (constants.%specific_impl_fn.b6b)] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%impl.elem1) [symbolic = %Destroy.WithSelf.SelfDestruct.type (constants.%Destroy.WithSelf.SelfDestruct.type.b85)] +// CHECK:STDOUT: %.loc26_19.21: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type, %impl.elem1 [symbolic = %.loc26_19.21 (constants.%.056)] +// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %impl.elem1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.068)] +// CHECK:STDOUT: %impl.elem2.loc26_19.4: @TestIterate.%.loc26_19.21 (%.056) = impl_witness_access %Destroy.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc26_19.4 (constants.%impl.elem2.5f8)] +// CHECK:STDOUT: %specific_impl_fn.loc26_19.6: = specific_impl_function %impl.elem2.loc26_19.4, @Destroy.WithSelf.SelfDestruct.1(%impl.elem1) [symbolic = %specific_impl_fn.loc26_19.6 (constants.%specific_impl_fn.b61)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%r.param: @TestIterate.%R.as_type.loc22_61.1 (%R.as_type)) { // CHECK:STDOUT: !entry: @@ -3128,52 +4049,52 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %i.patt: %pattern_type.fb7 = value_binding_pattern i [concrete = constants.%i.patt] // CHECK:STDOUT: } // CHECK:STDOUT: %r.ref: @TestIterate.%R.as_type.loc22_61.1 (%R.as_type) = name_ref r, %r -// CHECK:STDOUT: %impl.elem2.loc26_19.1: @TestIterate.%.loc26_19.19 (%.bf4) = impl_witness_access constants.%Iterate.lookup_impl_witness.0cb, element2 [symbolic = %impl.elem2.loc26_19.2 (constants.%impl.elem2.1a5)] +// CHECK:STDOUT: %impl.elem2.loc26_19.1: @TestIterate.%.loc26_19.19 (%.afc) = impl_witness_access constants.%Iterate.lookup_impl_witness.9e0, element2 [symbolic = %impl.elem2.loc26_19.3 (constants.%impl.elem2.895)] // CHECK:STDOUT: %bound_method.loc26_19.1: = bound_method %r.ref, %impl.elem2.loc26_19.1 -// CHECK:STDOUT: %Iterate.facet.loc26_19.1: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.0cb) [symbolic = %Iterate.facet.loc26_19.5 (constants.%Iterate.facet.a3a)] -// CHECK:STDOUT: %.loc26_19.1: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc26_19.1 [symbolic = %Iterate.facet.loc26_19.5 (constants.%Iterate.facet.a3a)] -// CHECK:STDOUT: %Iterate.facet.loc26_19.2: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.0cb) [symbolic = %Iterate.facet.loc26_19.5 (constants.%Iterate.facet.a3a)] -// CHECK:STDOUT: %.loc26_19.2: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc26_19.2 [symbolic = %Iterate.facet.loc26_19.5 (constants.%Iterate.facet.a3a)] -// CHECK:STDOUT: %specific_impl_fn.loc26_19.1: = specific_impl_function %impl.elem2.loc26_19.1, @Iterate.WithSelf.NewCursor(constants.%Iterate.facet.a3a) [symbolic = %specific_impl_fn.loc26_19.4 (constants.%specific_impl_fn.40d)] +// CHECK:STDOUT: %Iterate.facet.loc26_19.1: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.9e0) [symbolic = %Iterate.facet.loc26_19.5 (constants.%Iterate.facet.f88)] +// CHECK:STDOUT: %.loc26_19.1: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc26_19.1 [symbolic = %Iterate.facet.loc26_19.5 (constants.%Iterate.facet.f88)] +// CHECK:STDOUT: %Iterate.facet.loc26_19.2: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.9e0) [symbolic = %Iterate.facet.loc26_19.5 (constants.%Iterate.facet.f88)] +// CHECK:STDOUT: %.loc26_19.2: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc26_19.2 [symbolic = %Iterate.facet.loc26_19.5 (constants.%Iterate.facet.f88)] +// CHECK:STDOUT: %specific_impl_fn.loc26_19.1: = specific_impl_function %impl.elem2.loc26_19.1, @Iterate.WithSelf.NewCursor(constants.%Iterate.facet.f88) [symbolic = %specific_impl_fn.loc26_19.4 (constants.%specific_impl_fn.999)] // CHECK:STDOUT: %bound_method.loc26_19.2: = bound_method %r.ref, %specific_impl_fn.loc26_19.1 -// CHECK:STDOUT: %var: ref @TestIterate.%as_type (%as_type.033) = var_storage invalid -// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.call: init @TestIterate.%as_type (%as_type.033) to %var = call %bound_method.loc26_19.2(%r.ref) +// CHECK:STDOUT: %var: ref @TestIterate.%as_type (%as_type.ce3) = var_storage invalid +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.call: init @TestIterate.%as_type (%as_type.ce3) to %var = call %bound_method.loc26_19.2(%r.ref) // CHECK:STDOUT: assign %var, %Iterate.WithSelf.NewCursor.call // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.next: -// CHECK:STDOUT: %addr: @TestIterate.%ptr (%ptr.e53) = addr_of %var -// CHECK:STDOUT: %impl.elem3.loc26_19.1: @TestIterate.%.loc26_19.20 (%.b72) = impl_witness_access constants.%Iterate.lookup_impl_witness.0cb, element3 [symbolic = %impl.elem3.loc26_19.2 (constants.%impl.elem3.eef)] +// CHECK:STDOUT: %addr: @TestIterate.%ptr (%ptr.44a) = addr_of %var +// CHECK:STDOUT: %impl.elem3.loc26_19.1: @TestIterate.%.loc26_19.20 (%.b00) = impl_witness_access constants.%Iterate.lookup_impl_witness.9e0, element3 [symbolic = %impl.elem3.loc26_19.2 (constants.%impl.elem3.c16)] // CHECK:STDOUT: %bound_method.loc26_19.3: = bound_method %r.ref, %impl.elem3.loc26_19.1 -// CHECK:STDOUT: %Iterate.facet.loc26_19.3: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.0cb) [symbolic = %Iterate.facet.loc26_19.5 (constants.%Iterate.facet.a3a)] -// CHECK:STDOUT: %.loc26_19.3: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc26_19.3 [symbolic = %Iterate.facet.loc26_19.5 (constants.%Iterate.facet.a3a)] -// CHECK:STDOUT: %Iterate.facet.loc26_19.4: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.0cb) [symbolic = %Iterate.facet.loc26_19.5 (constants.%Iterate.facet.a3a)] -// CHECK:STDOUT: %.loc26_19.4: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc26_19.4 [symbolic = %Iterate.facet.loc26_19.5 (constants.%Iterate.facet.a3a)] -// CHECK:STDOUT: %.loc26_19.5: %Destroy.type = converted constants.%as_type.033, constants.%impl.elem1.abd [symbolic = %impl.elem1 (constants.%impl.elem1.abd)] -// CHECK:STDOUT: %.loc26_19.6: %Destroy.type = converted constants.%as_type.033, constants.%impl.elem1.abd [symbolic = %impl.elem1 (constants.%impl.elem1.abd)] -// CHECK:STDOUT: %specific_impl_fn.loc26_19.2: = specific_impl_function %impl.elem3.loc26_19.1, @Iterate.WithSelf.Next(constants.%Iterate.facet.a3a) [symbolic = %specific_impl_fn.loc26_19.5 (constants.%specific_impl_fn.e16)] +// CHECK:STDOUT: %Iterate.facet.loc26_19.3: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.9e0) [symbolic = %Iterate.facet.loc26_19.5 (constants.%Iterate.facet.f88)] +// CHECK:STDOUT: %.loc26_19.3: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc26_19.3 [symbolic = %Iterate.facet.loc26_19.5 (constants.%Iterate.facet.f88)] +// CHECK:STDOUT: %Iterate.facet.loc26_19.4: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.9e0) [symbolic = %Iterate.facet.loc26_19.5 (constants.%Iterate.facet.f88)] +// CHECK:STDOUT: %.loc26_19.4: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc26_19.4 [symbolic = %Iterate.facet.loc26_19.5 (constants.%Iterate.facet.f88)] +// CHECK:STDOUT: %.loc26_19.5: %Destroy.type = converted constants.%as_type.ce3, constants.%impl.elem1.0cf [symbolic = %impl.elem1 (constants.%impl.elem1.0cf)] +// CHECK:STDOUT: %.loc26_19.6: %Destroy.type = converted constants.%as_type.ce3, constants.%impl.elem1.0cf [symbolic = %impl.elem1 (constants.%impl.elem1.0cf)] +// CHECK:STDOUT: %specific_impl_fn.loc26_19.2: = specific_impl_function %impl.elem3.loc26_19.1, @Iterate.WithSelf.Next(constants.%Iterate.facet.f88) [symbolic = %specific_impl_fn.loc26_19.5 (constants.%specific_impl_fn.b6b)] // CHECK:STDOUT: %bound_method.loc26_19.4: = bound_method %r.ref, %specific_impl_fn.loc26_19.2 -// CHECK:STDOUT: %.loc26_19.7: ref %Optional.72d = temporary_storage -// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.72d to %.loc26_19.7 = call %bound_method.loc26_19.4(%r.ref, %addr) -// CHECK:STDOUT: %.loc26_19.8: ref %Optional.72d = temporary %.loc26_19.7, %Iterate.WithSelf.Next.call -// CHECK:STDOUT: %.loc26_19.9: %Optional.HasValue.type.7a6 = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.1e4) [concrete = constants.%Optional.HasValue.afd] -// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.7a6 = name_ref HasValue, %.loc26_19.9 [concrete = constants.%Optional.HasValue.afd] +// CHECK:STDOUT: %.loc26_19.7: ref %Optional.049 = temporary_storage +// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.049 to %.loc26_19.7 = call %bound_method.loc26_19.4(%r.ref, %addr) +// CHECK:STDOUT: %.loc26_19.8: ref %Optional.049 = temporary %.loc26_19.7, %Iterate.WithSelf.Next.call +// CHECK:STDOUT: %.loc26_19.9: %Optional.HasValue.type.794 = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.405) [concrete = constants.%Optional.HasValue.776] +// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.794 = name_ref HasValue, %.loc26_19.9 [concrete = constants.%Optional.HasValue.776] // CHECK:STDOUT: %Optional.HasValue.bound: = bound_method %.loc26_19.8, %HasValue.ref -// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%OptionalStorage.facet.1e4) [concrete = constants.%Optional.HasValue.specific_fn.cd8] +// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%OptionalStorage.facet.405) [concrete = constants.%Optional.HasValue.specific_fn.9fc] // CHECK:STDOUT: %bound_method.loc26_19.5: = bound_method %.loc26_19.8, %Optional.HasValue.specific_fn -// CHECK:STDOUT: %.loc26_19.10: %Optional.72d = acquire_value %.loc26_19.8 +// CHECK:STDOUT: %.loc26_19.10: %Optional.049 = acquire_value %.loc26_19.8 // CHECK:STDOUT: %Optional.HasValue.call: init bool = call %bound_method.loc26_19.5(%.loc26_19.10) // CHECK:STDOUT: %.loc26_19.11: bool = value_of_initializer %Optional.HasValue.call // CHECK:STDOUT: %.loc26_19.12: bool = converted %Optional.HasValue.call, %.loc26_19.11 // CHECK:STDOUT: if %.loc26_19.12 br !for.body else br !for.done // CHECK:STDOUT: // CHECK:STDOUT: !for.body: -// CHECK:STDOUT: %.loc26_19.13: %Optional.Get.type.65e = specific_constant imports.%Core.import_ref.dab, @Optional(constants.%OptionalStorage.facet.1e4) [concrete = constants.%Optional.Get.ef5] -// CHECK:STDOUT: %Get.ref: %Optional.Get.type.65e = name_ref Get, %.loc26_19.13 [concrete = constants.%Optional.Get.ef5] +// CHECK:STDOUT: %.loc26_19.13: %Optional.Get.type.e6c = specific_constant imports.%Core.import_ref.dab, @Optional(constants.%OptionalStorage.facet.405) [concrete = constants.%Optional.Get.cb6] +// CHECK:STDOUT: %Get.ref: %Optional.Get.type.e6c = name_ref Get, %.loc26_19.13 [concrete = constants.%Optional.Get.cb6] // CHECK:STDOUT: %Optional.Get.bound: = bound_method %.loc26_19.8, %Get.ref -// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%OptionalStorage.facet.1e4) [concrete = constants.%Optional.Get.specific_fn.1e8] +// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%OptionalStorage.facet.405) [concrete = constants.%Optional.Get.specific_fn.e69] // CHECK:STDOUT: %bound_method.loc26_19.6: = bound_method %.loc26_19.8, %Optional.Get.specific_fn -// CHECK:STDOUT: %.loc26_19.14: %Optional.72d = acquire_value %.loc26_19.8 +// CHECK:STDOUT: %.loc26_19.14: %Optional.049 = acquire_value %.loc26_19.8 // CHECK:STDOUT: %Optional.Get.call: init %f64.dc1 = call %bound_method.loc26_19.6(%.loc26_19.14) // CHECK:STDOUT: %.loc26_19.15: %f64.dc1 = value_of_initializer %Optional.Get.call // CHECK:STDOUT: %.loc26_19.16: %f64.dc1 = converted %Optional.Get.call, %.loc26_19.15 @@ -3186,48 +4107,102 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %specific_fn.loc27: = specific_function %impl.elem0.loc27, @Float.as.AddAssignWith.impl.Op(constants.%int_64) [concrete = constants.%Float.as.AddAssignWith.impl.Op.specific_fn] // CHECK:STDOUT: %bound_method.loc27_9.2: = bound_method %sum.ref, %specific_fn.loc27 // CHECK:STDOUT: %Float.as.AddAssignWith.impl.Op.call: init %empty_tuple.type = call %bound_method.loc27_9.2(%sum.ref, %i.ref) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc26_19.1: = bound_method %.loc26_19.8, constants.%Destroy.WithSelf.Op.403171.9 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc26_19.1: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc26_19.1(%.loc26_19.8) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc26_19.1: = bound_method %.loc26_19.8, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.9 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc26_19.1: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc26_19.1(%.loc26_19.8) // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.done: -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc26_19.2: = bound_method %.loc26_19.8, constants.%Destroy.WithSelf.Op.403171.9 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc26_19.2: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc26_19.2(%.loc26_19.8) -// CHECK:STDOUT: %impl.elem0.loc26_19.1: @TestIterate.%.loc26_19.21 (%.fe0) = impl_witness_access constants.%Destroy.lookup_impl_witness.303, element0 [symbolic = %impl.elem0.loc26_19.2 (constants.%impl.elem0.15f)] -// CHECK:STDOUT: %bound_method.loc26_19.7: = bound_method %var, %impl.elem0.loc26_19.1 -// CHECK:STDOUT: %.loc26_19.17: %Destroy.type = converted constants.%as_type.033, constants.%impl.elem1.abd [symbolic = %impl.elem1 (constants.%impl.elem1.abd)] -// CHECK:STDOUT: %.loc26_19.18: %Destroy.type = converted constants.%as_type.033, constants.%impl.elem1.abd [symbolic = %impl.elem1 (constants.%impl.elem1.abd)] -// CHECK:STDOUT: %specific_impl_fn.loc26_19.3: = specific_impl_function %impl.elem0.loc26_19.1, @Destroy.WithSelf.Op.1(constants.%impl.elem1.abd) [symbolic = %specific_impl_fn.loc26_19.6 (constants.%specific_impl_fn.2a1)] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc26_19.2: = bound_method %.loc26_19.8, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.9 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc26_19.2: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc26_19.2(%.loc26_19.8) +// CHECK:STDOUT: %impl.elem2.loc26_19.2: @TestIterate.%.loc26_19.21 (%.056) = impl_witness_access constants.%Destroy.lookup_impl_witness.068, element2 [symbolic = %impl.elem2.loc26_19.4 (constants.%impl.elem2.5f8)] +// CHECK:STDOUT: %bound_method.loc26_19.7: = bound_method %var, %impl.elem2.loc26_19.2 +// CHECK:STDOUT: %.loc26_19.17: %Destroy.type = converted constants.%as_type.ce3, constants.%impl.elem1.0cf [symbolic = %impl.elem1 (constants.%impl.elem1.0cf)] +// CHECK:STDOUT: %.loc26_19.18: %Destroy.type = converted constants.%as_type.ce3, constants.%impl.elem1.0cf [symbolic = %impl.elem1 (constants.%impl.elem1.0cf)] +// CHECK:STDOUT: %specific_impl_fn.loc26_19.3: = specific_impl_function %impl.elem2.loc26_19.2, @Destroy.WithSelf.SelfDestruct.1(constants.%impl.elem1.0cf) [symbolic = %specific_impl_fn.loc26_19.6 (constants.%specific_impl_fn.b61)] // CHECK:STDOUT: %bound_method.loc26_19.8: = bound_method %var, %specific_impl_fn.loc26_19.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc26_19.3: init %empty_tuple.type = call %bound_method.loc26_19.8(%var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc26_19.3: init %empty_tuple.type = call %bound_method.loc26_19.8(%var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc26_19.1(%self.param: ref %.cc0) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc26_19.1(%self.param: ref %.cc0) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc26_19.2(%self.param: ref %MaybeUnformed.5b0) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc26_19.1(%self.param: ref %.cc0) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc26_19.1(%self.param: ref %.cc0) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc26_19.2(%self.param: ref %MaybeUnformed.8ff) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc26_19.2(%self.param: ref %MaybeUnformed.8ff) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc26_19.2(%self.param: ref %MaybeUnformed.8ff) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc26_19.3(%self.param: ref bool) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc26_19.3(%self.param: ref bool) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc26_19.4(%self.param: ref %struct_type.value.has_value.a24) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc26_19.3(%self.param: ref bool) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.5(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.5(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc26_19.4(%self.param: ref %struct_type.value.has_value.58e) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc26_19.5(%self.param: ref %DefaultOptionalStorage.a3f) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc26_19.4(%self.param: ref %struct_type.value.has_value.58e) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc26_19.4(%self.param: ref %struct_type.value.has_value.58e) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.6(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.6(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc26_19.5(%self.param: ref %DefaultOptionalStorage.3e2) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc26_19.6(%self.param: ref %Optional.72d) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc26_19.5(%self.param: ref %DefaultOptionalStorage.3e2) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc26_19.5(%self.param: ref %DefaultOptionalStorage.3e2) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.7(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.7(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc26_19.6(%self.param: ref %Optional.049) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc26_19.6(%self.param: ref %Optional.049) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc26_19.6(%self.param: ref %Optional.049) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.8(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.8(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3238,13 +4213,13 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %i.patt: %pattern_type.fb7 = value_binding_pattern i [concrete = constants.%i.patt] // CHECK:STDOUT: } // CHECK:STDOUT: %m.ref: ref %MutableRange = name_ref m, %m -// CHECK:STDOUT: %impl.elem2: %.d89 = impl_witness_access constants.%Iterate.impl_witness.083, element2 [concrete = constants.%T.as_type.as.Iterate.impl.NewCursor.d12] +// CHECK:STDOUT: %impl.elem2: %.698 = impl_witness_access constants.%Iterate.impl_witness.6cb, element2 [concrete = constants.%T.as_type.as.Iterate.impl.NewCursor.fcd] // CHECK:STDOUT: %bound_method.loc68_19.1: = bound_method %m.ref, %impl.elem2 -// CHECK:STDOUT: %facet_value.loc68_19.1: %CppRange_where.type.d682d6.1 = facet_value constants.%MutableRange, (constants.%custom_witness.6c4ec3.3, constants.%Copy.impl_witness.0d6, constants.%custom_witness.902, constants.%custom_witness.c08, constants.%custom_witness.05b, constants.%custom_witness.491, constants.%custom_witness.ed8) [concrete = constants.%facet_value.ca9] -// CHECK:STDOUT: %.loc68_19.1: %CppRange_where.type.d682d6.1 = converted constants.%MutableRange, %facet_value.loc68_19.1 [concrete = constants.%facet_value.ca9] -// CHECK:STDOUT: %facet_value.loc68_19.2: %CppRange_where.type.d682d6.1 = facet_value constants.%MutableRange, (constants.%custom_witness.6c4ec3.3, constants.%Copy.impl_witness.0d6, constants.%custom_witness.902, constants.%custom_witness.c08, constants.%custom_witness.05b, constants.%custom_witness.491, constants.%custom_witness.ed8) [concrete = constants.%facet_value.ca9] -// CHECK:STDOUT: %.loc68_19.2: %CppRange_where.type.d682d6.1 = converted constants.%MutableRange, %facet_value.loc68_19.2 [concrete = constants.%facet_value.ca9] -// CHECK:STDOUT: %specific_fn.loc68_19.1: = specific_function %impl.elem2, @T.as_type.as.Iterate.impl.NewCursor(constants.%facet_value.ca9) [concrete = constants.%T.as_type.as.Iterate.impl.NewCursor.specific_fn] +// CHECK:STDOUT: %facet_value.loc68_19.1: %CppRange_where.type.d682d6.1 = facet_value constants.%MutableRange, (constants.%custom_witness.f8f19d.3, constants.%Copy.impl_witness.0d6, constants.%custom_witness.902, constants.%custom_witness.e74, constants.%custom_witness.05b, constants.%custom_witness.491, constants.%custom_witness.ed8) [concrete = constants.%facet_value.efd] +// CHECK:STDOUT: %.loc68_19.1: %CppRange_where.type.d682d6.1 = converted constants.%MutableRange, %facet_value.loc68_19.1 [concrete = constants.%facet_value.efd] +// CHECK:STDOUT: %facet_value.loc68_19.2: %CppRange_where.type.d682d6.1 = facet_value constants.%MutableRange, (constants.%custom_witness.f8f19d.3, constants.%Copy.impl_witness.0d6, constants.%custom_witness.902, constants.%custom_witness.e74, constants.%custom_witness.05b, constants.%custom_witness.491, constants.%custom_witness.ed8) [concrete = constants.%facet_value.efd] +// CHECK:STDOUT: %.loc68_19.2: %CppRange_where.type.d682d6.1 = converted constants.%MutableRange, %facet_value.loc68_19.2 [concrete = constants.%facet_value.efd] +// CHECK:STDOUT: %specific_fn.loc68_19.1: = specific_function %impl.elem2, @T.as_type.as.Iterate.impl.NewCursor(constants.%facet_value.efd) [concrete = constants.%T.as_type.as.Iterate.impl.NewCursor.specific_fn] // CHECK:STDOUT: %bound_method.loc68_19.2: = bound_method %m.ref, %specific_fn.loc68_19.1 // CHECK:STDOUT: %var: ref %tuple.type.dd0 = var_storage invalid // CHECK:STDOUT: %.loc68_18.1: %MutableRange = acquire_value %m.ref @@ -3254,36 +4229,36 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: // CHECK:STDOUT: !for.next: // CHECK:STDOUT: %addr: %ptr.a4f = addr_of %var -// CHECK:STDOUT: %impl.elem3: %.6e6 = impl_witness_access constants.%Iterate.impl_witness.083, element3 [concrete = constants.%T.as_type.as.Iterate.impl.Next.e47] +// CHECK:STDOUT: %impl.elem3: %.782 = impl_witness_access constants.%Iterate.impl_witness.6cb, element3 [concrete = constants.%T.as_type.as.Iterate.impl.Next.c88] // CHECK:STDOUT: %bound_method.loc68_19.3: = bound_method %m.ref, %impl.elem3 -// CHECK:STDOUT: %facet_value.loc68_19.3: %CppRange_where.type.d682d6.1 = facet_value constants.%MutableRange, (constants.%custom_witness.6c4ec3.3, constants.%Copy.impl_witness.0d6, constants.%custom_witness.902, constants.%custom_witness.c08, constants.%custom_witness.05b, constants.%custom_witness.491, constants.%custom_witness.ed8) [concrete = constants.%facet_value.ca9] -// CHECK:STDOUT: %.loc68_19.3: %CppRange_where.type.d682d6.1 = converted constants.%MutableRange, %facet_value.loc68_19.3 [concrete = constants.%facet_value.ca9] -// CHECK:STDOUT: %facet_value.loc68_19.4: %CppRange_where.type.d682d6.1 = facet_value constants.%MutableRange, (constants.%custom_witness.6c4ec3.3, constants.%Copy.impl_witness.0d6, constants.%custom_witness.902, constants.%custom_witness.c08, constants.%custom_witness.05b, constants.%custom_witness.491, constants.%custom_witness.ed8) [concrete = constants.%facet_value.ca9] -// CHECK:STDOUT: %.loc68_19.4: %CppRange_where.type.d682d6.1 = converted constants.%MutableRange, %facet_value.loc68_19.4 [concrete = constants.%facet_value.ca9] -// CHECK:STDOUT: %specific_fn.loc68_19.2: = specific_function %impl.elem3, @T.as_type.as.Iterate.impl.Next(constants.%facet_value.ca9) [concrete = constants.%T.as_type.as.Iterate.impl.Next.specific_fn] +// CHECK:STDOUT: %facet_value.loc68_19.3: %CppRange_where.type.d682d6.1 = facet_value constants.%MutableRange, (constants.%custom_witness.f8f19d.3, constants.%Copy.impl_witness.0d6, constants.%custom_witness.902, constants.%custom_witness.e74, constants.%custom_witness.05b, constants.%custom_witness.491, constants.%custom_witness.ed8) [concrete = constants.%facet_value.efd] +// CHECK:STDOUT: %.loc68_19.3: %CppRange_where.type.d682d6.1 = converted constants.%MutableRange, %facet_value.loc68_19.3 [concrete = constants.%facet_value.efd] +// CHECK:STDOUT: %facet_value.loc68_19.4: %CppRange_where.type.d682d6.1 = facet_value constants.%MutableRange, (constants.%custom_witness.f8f19d.3, constants.%Copy.impl_witness.0d6, constants.%custom_witness.902, constants.%custom_witness.e74, constants.%custom_witness.05b, constants.%custom_witness.491, constants.%custom_witness.ed8) [concrete = constants.%facet_value.efd] +// CHECK:STDOUT: %.loc68_19.4: %CppRange_where.type.d682d6.1 = converted constants.%MutableRange, %facet_value.loc68_19.4 [concrete = constants.%facet_value.efd] +// CHECK:STDOUT: %specific_fn.loc68_19.2: = specific_function %impl.elem3, @T.as_type.as.Iterate.impl.Next(constants.%facet_value.efd) [concrete = constants.%T.as_type.as.Iterate.impl.Next.specific_fn] // CHECK:STDOUT: %bound_method.loc68_19.4: = bound_method %m.ref, %specific_fn.loc68_19.2 -// CHECK:STDOUT: %.loc68_19.5: ref %Optional.72d = temporary_storage +// CHECK:STDOUT: %.loc68_19.5: ref %Optional.049 = temporary_storage // CHECK:STDOUT: %.loc68_18.2: %MutableRange = acquire_value %m.ref -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.call: init %Optional.72d to %.loc68_19.5 = call %bound_method.loc68_19.4(%.loc68_18.2, %addr) -// CHECK:STDOUT: %.loc68_19.6: ref %Optional.72d = temporary %.loc68_19.5, %T.as_type.as.Iterate.impl.Next.call -// CHECK:STDOUT: %.loc68_19.7: %Optional.HasValue.type.7a6 = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.1e4) [concrete = constants.%Optional.HasValue.afd] -// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.7a6 = name_ref HasValue, %.loc68_19.7 [concrete = constants.%Optional.HasValue.afd] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.call: init %Optional.049 to %.loc68_19.5 = call %bound_method.loc68_19.4(%.loc68_18.2, %addr) +// CHECK:STDOUT: %.loc68_19.6: ref %Optional.049 = temporary %.loc68_19.5, %T.as_type.as.Iterate.impl.Next.call +// CHECK:STDOUT: %.loc68_19.7: %Optional.HasValue.type.794 = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.405) [concrete = constants.%Optional.HasValue.776] +// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.794 = name_ref HasValue, %.loc68_19.7 [concrete = constants.%Optional.HasValue.776] // CHECK:STDOUT: %Optional.HasValue.bound: = bound_method %.loc68_19.6, %HasValue.ref -// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%OptionalStorage.facet.1e4) [concrete = constants.%Optional.HasValue.specific_fn.cd8] +// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%OptionalStorage.facet.405) [concrete = constants.%Optional.HasValue.specific_fn.9fc] // CHECK:STDOUT: %bound_method.loc68_19.5: = bound_method %.loc68_19.6, %Optional.HasValue.specific_fn -// CHECK:STDOUT: %.loc68_19.8: %Optional.72d = acquire_value %.loc68_19.6 +// CHECK:STDOUT: %.loc68_19.8: %Optional.049 = acquire_value %.loc68_19.6 // CHECK:STDOUT: %Optional.HasValue.call: init bool = call %bound_method.loc68_19.5(%.loc68_19.8) // CHECK:STDOUT: %.loc68_19.9: bool = value_of_initializer %Optional.HasValue.call // CHECK:STDOUT: %.loc68_19.10: bool = converted %Optional.HasValue.call, %.loc68_19.9 // CHECK:STDOUT: if %.loc68_19.10 br !for.body else br !for.done // CHECK:STDOUT: // CHECK:STDOUT: !for.body: -// CHECK:STDOUT: %.loc68_19.11: %Optional.Get.type.65e = specific_constant imports.%Core.import_ref.dab, @Optional(constants.%OptionalStorage.facet.1e4) [concrete = constants.%Optional.Get.ef5] -// CHECK:STDOUT: %Get.ref: %Optional.Get.type.65e = name_ref Get, %.loc68_19.11 [concrete = constants.%Optional.Get.ef5] +// CHECK:STDOUT: %.loc68_19.11: %Optional.Get.type.e6c = specific_constant imports.%Core.import_ref.dab, @Optional(constants.%OptionalStorage.facet.405) [concrete = constants.%Optional.Get.cb6] +// CHECK:STDOUT: %Get.ref: %Optional.Get.type.e6c = name_ref Get, %.loc68_19.11 [concrete = constants.%Optional.Get.cb6] // CHECK:STDOUT: %Optional.Get.bound: = bound_method %.loc68_19.6, %Get.ref -// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%OptionalStorage.facet.1e4) [concrete = constants.%Optional.Get.specific_fn.1e8] +// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%OptionalStorage.facet.405) [concrete = constants.%Optional.Get.specific_fn.e69] // CHECK:STDOUT: %bound_method.loc68_19.6: = bound_method %.loc68_19.6, %Optional.Get.specific_fn -// CHECK:STDOUT: %.loc68_19.12: %Optional.72d = acquire_value %.loc68_19.6 +// CHECK:STDOUT: %.loc68_19.12: %Optional.049 = acquire_value %.loc68_19.6 // CHECK:STDOUT: %Optional.Get.call: init %f64.dc1 = call %bound_method.loc68_19.6(%.loc68_19.12) // CHECK:STDOUT: %.loc68_19.13: %f64.dc1 = value_of_initializer %Optional.Get.call // CHECK:STDOUT: %.loc68_19.14: %f64.dc1 = converted %Optional.Get.call, %.loc68_19.13 @@ -3296,15 +4271,15 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %specific_fn.loc69: = specific_function %impl.elem0.loc69, @Float.as.AddAssignWith.impl.Op(constants.%int_64) [concrete = constants.%Float.as.AddAssignWith.impl.Op.specific_fn] // CHECK:STDOUT: %bound_method.loc69_9.2: = bound_method %sum.ref, %specific_fn.loc69 // CHECK:STDOUT: %Float.as.AddAssignWith.impl.Op.call: init %empty_tuple.type = call %bound_method.loc69_9.2(%sum.ref, %i.ref) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc68_19.1: = bound_method %.loc68_19.6, constants.%Destroy.WithSelf.Op.403171.9 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc68_19.1: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc68_19.1(%.loc68_19.6) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc68_19.1: = bound_method %.loc68_19.6, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.9 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc68_19.1: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc68_19.1(%.loc68_19.6) // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.done: -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc68_19.2: = bound_method %.loc68_19.6, constants.%Destroy.WithSelf.Op.403171.9 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc68_19.2: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc68_19.2(%.loc68_19.6) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc68_19.3: = bound_method %var, constants.%Destroy.WithSelf.Op.403171.10 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc68_19.3: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc68_19.3(%var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc68_19.2: = bound_method %.loc68_19.6, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.9 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc68_19.2: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc68_19.2(%.loc68_19.6) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc68_19.3: = bound_method %var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.11 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc68_19.3: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc68_19.3(%var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3312,14 +4287,14 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %R.patt.loc22_17.2 => constants.%R.patt // CHECK:STDOUT: %R.loc22_17.1 => constants.%R // CHECK:STDOUT: %R.as_type.loc22_61.1 => constants.%R.as_type -// CHECK:STDOUT: %pattern_type => constants.%pattern_type.15f -// CHECK:STDOUT: %r.param_patt.loc22_59.2 => constants.%r.param_patt.f80 -// CHECK:STDOUT: %r.patt.loc22_59.2 => constants.%r.patt.fdd +// CHECK:STDOUT: %pattern_type => constants.%pattern_type.6f7 +// CHECK:STDOUT: %r.param_patt.loc22_59.2 => constants.%r.param_patt.19a +// CHECK:STDOUT: %r.patt.loc22_59.2 => constants.%r.patt.f97 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @TestIterate(constants.%facet_value.f44) { +// CHECK:STDOUT: specific @TestIterate(constants.%facet_value.30f) { // CHECK:STDOUT: %R.patt.loc22_17.2 => constants.%R.patt -// CHECK:STDOUT: %R.loc22_17.1 => constants.%facet_value.f44 +// CHECK:STDOUT: %R.loc22_17.1 => constants.%facet_value.30f // CHECK:STDOUT: %R.as_type.loc22_61.1 => constants.%MutableRange // CHECK:STDOUT: %pattern_type => constants.%pattern_type.992 // CHECK:STDOUT: %r.param_patt.loc22_59.2 => constants.%r.param_patt.aeb @@ -3327,25 +4302,25 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc22 => constants.%complete_type.357 -// CHECK:STDOUT: %Iterate.lookup_impl_witness => constants.%Iterate.impl_witness.083 -// CHECK:STDOUT: %Iterate.facet.loc26_19.5 => constants.%Iterate.facet.1aa -// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type => constants.%Iterate.WithSelf.NewCursor.type.ee3 -// CHECK:STDOUT: %.loc26_19.19 => constants.%.d89 -// CHECK:STDOUT: %impl.elem2.loc26_19.2 => constants.%T.as_type.as.Iterate.impl.NewCursor.d12 +// CHECK:STDOUT: %Iterate.lookup_impl_witness => constants.%Iterate.impl_witness.6cb +// CHECK:STDOUT: %Iterate.facet.loc26_19.5 => constants.%Iterate.facet.d07 +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type => constants.%Iterate.WithSelf.NewCursor.type.0ef +// CHECK:STDOUT: %.loc26_19.19 => constants.%.698 +// CHECK:STDOUT: %impl.elem2.loc26_19.3 => constants.%T.as_type.as.Iterate.impl.NewCursor.fcd // CHECK:STDOUT: %specific_impl_fn.loc26_19.4 => constants.%T.as_type.as.Iterate.impl.NewCursor.specific_fn -// CHECK:STDOUT: %impl.elem1 => constants.%Destroy.facet.193 +// CHECK:STDOUT: %impl.elem1 => constants.%Destroy.facet.f0b // CHECK:STDOUT: %as_type => constants.%tuple.type.dd0 // CHECK:STDOUT: %require_complete.1 => constants.%complete_type.843 // CHECK:STDOUT: %ptr => constants.%ptr.a4f -// CHECK:STDOUT: %Iterate.WithSelf.Next.type => constants.%Iterate.WithSelf.Next.type.ab1 -// CHECK:STDOUT: %.loc26_19.20 => constants.%.6e6 -// CHECK:STDOUT: %impl.elem3.loc26_19.2 => constants.%T.as_type.as.Iterate.impl.Next.e47 +// CHECK:STDOUT: %Iterate.WithSelf.Next.type => constants.%Iterate.WithSelf.Next.type.7af +// CHECK:STDOUT: %.loc26_19.20 => constants.%.782 +// CHECK:STDOUT: %impl.elem3.loc26_19.2 => constants.%T.as_type.as.Iterate.impl.Next.c88 // CHECK:STDOUT: %specific_impl_fn.loc26_19.5 => constants.%T.as_type.as.Iterate.impl.Next.specific_fn -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.ada -// CHECK:STDOUT: %.loc26_19.21 => constants.%.183 -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.6c4ec3.10 -// CHECK:STDOUT: %impl.elem0.loc26_19.2 => constants.%Destroy.WithSelf.Op.403171.10 -// CHECK:STDOUT: %specific_impl_fn.loc26_19.6 => constants.%Destroy.WithSelf.Op.403171.10 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.e6e +// CHECK:STDOUT: %.loc26_19.21 => constants.%.94d +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.f8f19d.10 +// CHECK:STDOUT: %impl.elem2.loc26_19.4 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.11 +// CHECK:STDOUT: %specific_impl_fn.loc26_19.6 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.11 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- adl_returns_different_types.carbon @@ -3354,6 +4329,7 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: type: type = facet_type [concrete] // CHECK:STDOUT: %Iterate.type: type = facet_type <@Iterate> [concrete] // CHECK:STDOUT: %OptionalStorage.type: type = facet_type <@OptionalStorage> [concrete] +// CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %facet_type.f48: type = facet_type <@Destroy & @Copy> [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] @@ -3400,65 +4376,108 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %pattern_type.c43: type = pattern_type %ValueType [concrete] -// CHECK:STDOUT: %ValueType.cpp_destructor.type: type = fn_type @ValueType.cpp_destructor [concrete] -// CHECK:STDOUT: %ValueType.cpp_destructor: %ValueType.cpp_destructor.type = struct_value () [concrete] -// CHECK:STDOUT: %ValueType.Op.type.4c0699.1: type = fn_type @ValueType.Op.1 [concrete] -// CHECK:STDOUT: %ValueType.Op.4ec7f2.1: %ValueType.Op.type.4c0699.1 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.c4c: = custom_witness (%ValueType.Op.4ec7f2.1), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc27 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc27 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %ValueType.SubobjectDestroy.type: type = fn_type @ValueType.SubobjectDestroy [concrete] +// CHECK:STDOUT: %ValueType.SubobjectDestroy: %ValueType.SubobjectDestroy.type = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.226: = custom_witness (%Destroy.WithSelf.Op.403171.2, %ValueType.SubobjectDestroy, %Destroy.WithSelf.SelfDestruct.db3fdb.2), @Destroy [concrete] // CHECK:STDOUT: %const.dd6: type = const_type %ValueType [concrete] // CHECK:STDOUT: %ptr.69c: type = ptr_type %const.dd6 [concrete] // CHECK:STDOUT: %ptr.233: type = ptr_type %ValueType [concrete] -// CHECK:STDOUT: %ValueType.Op.type.4c0699.2: type = fn_type @ValueType.Op.2 [concrete] -// CHECK:STDOUT: %ValueType.Op.4ec7f2.2: %ValueType.Op.type.4c0699.2 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.202: = custom_witness (%ValueType.Op.4ec7f2.2), @Copy [concrete] -// CHECK:STDOUT: %facet_value.9f0: %facet_type.f48 = facet_value %ValueType, (%custom_witness.c4c, %custom_witness.202) [concrete] +// CHECK:STDOUT: %ValueType.Op.type: type = fn_type @ValueType.Op [concrete] +// CHECK:STDOUT: %ValueType.Op: %ValueType.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.202: = custom_witness (%ValueType.Op), @Copy [concrete] +// CHECK:STDOUT: %facet_value.978: %facet_type.f48 = facet_value %ValueType, (%custom_witness.226, %custom_witness.202) [concrete] // CHECK:STDOUT: %Iterate.lookup_impl_witness.1d8: = lookup_impl_witness %.Self.500, @Iterate [symbolic_self] // CHECK:STDOUT: %impl.elem0.294: %facet_type.f48 = impl_witness_access %Iterate.lookup_impl_witness.1d8, element0 [symbolic_self] -// CHECK:STDOUT: %Iterate_where.type.081: type = facet_type <@Iterate where %impl.elem0.294 = %facet_value.9f0> [concrete] -// CHECK:STDOUT: %pattern_type.d57: type = pattern_type %Iterate_where.type.081 [concrete] -// CHECK:STDOUT: %R.patt: %pattern_type.d57 = symbolic_binding_pattern R, 0 [symbolic] -// CHECK:STDOUT: %R: %Iterate_where.type.081 = symbolic_binding R, 0 [symbolic] +// CHECK:STDOUT: %Iterate_where.type.87e: type = facet_type <@Iterate where %impl.elem0.294 = %facet_value.978> [concrete] +// CHECK:STDOUT: %pattern_type.ba8: type = pattern_type %Iterate_where.type.87e [concrete] +// CHECK:STDOUT: %R.patt: %pattern_type.ba8 = symbolic_binding_pattern R, 0 [symbolic] +// CHECK:STDOUT: %R: %Iterate_where.type.87e = symbolic_binding R, 0 [symbolic] // CHECK:STDOUT: %R.as_type: type = facet_access_type %R [symbolic] -// CHECK:STDOUT: %pattern_type.a97: type = pattern_type %R.as_type [symbolic] -// CHECK:STDOUT: %r.param_patt.8bc: %pattern_type.a97 = value_param_pattern [symbolic] -// CHECK:STDOUT: %r.patt.440: %pattern_type.a97 = wrapper_binding_pattern r, %r.param_patt.8bc [symbolic] +// CHECK:STDOUT: %pattern_type.053: type = pattern_type %R.as_type [symbolic] +// CHECK:STDOUT: %r.param_patt.75e: %pattern_type.053 = value_param_pattern [symbolic] +// CHECK:STDOUT: %r.patt.82a: %pattern_type.053 = wrapper_binding_pattern r, %r.param_patt.75e [symbolic] // CHECK:STDOUT: %i.patt: %pattern_type.c43 = value_binding_pattern i [concrete] -// CHECK:STDOUT: %Iterate.lookup_impl_witness.bda: = lookup_impl_witness %R, @Iterate [symbolic] -// CHECK:STDOUT: %Iterate.facet.5c3: %Iterate.type = facet_value %R.as_type, (%Iterate.lookup_impl_witness.bda) [symbolic] -// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.825: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.5c3) [symbolic] -// CHECK:STDOUT: %Iterate.WithSelf.Next.type.37e: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.5c3) [symbolic] -// CHECK:STDOUT: %.ca5: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.825, %Iterate.facet.5c3 [symbolic] -// CHECK:STDOUT: %impl.elem2.60f: %.ca5 = impl_witness_access %Iterate.lookup_impl_witness.bda, element2 [symbolic] -// CHECK:STDOUT: %impl.elem1.75b: %Destroy.type = impl_witness_access %Iterate.lookup_impl_witness.bda, element1 [symbolic] -// CHECK:STDOUT: %as_type.aee: type = facet_access_type %impl.elem1.75b [symbolic] -// CHECK:STDOUT: %specific_impl_fn.979: = specific_impl_function %impl.elem2.60f, @Iterate.WithSelf.NewCursor(%Iterate.facet.5c3) [symbolic] -// CHECK:STDOUT: %ptr.779: type = ptr_type %as_type.aee [symbolic] -// CHECK:STDOUT: %.493: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.37e, %Iterate.facet.5c3 [symbolic] -// CHECK:STDOUT: %impl.elem3.e03: %.493 = impl_witness_access %Iterate.lookup_impl_witness.bda, element3 [symbolic] -// CHECK:STDOUT: %DefaultOptionalStorage.8b2: type = class_type @DefaultOptionalStorage, @DefaultOptionalStorage(%facet_value.9f0) [concrete] -// CHECK:STDOUT: %OptionalStorage.impl_witness.986: = impl_witness imports.%OptionalStorage.impl_witness_table.460, @T.as_type.as.OptionalStorage.impl(%facet_value.9f0) [concrete] -// CHECK:STDOUT: %OptionalStorage.facet.b3f: %OptionalStorage.type = facet_value %ValueType, (%OptionalStorage.impl_witness.986) [concrete] -// CHECK:STDOUT: %Optional.a40: type = class_type @Optional, @Optional(%OptionalStorage.facet.b3f) [concrete] -// CHECK:STDOUT: %specific_impl_fn.80c: = specific_impl_function %impl.elem3.e03, @Iterate.WithSelf.Next(%Iterate.facet.5c3) [symbolic] -// CHECK:STDOUT: %Optional.HasValue.type.fe3: type = fn_type @Optional.HasValue, @Optional(%OptionalStorage.facet.b3f) [concrete] -// CHECK:STDOUT: %Optional.HasValue.cb1: %Optional.HasValue.type.fe3 = struct_value () [concrete] -// CHECK:STDOUT: %Optional.Get.type.316: type = fn_type @Optional.Get, @Optional(%OptionalStorage.facet.b3f) [concrete] -// CHECK:STDOUT: %Optional.Get.4e3: %Optional.Get.type.316 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.facet.c02: %Destroy.type = facet_value %ValueType, (%custom_witness.c4c) [concrete] -// CHECK:STDOUT: %MaybeUnformed.e16: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.c02) [concrete] +// CHECK:STDOUT: %Iterate.lookup_impl_witness.01e: = lookup_impl_witness %R, @Iterate [symbolic] +// CHECK:STDOUT: %Iterate.facet.467: %Iterate.type = facet_value %R.as_type, (%Iterate.lookup_impl_witness.01e) [symbolic] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.6eb: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.467) [symbolic] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type.bb3: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.467) [symbolic] +// CHECK:STDOUT: %.9d7: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.6eb, %Iterate.facet.467 [symbolic] +// CHECK:STDOUT: %impl.elem2.b2a: %.9d7 = impl_witness_access %Iterate.lookup_impl_witness.01e, element2 [symbolic] +// CHECK:STDOUT: %impl.elem1.d56: %Destroy.type = impl_witness_access %Iterate.lookup_impl_witness.01e, element1 [symbolic] +// CHECK:STDOUT: %as_type.db9: type = facet_access_type %impl.elem1.d56 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.2f4: = specific_impl_function %impl.elem2.b2a, @Iterate.WithSelf.NewCursor(%Iterate.facet.467) [symbolic] +// CHECK:STDOUT: %ptr.eca: type = ptr_type %as_type.db9 [symbolic] +// CHECK:STDOUT: %.2d6: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.bb3, %Iterate.facet.467 [symbolic] +// CHECK:STDOUT: %impl.elem3.c97: %.2d6 = impl_witness_access %Iterate.lookup_impl_witness.01e, element3 [symbolic] +// CHECK:STDOUT: %DefaultOptionalStorage.53f: type = class_type @DefaultOptionalStorage, @DefaultOptionalStorage(%facet_value.978) [concrete] +// CHECK:STDOUT: %OptionalStorage.impl_witness.6c3: = impl_witness imports.%OptionalStorage.impl_witness_table.460, @T.as_type.as.OptionalStorage.impl(%facet_value.978) [concrete] +// CHECK:STDOUT: %OptionalStorage.facet.b3c: %OptionalStorage.type = facet_value %ValueType, (%OptionalStorage.impl_witness.6c3) [concrete] +// CHECK:STDOUT: %Optional.e69: type = class_type @Optional, @Optional(%OptionalStorage.facet.b3c) [concrete] +// CHECK:STDOUT: %pattern_type.62b: type = pattern_type %Optional.e69 [concrete] +// CHECK:STDOUT: %specific_impl_fn.5ea: = specific_impl_function %impl.elem3.c97, @Iterate.WithSelf.Next(%Iterate.facet.467) [symbolic] +// CHECK:STDOUT: %Optional.HasValue.type.c61: type = fn_type @Optional.HasValue, @Optional(%OptionalStorage.facet.b3c) [concrete] +// CHECK:STDOUT: %Optional.HasValue.ba9d: %Optional.HasValue.type.c61 = struct_value () [concrete] +// CHECK:STDOUT: %Optional.Get.type.394: type = fn_type @Optional.Get, @Optional(%OptionalStorage.facet.b3c) [concrete] +// CHECK:STDOUT: %Optional.Get.da9: %Optional.Get.type.394 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.facet.c1d: %Destroy.type = facet_value %ValueType, (%custom_witness.226) [concrete] +// CHECK:STDOUT: %MaybeUnformed.e45: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.c1d) [concrete] // CHECK:STDOUT: %.be1: type = maybe_unformed_type %ValueType [concrete] -// CHECK:STDOUT: %struct_type.value.has_value.baa: type = struct_type {.value: %MaybeUnformed.e16, .has_value: bool} [concrete] -// CHECK:STDOUT: %Optional.HasValue.specific_fn.048: = specific_function %Optional.HasValue.cb1, @Optional.HasValue(%OptionalStorage.facet.b3f) [concrete] -// CHECK:STDOUT: %Optional.Get.specific_fn.5ce: = specific_function %Optional.Get.4e3, @Optional.Get(%OptionalStorage.facet.b3f) [concrete] +// CHECK:STDOUT: %struct_type.value.has_value.619: type = struct_type {.value: %MaybeUnformed.e45, .has_value: bool} [concrete] +// CHECK:STDOUT: %Optional.HasValue.specific_fn.524: = specific_function %Optional.HasValue.ba9d, @Optional.HasValue(%OptionalStorage.facet.b3c) [concrete] +// CHECK:STDOUT: %Optional.Get.specific_fn.f41: = specific_function %Optional.Get.da9, @Optional.Get(%OptionalStorage.facet.b3c) [concrete] // CHECK:STDOUT: %operator_PlusEqual__carbon_thunk.type: type = fn_type @operator_PlusEqual__carbon_thunk [concrete] // CHECK:STDOUT: %operator_PlusEqual__carbon_thunk: %operator_PlusEqual__carbon_thunk.type = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.7: type = fn_type @Destroy.WithSelf.Op.loc31_37.6 [concrete] +// CHECK:STDOUT: %pattern_type.ce5: type = pattern_type %.be1 [concrete] +// CHECK:STDOUT: %self.param_patt.36c: %pattern_type.ce5 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.548: %pattern_type.ce5 = wrapper_binding_pattern self, %self.param_patt.36c [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc31_37.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc31_37.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.759: type = pattern_type %MaybeUnformed.e45 [concrete] +// CHECK:STDOUT: %self.param_patt.039: %pattern_type.759 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.4c2: %pattern_type.759 = wrapper_binding_pattern self, %self.param_patt.039 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc31_37.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc31_37.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.40d: %pattern_type.831 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.560: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt.40d [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc31_37.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.5: type = fn_type @Destroy.WithSelf.Op.loc31_37.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.5: %Destroy.WithSelf.Op.type.ef016f.5 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.a92: type = pattern_type %struct_type.value.has_value.619 [concrete] +// CHECK:STDOUT: %self.param_patt.565: %pattern_type.a92 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.1d7: %pattern_type.a92 = wrapper_binding_pattern self, %self.param_patt.565 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc31_37.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.6: type = fn_type @Destroy.WithSelf.Op.loc31_37.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.6: %Destroy.WithSelf.Op.type.ef016f.6 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.fdb: type = pattern_type %DefaultOptionalStorage.53f [concrete] +// CHECK:STDOUT: %self.param_patt.ace: %pattern_type.fdb = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.b05: %pattern_type.fdb = wrapper_binding_pattern self, %self.param_patt.ace [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc31_37.5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.7: type = fn_type @Destroy.WithSelf.Op.loc31_37.5 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.7: %Destroy.WithSelf.Op.type.ef016f.7 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.lookup_impl_witness.3ea: = lookup_impl_witness %impl.elem1.75b, @Destroy [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.696: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%impl.elem1.75b) [symbolic] -// CHECK:STDOUT: %.fbd: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.696, %impl.elem1.75b [symbolic] -// CHECK:STDOUT: %impl.elem0.bb2: %.fbd = impl_witness_access %Destroy.lookup_impl_witness.3ea, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.fa3: = specific_impl_function %impl.elem0.bb2, @Destroy.WithSelf.Op.1(%impl.elem1.75b) [symbolic] +// CHECK:STDOUT: %self.param_patt.a8e: %pattern_type.62b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.24c: %pattern_type.62b = wrapper_binding_pattern self, %self.param_patt.a8e [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc31_37.6 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.7: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.8: type = fn_type @Destroy.WithSelf.Op.loc31_37.6 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.8: %Destroy.WithSelf.Op.type.ef016f.8 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.8: type = fn_type @Destroy.WithSelf.SelfDestruct.loc31_37.6 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.8: %Destroy.WithSelf.SelfDestruct.type.fbceb5.8 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.lookup_impl_witness.d0e: = lookup_impl_witness %impl.elem1.d56, @Destroy [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.c82: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%impl.elem1.d56) [symbolic] +// CHECK:STDOUT: %.c10: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.c82, %impl.elem1.d56 [symbolic] +// CHECK:STDOUT: %impl.elem2.5c5: %.c10 = impl_witness_access %Destroy.lookup_impl_witness.d0e, element2 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.17d: = specific_impl_function %impl.elem2.5c5, @Destroy.WithSelf.SelfDestruct.1(%impl.elem1.d56) [symbolic] // CHECK:STDOUT: %ConstRange: type = class_type @ConstRange [concrete] // CHECK:STDOUT: %pattern_type.c1d: type = pattern_type %ConstRange [concrete] // CHECK:STDOUT: %Iterator: type = class_type @Iterator.1 [concrete] @@ -3471,44 +4490,56 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %Iterator.Op.type.3f6dc2.1: type = fn_type @Iterator.Op.1 [concrete] // CHECK:STDOUT: %Iterator.Op.240e50.1: %Iterator.Op.type.3f6dc2.1 = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.5be: = custom_witness (%ValueType, %Iterator.Op.240e50.1), @CppUnsafeDeref [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.9: type = fn_type @Destroy.WithSelf.Op.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.9: %Destroy.WithSelf.Op.type.ef016f.9 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.9: type = fn_type @Destroy.WithSelf.SelfDestruct.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.9: %Destroy.WithSelf.SelfDestruct.type.fbceb5.9 = struct_value () [concrete] +// CHECK:STDOUT: %Iterator.SubobjectDestroy.type: type = fn_type @Iterator.SubobjectDestroy [concrete] +// CHECK:STDOUT: %Iterator.SubobjectDestroy: %Iterator.SubobjectDestroy.type = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.429ac1.1: = custom_witness (%Destroy.WithSelf.Op.403171.9, %Iterator.SubobjectDestroy, %Destroy.WithSelf.SelfDestruct.db3fdb.9), @Destroy [concrete] // CHECK:STDOUT: %Iterator.Op.type.3f6dc2.2: type = fn_type @Iterator.Op.2 [concrete] // CHECK:STDOUT: %Iterator.Op.240e50.2: %Iterator.Op.type.3f6dc2.2 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.a147d4.1: = custom_witness (%Iterator.Op.240e50.2), @Destroy [concrete] -// CHECK:STDOUT: %Iterator.Op.type.3f6dc2.3: type = fn_type @Iterator.Op.3 [concrete] -// CHECK:STDOUT: %Iterator.Op.240e50.3: %Iterator.Op.type.3f6dc2.3 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.c31: = custom_witness (%Iterator.Op.240e50.3), @Inc [concrete] +// CHECK:STDOUT: %custom_witness.c31: = custom_witness (%Iterator.Op.240e50.2), @Inc [concrete] // CHECK:STDOUT: %Equal.type: type = fn_type @Equal [concrete] // CHECK:STDOUT: %Equal: %Equal.type = struct_value () [concrete] // CHECK:STDOUT: %NotEqual.type: type = fn_type @NotEqual [concrete] // CHECK:STDOUT: %NotEqual: %NotEqual.type = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.e21: = custom_witness (%Equal, %NotEqual), @EqWith, @EqWith(%Sentinel) [concrete] -// CHECK:STDOUT: %Sentinel.Op.type: type = fn_type @Sentinel.Op [concrete] -// CHECK:STDOUT: %Sentinel.Op: %Sentinel.Op.type = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.a147d4.2: = custom_witness (%Sentinel.Op), @Destroy [concrete] -// CHECK:STDOUT: %facet_value.289: %CppRange_where.type.d682d6.1 = facet_value %ConstRange, (%custom_witness.c4c, %custom_witness.202, %custom_witness.116, %custom_witness.a147d4.1, %custom_witness.5be, %custom_witness.c31, %custom_witness.e21, %custom_witness.a147d4.2) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.10: type = fn_type @Destroy.WithSelf.Op.loc38 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.10: %Destroy.WithSelf.Op.type.ef016f.10 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.10: type = fn_type @Destroy.WithSelf.SelfDestruct.loc38 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.10: %Destroy.WithSelf.SelfDestruct.type.fbceb5.10 = struct_value () [concrete] +// CHECK:STDOUT: %Sentinel.SubobjectDestroy.type: type = fn_type @Sentinel.SubobjectDestroy [concrete] +// CHECK:STDOUT: %Sentinel.SubobjectDestroy: %Sentinel.SubobjectDestroy.type = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.429ac1.2: = custom_witness (%Destroy.WithSelf.Op.403171.10, %Sentinel.SubobjectDestroy, %Destroy.WithSelf.SelfDestruct.db3fdb.10), @Destroy [concrete] +// CHECK:STDOUT: %facet_value.e8b: %CppRange_where.type.d682d6.1 = facet_value %ConstRange, (%custom_witness.226, %custom_witness.202, %custom_witness.116, %custom_witness.429ac1.1, %custom_witness.5be, %custom_witness.c31, %custom_witness.e21, %custom_witness.429ac1.2) [concrete] // CHECK:STDOUT: %tuple.type.7a6: type = tuple_type (%Iterator, %Sentinel) [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.8: type = fn_type @Destroy.WithSelf.Op.3 [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.8: %Destroy.WithSelf.Op.type.ef016f.8 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.6c4ec3.8: = custom_witness (%Destroy.WithSelf.Op.403171.8), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.9e5: %Destroy.type = facet_value %tuple.type.7a6, (%custom_witness.6c4ec3.8) [concrete] -// CHECK:STDOUT: %Iterate.impl_witness.6f6: = impl_witness imports.%Iterate.impl_witness_table.121, @T.as_type.as.Iterate.impl(%facet_value.289) [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.type.0fb: type = fn_type @T.as_type.as.Iterate.impl.NewCursor, @T.as_type.as.Iterate.impl(%facet_value.289) [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.126: %T.as_type.as.Iterate.impl.NewCursor.type.0fb = struct_value () [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.type.846: type = fn_type @T.as_type.as.Iterate.impl.Next, @T.as_type.as.Iterate.impl(%facet_value.289) [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.c7f: %T.as_type.as.Iterate.impl.Next.type.846 = struct_value () [concrete] -// CHECK:STDOUT: %Iterate.facet.8d2: %Iterate.type = facet_value %ConstRange, (%Iterate.impl_witness.6f6) [concrete] -// CHECK:STDOUT: %facet_value.142: %Iterate_where.type.081 = facet_value %ConstRange, (%Iterate.impl_witness.6f6) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.8: type = fn_type @Destroy.WithSelf.SubobjectDestroy.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.8: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.8 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.11: type = fn_type @Destroy.WithSelf.Op.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.11: %Destroy.WithSelf.Op.type.ef016f.11 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.11: type = fn_type @Destroy.WithSelf.SelfDestruct.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.11: %Destroy.WithSelf.SelfDestruct.type.fbceb5.11 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f8f19d.8: = custom_witness (%Destroy.WithSelf.Op.403171.11, %Destroy.WithSelf.SubobjectDestroy.d01daf.8, %Destroy.WithSelf.SelfDestruct.db3fdb.11), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.d83: %Destroy.type = facet_value %tuple.type.7a6, (%custom_witness.f8f19d.8) [concrete] +// CHECK:STDOUT: %Iterate.impl_witness.6b0: = impl_witness imports.%Iterate.impl_witness_table.121, @T.as_type.as.Iterate.impl(%facet_value.e8b) [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.type.0f8: type = fn_type @T.as_type.as.Iterate.impl.NewCursor, @T.as_type.as.Iterate.impl(%facet_value.e8b) [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.fa5: %T.as_type.as.Iterate.impl.NewCursor.type.0f8 = struct_value () [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.type.e47: type = fn_type @T.as_type.as.Iterate.impl.Next, @T.as_type.as.Iterate.impl(%facet_value.e8b) [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.e9b: %T.as_type.as.Iterate.impl.Next.type.e47 = struct_value () [concrete] +// CHECK:STDOUT: %Iterate.facet.80d: %Iterate.type = facet_value %ConstRange, (%Iterate.impl_witness.6b0) [concrete] +// CHECK:STDOUT: %facet_value.c77: %Iterate_where.type.87e = facet_value %ConstRange, (%Iterate.impl_witness.6b0) [concrete] // CHECK:STDOUT: %r.param_patt.ac5: %pattern_type.c1d = value_param_pattern [concrete] // CHECK:STDOUT: %r.patt.97f: %pattern_type.c1d = wrapper_binding_pattern r, %r.param_patt.ac5 [concrete] -// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.c36: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.8d2) [concrete] -// CHECK:STDOUT: %Iterate.WithSelf.Next.type.01e: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.8d2) [concrete] -// CHECK:STDOUT: %.a1c: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.c36, %Iterate.facet.8d2 [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.specific_fn: = specific_function %T.as_type.as.Iterate.impl.NewCursor.126, @T.as_type.as.Iterate.impl.NewCursor(%facet_value.289) [concrete] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.c59: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.80d) [concrete] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type.5e6: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.80d) [concrete] +// CHECK:STDOUT: %.182: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.c59, %Iterate.facet.80d [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.specific_fn: = specific_function %T.as_type.as.Iterate.impl.NewCursor.fa5, @T.as_type.as.Iterate.impl.NewCursor(%facet_value.e8b) [concrete] // CHECK:STDOUT: %ptr.d33: type = ptr_type %tuple.type.7a6 [concrete] -// CHECK:STDOUT: %.eab: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.01e, %Iterate.facet.8d2 [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.specific_fn: = specific_function %T.as_type.as.Iterate.impl.Next.c7f, @T.as_type.as.Iterate.impl.Next(%facet_value.289) [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.085: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Destroy.facet.9e5) [concrete] -// CHECK:STDOUT: %.83b: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.085, %Destroy.facet.9e5 [concrete] +// CHECK:STDOUT: %.883: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.5e6, %Iterate.facet.80d [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.specific_fn: = specific_function %T.as_type.as.Iterate.impl.Next.e9b, @T.as_type.as.Iterate.impl.Next(%facet_value.e8b) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.036: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.d83) [concrete] +// CHECK:STDOUT: %.6cc: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.036, %Destroy.facet.d83 [concrete] // CHECK:STDOUT: %complete_type.cf0: = complete_type_witness %tuple.type.7a6 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3537,11 +4568,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: import Cpp//... // CHECK:STDOUT: } // CHECK:STDOUT: %ValueType.decl: type = class_decl @ValueType [concrete = constants.%ValueType] {} {} -// CHECK:STDOUT: %ValueType.cpp_destructor.decl: %ValueType.cpp_destructor.type = fn_decl @ValueType.cpp_destructor [concrete = constants.%ValueType.cpp_destructor] { -// CHECK:STDOUT: -// CHECK:STDOUT: } { -// CHECK:STDOUT: -// CHECK:STDOUT: } // CHECK:STDOUT: %operator_PlusEqual__carbon_thunk.decl: %operator_PlusEqual__carbon_thunk.type = fn_decl @operator_PlusEqual__carbon_thunk [concrete = constants.%operator_PlusEqual__carbon_thunk] { // CHECK:STDOUT: // CHECK:STDOUT: } { @@ -3550,28 +4576,115 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %ConstRange.decl: type = class_decl @ConstRange [concrete = constants.%ConstRange] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @TestIterate(%R.loc27_17.2: %Iterate_where.type.081) { +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc31_37.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.ce5 = ref_param_pattern [concrete = constants.%self.param_patt.36c] +// CHECK:STDOUT: %self.patt: %pattern_type.ce5 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.548] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %.be1 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %.be1 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc31_37.1 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.ce5 = ref_param_pattern [concrete = constants.%self.param_patt.36c] +// CHECK:STDOUT: %self.patt: %pattern_type.ce5 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.548] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %.be1 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %.be1 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc31_37.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.759 = ref_param_pattern [concrete = constants.%self.param_patt.039] +// CHECK:STDOUT: %self.patt: %pattern_type.759 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.4c2] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %MaybeUnformed.e45 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %MaybeUnformed.e45 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc31_37.2 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.759 = ref_param_pattern [concrete = constants.%self.param_patt.039] +// CHECK:STDOUT: %self.patt: %pattern_type.759 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.4c2] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %MaybeUnformed.e45 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %MaybeUnformed.e45 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc31_37.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d] +// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0 +// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.5 = fn_decl @Destroy.WithSelf.Op.loc31_37.3 [concrete = constants.%Destroy.WithSelf.Op.403171.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d] +// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0 +// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc31_37.4 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.a92 = ref_param_pattern [concrete = constants.%self.param_patt.565] +// CHECK:STDOUT: %self.patt: %pattern_type.a92 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.1d7] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.value.has_value.619 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.value.has_value.619 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.5: %Destroy.WithSelf.Op.type.ef016f.6 = fn_decl @Destroy.WithSelf.Op.loc31_37.4 [concrete = constants.%Destroy.WithSelf.Op.403171.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.a92 = ref_param_pattern [concrete = constants.%self.param_patt.565] +// CHECK:STDOUT: %self.patt: %pattern_type.a92 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.1d7] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.value.has_value.619 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.value.has_value.619 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc31_37.5 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.fdb = ref_param_pattern [concrete = constants.%self.param_patt.ace] +// CHECK:STDOUT: %self.patt: %pattern_type.fdb = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.b05] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %DefaultOptionalStorage.53f = ref_param call_param0 +// CHECK:STDOUT: %self: ref %DefaultOptionalStorage.53f = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.6: %Destroy.WithSelf.Op.type.ef016f.7 = fn_decl @Destroy.WithSelf.Op.loc31_37.5 [concrete = constants.%Destroy.WithSelf.Op.403171.7] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.fdb = ref_param_pattern [concrete = constants.%self.param_patt.ace] +// CHECK:STDOUT: %self.patt: %pattern_type.fdb = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.b05] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %DefaultOptionalStorage.53f = ref_param call_param0 +// CHECK:STDOUT: %self: ref %DefaultOptionalStorage.53f = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc31_37.6 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.7] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.62b = ref_param_pattern [concrete = constants.%self.param_patt.a8e] +// CHECK:STDOUT: %self.patt: %pattern_type.62b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.24c] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Optional.e69 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Optional.e69 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.7: %Destroy.WithSelf.Op.type.ef016f.8 = fn_decl @Destroy.WithSelf.Op.loc31_37.6 [concrete = constants.%Destroy.WithSelf.Op.403171.8] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.62b = ref_param_pattern [concrete = constants.%self.param_patt.a8e] +// CHECK:STDOUT: %self.patt: %pattern_type.62b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.24c] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Optional.e69 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Optional.e69 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @TestIterate(%R.loc27_17.2: %Iterate_where.type.87e) { // CHECK:STDOUT: // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: %Iterate.lookup_impl_witness: = lookup_impl_witness %R.loc27_17.1, @Iterate [symbolic = %Iterate.lookup_impl_witness (constants.%Iterate.lookup_impl_witness.bda)] -// CHECK:STDOUT: %Iterate.facet.loc31_37.5: %Iterate.type = facet_value %R.as_type.loc27_79.1, (%Iterate.lookup_impl_witness) [symbolic = %Iterate.facet.loc31_37.5 (constants.%Iterate.facet.5c3)] -// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.loc31_37.5) [symbolic = %Iterate.WithSelf.NewCursor.type (constants.%Iterate.WithSelf.NewCursor.type.825)] -// CHECK:STDOUT: %.loc31_37.20: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type, %Iterate.facet.loc31_37.5 [symbolic = %.loc31_37.20 (constants.%.ca5)] -// CHECK:STDOUT: %impl.elem2.loc31_37.2: @TestIterate.%.loc31_37.20 (%.ca5) = impl_witness_access %Iterate.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc31_37.2 (constants.%impl.elem2.60f)] -// CHECK:STDOUT: %specific_impl_fn.loc31_37.4: = specific_impl_function %impl.elem2.loc31_37.2, @Iterate.WithSelf.NewCursor(%Iterate.facet.loc31_37.5) [symbolic = %specific_impl_fn.loc31_37.4 (constants.%specific_impl_fn.979)] +// CHECK:STDOUT: %Iterate.lookup_impl_witness: = lookup_impl_witness %R.loc27_17.1, @Iterate [symbolic = %Iterate.lookup_impl_witness (constants.%Iterate.lookup_impl_witness.01e)] +// CHECK:STDOUT: %Iterate.facet.loc31_37.5: %Iterate.type = facet_value %R.as_type.loc27_79.1, (%Iterate.lookup_impl_witness) [symbolic = %Iterate.facet.loc31_37.5 (constants.%Iterate.facet.467)] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.loc31_37.5) [symbolic = %Iterate.WithSelf.NewCursor.type (constants.%Iterate.WithSelf.NewCursor.type.6eb)] +// CHECK:STDOUT: %.loc31_37.20: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type, %Iterate.facet.loc31_37.5 [symbolic = %.loc31_37.20 (constants.%.9d7)] +// CHECK:STDOUT: %impl.elem2.loc31_37.3: @TestIterate.%.loc31_37.20 (%.9d7) = impl_witness_access %Iterate.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc31_37.3 (constants.%impl.elem2.b2a)] +// CHECK:STDOUT: %specific_impl_fn.loc31_37.4: = specific_impl_function %impl.elem2.loc31_37.3, @Iterate.WithSelf.NewCursor(%Iterate.facet.loc31_37.5) [symbolic = %specific_impl_fn.loc31_37.4 (constants.%specific_impl_fn.2f4)] // CHECK:STDOUT: -// CHECK:STDOUT: %ptr: type = ptr_type %as_type [symbolic = %ptr (constants.%ptr.779)] -// CHECK:STDOUT: %Iterate.WithSelf.Next.type: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.loc31_37.5) [symbolic = %Iterate.WithSelf.Next.type (constants.%Iterate.WithSelf.Next.type.37e)] -// CHECK:STDOUT: %.loc31_37.21: type = fn_type_with_self_type %Iterate.WithSelf.Next.type, %Iterate.facet.loc31_37.5 [symbolic = %.loc31_37.21 (constants.%.493)] -// CHECK:STDOUT: %impl.elem3.loc31_37.2: @TestIterate.%.loc31_37.21 (%.493) = impl_witness_access %Iterate.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc31_37.2 (constants.%impl.elem3.e03)] -// CHECK:STDOUT: %specific_impl_fn.loc31_37.5: = specific_impl_function %impl.elem3.loc31_37.2, @Iterate.WithSelf.Next(%Iterate.facet.loc31_37.5) [symbolic = %specific_impl_fn.loc31_37.5 (constants.%specific_impl_fn.80c)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%impl.elem1) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.696)] -// CHECK:STDOUT: %.loc31_37.22: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %impl.elem1 [symbolic = %.loc31_37.22 (constants.%.fbd)] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %impl.elem1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.3ea)] -// CHECK:STDOUT: %impl.elem0.loc31_37.2: @TestIterate.%.loc31_37.22 (%.fbd) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc31_37.2 (constants.%impl.elem0.bb2)] -// CHECK:STDOUT: %specific_impl_fn.loc31_37.6: = specific_impl_function %impl.elem0.loc31_37.2, @Destroy.WithSelf.Op.1(%impl.elem1) [symbolic = %specific_impl_fn.loc31_37.6 (constants.%specific_impl_fn.fa3)] +// CHECK:STDOUT: %ptr: type = ptr_type %as_type [symbolic = %ptr (constants.%ptr.eca)] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.loc31_37.5) [symbolic = %Iterate.WithSelf.Next.type (constants.%Iterate.WithSelf.Next.type.bb3)] +// CHECK:STDOUT: %.loc31_37.21: type = fn_type_with_self_type %Iterate.WithSelf.Next.type, %Iterate.facet.loc31_37.5 [symbolic = %.loc31_37.21 (constants.%.2d6)] +// CHECK:STDOUT: %impl.elem3.loc31_37.2: @TestIterate.%.loc31_37.21 (%.2d6) = impl_witness_access %Iterate.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc31_37.2 (constants.%impl.elem3.c97)] +// CHECK:STDOUT: %specific_impl_fn.loc31_37.5: = specific_impl_function %impl.elem3.loc31_37.2, @Iterate.WithSelf.Next(%Iterate.facet.loc31_37.5) [symbolic = %specific_impl_fn.loc31_37.5 (constants.%specific_impl_fn.5ea)] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%impl.elem1) [symbolic = %Destroy.WithSelf.SelfDestruct.type (constants.%Destroy.WithSelf.SelfDestruct.type.c82)] +// CHECK:STDOUT: %.loc31_37.22: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type, %impl.elem1 [symbolic = %.loc31_37.22 (constants.%.c10)] +// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %impl.elem1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.d0e)] +// CHECK:STDOUT: %impl.elem2.loc31_37.4: @TestIterate.%.loc31_37.22 (%.c10) = impl_witness_access %Destroy.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc31_37.4 (constants.%impl.elem2.5c5)] +// CHECK:STDOUT: %specific_impl_fn.loc31_37.6: = specific_impl_function %impl.elem2.loc31_37.4, @Destroy.WithSelf.SelfDestruct.1(%impl.elem1) [symbolic = %specific_impl_fn.loc31_37.6 (constants.%specific_impl_fn.17d)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%r.param: @TestIterate.%R.as_type.loc27_79.1 (%R.as_type)) { // CHECK:STDOUT: !entry: @@ -3580,53 +4693,53 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %i.patt: %pattern_type.c43 = value_binding_pattern i [concrete = constants.%i.patt] // CHECK:STDOUT: } // CHECK:STDOUT: %r.ref: @TestIterate.%R.as_type.loc27_79.1 (%R.as_type) = name_ref r, %r -// CHECK:STDOUT: %impl.elem2.loc31_37.1: @TestIterate.%.loc31_37.20 (%.ca5) = impl_witness_access constants.%Iterate.lookup_impl_witness.bda, element2 [symbolic = %impl.elem2.loc31_37.2 (constants.%impl.elem2.60f)] +// CHECK:STDOUT: %impl.elem2.loc31_37.1: @TestIterate.%.loc31_37.20 (%.9d7) = impl_witness_access constants.%Iterate.lookup_impl_witness.01e, element2 [symbolic = %impl.elem2.loc31_37.3 (constants.%impl.elem2.b2a)] // CHECK:STDOUT: %bound_method.loc31_37.1: = bound_method %r.ref, %impl.elem2.loc31_37.1 -// CHECK:STDOUT: %Iterate.facet.loc31_37.1: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.bda) [symbolic = %Iterate.facet.loc31_37.5 (constants.%Iterate.facet.5c3)] -// CHECK:STDOUT: %.loc31_37.1: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc31_37.1 [symbolic = %Iterate.facet.loc31_37.5 (constants.%Iterate.facet.5c3)] -// CHECK:STDOUT: %Iterate.facet.loc31_37.2: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.bda) [symbolic = %Iterate.facet.loc31_37.5 (constants.%Iterate.facet.5c3)] -// CHECK:STDOUT: %.loc31_37.2: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc31_37.2 [symbolic = %Iterate.facet.loc31_37.5 (constants.%Iterate.facet.5c3)] -// CHECK:STDOUT: %specific_impl_fn.loc31_37.1: = specific_impl_function %impl.elem2.loc31_37.1, @Iterate.WithSelf.NewCursor(constants.%Iterate.facet.5c3) [symbolic = %specific_impl_fn.loc31_37.4 (constants.%specific_impl_fn.979)] +// CHECK:STDOUT: %Iterate.facet.loc31_37.1: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.01e) [symbolic = %Iterate.facet.loc31_37.5 (constants.%Iterate.facet.467)] +// CHECK:STDOUT: %.loc31_37.1: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc31_37.1 [symbolic = %Iterate.facet.loc31_37.5 (constants.%Iterate.facet.467)] +// CHECK:STDOUT: %Iterate.facet.loc31_37.2: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.01e) [symbolic = %Iterate.facet.loc31_37.5 (constants.%Iterate.facet.467)] +// CHECK:STDOUT: %.loc31_37.2: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc31_37.2 [symbolic = %Iterate.facet.loc31_37.5 (constants.%Iterate.facet.467)] +// CHECK:STDOUT: %specific_impl_fn.loc31_37.1: = specific_impl_function %impl.elem2.loc31_37.1, @Iterate.WithSelf.NewCursor(constants.%Iterate.facet.467) [symbolic = %specific_impl_fn.loc31_37.4 (constants.%specific_impl_fn.2f4)] // CHECK:STDOUT: %bound_method.loc31_37.2: = bound_method %r.ref, %specific_impl_fn.loc31_37.1 -// CHECK:STDOUT: %var: ref @TestIterate.%as_type (%as_type.aee) = var_storage invalid -// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.call: init @TestIterate.%as_type (%as_type.aee) to %var = call %bound_method.loc31_37.2(%r.ref) +// CHECK:STDOUT: %var: ref @TestIterate.%as_type (%as_type.db9) = var_storage invalid +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.call: init @TestIterate.%as_type (%as_type.db9) to %var = call %bound_method.loc31_37.2(%r.ref) // CHECK:STDOUT: assign %var, %Iterate.WithSelf.NewCursor.call // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.next: -// CHECK:STDOUT: %addr.loc31: @TestIterate.%ptr (%ptr.779) = addr_of %var -// CHECK:STDOUT: %impl.elem3.loc31_37.1: @TestIterate.%.loc31_37.21 (%.493) = impl_witness_access constants.%Iterate.lookup_impl_witness.bda, element3 [symbolic = %impl.elem3.loc31_37.2 (constants.%impl.elem3.e03)] +// CHECK:STDOUT: %addr.loc31: @TestIterate.%ptr (%ptr.eca) = addr_of %var +// CHECK:STDOUT: %impl.elem3.loc31_37.1: @TestIterate.%.loc31_37.21 (%.2d6) = impl_witness_access constants.%Iterate.lookup_impl_witness.01e, element3 [symbolic = %impl.elem3.loc31_37.2 (constants.%impl.elem3.c97)] // CHECK:STDOUT: %bound_method.loc31_37.3: = bound_method %r.ref, %impl.elem3.loc31_37.1 -// CHECK:STDOUT: %Iterate.facet.loc31_37.3: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.bda) [symbolic = %Iterate.facet.loc31_37.5 (constants.%Iterate.facet.5c3)] -// CHECK:STDOUT: %.loc31_37.3: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc31_37.3 [symbolic = %Iterate.facet.loc31_37.5 (constants.%Iterate.facet.5c3)] -// CHECK:STDOUT: %Iterate.facet.loc31_37.4: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.bda) [symbolic = %Iterate.facet.loc31_37.5 (constants.%Iterate.facet.5c3)] -// CHECK:STDOUT: %.loc31_37.4: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc31_37.4 [symbolic = %Iterate.facet.loc31_37.5 (constants.%Iterate.facet.5c3)] -// CHECK:STDOUT: %.loc31_37.5: %Destroy.type = converted constants.%as_type.aee, constants.%impl.elem1.75b [symbolic = %impl.elem1 (constants.%impl.elem1.75b)] -// CHECK:STDOUT: %.loc31_37.6: %Destroy.type = converted constants.%as_type.aee, constants.%impl.elem1.75b [symbolic = %impl.elem1 (constants.%impl.elem1.75b)] -// CHECK:STDOUT: %specific_impl_fn.loc31_37.2: = specific_impl_function %impl.elem3.loc31_37.1, @Iterate.WithSelf.Next(constants.%Iterate.facet.5c3) [symbolic = %specific_impl_fn.loc31_37.5 (constants.%specific_impl_fn.80c)] +// CHECK:STDOUT: %Iterate.facet.loc31_37.3: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.01e) [symbolic = %Iterate.facet.loc31_37.5 (constants.%Iterate.facet.467)] +// CHECK:STDOUT: %.loc31_37.3: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc31_37.3 [symbolic = %Iterate.facet.loc31_37.5 (constants.%Iterate.facet.467)] +// CHECK:STDOUT: %Iterate.facet.loc31_37.4: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.01e) [symbolic = %Iterate.facet.loc31_37.5 (constants.%Iterate.facet.467)] +// CHECK:STDOUT: %.loc31_37.4: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc31_37.4 [symbolic = %Iterate.facet.loc31_37.5 (constants.%Iterate.facet.467)] +// CHECK:STDOUT: %.loc31_37.5: %Destroy.type = converted constants.%as_type.db9, constants.%impl.elem1.d56 [symbolic = %impl.elem1 (constants.%impl.elem1.d56)] +// CHECK:STDOUT: %.loc31_37.6: %Destroy.type = converted constants.%as_type.db9, constants.%impl.elem1.d56 [symbolic = %impl.elem1 (constants.%impl.elem1.d56)] +// CHECK:STDOUT: %specific_impl_fn.loc31_37.2: = specific_impl_function %impl.elem3.loc31_37.1, @Iterate.WithSelf.Next(constants.%Iterate.facet.467) [symbolic = %specific_impl_fn.loc31_37.5 (constants.%specific_impl_fn.5ea)] // CHECK:STDOUT: %bound_method.loc31_37.4: = bound_method %r.ref, %specific_impl_fn.loc31_37.2 -// CHECK:STDOUT: %.loc31_37.7: ref %Optional.a40 = temporary_storage -// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.a40 to %.loc31_37.7 = call %bound_method.loc31_37.4(%r.ref, %addr.loc31) -// CHECK:STDOUT: %.loc31_37.8: ref %Optional.a40 = temporary %.loc31_37.7, %Iterate.WithSelf.Next.call -// CHECK:STDOUT: %.loc31_37.9: %Optional.HasValue.type.fe3 = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.b3f) [concrete = constants.%Optional.HasValue.cb1] -// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.fe3 = name_ref HasValue, %.loc31_37.9 [concrete = constants.%Optional.HasValue.cb1] +// CHECK:STDOUT: %.loc31_37.7: ref %Optional.e69 = temporary_storage +// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.e69 to %.loc31_37.7 = call %bound_method.loc31_37.4(%r.ref, %addr.loc31) +// CHECK:STDOUT: %.loc31_37.8: ref %Optional.e69 = temporary %.loc31_37.7, %Iterate.WithSelf.Next.call +// CHECK:STDOUT: %.loc31_37.9: %Optional.HasValue.type.c61 = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.b3c) [concrete = constants.%Optional.HasValue.ba9d] +// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.c61 = name_ref HasValue, %.loc31_37.9 [concrete = constants.%Optional.HasValue.ba9d] // CHECK:STDOUT: %Optional.HasValue.bound: = bound_method %.loc31_37.8, %HasValue.ref -// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%OptionalStorage.facet.b3f) [concrete = constants.%Optional.HasValue.specific_fn.048] +// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%OptionalStorage.facet.b3c) [concrete = constants.%Optional.HasValue.specific_fn.524] // CHECK:STDOUT: %bound_method.loc31_37.5: = bound_method %.loc31_37.8, %Optional.HasValue.specific_fn -// CHECK:STDOUT: %.loc31_37.10: %Optional.a40 = acquire_value %.loc31_37.8 +// CHECK:STDOUT: %.loc31_37.10: %Optional.e69 = acquire_value %.loc31_37.8 // CHECK:STDOUT: %Optional.HasValue.call: init bool = call %bound_method.loc31_37.5(%.loc31_37.10) // CHECK:STDOUT: %.loc31_37.11: bool = value_of_initializer %Optional.HasValue.call // CHECK:STDOUT: %.loc31_37.12: bool = converted %Optional.HasValue.call, %.loc31_37.11 // CHECK:STDOUT: if %.loc31_37.12 br !for.body else br !for.done // CHECK:STDOUT: // CHECK:STDOUT: !for.body: -// CHECK:STDOUT: %.loc31_37.13: %Optional.Get.type.316 = specific_constant imports.%Core.import_ref.dab, @Optional(constants.%OptionalStorage.facet.b3f) [concrete = constants.%Optional.Get.4e3] -// CHECK:STDOUT: %Get.ref: %Optional.Get.type.316 = name_ref Get, %.loc31_37.13 [concrete = constants.%Optional.Get.4e3] +// CHECK:STDOUT: %.loc31_37.13: %Optional.Get.type.394 = specific_constant imports.%Core.import_ref.dab, @Optional(constants.%OptionalStorage.facet.b3c) [concrete = constants.%Optional.Get.da9] +// CHECK:STDOUT: %Get.ref: %Optional.Get.type.394 = name_ref Get, %.loc31_37.13 [concrete = constants.%Optional.Get.da9] // CHECK:STDOUT: %Optional.Get.bound: = bound_method %.loc31_37.8, %Get.ref -// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%OptionalStorage.facet.b3f) [concrete = constants.%Optional.Get.specific_fn.5ce] +// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%OptionalStorage.facet.b3c) [concrete = constants.%Optional.Get.specific_fn.f41] // CHECK:STDOUT: %bound_method.loc31_37.6: = bound_method %.loc31_37.8, %Optional.Get.specific_fn // CHECK:STDOUT: %.loc31_37.14: ref %ValueType = temporary_storage -// CHECK:STDOUT: %.loc31_37.15: %Optional.a40 = acquire_value %.loc31_37.8 +// CHECK:STDOUT: %.loc31_37.15: %Optional.e69 = acquire_value %.loc31_37.8 // CHECK:STDOUT: %Optional.Get.call: init %ValueType to %.loc31_37.14 = call %bound_method.loc31_37.6(%.loc31_37.15) // CHECK:STDOUT: %.loc31_37.16: ref %ValueType = temporary %.loc31_37.14, %Optional.Get.call // CHECK:STDOUT: %.loc31_37.17: %ValueType = acquire_value %.loc31_37.16 @@ -3643,52 +4756,104 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %.loc32_9.1: %ptr.69c = as_compatible %addr.loc32 // CHECK:STDOUT: %.loc32_9.2: %ptr.69c = converted %addr.loc32, %.loc32_9.1 // CHECK:STDOUT: %operator_PlusEqual__carbon_thunk.call: ref %ValueType = call imports.%operator_PlusEqual__carbon_thunk.decl(%sum.ref, %.loc32_9.2) -// CHECK:STDOUT: %ValueType.Op.bound.loc31: = bound_method %.loc31_37.16, constants.%ValueType.Op.4ec7f2.1 -// CHECK:STDOUT: %Op.ref.loc31: %ValueType.cpp_destructor.type = name_ref Op, imports.%ValueType.cpp_destructor.decl [concrete = constants.%ValueType.cpp_destructor] -// CHECK:STDOUT: %ValueType.cpp_destructor.bound.loc31: = bound_method %.loc31_37.16, %Op.ref.loc31 -// CHECK:STDOUT: %ValueType.cpp_destructor.call.loc31: init %empty_tuple.type = call %ValueType.cpp_destructor.bound.loc31(%.loc31_37.16) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc31_37.1: = bound_method %.loc31_37.8, constants.%Destroy.WithSelf.Op.403171.7 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc31_37.1: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc31_37.1(%.loc31_37.8) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc31_37.1: = bound_method %.loc31_37.16, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc31_37.1: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc31_37.1(%.loc31_37.16) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc31_37.2: = bound_method %.loc31_37.8, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.8 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc31_37.2: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc31_37.2(%.loc31_37.8) // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.done: -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc31_37.2: = bound_method %.loc31_37.8, constants.%Destroy.WithSelf.Op.403171.7 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc31_37.2: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc31_37.2(%.loc31_37.8) -// CHECK:STDOUT: %impl.elem0.loc31_37.1: @TestIterate.%.loc31_37.22 (%.fbd) = impl_witness_access constants.%Destroy.lookup_impl_witness.3ea, element0 [symbolic = %impl.elem0.loc31_37.2 (constants.%impl.elem0.bb2)] -// CHECK:STDOUT: %bound_method.loc31_37.7: = bound_method %var, %impl.elem0.loc31_37.1 -// CHECK:STDOUT: %.loc31_37.18: %Destroy.type = converted constants.%as_type.aee, constants.%impl.elem1.75b [symbolic = %impl.elem1 (constants.%impl.elem1.75b)] -// CHECK:STDOUT: %.loc31_37.19: %Destroy.type = converted constants.%as_type.aee, constants.%impl.elem1.75b [symbolic = %impl.elem1 (constants.%impl.elem1.75b)] -// CHECK:STDOUT: %specific_impl_fn.loc31_37.3: = specific_impl_function %impl.elem0.loc31_37.1, @Destroy.WithSelf.Op.1(constants.%impl.elem1.75b) [symbolic = %specific_impl_fn.loc31_37.6 (constants.%specific_impl_fn.fa3)] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc31_37.3: = bound_method %.loc31_37.8, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.8 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc31_37.3: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc31_37.3(%.loc31_37.8) +// CHECK:STDOUT: %impl.elem2.loc31_37.2: @TestIterate.%.loc31_37.22 (%.c10) = impl_witness_access constants.%Destroy.lookup_impl_witness.d0e, element2 [symbolic = %impl.elem2.loc31_37.4 (constants.%impl.elem2.5c5)] +// CHECK:STDOUT: %bound_method.loc31_37.7: = bound_method %var, %impl.elem2.loc31_37.2 +// CHECK:STDOUT: %.loc31_37.18: %Destroy.type = converted constants.%as_type.db9, constants.%impl.elem1.d56 [symbolic = %impl.elem1 (constants.%impl.elem1.d56)] +// CHECK:STDOUT: %.loc31_37.19: %Destroy.type = converted constants.%as_type.db9, constants.%impl.elem1.d56 [symbolic = %impl.elem1 (constants.%impl.elem1.d56)] +// CHECK:STDOUT: %specific_impl_fn.loc31_37.3: = specific_impl_function %impl.elem2.loc31_37.2, @Destroy.WithSelf.SelfDestruct.1(constants.%impl.elem1.d56) [symbolic = %specific_impl_fn.loc31_37.6 (constants.%specific_impl_fn.17d)] // CHECK:STDOUT: %bound_method.loc31_37.8: = bound_method %var, %specific_impl_fn.loc31_37.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc31_37.3: init %empty_tuple.type = call %bound_method.loc31_37.8(%var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc31_37.4: init %empty_tuple.type = call %bound_method.loc31_37.8(%var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc31_37.1(%self.param: ref %.be1) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc31_37.1(%self.param: ref %.be1) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc31_37.2(%self.param: ref %MaybeUnformed.e16) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc31_37.1(%self.param: ref %.be1) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc31_37.1(%self.param: ref %.be1) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc31_37.2(%self.param: ref %MaybeUnformed.e45) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc31_37.2(%self.param: ref %MaybeUnformed.e45) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc31_37.2(%self.param: ref %MaybeUnformed.e45) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc31_37.3(%self.param: ref bool) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc31_37.3(%self.param: ref bool) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc31_37.4(%self.param: ref %struct_type.value.has_value.baa) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc31_37.3(%self.param: ref bool) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc31_37.4(%self.param: ref %struct_type.value.has_value.619) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc31_37.5(%self.param: ref %DefaultOptionalStorage.8b2) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc31_37.4(%self.param: ref %struct_type.value.has_value.619) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc31_37.4(%self.param: ref %struct_type.value.has_value.619) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.5(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc31_37.5(%self.param: ref %DefaultOptionalStorage.53f) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc31_37.6(%self.param: ref %Optional.a40) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc31_37.5(%self.param: ref %DefaultOptionalStorage.53f) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc31_37.5(%self.param: ref %DefaultOptionalStorage.53f) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.6(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.5(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc31_37.6(%self.param: ref %Optional.e69) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc31_37.6(%self.param: ref %Optional.e69) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc31_37.6(%self.param: ref %Optional.e69) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.7(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.6(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3699,13 +4864,13 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %i.patt: %pattern_type.c43 = value_binding_pattern i [concrete = constants.%i.patt] // CHECK:STDOUT: } // CHECK:STDOUT: %c.ref: %ConstRange = name_ref c, %c -// CHECK:STDOUT: %impl.elem2: %.a1c = impl_witness_access constants.%Iterate.impl_witness.6f6, element2 [concrete = constants.%T.as_type.as.Iterate.impl.NewCursor.126] +// CHECK:STDOUT: %impl.elem2: %.182 = impl_witness_access constants.%Iterate.impl_witness.6b0, element2 [concrete = constants.%T.as_type.as.Iterate.impl.NewCursor.fa5] // CHECK:STDOUT: %bound_method.loc45_37.1: = bound_method %c.ref, %impl.elem2 -// CHECK:STDOUT: %facet_value.loc45_37.1: %CppRange_where.type.d682d6.1 = facet_value constants.%ConstRange, (constants.%custom_witness.c4c, constants.%custom_witness.202, constants.%custom_witness.116, constants.%custom_witness.a147d4.1, constants.%custom_witness.5be, constants.%custom_witness.c31, constants.%custom_witness.e21, constants.%custom_witness.a147d4.2) [concrete = constants.%facet_value.289] -// CHECK:STDOUT: %.loc45_37.1: %CppRange_where.type.d682d6.1 = converted constants.%ConstRange, %facet_value.loc45_37.1 [concrete = constants.%facet_value.289] -// CHECK:STDOUT: %facet_value.loc45_37.2: %CppRange_where.type.d682d6.1 = facet_value constants.%ConstRange, (constants.%custom_witness.c4c, constants.%custom_witness.202, constants.%custom_witness.116, constants.%custom_witness.a147d4.1, constants.%custom_witness.5be, constants.%custom_witness.c31, constants.%custom_witness.e21, constants.%custom_witness.a147d4.2) [concrete = constants.%facet_value.289] -// CHECK:STDOUT: %.loc45_37.2: %CppRange_where.type.d682d6.1 = converted constants.%ConstRange, %facet_value.loc45_37.2 [concrete = constants.%facet_value.289] -// CHECK:STDOUT: %specific_fn.loc45_37.1: = specific_function %impl.elem2, @T.as_type.as.Iterate.impl.NewCursor(constants.%facet_value.289) [concrete = constants.%T.as_type.as.Iterate.impl.NewCursor.specific_fn] +// CHECK:STDOUT: %facet_value.loc45_37.1: %CppRange_where.type.d682d6.1 = facet_value constants.%ConstRange, (constants.%custom_witness.226, constants.%custom_witness.202, constants.%custom_witness.116, constants.%custom_witness.429ac1.1, constants.%custom_witness.5be, constants.%custom_witness.c31, constants.%custom_witness.e21, constants.%custom_witness.429ac1.2) [concrete = constants.%facet_value.e8b] +// CHECK:STDOUT: %.loc45_37.1: %CppRange_where.type.d682d6.1 = converted constants.%ConstRange, %facet_value.loc45_37.1 [concrete = constants.%facet_value.e8b] +// CHECK:STDOUT: %facet_value.loc45_37.2: %CppRange_where.type.d682d6.1 = facet_value constants.%ConstRange, (constants.%custom_witness.226, constants.%custom_witness.202, constants.%custom_witness.116, constants.%custom_witness.429ac1.1, constants.%custom_witness.5be, constants.%custom_witness.c31, constants.%custom_witness.e21, constants.%custom_witness.429ac1.2) [concrete = constants.%facet_value.e8b] +// CHECK:STDOUT: %.loc45_37.2: %CppRange_where.type.d682d6.1 = converted constants.%ConstRange, %facet_value.loc45_37.2 [concrete = constants.%facet_value.e8b] +// CHECK:STDOUT: %specific_fn.loc45_37.1: = specific_function %impl.elem2, @T.as_type.as.Iterate.impl.NewCursor(constants.%facet_value.e8b) [concrete = constants.%T.as_type.as.Iterate.impl.NewCursor.specific_fn] // CHECK:STDOUT: %bound_method.loc45_37.2: = bound_method %c.ref, %specific_fn.loc45_37.1 // CHECK:STDOUT: %var: ref %tuple.type.7a6 = var_storage invalid // CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.call: init %tuple.type.7a6 to %var = call %bound_method.loc45_37.2(%c.ref) @@ -3714,36 +4879,36 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: // CHECK:STDOUT: !for.next: // CHECK:STDOUT: %addr.loc45: %ptr.d33 = addr_of %var -// CHECK:STDOUT: %impl.elem3: %.eab = impl_witness_access constants.%Iterate.impl_witness.6f6, element3 [concrete = constants.%T.as_type.as.Iterate.impl.Next.c7f] +// CHECK:STDOUT: %impl.elem3: %.883 = impl_witness_access constants.%Iterate.impl_witness.6b0, element3 [concrete = constants.%T.as_type.as.Iterate.impl.Next.e9b] // CHECK:STDOUT: %bound_method.loc45_37.3: = bound_method %c.ref, %impl.elem3 -// CHECK:STDOUT: %facet_value.loc45_37.3: %CppRange_where.type.d682d6.1 = facet_value constants.%ConstRange, (constants.%custom_witness.c4c, constants.%custom_witness.202, constants.%custom_witness.116, constants.%custom_witness.a147d4.1, constants.%custom_witness.5be, constants.%custom_witness.c31, constants.%custom_witness.e21, constants.%custom_witness.a147d4.2) [concrete = constants.%facet_value.289] -// CHECK:STDOUT: %.loc45_37.3: %CppRange_where.type.d682d6.1 = converted constants.%ConstRange, %facet_value.loc45_37.3 [concrete = constants.%facet_value.289] -// CHECK:STDOUT: %facet_value.loc45_37.4: %CppRange_where.type.d682d6.1 = facet_value constants.%ConstRange, (constants.%custom_witness.c4c, constants.%custom_witness.202, constants.%custom_witness.116, constants.%custom_witness.a147d4.1, constants.%custom_witness.5be, constants.%custom_witness.c31, constants.%custom_witness.e21, constants.%custom_witness.a147d4.2) [concrete = constants.%facet_value.289] -// CHECK:STDOUT: %.loc45_37.4: %CppRange_where.type.d682d6.1 = converted constants.%ConstRange, %facet_value.loc45_37.4 [concrete = constants.%facet_value.289] -// CHECK:STDOUT: %specific_fn.loc45_37.2: = specific_function %impl.elem3, @T.as_type.as.Iterate.impl.Next(constants.%facet_value.289) [concrete = constants.%T.as_type.as.Iterate.impl.Next.specific_fn] +// CHECK:STDOUT: %facet_value.loc45_37.3: %CppRange_where.type.d682d6.1 = facet_value constants.%ConstRange, (constants.%custom_witness.226, constants.%custom_witness.202, constants.%custom_witness.116, constants.%custom_witness.429ac1.1, constants.%custom_witness.5be, constants.%custom_witness.c31, constants.%custom_witness.e21, constants.%custom_witness.429ac1.2) [concrete = constants.%facet_value.e8b] +// CHECK:STDOUT: %.loc45_37.3: %CppRange_where.type.d682d6.1 = converted constants.%ConstRange, %facet_value.loc45_37.3 [concrete = constants.%facet_value.e8b] +// CHECK:STDOUT: %facet_value.loc45_37.4: %CppRange_where.type.d682d6.1 = facet_value constants.%ConstRange, (constants.%custom_witness.226, constants.%custom_witness.202, constants.%custom_witness.116, constants.%custom_witness.429ac1.1, constants.%custom_witness.5be, constants.%custom_witness.c31, constants.%custom_witness.e21, constants.%custom_witness.429ac1.2) [concrete = constants.%facet_value.e8b] +// CHECK:STDOUT: %.loc45_37.4: %CppRange_where.type.d682d6.1 = converted constants.%ConstRange, %facet_value.loc45_37.4 [concrete = constants.%facet_value.e8b] +// CHECK:STDOUT: %specific_fn.loc45_37.2: = specific_function %impl.elem3, @T.as_type.as.Iterate.impl.Next(constants.%facet_value.e8b) [concrete = constants.%T.as_type.as.Iterate.impl.Next.specific_fn] // CHECK:STDOUT: %bound_method.loc45_37.4: = bound_method %c.ref, %specific_fn.loc45_37.2 -// CHECK:STDOUT: %.loc45_37.5: ref %Optional.a40 = temporary_storage -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.call: init %Optional.a40 to %.loc45_37.5 = call %bound_method.loc45_37.4(%c.ref, %addr.loc45) -// CHECK:STDOUT: %.loc45_37.6: ref %Optional.a40 = temporary %.loc45_37.5, %T.as_type.as.Iterate.impl.Next.call -// CHECK:STDOUT: %.loc45_37.7: %Optional.HasValue.type.fe3 = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.b3f) [concrete = constants.%Optional.HasValue.cb1] -// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.fe3 = name_ref HasValue, %.loc45_37.7 [concrete = constants.%Optional.HasValue.cb1] +// CHECK:STDOUT: %.loc45_37.5: ref %Optional.e69 = temporary_storage +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.call: init %Optional.e69 to %.loc45_37.5 = call %bound_method.loc45_37.4(%c.ref, %addr.loc45) +// CHECK:STDOUT: %.loc45_37.6: ref %Optional.e69 = temporary %.loc45_37.5, %T.as_type.as.Iterate.impl.Next.call +// CHECK:STDOUT: %.loc45_37.7: %Optional.HasValue.type.c61 = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.b3c) [concrete = constants.%Optional.HasValue.ba9d] +// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.c61 = name_ref HasValue, %.loc45_37.7 [concrete = constants.%Optional.HasValue.ba9d] // CHECK:STDOUT: %Optional.HasValue.bound: = bound_method %.loc45_37.6, %HasValue.ref -// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%OptionalStorage.facet.b3f) [concrete = constants.%Optional.HasValue.specific_fn.048] +// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%OptionalStorage.facet.b3c) [concrete = constants.%Optional.HasValue.specific_fn.524] // CHECK:STDOUT: %bound_method.loc45_37.5: = bound_method %.loc45_37.6, %Optional.HasValue.specific_fn -// CHECK:STDOUT: %.loc45_37.8: %Optional.a40 = acquire_value %.loc45_37.6 +// CHECK:STDOUT: %.loc45_37.8: %Optional.e69 = acquire_value %.loc45_37.6 // CHECK:STDOUT: %Optional.HasValue.call: init bool = call %bound_method.loc45_37.5(%.loc45_37.8) // CHECK:STDOUT: %.loc45_37.9: bool = value_of_initializer %Optional.HasValue.call // CHECK:STDOUT: %.loc45_37.10: bool = converted %Optional.HasValue.call, %.loc45_37.9 // CHECK:STDOUT: if %.loc45_37.10 br !for.body else br !for.done // CHECK:STDOUT: // CHECK:STDOUT: !for.body: -// CHECK:STDOUT: %.loc45_37.11: %Optional.Get.type.316 = specific_constant imports.%Core.import_ref.dab, @Optional(constants.%OptionalStorage.facet.b3f) [concrete = constants.%Optional.Get.4e3] -// CHECK:STDOUT: %Get.ref: %Optional.Get.type.316 = name_ref Get, %.loc45_37.11 [concrete = constants.%Optional.Get.4e3] +// CHECK:STDOUT: %.loc45_37.11: %Optional.Get.type.394 = specific_constant imports.%Core.import_ref.dab, @Optional(constants.%OptionalStorage.facet.b3c) [concrete = constants.%Optional.Get.da9] +// CHECK:STDOUT: %Get.ref: %Optional.Get.type.394 = name_ref Get, %.loc45_37.11 [concrete = constants.%Optional.Get.da9] // CHECK:STDOUT: %Optional.Get.bound: = bound_method %.loc45_37.6, %Get.ref -// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%OptionalStorage.facet.b3f) [concrete = constants.%Optional.Get.specific_fn.5ce] +// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%OptionalStorage.facet.b3c) [concrete = constants.%Optional.Get.specific_fn.f41] // CHECK:STDOUT: %bound_method.loc45_37.6: = bound_method %.loc45_37.6, %Optional.Get.specific_fn // CHECK:STDOUT: %.loc45_37.12: ref %ValueType = temporary_storage -// CHECK:STDOUT: %.loc45_37.13: %Optional.a40 = acquire_value %.loc45_37.6 +// CHECK:STDOUT: %.loc45_37.13: %Optional.e69 = acquire_value %.loc45_37.6 // CHECK:STDOUT: %Optional.Get.call: init %ValueType to %.loc45_37.12 = call %bound_method.loc45_37.6(%.loc45_37.13) // CHECK:STDOUT: %.loc45_37.14: ref %ValueType = temporary %.loc45_37.12, %Optional.Get.call // CHECK:STDOUT: %.loc45_37.15: %ValueType = acquire_value %.loc45_37.14 @@ -3760,19 +4925,17 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %.loc46_9.1: %ptr.69c = as_compatible %addr.loc46 // CHECK:STDOUT: %.loc46_9.2: %ptr.69c = converted %addr.loc46, %.loc46_9.1 // CHECK:STDOUT: %operator_PlusEqual__carbon_thunk.call: ref %ValueType = call imports.%operator_PlusEqual__carbon_thunk.decl(%sum.ref, %.loc46_9.2) -// CHECK:STDOUT: %ValueType.Op.bound.loc45: = bound_method %.loc45_37.14, constants.%ValueType.Op.4ec7f2.1 -// CHECK:STDOUT: %Op.ref.loc45: %ValueType.cpp_destructor.type = name_ref Op, imports.%ValueType.cpp_destructor.decl [concrete = constants.%ValueType.cpp_destructor] -// CHECK:STDOUT: %ValueType.cpp_destructor.bound.loc45: = bound_method %.loc45_37.14, %Op.ref.loc45 -// CHECK:STDOUT: %ValueType.cpp_destructor.call.loc45: init %empty_tuple.type = call %ValueType.cpp_destructor.bound.loc45(%.loc45_37.14) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc45_37.1: = bound_method %.loc45_37.6, constants.%Destroy.WithSelf.Op.403171.7 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc45_37.1: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc45_37.1(%.loc45_37.6) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc45_37.1: = bound_method %.loc45_37.14, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc45_37.1: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc45_37.1(%.loc45_37.14) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc45_37.2: = bound_method %.loc45_37.6, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.8 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc45_37.2: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc45_37.2(%.loc45_37.6) // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.done: -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc45_37.2: = bound_method %.loc45_37.6, constants.%Destroy.WithSelf.Op.403171.7 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc45_37.2: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc45_37.2(%.loc45_37.6) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc45_37.3: = bound_method %var, constants.%Destroy.WithSelf.Op.403171.8 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc45_37.3: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc45_37.3(%var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc45_37.3: = bound_method %.loc45_37.6, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.8 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc45_37.3: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc45_37.3(%.loc45_37.6) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc45_37.4: = bound_method %var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.11 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc45_37.4: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc45_37.4(%var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3780,14 +4943,14 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %R.patt.loc27_17.2 => constants.%R.patt // CHECK:STDOUT: %R.loc27_17.1 => constants.%R // CHECK:STDOUT: %R.as_type.loc27_79.1 => constants.%R.as_type -// CHECK:STDOUT: %pattern_type => constants.%pattern_type.a97 -// CHECK:STDOUT: %r.param_patt.loc27_77.2 => constants.%r.param_patt.8bc -// CHECK:STDOUT: %r.patt.loc27_77.2 => constants.%r.patt.440 +// CHECK:STDOUT: %pattern_type => constants.%pattern_type.053 +// CHECK:STDOUT: %r.param_patt.loc27_77.2 => constants.%r.param_patt.75e +// CHECK:STDOUT: %r.patt.loc27_77.2 => constants.%r.patt.82a // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @TestIterate(constants.%facet_value.142) { +// CHECK:STDOUT: specific @TestIterate(constants.%facet_value.c77) { // CHECK:STDOUT: %R.patt.loc27_17.2 => constants.%R.patt -// CHECK:STDOUT: %R.loc27_17.1 => constants.%facet_value.142 +// CHECK:STDOUT: %R.loc27_17.1 => constants.%facet_value.c77 // CHECK:STDOUT: %R.as_type.loc27_79.1 => constants.%ConstRange // CHECK:STDOUT: %pattern_type => constants.%pattern_type.c1d // CHECK:STDOUT: %r.param_patt.loc27_77.2 => constants.%r.param_patt.ac5 @@ -3795,25 +4958,25 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc27 => constants.%complete_type.357 -// CHECK:STDOUT: %Iterate.lookup_impl_witness => constants.%Iterate.impl_witness.6f6 -// CHECK:STDOUT: %Iterate.facet.loc31_37.5 => constants.%Iterate.facet.8d2 -// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type => constants.%Iterate.WithSelf.NewCursor.type.c36 -// CHECK:STDOUT: %.loc31_37.20 => constants.%.a1c -// CHECK:STDOUT: %impl.elem2.loc31_37.2 => constants.%T.as_type.as.Iterate.impl.NewCursor.126 +// CHECK:STDOUT: %Iterate.lookup_impl_witness => constants.%Iterate.impl_witness.6b0 +// CHECK:STDOUT: %Iterate.facet.loc31_37.5 => constants.%Iterate.facet.80d +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type => constants.%Iterate.WithSelf.NewCursor.type.c59 +// CHECK:STDOUT: %.loc31_37.20 => constants.%.182 +// CHECK:STDOUT: %impl.elem2.loc31_37.3 => constants.%T.as_type.as.Iterate.impl.NewCursor.fa5 // CHECK:STDOUT: %specific_impl_fn.loc31_37.4 => constants.%T.as_type.as.Iterate.impl.NewCursor.specific_fn -// CHECK:STDOUT: %impl.elem1 => constants.%Destroy.facet.9e5 +// CHECK:STDOUT: %impl.elem1 => constants.%Destroy.facet.d83 // CHECK:STDOUT: %as_type => constants.%tuple.type.7a6 // CHECK:STDOUT: %require_complete.1 => constants.%complete_type.cf0 // CHECK:STDOUT: %ptr => constants.%ptr.d33 -// CHECK:STDOUT: %Iterate.WithSelf.Next.type => constants.%Iterate.WithSelf.Next.type.01e -// CHECK:STDOUT: %.loc31_37.21 => constants.%.eab -// CHECK:STDOUT: %impl.elem3.loc31_37.2 => constants.%T.as_type.as.Iterate.impl.Next.c7f +// CHECK:STDOUT: %Iterate.WithSelf.Next.type => constants.%Iterate.WithSelf.Next.type.5e6 +// CHECK:STDOUT: %.loc31_37.21 => constants.%.883 +// CHECK:STDOUT: %impl.elem3.loc31_37.2 => constants.%T.as_type.as.Iterate.impl.Next.e9b // CHECK:STDOUT: %specific_impl_fn.loc31_37.5 => constants.%T.as_type.as.Iterate.impl.Next.specific_fn -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.085 -// CHECK:STDOUT: %.loc31_37.22 => constants.%.83b -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.6c4ec3.8 -// CHECK:STDOUT: %impl.elem0.loc31_37.2 => constants.%Destroy.WithSelf.Op.403171.8 -// CHECK:STDOUT: %specific_impl_fn.loc31_37.6 => constants.%Destroy.WithSelf.Op.403171.8 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.036 +// CHECK:STDOUT: %.loc31_37.22 => constants.%.6cc +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.f8f19d.8 +// CHECK:STDOUT: %impl.elem2.loc31_37.4 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.11 +// CHECK:STDOUT: %specific_impl_fn.loc31_37.6 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.11 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_adl_returns_different_types_mutable.carbon @@ -3822,6 +4985,7 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: type: type = facet_type [concrete] // CHECK:STDOUT: %Iterate.type: type = facet_type <@Iterate> [concrete] // CHECK:STDOUT: %OptionalStorage.type: type = facet_type <@OptionalStorage> [concrete] +// CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %facet_type.f48: type = facet_type <@Destroy & @Copy> [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] @@ -3839,65 +5003,108 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %.Self.500: %Iterate.type = symbolic_binding .Self [symbolic_self] // CHECK:STDOUT: %ValueType: type = class_type @ValueType [concrete] // CHECK:STDOUT: %pattern_type.d2d: type = pattern_type %ValueType [concrete] -// CHECK:STDOUT: %ValueType.cpp_destructor.type: type = fn_type @ValueType.cpp_destructor [concrete] -// CHECK:STDOUT: %ValueType.cpp_destructor: %ValueType.cpp_destructor.type = struct_value () [concrete] -// CHECK:STDOUT: %ValueType.Op.type.db6aa9.1: type = fn_type @ValueType.Op.1 [concrete] -// CHECK:STDOUT: %ValueType.Op.4590ed.1: %ValueType.Op.type.db6aa9.1 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.d86: = custom_witness (%ValueType.Op.4590ed.1), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc27 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc27 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %ValueType.SubobjectDestroy.type: type = fn_type @ValueType.SubobjectDestroy [concrete] +// CHECK:STDOUT: %ValueType.SubobjectDestroy: %ValueType.SubobjectDestroy.type = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.3ec: = custom_witness (%Destroy.WithSelf.Op.403171.2, %ValueType.SubobjectDestroy, %Destroy.WithSelf.SelfDestruct.db3fdb.2), @Destroy [concrete] // CHECK:STDOUT: %const.91f: type = const_type %ValueType [concrete] // CHECK:STDOUT: %ptr.5f4: type = ptr_type %const.91f [concrete] // CHECK:STDOUT: %ptr.9c6: type = ptr_type %ValueType [concrete] -// CHECK:STDOUT: %ValueType.Op.type.db6aa9.2: type = fn_type @ValueType.Op.2 [concrete] -// CHECK:STDOUT: %ValueType.Op.4590ed.2: %ValueType.Op.type.db6aa9.2 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.587: = custom_witness (%ValueType.Op.4590ed.2), @Copy [concrete] -// CHECK:STDOUT: %facet_value.56f: %facet_type.f48 = facet_value %ValueType, (%custom_witness.d86, %custom_witness.587) [concrete] +// CHECK:STDOUT: %ValueType.Op.type: type = fn_type @ValueType.Op [concrete] +// CHECK:STDOUT: %ValueType.Op: %ValueType.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.587: = custom_witness (%ValueType.Op), @Copy [concrete] +// CHECK:STDOUT: %facet_value.14c: %facet_type.f48 = facet_value %ValueType, (%custom_witness.3ec, %custom_witness.587) [concrete] // CHECK:STDOUT: %Iterate.lookup_impl_witness.1d8: = lookup_impl_witness %.Self.500, @Iterate [symbolic_self] // CHECK:STDOUT: %impl.elem0.294: %facet_type.f48 = impl_witness_access %Iterate.lookup_impl_witness.1d8, element0 [symbolic_self] -// CHECK:STDOUT: %Iterate_where.type.f03: type = facet_type <@Iterate where %impl.elem0.294 = %facet_value.56f> [concrete] -// CHECK:STDOUT: %pattern_type.dde: type = pattern_type %Iterate_where.type.f03 [concrete] -// CHECK:STDOUT: %R.patt: %pattern_type.dde = symbolic_binding_pattern R, 0 [symbolic] -// CHECK:STDOUT: %R: %Iterate_where.type.f03 = symbolic_binding R, 0 [symbolic] +// CHECK:STDOUT: %Iterate_where.type.9df: type = facet_type <@Iterate where %impl.elem0.294 = %facet_value.14c> [concrete] +// CHECK:STDOUT: %pattern_type.e3a: type = pattern_type %Iterate_where.type.9df [concrete] +// CHECK:STDOUT: %R.patt: %pattern_type.e3a = symbolic_binding_pattern R, 0 [symbolic] +// CHECK:STDOUT: %R: %Iterate_where.type.9df = symbolic_binding R, 0 [symbolic] // CHECK:STDOUT: %R.as_type: type = facet_access_type %R [symbolic] -// CHECK:STDOUT: %pattern_type.acd: type = pattern_type %R.as_type [symbolic] -// CHECK:STDOUT: %r.param_patt: %pattern_type.acd = value_param_pattern [symbolic] -// CHECK:STDOUT: %r.patt: %pattern_type.acd = wrapper_binding_pattern r, %r.param_patt [symbolic] +// CHECK:STDOUT: %pattern_type.0bc: type = pattern_type %R.as_type [symbolic] +// CHECK:STDOUT: %r.param_patt: %pattern_type.0bc = value_param_pattern [symbolic] +// CHECK:STDOUT: %r.patt: %pattern_type.0bc = wrapper_binding_pattern r, %r.param_patt [symbolic] // CHECK:STDOUT: %i.patt: %pattern_type.d2d = value_binding_pattern i [concrete] -// CHECK:STDOUT: %Iterate.lookup_impl_witness.698: = lookup_impl_witness %R, @Iterate [symbolic] -// CHECK:STDOUT: %Iterate.facet.122: %Iterate.type = facet_value %R.as_type, (%Iterate.lookup_impl_witness.698) [symbolic] -// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.d16: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.122) [symbolic] -// CHECK:STDOUT: %Iterate.WithSelf.Next.type.2f3: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.122) [symbolic] -// CHECK:STDOUT: %.26d: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.d16, %Iterate.facet.122 [symbolic] -// CHECK:STDOUT: %impl.elem2.d05: %.26d = impl_witness_access %Iterate.lookup_impl_witness.698, element2 [symbolic] -// CHECK:STDOUT: %impl.elem1.127: %Destroy.type = impl_witness_access %Iterate.lookup_impl_witness.698, element1 [symbolic] -// CHECK:STDOUT: %as_type.d08: type = facet_access_type %impl.elem1.127 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.342: = specific_impl_function %impl.elem2.d05, @Iterate.WithSelf.NewCursor(%Iterate.facet.122) [symbolic] -// CHECK:STDOUT: %ptr.2f2: type = ptr_type %as_type.d08 [symbolic] -// CHECK:STDOUT: %.25b: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.2f3, %Iterate.facet.122 [symbolic] -// CHECK:STDOUT: %impl.elem3.9e9: %.25b = impl_witness_access %Iterate.lookup_impl_witness.698, element3 [symbolic] -// CHECK:STDOUT: %DefaultOptionalStorage.d67: type = class_type @DefaultOptionalStorage, @DefaultOptionalStorage(%facet_value.56f) [concrete] -// CHECK:STDOUT: %OptionalStorage.impl_witness.2c9: = impl_witness imports.%OptionalStorage.impl_witness_table.460, @T.as_type.as.OptionalStorage.impl(%facet_value.56f) [concrete] -// CHECK:STDOUT: %OptionalStorage.facet.19b: %OptionalStorage.type = facet_value %ValueType, (%OptionalStorage.impl_witness.2c9) [concrete] -// CHECK:STDOUT: %Optional.40d: type = class_type @Optional, @Optional(%OptionalStorage.facet.19b) [concrete] -// CHECK:STDOUT: %specific_impl_fn.ee9: = specific_impl_function %impl.elem3.9e9, @Iterate.WithSelf.Next(%Iterate.facet.122) [symbolic] -// CHECK:STDOUT: %Optional.HasValue.type.5e1: type = fn_type @Optional.HasValue, @Optional(%OptionalStorage.facet.19b) [concrete] -// CHECK:STDOUT: %Optional.HasValue.d7c: %Optional.HasValue.type.5e1 = struct_value () [concrete] -// CHECK:STDOUT: %Optional.Get.type.1fe: type = fn_type @Optional.Get, @Optional(%OptionalStorage.facet.19b) [concrete] -// CHECK:STDOUT: %Optional.Get.6fd: %Optional.Get.type.1fe = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.facet.10d: %Destroy.type = facet_value %ValueType, (%custom_witness.d86) [concrete] -// CHECK:STDOUT: %MaybeUnformed.09f: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.10d) [concrete] +// CHECK:STDOUT: %Iterate.lookup_impl_witness.711: = lookup_impl_witness %R, @Iterate [symbolic] +// CHECK:STDOUT: %Iterate.facet.04e: %Iterate.type = facet_value %R.as_type, (%Iterate.lookup_impl_witness.711) [symbolic] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.aea: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.04e) [symbolic] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type.9d6: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.04e) [symbolic] +// CHECK:STDOUT: %.d1d: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.aea, %Iterate.facet.04e [symbolic] +// CHECK:STDOUT: %impl.elem2.bf8: %.d1d = impl_witness_access %Iterate.lookup_impl_witness.711, element2 [symbolic] +// CHECK:STDOUT: %impl.elem1.0e0: %Destroy.type = impl_witness_access %Iterate.lookup_impl_witness.711, element1 [symbolic] +// CHECK:STDOUT: %as_type.b30: type = facet_access_type %impl.elem1.0e0 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.d24: = specific_impl_function %impl.elem2.bf8, @Iterate.WithSelf.NewCursor(%Iterate.facet.04e) [symbolic] +// CHECK:STDOUT: %ptr.46a: type = ptr_type %as_type.b30 [symbolic] +// CHECK:STDOUT: %.b83: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.9d6, %Iterate.facet.04e [symbolic] +// CHECK:STDOUT: %impl.elem3.351: %.b83 = impl_witness_access %Iterate.lookup_impl_witness.711, element3 [symbolic] +// CHECK:STDOUT: %DefaultOptionalStorage.6f8: type = class_type @DefaultOptionalStorage, @DefaultOptionalStorage(%facet_value.14c) [concrete] +// CHECK:STDOUT: %OptionalStorage.impl_witness.323: = impl_witness imports.%OptionalStorage.impl_witness_table.460, @T.as_type.as.OptionalStorage.impl(%facet_value.14c) [concrete] +// CHECK:STDOUT: %OptionalStorage.facet.864: %OptionalStorage.type = facet_value %ValueType, (%OptionalStorage.impl_witness.323) [concrete] +// CHECK:STDOUT: %Optional.59e: type = class_type @Optional, @Optional(%OptionalStorage.facet.864) [concrete] +// CHECK:STDOUT: %pattern_type.9bf: type = pattern_type %Optional.59e [concrete] +// CHECK:STDOUT: %specific_impl_fn.946: = specific_impl_function %impl.elem3.351, @Iterate.WithSelf.Next(%Iterate.facet.04e) [symbolic] +// CHECK:STDOUT: %Optional.HasValue.type.22f: type = fn_type @Optional.HasValue, @Optional(%OptionalStorage.facet.864) [concrete] +// CHECK:STDOUT: %Optional.HasValue.c86: %Optional.HasValue.type.22f = struct_value () [concrete] +// CHECK:STDOUT: %Optional.Get.type.e57: type = fn_type @Optional.Get, @Optional(%OptionalStorage.facet.864) [concrete] +// CHECK:STDOUT: %Optional.Get.d4a: %Optional.Get.type.e57 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.facet.6cb: %Destroy.type = facet_value %ValueType, (%custom_witness.3ec) [concrete] +// CHECK:STDOUT: %MaybeUnformed.8ca: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.6cb) [concrete] // CHECK:STDOUT: %.dd1: type = maybe_unformed_type %ValueType [concrete] -// CHECK:STDOUT: %struct_type.value.has_value.d6e: type = struct_type {.value: %MaybeUnformed.09f, .has_value: bool} [concrete] -// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %Optional.HasValue.d7c, @Optional.HasValue(%OptionalStorage.facet.19b) [concrete] -// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Optional.Get.6fd, @Optional.Get(%OptionalStorage.facet.19b) [concrete] +// CHECK:STDOUT: %struct_type.value.has_value.786: type = struct_type {.value: %MaybeUnformed.8ca, .has_value: bool} [concrete] +// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %Optional.HasValue.c86, @Optional.HasValue(%OptionalStorage.facet.864) [concrete] +// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Optional.Get.d4a, @Optional.Get(%OptionalStorage.facet.864) [concrete] // CHECK:STDOUT: %operator_PlusEqual__carbon_thunk.type: type = fn_type @operator_PlusEqual__carbon_thunk [concrete] // CHECK:STDOUT: %operator_PlusEqual__carbon_thunk: %operator_PlusEqual__carbon_thunk.type = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.7: type = fn_type @Destroy.WithSelf.Op.loc31_44.6 [concrete] +// CHECK:STDOUT: %pattern_type.1d1: type = pattern_type %.dd1 [concrete] +// CHECK:STDOUT: %self.param_patt.964: %pattern_type.1d1 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.82f: %pattern_type.1d1 = wrapper_binding_pattern self, %self.param_patt.964 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc31_44.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc31_44.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.c42: type = pattern_type %MaybeUnformed.8ca [concrete] +// CHECK:STDOUT: %self.param_patt.7e6: %pattern_type.c42 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.c0f: %pattern_type.c42 = wrapper_binding_pattern self, %self.param_patt.7e6 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc31_44.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc31_44.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.40d: %pattern_type.831 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.560: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt.40d [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc31_44.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.5: type = fn_type @Destroy.WithSelf.Op.loc31_44.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.5: %Destroy.WithSelf.Op.type.ef016f.5 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.8f3: type = pattern_type %struct_type.value.has_value.786 [concrete] +// CHECK:STDOUT: %self.param_patt.8d5: %pattern_type.8f3 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.5e5: %pattern_type.8f3 = wrapper_binding_pattern self, %self.param_patt.8d5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc31_44.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.6: type = fn_type @Destroy.WithSelf.Op.loc31_44.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.6: %Destroy.WithSelf.Op.type.ef016f.6 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.e17: type = pattern_type %DefaultOptionalStorage.6f8 [concrete] +// CHECK:STDOUT: %self.param_patt.993: %pattern_type.e17 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.c64: %pattern_type.e17 = wrapper_binding_pattern self, %self.param_patt.993 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc31_44.5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.7: type = fn_type @Destroy.WithSelf.Op.loc31_44.5 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.7: %Destroy.WithSelf.Op.type.ef016f.7 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.lookup_impl_witness.80c: = lookup_impl_witness %impl.elem1.127, @Destroy [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.678: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%impl.elem1.127) [symbolic] -// CHECK:STDOUT: %.195: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.678, %impl.elem1.127 [symbolic] -// CHECK:STDOUT: %impl.elem0.d51: %.195 = impl_witness_access %Destroy.lookup_impl_witness.80c, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.9d5: = specific_impl_function %impl.elem0.d51, @Destroy.WithSelf.Op.1(%impl.elem1.127) [symbolic] +// CHECK:STDOUT: %self.param_patt.d84: %pattern_type.9bf = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.81b: %pattern_type.9bf = wrapper_binding_pattern self, %self.param_patt.d84 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc31_44.6 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.7: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.8: type = fn_type @Destroy.WithSelf.Op.loc31_44.6 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.8: %Destroy.WithSelf.Op.type.ef016f.8 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.8: type = fn_type @Destroy.WithSelf.SelfDestruct.loc31_44.6 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.8: %Destroy.WithSelf.SelfDestruct.type.fbceb5.8 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.lookup_impl_witness.696: = lookup_impl_witness %impl.elem1.0e0, @Destroy [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.bb9: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%impl.elem1.0e0) [symbolic] +// CHECK:STDOUT: %.cd9: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.bb9, %impl.elem1.0e0 [symbolic] +// CHECK:STDOUT: %impl.elem2.75b: %.cd9 = impl_witness_access %Destroy.lookup_impl_witness.696, element2 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.65c: = specific_impl_function %impl.elem2.75b, @Destroy.WithSelf.SelfDestruct.1(%impl.elem1.0e0) [symbolic] // CHECK:STDOUT: %MutableRange: type = class_type @MutableRange [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3921,11 +5128,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: import Cpp//... // CHECK:STDOUT: } // CHECK:STDOUT: %ValueType.decl: type = class_decl @ValueType [concrete = constants.%ValueType] {} {} -// CHECK:STDOUT: %ValueType.cpp_destructor.decl: %ValueType.cpp_destructor.type = fn_decl @ValueType.cpp_destructor [concrete = constants.%ValueType.cpp_destructor] { -// CHECK:STDOUT: -// CHECK:STDOUT: } { -// CHECK:STDOUT: -// CHECK:STDOUT: } // CHECK:STDOUT: %operator_PlusEqual__carbon_thunk.decl: %operator_PlusEqual__carbon_thunk.type = fn_decl @operator_PlusEqual__carbon_thunk [concrete = constants.%operator_PlusEqual__carbon_thunk] { // CHECK:STDOUT: // CHECK:STDOUT: } { @@ -3934,28 +5136,115 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %MutableRange.decl: type = class_decl @MutableRange [concrete = constants.%MutableRange] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @TestIterate(%R.loc27_17.2: %Iterate_where.type.f03) { +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc31_44.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.1d1 = ref_param_pattern [concrete = constants.%self.param_patt.964] +// CHECK:STDOUT: %self.patt: %pattern_type.1d1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.82f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %.dd1 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %.dd1 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc31_44.1 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.1d1 = ref_param_pattern [concrete = constants.%self.param_patt.964] +// CHECK:STDOUT: %self.patt: %pattern_type.1d1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.82f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %.dd1 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %.dd1 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc31_44.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.c42 = ref_param_pattern [concrete = constants.%self.param_patt.7e6] +// CHECK:STDOUT: %self.patt: %pattern_type.c42 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.c0f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %MaybeUnformed.8ca = ref_param call_param0 +// CHECK:STDOUT: %self: ref %MaybeUnformed.8ca = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc31_44.2 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.c42 = ref_param_pattern [concrete = constants.%self.param_patt.7e6] +// CHECK:STDOUT: %self.patt: %pattern_type.c42 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.c0f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %MaybeUnformed.8ca = ref_param call_param0 +// CHECK:STDOUT: %self: ref %MaybeUnformed.8ca = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc31_44.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d] +// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0 +// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.5 = fn_decl @Destroy.WithSelf.Op.loc31_44.3 [concrete = constants.%Destroy.WithSelf.Op.403171.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d] +// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0 +// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc31_44.4 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.8f3 = ref_param_pattern [concrete = constants.%self.param_patt.8d5] +// CHECK:STDOUT: %self.patt: %pattern_type.8f3 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.5e5] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.value.has_value.786 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.value.has_value.786 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.5: %Destroy.WithSelf.Op.type.ef016f.6 = fn_decl @Destroy.WithSelf.Op.loc31_44.4 [concrete = constants.%Destroy.WithSelf.Op.403171.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.8f3 = ref_param_pattern [concrete = constants.%self.param_patt.8d5] +// CHECK:STDOUT: %self.patt: %pattern_type.8f3 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.5e5] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.value.has_value.786 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.value.has_value.786 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc31_44.5 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e17 = ref_param_pattern [concrete = constants.%self.param_patt.993] +// CHECK:STDOUT: %self.patt: %pattern_type.e17 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.c64] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %DefaultOptionalStorage.6f8 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %DefaultOptionalStorage.6f8 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.6: %Destroy.WithSelf.Op.type.ef016f.7 = fn_decl @Destroy.WithSelf.Op.loc31_44.5 [concrete = constants.%Destroy.WithSelf.Op.403171.7] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e17 = ref_param_pattern [concrete = constants.%self.param_patt.993] +// CHECK:STDOUT: %self.patt: %pattern_type.e17 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.c64] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %DefaultOptionalStorage.6f8 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %DefaultOptionalStorage.6f8 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc31_44.6 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.7] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.9bf = ref_param_pattern [concrete = constants.%self.param_patt.d84] +// CHECK:STDOUT: %self.patt: %pattern_type.9bf = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.81b] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Optional.59e = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Optional.59e = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.7: %Destroy.WithSelf.Op.type.ef016f.8 = fn_decl @Destroy.WithSelf.Op.loc31_44.6 [concrete = constants.%Destroy.WithSelf.Op.403171.8] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.9bf = ref_param_pattern [concrete = constants.%self.param_patt.d84] +// CHECK:STDOUT: %self.patt: %pattern_type.9bf = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.81b] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Optional.59e = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Optional.59e = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @TestIterate(%R.loc27_17.2: %Iterate_where.type.9df) { // CHECK:STDOUT: // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: %Iterate.lookup_impl_witness: = lookup_impl_witness %R.loc27_17.1, @Iterate [symbolic = %Iterate.lookup_impl_witness (constants.%Iterate.lookup_impl_witness.698)] -// CHECK:STDOUT: %Iterate.facet.loc31_44.5: %Iterate.type = facet_value %R.as_type.loc27_86.1, (%Iterate.lookup_impl_witness) [symbolic = %Iterate.facet.loc31_44.5 (constants.%Iterate.facet.122)] -// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.loc31_44.5) [symbolic = %Iterate.WithSelf.NewCursor.type (constants.%Iterate.WithSelf.NewCursor.type.d16)] -// CHECK:STDOUT: %.loc31_44.20: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type, %Iterate.facet.loc31_44.5 [symbolic = %.loc31_44.20 (constants.%.26d)] -// CHECK:STDOUT: %impl.elem2.loc31_44.2: @TestIterate.%.loc31_44.20 (%.26d) = impl_witness_access %Iterate.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc31_44.2 (constants.%impl.elem2.d05)] -// CHECK:STDOUT: %specific_impl_fn.loc31_44.4: = specific_impl_function %impl.elem2.loc31_44.2, @Iterate.WithSelf.NewCursor(%Iterate.facet.loc31_44.5) [symbolic = %specific_impl_fn.loc31_44.4 (constants.%specific_impl_fn.342)] +// CHECK:STDOUT: %Iterate.lookup_impl_witness: = lookup_impl_witness %R.loc27_17.1, @Iterate [symbolic = %Iterate.lookup_impl_witness (constants.%Iterate.lookup_impl_witness.711)] +// CHECK:STDOUT: %Iterate.facet.loc31_44.5: %Iterate.type = facet_value %R.as_type.loc27_86.1, (%Iterate.lookup_impl_witness) [symbolic = %Iterate.facet.loc31_44.5 (constants.%Iterate.facet.04e)] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.loc31_44.5) [symbolic = %Iterate.WithSelf.NewCursor.type (constants.%Iterate.WithSelf.NewCursor.type.aea)] +// CHECK:STDOUT: %.loc31_44.20: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type, %Iterate.facet.loc31_44.5 [symbolic = %.loc31_44.20 (constants.%.d1d)] +// CHECK:STDOUT: %impl.elem2.loc31_44.3: @TestIterate.%.loc31_44.20 (%.d1d) = impl_witness_access %Iterate.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc31_44.3 (constants.%impl.elem2.bf8)] +// CHECK:STDOUT: %specific_impl_fn.loc31_44.4: = specific_impl_function %impl.elem2.loc31_44.3, @Iterate.WithSelf.NewCursor(%Iterate.facet.loc31_44.5) [symbolic = %specific_impl_fn.loc31_44.4 (constants.%specific_impl_fn.d24)] // CHECK:STDOUT: -// CHECK:STDOUT: %ptr: type = ptr_type %as_type [symbolic = %ptr (constants.%ptr.2f2)] -// CHECK:STDOUT: %Iterate.WithSelf.Next.type: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.loc31_44.5) [symbolic = %Iterate.WithSelf.Next.type (constants.%Iterate.WithSelf.Next.type.2f3)] -// CHECK:STDOUT: %.loc31_44.21: type = fn_type_with_self_type %Iterate.WithSelf.Next.type, %Iterate.facet.loc31_44.5 [symbolic = %.loc31_44.21 (constants.%.25b)] -// CHECK:STDOUT: %impl.elem3.loc31_44.2: @TestIterate.%.loc31_44.21 (%.25b) = impl_witness_access %Iterate.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc31_44.2 (constants.%impl.elem3.9e9)] -// CHECK:STDOUT: %specific_impl_fn.loc31_44.5: = specific_impl_function %impl.elem3.loc31_44.2, @Iterate.WithSelf.Next(%Iterate.facet.loc31_44.5) [symbolic = %specific_impl_fn.loc31_44.5 (constants.%specific_impl_fn.ee9)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%impl.elem1) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.678)] -// CHECK:STDOUT: %.loc31_44.22: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %impl.elem1 [symbolic = %.loc31_44.22 (constants.%.195)] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %impl.elem1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.80c)] -// CHECK:STDOUT: %impl.elem0.loc31_44.2: @TestIterate.%.loc31_44.22 (%.195) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc31_44.2 (constants.%impl.elem0.d51)] -// CHECK:STDOUT: %specific_impl_fn.loc31_44.6: = specific_impl_function %impl.elem0.loc31_44.2, @Destroy.WithSelf.Op.1(%impl.elem1) [symbolic = %specific_impl_fn.loc31_44.6 (constants.%specific_impl_fn.9d5)] +// CHECK:STDOUT: %ptr: type = ptr_type %as_type [symbolic = %ptr (constants.%ptr.46a)] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.loc31_44.5) [symbolic = %Iterate.WithSelf.Next.type (constants.%Iterate.WithSelf.Next.type.9d6)] +// CHECK:STDOUT: %.loc31_44.21: type = fn_type_with_self_type %Iterate.WithSelf.Next.type, %Iterate.facet.loc31_44.5 [symbolic = %.loc31_44.21 (constants.%.b83)] +// CHECK:STDOUT: %impl.elem3.loc31_44.2: @TestIterate.%.loc31_44.21 (%.b83) = impl_witness_access %Iterate.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc31_44.2 (constants.%impl.elem3.351)] +// CHECK:STDOUT: %specific_impl_fn.loc31_44.5: = specific_impl_function %impl.elem3.loc31_44.2, @Iterate.WithSelf.Next(%Iterate.facet.loc31_44.5) [symbolic = %specific_impl_fn.loc31_44.5 (constants.%specific_impl_fn.946)] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%impl.elem1) [symbolic = %Destroy.WithSelf.SelfDestruct.type (constants.%Destroy.WithSelf.SelfDestruct.type.bb9)] +// CHECK:STDOUT: %.loc31_44.22: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type, %impl.elem1 [symbolic = %.loc31_44.22 (constants.%.cd9)] +// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %impl.elem1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.696)] +// CHECK:STDOUT: %impl.elem2.loc31_44.4: @TestIterate.%.loc31_44.22 (%.cd9) = impl_witness_access %Destroy.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc31_44.4 (constants.%impl.elem2.75b)] +// CHECK:STDOUT: %specific_impl_fn.loc31_44.6: = specific_impl_function %impl.elem2.loc31_44.4, @Destroy.WithSelf.SelfDestruct.1(%impl.elem1) [symbolic = %specific_impl_fn.loc31_44.6 (constants.%specific_impl_fn.65c)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%r.param: @TestIterate.%R.as_type.loc27_86.1 (%R.as_type)) { // CHECK:STDOUT: !entry: @@ -3964,53 +5253,53 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %i.patt: %pattern_type.d2d = value_binding_pattern i [concrete = constants.%i.patt] // CHECK:STDOUT: } // CHECK:STDOUT: %r.ref: @TestIterate.%R.as_type.loc27_86.1 (%R.as_type) = name_ref r, %r -// CHECK:STDOUT: %impl.elem2.loc31_44.1: @TestIterate.%.loc31_44.20 (%.26d) = impl_witness_access constants.%Iterate.lookup_impl_witness.698, element2 [symbolic = %impl.elem2.loc31_44.2 (constants.%impl.elem2.d05)] +// CHECK:STDOUT: %impl.elem2.loc31_44.1: @TestIterate.%.loc31_44.20 (%.d1d) = impl_witness_access constants.%Iterate.lookup_impl_witness.711, element2 [symbolic = %impl.elem2.loc31_44.3 (constants.%impl.elem2.bf8)] // CHECK:STDOUT: %bound_method.loc31_44.1: = bound_method %r.ref, %impl.elem2.loc31_44.1 -// CHECK:STDOUT: %Iterate.facet.loc31_44.1: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.698) [symbolic = %Iterate.facet.loc31_44.5 (constants.%Iterate.facet.122)] -// CHECK:STDOUT: %.loc31_44.1: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc31_44.1 [symbolic = %Iterate.facet.loc31_44.5 (constants.%Iterate.facet.122)] -// CHECK:STDOUT: %Iterate.facet.loc31_44.2: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.698) [symbolic = %Iterate.facet.loc31_44.5 (constants.%Iterate.facet.122)] -// CHECK:STDOUT: %.loc31_44.2: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc31_44.2 [symbolic = %Iterate.facet.loc31_44.5 (constants.%Iterate.facet.122)] -// CHECK:STDOUT: %specific_impl_fn.loc31_44.1: = specific_impl_function %impl.elem2.loc31_44.1, @Iterate.WithSelf.NewCursor(constants.%Iterate.facet.122) [symbolic = %specific_impl_fn.loc31_44.4 (constants.%specific_impl_fn.342)] +// CHECK:STDOUT: %Iterate.facet.loc31_44.1: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.711) [symbolic = %Iterate.facet.loc31_44.5 (constants.%Iterate.facet.04e)] +// CHECK:STDOUT: %.loc31_44.1: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc31_44.1 [symbolic = %Iterate.facet.loc31_44.5 (constants.%Iterate.facet.04e)] +// CHECK:STDOUT: %Iterate.facet.loc31_44.2: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.711) [symbolic = %Iterate.facet.loc31_44.5 (constants.%Iterate.facet.04e)] +// CHECK:STDOUT: %.loc31_44.2: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc31_44.2 [symbolic = %Iterate.facet.loc31_44.5 (constants.%Iterate.facet.04e)] +// CHECK:STDOUT: %specific_impl_fn.loc31_44.1: = specific_impl_function %impl.elem2.loc31_44.1, @Iterate.WithSelf.NewCursor(constants.%Iterate.facet.04e) [symbolic = %specific_impl_fn.loc31_44.4 (constants.%specific_impl_fn.d24)] // CHECK:STDOUT: %bound_method.loc31_44.2: = bound_method %r.ref, %specific_impl_fn.loc31_44.1 -// CHECK:STDOUT: %var: ref @TestIterate.%as_type (%as_type.d08) = var_storage invalid -// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.call: init @TestIterate.%as_type (%as_type.d08) to %var = call %bound_method.loc31_44.2(%r.ref) +// CHECK:STDOUT: %var: ref @TestIterate.%as_type (%as_type.b30) = var_storage invalid +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.call: init @TestIterate.%as_type (%as_type.b30) to %var = call %bound_method.loc31_44.2(%r.ref) // CHECK:STDOUT: assign %var, %Iterate.WithSelf.NewCursor.call // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.next: -// CHECK:STDOUT: %addr.loc31: @TestIterate.%ptr (%ptr.2f2) = addr_of %var -// CHECK:STDOUT: %impl.elem3.loc31_44.1: @TestIterate.%.loc31_44.21 (%.25b) = impl_witness_access constants.%Iterate.lookup_impl_witness.698, element3 [symbolic = %impl.elem3.loc31_44.2 (constants.%impl.elem3.9e9)] +// CHECK:STDOUT: %addr.loc31: @TestIterate.%ptr (%ptr.46a) = addr_of %var +// CHECK:STDOUT: %impl.elem3.loc31_44.1: @TestIterate.%.loc31_44.21 (%.b83) = impl_witness_access constants.%Iterate.lookup_impl_witness.711, element3 [symbolic = %impl.elem3.loc31_44.2 (constants.%impl.elem3.351)] // CHECK:STDOUT: %bound_method.loc31_44.3: = bound_method %r.ref, %impl.elem3.loc31_44.1 -// CHECK:STDOUT: %Iterate.facet.loc31_44.3: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.698) [symbolic = %Iterate.facet.loc31_44.5 (constants.%Iterate.facet.122)] -// CHECK:STDOUT: %.loc31_44.3: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc31_44.3 [symbolic = %Iterate.facet.loc31_44.5 (constants.%Iterate.facet.122)] -// CHECK:STDOUT: %Iterate.facet.loc31_44.4: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.698) [symbolic = %Iterate.facet.loc31_44.5 (constants.%Iterate.facet.122)] -// CHECK:STDOUT: %.loc31_44.4: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc31_44.4 [symbolic = %Iterate.facet.loc31_44.5 (constants.%Iterate.facet.122)] -// CHECK:STDOUT: %.loc31_44.5: %Destroy.type = converted constants.%as_type.d08, constants.%impl.elem1.127 [symbolic = %impl.elem1 (constants.%impl.elem1.127)] -// CHECK:STDOUT: %.loc31_44.6: %Destroy.type = converted constants.%as_type.d08, constants.%impl.elem1.127 [symbolic = %impl.elem1 (constants.%impl.elem1.127)] -// CHECK:STDOUT: %specific_impl_fn.loc31_44.2: = specific_impl_function %impl.elem3.loc31_44.1, @Iterate.WithSelf.Next(constants.%Iterate.facet.122) [symbolic = %specific_impl_fn.loc31_44.5 (constants.%specific_impl_fn.ee9)] +// CHECK:STDOUT: %Iterate.facet.loc31_44.3: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.711) [symbolic = %Iterate.facet.loc31_44.5 (constants.%Iterate.facet.04e)] +// CHECK:STDOUT: %.loc31_44.3: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc31_44.3 [symbolic = %Iterate.facet.loc31_44.5 (constants.%Iterate.facet.04e)] +// CHECK:STDOUT: %Iterate.facet.loc31_44.4: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.711) [symbolic = %Iterate.facet.loc31_44.5 (constants.%Iterate.facet.04e)] +// CHECK:STDOUT: %.loc31_44.4: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc31_44.4 [symbolic = %Iterate.facet.loc31_44.5 (constants.%Iterate.facet.04e)] +// CHECK:STDOUT: %.loc31_44.5: %Destroy.type = converted constants.%as_type.b30, constants.%impl.elem1.0e0 [symbolic = %impl.elem1 (constants.%impl.elem1.0e0)] +// CHECK:STDOUT: %.loc31_44.6: %Destroy.type = converted constants.%as_type.b30, constants.%impl.elem1.0e0 [symbolic = %impl.elem1 (constants.%impl.elem1.0e0)] +// CHECK:STDOUT: %specific_impl_fn.loc31_44.2: = specific_impl_function %impl.elem3.loc31_44.1, @Iterate.WithSelf.Next(constants.%Iterate.facet.04e) [symbolic = %specific_impl_fn.loc31_44.5 (constants.%specific_impl_fn.946)] // CHECK:STDOUT: %bound_method.loc31_44.4: = bound_method %r.ref, %specific_impl_fn.loc31_44.2 -// CHECK:STDOUT: %.loc31_44.7: ref %Optional.40d = temporary_storage -// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.40d to %.loc31_44.7 = call %bound_method.loc31_44.4(%r.ref, %addr.loc31) -// CHECK:STDOUT: %.loc31_44.8: ref %Optional.40d = temporary %.loc31_44.7, %Iterate.WithSelf.Next.call -// CHECK:STDOUT: %.loc31_44.9: %Optional.HasValue.type.5e1 = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.19b) [concrete = constants.%Optional.HasValue.d7c] -// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.5e1 = name_ref HasValue, %.loc31_44.9 [concrete = constants.%Optional.HasValue.d7c] +// CHECK:STDOUT: %.loc31_44.7: ref %Optional.59e = temporary_storage +// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.59e to %.loc31_44.7 = call %bound_method.loc31_44.4(%r.ref, %addr.loc31) +// CHECK:STDOUT: %.loc31_44.8: ref %Optional.59e = temporary %.loc31_44.7, %Iterate.WithSelf.Next.call +// CHECK:STDOUT: %.loc31_44.9: %Optional.HasValue.type.22f = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.864) [concrete = constants.%Optional.HasValue.c86] +// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.22f = name_ref HasValue, %.loc31_44.9 [concrete = constants.%Optional.HasValue.c86] // CHECK:STDOUT: %Optional.HasValue.bound: = bound_method %.loc31_44.8, %HasValue.ref -// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%OptionalStorage.facet.19b) [concrete = constants.%Optional.HasValue.specific_fn] +// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%OptionalStorage.facet.864) [concrete = constants.%Optional.HasValue.specific_fn] // CHECK:STDOUT: %bound_method.loc31_44.5: = bound_method %.loc31_44.8, %Optional.HasValue.specific_fn -// CHECK:STDOUT: %.loc31_44.10: %Optional.40d = acquire_value %.loc31_44.8 +// CHECK:STDOUT: %.loc31_44.10: %Optional.59e = acquire_value %.loc31_44.8 // CHECK:STDOUT: %Optional.HasValue.call: init bool = call %bound_method.loc31_44.5(%.loc31_44.10) // CHECK:STDOUT: %.loc31_44.11: bool = value_of_initializer %Optional.HasValue.call // CHECK:STDOUT: %.loc31_44.12: bool = converted %Optional.HasValue.call, %.loc31_44.11 // CHECK:STDOUT: if %.loc31_44.12 br !for.body else br !for.done // CHECK:STDOUT: // CHECK:STDOUT: !for.body: -// CHECK:STDOUT: %.loc31_44.13: %Optional.Get.type.1fe = specific_constant imports.%Core.import_ref.dab, @Optional(constants.%OptionalStorage.facet.19b) [concrete = constants.%Optional.Get.6fd] -// CHECK:STDOUT: %Get.ref: %Optional.Get.type.1fe = name_ref Get, %.loc31_44.13 [concrete = constants.%Optional.Get.6fd] +// CHECK:STDOUT: %.loc31_44.13: %Optional.Get.type.e57 = specific_constant imports.%Core.import_ref.dab, @Optional(constants.%OptionalStorage.facet.864) [concrete = constants.%Optional.Get.d4a] +// CHECK:STDOUT: %Get.ref: %Optional.Get.type.e57 = name_ref Get, %.loc31_44.13 [concrete = constants.%Optional.Get.d4a] // CHECK:STDOUT: %Optional.Get.bound: = bound_method %.loc31_44.8, %Get.ref -// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%OptionalStorage.facet.19b) [concrete = constants.%Optional.Get.specific_fn] +// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%OptionalStorage.facet.864) [concrete = constants.%Optional.Get.specific_fn] // CHECK:STDOUT: %bound_method.loc31_44.6: = bound_method %.loc31_44.8, %Optional.Get.specific_fn // CHECK:STDOUT: %.loc31_44.14: ref %ValueType = temporary_storage -// CHECK:STDOUT: %.loc31_44.15: %Optional.40d = acquire_value %.loc31_44.8 +// CHECK:STDOUT: %.loc31_44.15: %Optional.59e = acquire_value %.loc31_44.8 // CHECK:STDOUT: %Optional.Get.call: init %ValueType to %.loc31_44.14 = call %bound_method.loc31_44.6(%.loc31_44.15) // CHECK:STDOUT: %.loc31_44.16: ref %ValueType = temporary %.loc31_44.14, %Optional.Get.call // CHECK:STDOUT: %.loc31_44.17: %ValueType = acquire_value %.loc31_44.16 @@ -4027,52 +5316,104 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %.loc32_9.1: %ptr.5f4 = as_compatible %addr.loc32 // CHECK:STDOUT: %.loc32_9.2: %ptr.5f4 = converted %addr.loc32, %.loc32_9.1 // CHECK:STDOUT: %operator_PlusEqual__carbon_thunk.call: ref %ValueType = call imports.%operator_PlusEqual__carbon_thunk.decl(%sum.ref, %.loc32_9.2) -// CHECK:STDOUT: %ValueType.Op.bound.loc31: = bound_method %.loc31_44.16, constants.%ValueType.Op.4590ed.1 -// CHECK:STDOUT: %Op.ref.loc31: %ValueType.cpp_destructor.type = name_ref Op, imports.%ValueType.cpp_destructor.decl [concrete = constants.%ValueType.cpp_destructor] -// CHECK:STDOUT: %ValueType.cpp_destructor.bound.loc31: = bound_method %.loc31_44.16, %Op.ref.loc31 -// CHECK:STDOUT: %ValueType.cpp_destructor.call.loc31: init %empty_tuple.type = call %ValueType.cpp_destructor.bound.loc31(%.loc31_44.16) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc31_44.1: = bound_method %.loc31_44.8, constants.%Destroy.WithSelf.Op.403171.7 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc31_44.1: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc31_44.1(%.loc31_44.8) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc31_44.1: = bound_method %.loc31_44.16, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc31_44.1: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc31_44.1(%.loc31_44.16) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc31_44.2: = bound_method %.loc31_44.8, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.8 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc31_44.2: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc31_44.2(%.loc31_44.8) // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.done: -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc31_44.2: = bound_method %.loc31_44.8, constants.%Destroy.WithSelf.Op.403171.7 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc31_44.2: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc31_44.2(%.loc31_44.8) -// CHECK:STDOUT: %impl.elem0.loc31_44.1: @TestIterate.%.loc31_44.22 (%.195) = impl_witness_access constants.%Destroy.lookup_impl_witness.80c, element0 [symbolic = %impl.elem0.loc31_44.2 (constants.%impl.elem0.d51)] -// CHECK:STDOUT: %bound_method.loc31_44.7: = bound_method %var, %impl.elem0.loc31_44.1 -// CHECK:STDOUT: %.loc31_44.18: %Destroy.type = converted constants.%as_type.d08, constants.%impl.elem1.127 [symbolic = %impl.elem1 (constants.%impl.elem1.127)] -// CHECK:STDOUT: %.loc31_44.19: %Destroy.type = converted constants.%as_type.d08, constants.%impl.elem1.127 [symbolic = %impl.elem1 (constants.%impl.elem1.127)] -// CHECK:STDOUT: %specific_impl_fn.loc31_44.3: = specific_impl_function %impl.elem0.loc31_44.1, @Destroy.WithSelf.Op.1(constants.%impl.elem1.127) [symbolic = %specific_impl_fn.loc31_44.6 (constants.%specific_impl_fn.9d5)] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc31_44.3: = bound_method %.loc31_44.8, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.8 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc31_44.3: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc31_44.3(%.loc31_44.8) +// CHECK:STDOUT: %impl.elem2.loc31_44.2: @TestIterate.%.loc31_44.22 (%.cd9) = impl_witness_access constants.%Destroy.lookup_impl_witness.696, element2 [symbolic = %impl.elem2.loc31_44.4 (constants.%impl.elem2.75b)] +// CHECK:STDOUT: %bound_method.loc31_44.7: = bound_method %var, %impl.elem2.loc31_44.2 +// CHECK:STDOUT: %.loc31_44.18: %Destroy.type = converted constants.%as_type.b30, constants.%impl.elem1.0e0 [symbolic = %impl.elem1 (constants.%impl.elem1.0e0)] +// CHECK:STDOUT: %.loc31_44.19: %Destroy.type = converted constants.%as_type.b30, constants.%impl.elem1.0e0 [symbolic = %impl.elem1 (constants.%impl.elem1.0e0)] +// CHECK:STDOUT: %specific_impl_fn.loc31_44.3: = specific_impl_function %impl.elem2.loc31_44.2, @Destroy.WithSelf.SelfDestruct.1(constants.%impl.elem1.0e0) [symbolic = %specific_impl_fn.loc31_44.6 (constants.%specific_impl_fn.65c)] // CHECK:STDOUT: %bound_method.loc31_44.8: = bound_method %var, %specific_impl_fn.loc31_44.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc31_44.3: init %empty_tuple.type = call %bound_method.loc31_44.8(%var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc31_44.4: init %empty_tuple.type = call %bound_method.loc31_44.8(%var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc31_44.1(%self.param: ref %.dd1) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc31_44.1(%self.param: ref %.dd1) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc31_44.2(%self.param: ref %MaybeUnformed.09f) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc31_44.1(%self.param: ref %.dd1) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc31_44.1(%self.param: ref %.dd1) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc31_44.2(%self.param: ref %MaybeUnformed.8ca) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc31_44.2(%self.param: ref %MaybeUnformed.8ca) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc31_44.2(%self.param: ref %MaybeUnformed.8ca) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc31_44.3(%self.param: ref bool) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc31_44.3(%self.param: ref bool) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc31_44.4(%self.param: ref %struct_type.value.has_value.d6e) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc31_44.3(%self.param: ref bool) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc31_44.4(%self.param: ref %struct_type.value.has_value.786) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc31_44.5(%self.param: ref %DefaultOptionalStorage.d67) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc31_44.4(%self.param: ref %struct_type.value.has_value.786) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc31_44.4(%self.param: ref %struct_type.value.has_value.786) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.5(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc31_44.5(%self.param: ref %DefaultOptionalStorage.6f8) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc31_44.6(%self.param: ref %Optional.40d) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc31_44.5(%self.param: ref %DefaultOptionalStorage.6f8) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc31_44.5(%self.param: ref %DefaultOptionalStorage.6f8) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.6(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.5(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc31_44.6(%self.param: ref %Optional.59e) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc31_44.6(%self.param: ref %Optional.59e) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc31_44.6(%self.param: ref %Optional.59e) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.7(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.6(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -4112,7 +5453,7 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %R.patt.loc27_17.2 => constants.%R.patt // CHECK:STDOUT: %R.loc27_17.1 => constants.%R // CHECK:STDOUT: %R.as_type.loc27_86.1 => constants.%R.as_type -// CHECK:STDOUT: %pattern_type => constants.%pattern_type.acd +// CHECK:STDOUT: %pattern_type => constants.%pattern_type.0bc // CHECK:STDOUT: %r.param_patt.loc27_84.2 => constants.%r.param_patt // CHECK:STDOUT: %r.patt.loc27_84.2 => constants.%r.patt // CHECK:STDOUT: } @@ -4123,6 +5464,7 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: type: type = facet_type [concrete] // CHECK:STDOUT: %Iterate.type: type = facet_type <@Iterate> [concrete] // CHECK:STDOUT: %OptionalStorage.type: type = facet_type <@OptionalStorage> [concrete] +// CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %facet_type.f48: type = facet_type <@Destroy & @Copy> [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] @@ -4169,65 +5511,108 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %pattern_type.e09: type = pattern_type %ValueType [concrete] -// CHECK:STDOUT: %ValueType.cpp_destructor.type: type = fn_type @ValueType.cpp_destructor [concrete] -// CHECK:STDOUT: %ValueType.cpp_destructor: %ValueType.cpp_destructor.type = struct_value () [concrete] -// CHECK:STDOUT: %ValueType.Op.type.9ce105.1: type = fn_type @ValueType.Op.1 [concrete] -// CHECK:STDOUT: %ValueType.Op.038ea9.1: %ValueType.Op.type.9ce105.1 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.ca2: = custom_witness (%ValueType.Op.038ea9.1), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc34 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc34 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %ValueType.SubobjectDestroy.type: type = fn_type @ValueType.SubobjectDestroy [concrete] +// CHECK:STDOUT: %ValueType.SubobjectDestroy: %ValueType.SubobjectDestroy.type = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.dc3: = custom_witness (%Destroy.WithSelf.Op.403171.2, %ValueType.SubobjectDestroy, %Destroy.WithSelf.SelfDestruct.db3fdb.2), @Destroy [concrete] // CHECK:STDOUT: %const.924: type = const_type %ValueType [concrete] // CHECK:STDOUT: %ptr.403: type = ptr_type %const.924 [concrete] // CHECK:STDOUT: %ptr.6ed: type = ptr_type %ValueType [concrete] -// CHECK:STDOUT: %ValueType.Op.type.9ce105.2: type = fn_type @ValueType.Op.2 [concrete] -// CHECK:STDOUT: %ValueType.Op.038ea9.2: %ValueType.Op.type.9ce105.2 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.1c5: = custom_witness (%ValueType.Op.038ea9.2), @Copy [concrete] -// CHECK:STDOUT: %facet_value.851: %facet_type.f48 = facet_value %ValueType, (%custom_witness.ca2, %custom_witness.1c5) [concrete] +// CHECK:STDOUT: %ValueType.Op.type: type = fn_type @ValueType.Op [concrete] +// CHECK:STDOUT: %ValueType.Op: %ValueType.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.1c5: = custom_witness (%ValueType.Op), @Copy [concrete] +// CHECK:STDOUT: %facet_value.36a: %facet_type.f48 = facet_value %ValueType, (%custom_witness.dc3, %custom_witness.1c5) [concrete] // CHECK:STDOUT: %Iterate.lookup_impl_witness.1d8: = lookup_impl_witness %.Self.500, @Iterate [symbolic_self] // CHECK:STDOUT: %impl.elem0.294: %facet_type.f48 = impl_witness_access %Iterate.lookup_impl_witness.1d8, element0 [symbolic_self] -// CHECK:STDOUT: %Iterate_where.type.290: type = facet_type <@Iterate where %impl.elem0.294 = %facet_value.851> [concrete] -// CHECK:STDOUT: %pattern_type.9fd: type = pattern_type %Iterate_where.type.290 [concrete] -// CHECK:STDOUT: %R.patt: %pattern_type.9fd = symbolic_binding_pattern R, 0 [symbolic] -// CHECK:STDOUT: %R: %Iterate_where.type.290 = symbolic_binding R, 0 [symbolic] +// CHECK:STDOUT: %Iterate_where.type.8b0: type = facet_type <@Iterate where %impl.elem0.294 = %facet_value.36a> [concrete] +// CHECK:STDOUT: %pattern_type.5f2: type = pattern_type %Iterate_where.type.8b0 [concrete] +// CHECK:STDOUT: %R.patt: %pattern_type.5f2 = symbolic_binding_pattern R, 0 [symbolic] +// CHECK:STDOUT: %R: %Iterate_where.type.8b0 = symbolic_binding R, 0 [symbolic] // CHECK:STDOUT: %R.as_type: type = facet_access_type %R [symbolic] -// CHECK:STDOUT: %pattern_type.447: type = pattern_type %R.as_type [symbolic] -// CHECK:STDOUT: %r.param_patt.207: %pattern_type.447 = value_param_pattern [symbolic] -// CHECK:STDOUT: %r.patt.e8b: %pattern_type.447 = wrapper_binding_pattern r, %r.param_patt.207 [symbolic] +// CHECK:STDOUT: %pattern_type.611: type = pattern_type %R.as_type [symbolic] +// CHECK:STDOUT: %r.param_patt.e64: %pattern_type.611 = value_param_pattern [symbolic] +// CHECK:STDOUT: %r.patt.dcb: %pattern_type.611 = wrapper_binding_pattern r, %r.param_patt.e64 [symbolic] // CHECK:STDOUT: %i.patt: %pattern_type.e09 = value_binding_pattern i [concrete] -// CHECK:STDOUT: %Iterate.lookup_impl_witness.116: = lookup_impl_witness %R, @Iterate [symbolic] -// CHECK:STDOUT: %Iterate.facet.401: %Iterate.type = facet_value %R.as_type, (%Iterate.lookup_impl_witness.116) [symbolic] -// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.e10: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.401) [symbolic] -// CHECK:STDOUT: %Iterate.WithSelf.Next.type.7bd: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.401) [symbolic] -// CHECK:STDOUT: %.4ab: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.e10, %Iterate.facet.401 [symbolic] -// CHECK:STDOUT: %impl.elem2.739: %.4ab = impl_witness_access %Iterate.lookup_impl_witness.116, element2 [symbolic] -// CHECK:STDOUT: %impl.elem1.9b3: %Destroy.type = impl_witness_access %Iterate.lookup_impl_witness.116, element1 [symbolic] -// CHECK:STDOUT: %as_type.04b: type = facet_access_type %impl.elem1.9b3 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.2b2: = specific_impl_function %impl.elem2.739, @Iterate.WithSelf.NewCursor(%Iterate.facet.401) [symbolic] -// CHECK:STDOUT: %ptr.494: type = ptr_type %as_type.04b [symbolic] -// CHECK:STDOUT: %.8ee: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.7bd, %Iterate.facet.401 [symbolic] -// CHECK:STDOUT: %impl.elem3.65d: %.8ee = impl_witness_access %Iterate.lookup_impl_witness.116, element3 [symbolic] -// CHECK:STDOUT: %DefaultOptionalStorage.338: type = class_type @DefaultOptionalStorage, @DefaultOptionalStorage(%facet_value.851) [concrete] -// CHECK:STDOUT: %OptionalStorage.impl_witness.26a: = impl_witness imports.%OptionalStorage.impl_witness_table.460, @T.as_type.as.OptionalStorage.impl(%facet_value.851) [concrete] -// CHECK:STDOUT: %OptionalStorage.facet.33d: %OptionalStorage.type = facet_value %ValueType, (%OptionalStorage.impl_witness.26a) [concrete] -// CHECK:STDOUT: %Optional.3cc: type = class_type @Optional, @Optional(%OptionalStorage.facet.33d) [concrete] -// CHECK:STDOUT: %specific_impl_fn.30e: = specific_impl_function %impl.elem3.65d, @Iterate.WithSelf.Next(%Iterate.facet.401) [symbolic] -// CHECK:STDOUT: %Optional.HasValue.type.f78: type = fn_type @Optional.HasValue, @Optional(%OptionalStorage.facet.33d) [concrete] -// CHECK:STDOUT: %Optional.HasValue.519: %Optional.HasValue.type.f78 = struct_value () [concrete] -// CHECK:STDOUT: %Optional.Get.type.9c5: type = fn_type @Optional.Get, @Optional(%OptionalStorage.facet.33d) [concrete] -// CHECK:STDOUT: %Optional.Get.323: %Optional.Get.type.9c5 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.facet.b42: %Destroy.type = facet_value %ValueType, (%custom_witness.ca2) [concrete] -// CHECK:STDOUT: %MaybeUnformed.5d7: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.b42) [concrete] +// CHECK:STDOUT: %Iterate.lookup_impl_witness.a99: = lookup_impl_witness %R, @Iterate [symbolic] +// CHECK:STDOUT: %Iterate.facet.c55: %Iterate.type = facet_value %R.as_type, (%Iterate.lookup_impl_witness.a99) [symbolic] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.a6c: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.c55) [symbolic] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type.cd7: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.c55) [symbolic] +// CHECK:STDOUT: %.57a: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.a6c, %Iterate.facet.c55 [symbolic] +// CHECK:STDOUT: %impl.elem2.51b: %.57a = impl_witness_access %Iterate.lookup_impl_witness.a99, element2 [symbolic] +// CHECK:STDOUT: %impl.elem1.751: %Destroy.type = impl_witness_access %Iterate.lookup_impl_witness.a99, element1 [symbolic] +// CHECK:STDOUT: %as_type.733: type = facet_access_type %impl.elem1.751 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.986: = specific_impl_function %impl.elem2.51b, @Iterate.WithSelf.NewCursor(%Iterate.facet.c55) [symbolic] +// CHECK:STDOUT: %ptr.696: type = ptr_type %as_type.733 [symbolic] +// CHECK:STDOUT: %.c1e: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.cd7, %Iterate.facet.c55 [symbolic] +// CHECK:STDOUT: %impl.elem3.576: %.c1e = impl_witness_access %Iterate.lookup_impl_witness.a99, element3 [symbolic] +// CHECK:STDOUT: %DefaultOptionalStorage.58e: type = class_type @DefaultOptionalStorage, @DefaultOptionalStorage(%facet_value.36a) [concrete] +// CHECK:STDOUT: %OptionalStorage.impl_witness.913: = impl_witness imports.%OptionalStorage.impl_witness_table.460, @T.as_type.as.OptionalStorage.impl(%facet_value.36a) [concrete] +// CHECK:STDOUT: %OptionalStorage.facet.e68: %OptionalStorage.type = facet_value %ValueType, (%OptionalStorage.impl_witness.913) [concrete] +// CHECK:STDOUT: %Optional.70f: type = class_type @Optional, @Optional(%OptionalStorage.facet.e68) [concrete] +// CHECK:STDOUT: %pattern_type.540: type = pattern_type %Optional.70f [concrete] +// CHECK:STDOUT: %specific_impl_fn.1db: = specific_impl_function %impl.elem3.576, @Iterate.WithSelf.Next(%Iterate.facet.c55) [symbolic] +// CHECK:STDOUT: %Optional.HasValue.type.74b: type = fn_type @Optional.HasValue, @Optional(%OptionalStorage.facet.e68) [concrete] +// CHECK:STDOUT: %Optional.HasValue.f75: %Optional.HasValue.type.74b = struct_value () [concrete] +// CHECK:STDOUT: %Optional.Get.type.316: type = fn_type @Optional.Get, @Optional(%OptionalStorage.facet.e68) [concrete] +// CHECK:STDOUT: %Optional.Get.483: %Optional.Get.type.316 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.facet.745: %Destroy.type = facet_value %ValueType, (%custom_witness.dc3) [concrete] +// CHECK:STDOUT: %MaybeUnformed.0af: type = class_type @MaybeUnformed, @MaybeUnformed(%Destroy.facet.745) [concrete] // CHECK:STDOUT: %.8f3: type = maybe_unformed_type %ValueType [concrete] -// CHECK:STDOUT: %struct_type.value.has_value.bd1: type = struct_type {.value: %MaybeUnformed.5d7, .has_value: bool} [concrete] -// CHECK:STDOUT: %Optional.HasValue.specific_fn.b3a: = specific_function %Optional.HasValue.519, @Optional.HasValue(%OptionalStorage.facet.33d) [concrete] -// CHECK:STDOUT: %Optional.Get.specific_fn.d62: = specific_function %Optional.Get.323, @Optional.Get(%OptionalStorage.facet.33d) [concrete] +// CHECK:STDOUT: %struct_type.value.has_value.ac3: type = struct_type {.value: %MaybeUnformed.0af, .has_value: bool} [concrete] +// CHECK:STDOUT: %Optional.HasValue.specific_fn.e2e: = specific_function %Optional.HasValue.f75, @Optional.HasValue(%OptionalStorage.facet.e68) [concrete] +// CHECK:STDOUT: %Optional.Get.specific_fn.296: = specific_function %Optional.Get.483, @Optional.Get(%OptionalStorage.facet.e68) [concrete] // CHECK:STDOUT: %operator_PlusEqual__carbon_thunk.type: type = fn_type @operator_PlusEqual__carbon_thunk [concrete] // CHECK:STDOUT: %operator_PlusEqual__carbon_thunk: %operator_PlusEqual__carbon_thunk.type = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.7: type = fn_type @Destroy.WithSelf.Op.loc38_41.6 [concrete] +// CHECK:STDOUT: %pattern_type.60e: type = pattern_type %.8f3 [concrete] +// CHECK:STDOUT: %self.param_patt.61b3: %pattern_type.60e = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.ecc: %pattern_type.60e = wrapper_binding_pattern self, %self.param_patt.61b3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc38_41.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc38_41.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.e4c: type = pattern_type %MaybeUnformed.0af [concrete] +// CHECK:STDOUT: %self.param_patt.cb2: %pattern_type.e4c = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.32b: %pattern_type.e4c = wrapper_binding_pattern self, %self.param_patt.cb2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc38_41.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc38_41.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.40d: %pattern_type.831 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.560: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt.40d [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc38_41.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.5: type = fn_type @Destroy.WithSelf.Op.loc38_41.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.5: %Destroy.WithSelf.Op.type.ef016f.5 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.95d: type = pattern_type %struct_type.value.has_value.ac3 [concrete] +// CHECK:STDOUT: %self.param_patt.432: %pattern_type.95d = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.25a: %pattern_type.95d = wrapper_binding_pattern self, %self.param_patt.432 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc38_41.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.6: type = fn_type @Destroy.WithSelf.Op.loc38_41.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.6: %Destroy.WithSelf.Op.type.ef016f.6 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.e96: type = pattern_type %DefaultOptionalStorage.58e [concrete] +// CHECK:STDOUT: %self.param_patt.861: %pattern_type.e96 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.c75: %pattern_type.e96 = wrapper_binding_pattern self, %self.param_patt.861 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc38_41.5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.7: type = fn_type @Destroy.WithSelf.Op.loc38_41.5 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.7: %Destroy.WithSelf.Op.type.ef016f.7 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.lookup_impl_witness.95e: = lookup_impl_witness %impl.elem1.9b3, @Destroy [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.223: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%impl.elem1.9b3) [symbolic] -// CHECK:STDOUT: %.32e: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.223, %impl.elem1.9b3 [symbolic] -// CHECK:STDOUT: %impl.elem0.87c: %.32e = impl_witness_access %Destroy.lookup_impl_witness.95e, element0 [symbolic] -// CHECK:STDOUT: %specific_impl_fn.65a: = specific_impl_function %impl.elem0.87c, @Destroy.WithSelf.Op.1(%impl.elem1.9b3) [symbolic] +// CHECK:STDOUT: %self.param_patt.422: %pattern_type.540 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.f61: %pattern_type.540 = wrapper_binding_pattern self, %self.param_patt.422 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc38_41.6 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.7: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.8: type = fn_type @Destroy.WithSelf.Op.loc38_41.6 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.8: %Destroy.WithSelf.Op.type.ef016f.8 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.8: type = fn_type @Destroy.WithSelf.SelfDestruct.loc38_41.6 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.8: %Destroy.WithSelf.SelfDestruct.type.fbceb5.8 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.lookup_impl_witness.eb0: = lookup_impl_witness %impl.elem1.751, @Destroy [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.57f: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%impl.elem1.751) [symbolic] +// CHECK:STDOUT: %.b9e: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.57f, %impl.elem1.751 [symbolic] +// CHECK:STDOUT: %impl.elem2.570: %.b9e = impl_witness_access %Destroy.lookup_impl_witness.eb0, element2 [symbolic] +// CHECK:STDOUT: %specific_impl_fn.74c: = specific_impl_function %impl.elem2.570, @Destroy.WithSelf.SelfDestruct.1(%impl.elem1.751) [symbolic] // CHECK:STDOUT: %MutableAndConstRange: type = class_type @MutableAndConstRange [concrete] // CHECK:STDOUT: %pattern_type.fdb: type = pattern_type %MutableAndConstRange [concrete] // CHECK:STDOUT: %Iterator: type = class_type @Iterator.1 [concrete] @@ -4239,41 +5624,49 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %Iterator.Op.type.c95ff6.1: type = fn_type @Iterator.Op.1 [concrete] // CHECK:STDOUT: %Iterator.Op.c90ac2.1: %Iterator.Op.type.c95ff6.1 = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.d56: = custom_witness (%ValueType, %Iterator.Op.c90ac2.1), @CppUnsafeDeref [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.9: type = fn_type @Destroy.WithSelf.Op.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.9: %Destroy.WithSelf.Op.type.ef016f.9 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.9: type = fn_type @Destroy.WithSelf.SelfDestruct.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.9: %Destroy.WithSelf.SelfDestruct.type.fbceb5.9 = struct_value () [concrete] +// CHECK:STDOUT: %Iterator.SubobjectDestroy.type: type = fn_type @Iterator.SubobjectDestroy [concrete] +// CHECK:STDOUT: %Iterator.SubobjectDestroy: %Iterator.SubobjectDestroy.type = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.809: = custom_witness (%Destroy.WithSelf.Op.403171.9, %Iterator.SubobjectDestroy, %Destroy.WithSelf.SelfDestruct.db3fdb.9), @Destroy [concrete] // CHECK:STDOUT: %Iterator.Op.type.c95ff6.2: type = fn_type @Iterator.Op.2 [concrete] // CHECK:STDOUT: %Iterator.Op.c90ac2.2: %Iterator.Op.type.c95ff6.2 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.a79: = custom_witness (%Iterator.Op.c90ac2.2), @Destroy [concrete] -// CHECK:STDOUT: %Iterator.Op.type.c95ff6.3: type = fn_type @Iterator.Op.3 [concrete] -// CHECK:STDOUT: %Iterator.Op.c90ac2.3: %Iterator.Op.type.c95ff6.3 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.68a: = custom_witness (%Iterator.Op.c90ac2.3), @Inc [concrete] +// CHECK:STDOUT: %custom_witness.68a: = custom_witness (%Iterator.Op.c90ac2.2), @Inc [concrete] // CHECK:STDOUT: %Equal.type: type = fn_type @Equal [concrete] // CHECK:STDOUT: %Equal: %Equal.type = struct_value () [concrete] // CHECK:STDOUT: %NotEqual.type: type = fn_type @NotEqual [concrete] // CHECK:STDOUT: %NotEqual: %NotEqual.type = struct_value () [concrete] // CHECK:STDOUT: %custom_witness.2ef: = custom_witness (%Equal, %NotEqual), @EqWith, @EqWith(%Iterator) [concrete] -// CHECK:STDOUT: %facet_value.94c: %CppRange_where.type.d682d6.1 = facet_value %MutableAndConstRange, (%custom_witness.ca2, %custom_witness.1c5, %custom_witness.660, %custom_witness.a79, %custom_witness.d56, %custom_witness.68a, %custom_witness.2ef) [concrete] +// CHECK:STDOUT: %facet_value.cc4: %CppRange_where.type.d682d6.1 = facet_value %MutableAndConstRange, (%custom_witness.dc3, %custom_witness.1c5, %custom_witness.660, %custom_witness.809, %custom_witness.d56, %custom_witness.68a, %custom_witness.2ef) [concrete] // CHECK:STDOUT: %tuple.type.de6: type = tuple_type (%Iterator, %Iterator) [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.8: type = fn_type @Destroy.WithSelf.Op.3 [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.8: %Destroy.WithSelf.Op.type.ef016f.8 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.6c4ec3.8: = custom_witness (%Destroy.WithSelf.Op.403171.8), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.fb2: %Destroy.type = facet_value %tuple.type.de6, (%custom_witness.6c4ec3.8) [concrete] -// CHECK:STDOUT: %Iterate.impl_witness.e93: = impl_witness imports.%Iterate.impl_witness_table.121, @T.as_type.as.Iterate.impl(%facet_value.94c) [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.type.c35: type = fn_type @T.as_type.as.Iterate.impl.NewCursor, @T.as_type.as.Iterate.impl(%facet_value.94c) [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.237: %T.as_type.as.Iterate.impl.NewCursor.type.c35 = struct_value () [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.type.50f: type = fn_type @T.as_type.as.Iterate.impl.Next, @T.as_type.as.Iterate.impl(%facet_value.94c) [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.1b2: %T.as_type.as.Iterate.impl.Next.type.50f = struct_value () [concrete] -// CHECK:STDOUT: %Iterate.facet.c00: %Iterate.type = facet_value %MutableAndConstRange, (%Iterate.impl_witness.e93) [concrete] -// CHECK:STDOUT: %facet_value.266: %Iterate_where.type.290 = facet_value %MutableAndConstRange, (%Iterate.impl_witness.e93) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.8: type = fn_type @Destroy.WithSelf.SubobjectDestroy.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.8: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.8 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.10: type = fn_type @Destroy.WithSelf.Op.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.10: %Destroy.WithSelf.Op.type.ef016f.10 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.10: type = fn_type @Destroy.WithSelf.SelfDestruct.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.10: %Destroy.WithSelf.SelfDestruct.type.fbceb5.10 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f8f19d.8: = custom_witness (%Destroy.WithSelf.Op.403171.10, %Destroy.WithSelf.SubobjectDestroy.d01daf.8, %Destroy.WithSelf.SelfDestruct.db3fdb.10), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.c9a: %Destroy.type = facet_value %tuple.type.de6, (%custom_witness.f8f19d.8) [concrete] +// CHECK:STDOUT: %Iterate.impl_witness.42b: = impl_witness imports.%Iterate.impl_witness_table.121, @T.as_type.as.Iterate.impl(%facet_value.cc4) [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.type.d47: type = fn_type @T.as_type.as.Iterate.impl.NewCursor, @T.as_type.as.Iterate.impl(%facet_value.cc4) [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.4ab: %T.as_type.as.Iterate.impl.NewCursor.type.d47 = struct_value () [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.type.7d9: type = fn_type @T.as_type.as.Iterate.impl.Next, @T.as_type.as.Iterate.impl(%facet_value.cc4) [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.214: %T.as_type.as.Iterate.impl.Next.type.7d9 = struct_value () [concrete] +// CHECK:STDOUT: %Iterate.facet.c14: %Iterate.type = facet_value %MutableAndConstRange, (%Iterate.impl_witness.42b) [concrete] +// CHECK:STDOUT: %facet_value.caf: %Iterate_where.type.8b0 = facet_value %MutableAndConstRange, (%Iterate.impl_witness.42b) [concrete] // CHECK:STDOUT: %r.param_patt.3a6: %pattern_type.fdb = value_param_pattern [concrete] // CHECK:STDOUT: %r.patt.403: %pattern_type.fdb = wrapper_binding_pattern r, %r.param_patt.3a6 [concrete] -// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.d86: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.c00) [concrete] -// CHECK:STDOUT: %Iterate.WithSelf.Next.type.4a6: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.c00) [concrete] -// CHECK:STDOUT: %.e94: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.d86, %Iterate.facet.c00 [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.specific_fn: = specific_function %T.as_type.as.Iterate.impl.NewCursor.237, @T.as_type.as.Iterate.impl.NewCursor(%facet_value.94c) [concrete] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type.e77: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.c14) [concrete] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type.c27: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.c14) [concrete] +// CHECK:STDOUT: %.c8f: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type.e77, %Iterate.facet.c14 [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.NewCursor.specific_fn: = specific_function %T.as_type.as.Iterate.impl.NewCursor.4ab, @T.as_type.as.Iterate.impl.NewCursor(%facet_value.cc4) [concrete] // CHECK:STDOUT: %ptr.b95: type = ptr_type %tuple.type.de6 [concrete] -// CHECK:STDOUT: %.d53: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.4a6, %Iterate.facet.c00 [concrete] -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.specific_fn: = specific_function %T.as_type.as.Iterate.impl.Next.1b2, @T.as_type.as.Iterate.impl.Next(%facet_value.94c) [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.b34: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Destroy.facet.fb2) [concrete] -// CHECK:STDOUT: %.d72: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.b34, %Destroy.facet.fb2 [concrete] +// CHECK:STDOUT: %.d7e: type = fn_type_with_self_type %Iterate.WithSelf.Next.type.c27, %Iterate.facet.c14 [concrete] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.specific_fn: = specific_function %T.as_type.as.Iterate.impl.Next.214, @T.as_type.as.Iterate.impl.Next(%facet_value.cc4) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.c7c: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.c9a) [concrete] +// CHECK:STDOUT: %.c56: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.c7c, %Destroy.facet.c9a [concrete] // CHECK:STDOUT: %complete_type.95d: = complete_type_witness %tuple.type.de6 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -4302,11 +5695,6 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: import Cpp//... // CHECK:STDOUT: } // CHECK:STDOUT: %ValueType.decl: type = class_decl @ValueType [concrete = constants.%ValueType] {} {} -// CHECK:STDOUT: %ValueType.cpp_destructor.decl: %ValueType.cpp_destructor.type = fn_decl @ValueType.cpp_destructor [concrete = constants.%ValueType.cpp_destructor] { -// CHECK:STDOUT: -// CHECK:STDOUT: } { -// CHECK:STDOUT: -// CHECK:STDOUT: } // CHECK:STDOUT: %operator_PlusEqual__carbon_thunk.decl: %operator_PlusEqual__carbon_thunk.type = fn_decl @operator_PlusEqual__carbon_thunk [concrete = constants.%operator_PlusEqual__carbon_thunk] { // CHECK:STDOUT: // CHECK:STDOUT: } { @@ -4315,28 +5703,115 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %MutableAndConstRange.decl: type = class_decl @MutableAndConstRange [concrete = constants.%MutableAndConstRange] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic fn @TestIterate(%R.loc34_17.2: %Iterate_where.type.290) { +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc38_41.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.60e = ref_param_pattern [concrete = constants.%self.param_patt.61b3] +// CHECK:STDOUT: %self.patt: %pattern_type.60e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ecc] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %.8f3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %.8f3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc38_41.1 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.60e = ref_param_pattern [concrete = constants.%self.param_patt.61b3] +// CHECK:STDOUT: %self.patt: %pattern_type.60e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ecc] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %.8f3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %.8f3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc38_41.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e4c = ref_param_pattern [concrete = constants.%self.param_patt.cb2] +// CHECK:STDOUT: %self.patt: %pattern_type.e4c = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.32b] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %MaybeUnformed.0af = ref_param call_param0 +// CHECK:STDOUT: %self: ref %MaybeUnformed.0af = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc38_41.2 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e4c = ref_param_pattern [concrete = constants.%self.param_patt.cb2] +// CHECK:STDOUT: %self.patt: %pattern_type.e4c = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.32b] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %MaybeUnformed.0af = ref_param call_param0 +// CHECK:STDOUT: %self: ref %MaybeUnformed.0af = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc38_41.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d] +// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0 +// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.5 = fn_decl @Destroy.WithSelf.Op.loc38_41.3 [concrete = constants.%Destroy.WithSelf.Op.403171.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d] +// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0 +// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc38_41.4 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.95d = ref_param_pattern [concrete = constants.%self.param_patt.432] +// CHECK:STDOUT: %self.patt: %pattern_type.95d = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.25a] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.value.has_value.ac3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.value.has_value.ac3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.5: %Destroy.WithSelf.Op.type.ef016f.6 = fn_decl @Destroy.WithSelf.Op.loc38_41.4 [concrete = constants.%Destroy.WithSelf.Op.403171.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.95d = ref_param_pattern [concrete = constants.%self.param_patt.432] +// CHECK:STDOUT: %self.patt: %pattern_type.95d = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.25a] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.value.has_value.ac3 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.value.has_value.ac3 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc38_41.5 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e96 = ref_param_pattern [concrete = constants.%self.param_patt.861] +// CHECK:STDOUT: %self.patt: %pattern_type.e96 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.c75] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %DefaultOptionalStorage.58e = ref_param call_param0 +// CHECK:STDOUT: %self: ref %DefaultOptionalStorage.58e = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.6: %Destroy.WithSelf.Op.type.ef016f.7 = fn_decl @Destroy.WithSelf.Op.loc38_41.5 [concrete = constants.%Destroy.WithSelf.Op.403171.7] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e96 = ref_param_pattern [concrete = constants.%self.param_patt.861] +// CHECK:STDOUT: %self.patt: %pattern_type.e96 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.c75] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %DefaultOptionalStorage.58e = ref_param call_param0 +// CHECK:STDOUT: %self: ref %DefaultOptionalStorage.58e = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc38_41.6 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.7] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.540 = ref_param_pattern [concrete = constants.%self.param_patt.422] +// CHECK:STDOUT: %self.patt: %pattern_type.540 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.f61] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Optional.70f = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Optional.70f = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.7: %Destroy.WithSelf.Op.type.ef016f.8 = fn_decl @Destroy.WithSelf.Op.loc38_41.6 [concrete = constants.%Destroy.WithSelf.Op.403171.8] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.540 = ref_param_pattern [concrete = constants.%self.param_patt.422] +// CHECK:STDOUT: %self.patt: %pattern_type.540 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.f61] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Optional.70f = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Optional.70f = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @TestIterate(%R.loc34_17.2: %Iterate_where.type.8b0) { // CHECK:STDOUT: // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: -// CHECK:STDOUT: %Iterate.lookup_impl_witness: = lookup_impl_witness %R.loc34_17.1, @Iterate [symbolic = %Iterate.lookup_impl_witness (constants.%Iterate.lookup_impl_witness.116)] -// CHECK:STDOUT: %Iterate.facet.loc38_41.5: %Iterate.type = facet_value %R.as_type.loc34_83.1, (%Iterate.lookup_impl_witness) [symbolic = %Iterate.facet.loc38_41.5 (constants.%Iterate.facet.401)] -// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.loc38_41.5) [symbolic = %Iterate.WithSelf.NewCursor.type (constants.%Iterate.WithSelf.NewCursor.type.e10)] -// CHECK:STDOUT: %.loc38_41.20: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type, %Iterate.facet.loc38_41.5 [symbolic = %.loc38_41.20 (constants.%.4ab)] -// CHECK:STDOUT: %impl.elem2.loc38_41.2: @TestIterate.%.loc38_41.20 (%.4ab) = impl_witness_access %Iterate.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc38_41.2 (constants.%impl.elem2.739)] -// CHECK:STDOUT: %specific_impl_fn.loc38_41.4: = specific_impl_function %impl.elem2.loc38_41.2, @Iterate.WithSelf.NewCursor(%Iterate.facet.loc38_41.5) [symbolic = %specific_impl_fn.loc38_41.4 (constants.%specific_impl_fn.2b2)] +// CHECK:STDOUT: %Iterate.lookup_impl_witness: = lookup_impl_witness %R.loc34_17.1, @Iterate [symbolic = %Iterate.lookup_impl_witness (constants.%Iterate.lookup_impl_witness.a99)] +// CHECK:STDOUT: %Iterate.facet.loc38_41.5: %Iterate.type = facet_value %R.as_type.loc34_83.1, (%Iterate.lookup_impl_witness) [symbolic = %Iterate.facet.loc38_41.5 (constants.%Iterate.facet.c55)] +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type: type = fn_type @Iterate.WithSelf.NewCursor, @Iterate.WithSelf(%Iterate.facet.loc38_41.5) [symbolic = %Iterate.WithSelf.NewCursor.type (constants.%Iterate.WithSelf.NewCursor.type.a6c)] +// CHECK:STDOUT: %.loc38_41.20: type = fn_type_with_self_type %Iterate.WithSelf.NewCursor.type, %Iterate.facet.loc38_41.5 [symbolic = %.loc38_41.20 (constants.%.57a)] +// CHECK:STDOUT: %impl.elem2.loc38_41.3: @TestIterate.%.loc38_41.20 (%.57a) = impl_witness_access %Iterate.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc38_41.3 (constants.%impl.elem2.51b)] +// CHECK:STDOUT: %specific_impl_fn.loc38_41.4: = specific_impl_function %impl.elem2.loc38_41.3, @Iterate.WithSelf.NewCursor(%Iterate.facet.loc38_41.5) [symbolic = %specific_impl_fn.loc38_41.4 (constants.%specific_impl_fn.986)] // CHECK:STDOUT: -// CHECK:STDOUT: %ptr: type = ptr_type %as_type [symbolic = %ptr (constants.%ptr.494)] -// CHECK:STDOUT: %Iterate.WithSelf.Next.type: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.loc38_41.5) [symbolic = %Iterate.WithSelf.Next.type (constants.%Iterate.WithSelf.Next.type.7bd)] -// CHECK:STDOUT: %.loc38_41.21: type = fn_type_with_self_type %Iterate.WithSelf.Next.type, %Iterate.facet.loc38_41.5 [symbolic = %.loc38_41.21 (constants.%.8ee)] -// CHECK:STDOUT: %impl.elem3.loc38_41.2: @TestIterate.%.loc38_41.21 (%.8ee) = impl_witness_access %Iterate.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc38_41.2 (constants.%impl.elem3.65d)] -// CHECK:STDOUT: %specific_impl_fn.loc38_41.5: = specific_impl_function %impl.elem3.loc38_41.2, @Iterate.WithSelf.Next(%Iterate.facet.loc38_41.5) [symbolic = %specific_impl_fn.loc38_41.5 (constants.%specific_impl_fn.30e)] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%impl.elem1) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.223)] -// CHECK:STDOUT: %.loc38_41.22: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %impl.elem1 [symbolic = %.loc38_41.22 (constants.%.32e)] -// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %impl.elem1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.95e)] -// CHECK:STDOUT: %impl.elem0.loc38_41.2: @TestIterate.%.loc38_41.22 (%.32e) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc38_41.2 (constants.%impl.elem0.87c)] -// CHECK:STDOUT: %specific_impl_fn.loc38_41.6: = specific_impl_function %impl.elem0.loc38_41.2, @Destroy.WithSelf.Op.1(%impl.elem1) [symbolic = %specific_impl_fn.loc38_41.6 (constants.%specific_impl_fn.65a)] +// CHECK:STDOUT: %ptr: type = ptr_type %as_type [symbolic = %ptr (constants.%ptr.696)] +// CHECK:STDOUT: %Iterate.WithSelf.Next.type: type = fn_type @Iterate.WithSelf.Next, @Iterate.WithSelf(%Iterate.facet.loc38_41.5) [symbolic = %Iterate.WithSelf.Next.type (constants.%Iterate.WithSelf.Next.type.cd7)] +// CHECK:STDOUT: %.loc38_41.21: type = fn_type_with_self_type %Iterate.WithSelf.Next.type, %Iterate.facet.loc38_41.5 [symbolic = %.loc38_41.21 (constants.%.c1e)] +// CHECK:STDOUT: %impl.elem3.loc38_41.2: @TestIterate.%.loc38_41.21 (%.c1e) = impl_witness_access %Iterate.lookup_impl_witness, element3 [symbolic = %impl.elem3.loc38_41.2 (constants.%impl.elem3.576)] +// CHECK:STDOUT: %specific_impl_fn.loc38_41.5: = specific_impl_function %impl.elem3.loc38_41.2, @Iterate.WithSelf.Next(%Iterate.facet.loc38_41.5) [symbolic = %specific_impl_fn.loc38_41.5 (constants.%specific_impl_fn.1db)] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%impl.elem1) [symbolic = %Destroy.WithSelf.SelfDestruct.type (constants.%Destroy.WithSelf.SelfDestruct.type.57f)] +// CHECK:STDOUT: %.loc38_41.22: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type, %impl.elem1 [symbolic = %.loc38_41.22 (constants.%.b9e)] +// CHECK:STDOUT: %Destroy.lookup_impl_witness: = lookup_impl_witness %impl.elem1, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness.eb0)] +// CHECK:STDOUT: %impl.elem2.loc38_41.4: @TestIterate.%.loc38_41.22 (%.b9e) = impl_witness_access %Destroy.lookup_impl_witness, element2 [symbolic = %impl.elem2.loc38_41.4 (constants.%impl.elem2.570)] +// CHECK:STDOUT: %specific_impl_fn.loc38_41.6: = specific_impl_function %impl.elem2.loc38_41.4, @Destroy.WithSelf.SelfDestruct.1(%impl.elem1) [symbolic = %specific_impl_fn.loc38_41.6 (constants.%specific_impl_fn.74c)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%r.param: @TestIterate.%R.as_type.loc34_83.1 (%R.as_type)) { // CHECK:STDOUT: !entry: @@ -4345,53 +5820,53 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %i.patt: %pattern_type.e09 = value_binding_pattern i [concrete = constants.%i.patt] // CHECK:STDOUT: } // CHECK:STDOUT: %r.ref: @TestIterate.%R.as_type.loc34_83.1 (%R.as_type) = name_ref r, %r -// CHECK:STDOUT: %impl.elem2.loc38_41.1: @TestIterate.%.loc38_41.20 (%.4ab) = impl_witness_access constants.%Iterate.lookup_impl_witness.116, element2 [symbolic = %impl.elem2.loc38_41.2 (constants.%impl.elem2.739)] +// CHECK:STDOUT: %impl.elem2.loc38_41.1: @TestIterate.%.loc38_41.20 (%.57a) = impl_witness_access constants.%Iterate.lookup_impl_witness.a99, element2 [symbolic = %impl.elem2.loc38_41.3 (constants.%impl.elem2.51b)] // CHECK:STDOUT: %bound_method.loc38_41.1: = bound_method %r.ref, %impl.elem2.loc38_41.1 -// CHECK:STDOUT: %Iterate.facet.loc38_41.1: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.116) [symbolic = %Iterate.facet.loc38_41.5 (constants.%Iterate.facet.401)] -// CHECK:STDOUT: %.loc38_41.1: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc38_41.1 [symbolic = %Iterate.facet.loc38_41.5 (constants.%Iterate.facet.401)] -// CHECK:STDOUT: %Iterate.facet.loc38_41.2: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.116) [symbolic = %Iterate.facet.loc38_41.5 (constants.%Iterate.facet.401)] -// CHECK:STDOUT: %.loc38_41.2: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc38_41.2 [symbolic = %Iterate.facet.loc38_41.5 (constants.%Iterate.facet.401)] -// CHECK:STDOUT: %specific_impl_fn.loc38_41.1: = specific_impl_function %impl.elem2.loc38_41.1, @Iterate.WithSelf.NewCursor(constants.%Iterate.facet.401) [symbolic = %specific_impl_fn.loc38_41.4 (constants.%specific_impl_fn.2b2)] +// CHECK:STDOUT: %Iterate.facet.loc38_41.1: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.a99) [symbolic = %Iterate.facet.loc38_41.5 (constants.%Iterate.facet.c55)] +// CHECK:STDOUT: %.loc38_41.1: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc38_41.1 [symbolic = %Iterate.facet.loc38_41.5 (constants.%Iterate.facet.c55)] +// CHECK:STDOUT: %Iterate.facet.loc38_41.2: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.a99) [symbolic = %Iterate.facet.loc38_41.5 (constants.%Iterate.facet.c55)] +// CHECK:STDOUT: %.loc38_41.2: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc38_41.2 [symbolic = %Iterate.facet.loc38_41.5 (constants.%Iterate.facet.c55)] +// CHECK:STDOUT: %specific_impl_fn.loc38_41.1: = specific_impl_function %impl.elem2.loc38_41.1, @Iterate.WithSelf.NewCursor(constants.%Iterate.facet.c55) [symbolic = %specific_impl_fn.loc38_41.4 (constants.%specific_impl_fn.986)] // CHECK:STDOUT: %bound_method.loc38_41.2: = bound_method %r.ref, %specific_impl_fn.loc38_41.1 -// CHECK:STDOUT: %var: ref @TestIterate.%as_type (%as_type.04b) = var_storage invalid -// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.call: init @TestIterate.%as_type (%as_type.04b) to %var = call %bound_method.loc38_41.2(%r.ref) +// CHECK:STDOUT: %var: ref @TestIterate.%as_type (%as_type.733) = var_storage invalid +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.call: init @TestIterate.%as_type (%as_type.733) to %var = call %bound_method.loc38_41.2(%r.ref) // CHECK:STDOUT: assign %var, %Iterate.WithSelf.NewCursor.call // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.next: -// CHECK:STDOUT: %addr.loc38: @TestIterate.%ptr (%ptr.494) = addr_of %var -// CHECK:STDOUT: %impl.elem3.loc38_41.1: @TestIterate.%.loc38_41.21 (%.8ee) = impl_witness_access constants.%Iterate.lookup_impl_witness.116, element3 [symbolic = %impl.elem3.loc38_41.2 (constants.%impl.elem3.65d)] +// CHECK:STDOUT: %addr.loc38: @TestIterate.%ptr (%ptr.696) = addr_of %var +// CHECK:STDOUT: %impl.elem3.loc38_41.1: @TestIterate.%.loc38_41.21 (%.c1e) = impl_witness_access constants.%Iterate.lookup_impl_witness.a99, element3 [symbolic = %impl.elem3.loc38_41.2 (constants.%impl.elem3.576)] // CHECK:STDOUT: %bound_method.loc38_41.3: = bound_method %r.ref, %impl.elem3.loc38_41.1 -// CHECK:STDOUT: %Iterate.facet.loc38_41.3: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.116) [symbolic = %Iterate.facet.loc38_41.5 (constants.%Iterate.facet.401)] -// CHECK:STDOUT: %.loc38_41.3: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc38_41.3 [symbolic = %Iterate.facet.loc38_41.5 (constants.%Iterate.facet.401)] -// CHECK:STDOUT: %Iterate.facet.loc38_41.4: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.116) [symbolic = %Iterate.facet.loc38_41.5 (constants.%Iterate.facet.401)] -// CHECK:STDOUT: %.loc38_41.4: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc38_41.4 [symbolic = %Iterate.facet.loc38_41.5 (constants.%Iterate.facet.401)] -// CHECK:STDOUT: %.loc38_41.5: %Destroy.type = converted constants.%as_type.04b, constants.%impl.elem1.9b3 [symbolic = %impl.elem1 (constants.%impl.elem1.9b3)] -// CHECK:STDOUT: %.loc38_41.6: %Destroy.type = converted constants.%as_type.04b, constants.%impl.elem1.9b3 [symbolic = %impl.elem1 (constants.%impl.elem1.9b3)] -// CHECK:STDOUT: %specific_impl_fn.loc38_41.2: = specific_impl_function %impl.elem3.loc38_41.1, @Iterate.WithSelf.Next(constants.%Iterate.facet.401) [symbolic = %specific_impl_fn.loc38_41.5 (constants.%specific_impl_fn.30e)] +// CHECK:STDOUT: %Iterate.facet.loc38_41.3: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.a99) [symbolic = %Iterate.facet.loc38_41.5 (constants.%Iterate.facet.c55)] +// CHECK:STDOUT: %.loc38_41.3: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc38_41.3 [symbolic = %Iterate.facet.loc38_41.5 (constants.%Iterate.facet.c55)] +// CHECK:STDOUT: %Iterate.facet.loc38_41.4: %Iterate.type = facet_value constants.%R.as_type, (constants.%Iterate.lookup_impl_witness.a99) [symbolic = %Iterate.facet.loc38_41.5 (constants.%Iterate.facet.c55)] +// CHECK:STDOUT: %.loc38_41.4: %Iterate.type = converted constants.%R.as_type, %Iterate.facet.loc38_41.4 [symbolic = %Iterate.facet.loc38_41.5 (constants.%Iterate.facet.c55)] +// CHECK:STDOUT: %.loc38_41.5: %Destroy.type = converted constants.%as_type.733, constants.%impl.elem1.751 [symbolic = %impl.elem1 (constants.%impl.elem1.751)] +// CHECK:STDOUT: %.loc38_41.6: %Destroy.type = converted constants.%as_type.733, constants.%impl.elem1.751 [symbolic = %impl.elem1 (constants.%impl.elem1.751)] +// CHECK:STDOUT: %specific_impl_fn.loc38_41.2: = specific_impl_function %impl.elem3.loc38_41.1, @Iterate.WithSelf.Next(constants.%Iterate.facet.c55) [symbolic = %specific_impl_fn.loc38_41.5 (constants.%specific_impl_fn.1db)] // CHECK:STDOUT: %bound_method.loc38_41.4: = bound_method %r.ref, %specific_impl_fn.loc38_41.2 -// CHECK:STDOUT: %.loc38_41.7: ref %Optional.3cc = temporary_storage -// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.3cc to %.loc38_41.7 = call %bound_method.loc38_41.4(%r.ref, %addr.loc38) -// CHECK:STDOUT: %.loc38_41.8: ref %Optional.3cc = temporary %.loc38_41.7, %Iterate.WithSelf.Next.call -// CHECK:STDOUT: %.loc38_41.9: %Optional.HasValue.type.f78 = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.33d) [concrete = constants.%Optional.HasValue.519] -// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.f78 = name_ref HasValue, %.loc38_41.9 [concrete = constants.%Optional.HasValue.519] +// CHECK:STDOUT: %.loc38_41.7: ref %Optional.70f = temporary_storage +// CHECK:STDOUT: %Iterate.WithSelf.Next.call: init %Optional.70f to %.loc38_41.7 = call %bound_method.loc38_41.4(%r.ref, %addr.loc38) +// CHECK:STDOUT: %.loc38_41.8: ref %Optional.70f = temporary %.loc38_41.7, %Iterate.WithSelf.Next.call +// CHECK:STDOUT: %.loc38_41.9: %Optional.HasValue.type.74b = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.e68) [concrete = constants.%Optional.HasValue.f75] +// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.74b = name_ref HasValue, %.loc38_41.9 [concrete = constants.%Optional.HasValue.f75] // CHECK:STDOUT: %Optional.HasValue.bound: = bound_method %.loc38_41.8, %HasValue.ref -// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%OptionalStorage.facet.33d) [concrete = constants.%Optional.HasValue.specific_fn.b3a] +// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%OptionalStorage.facet.e68) [concrete = constants.%Optional.HasValue.specific_fn.e2e] // CHECK:STDOUT: %bound_method.loc38_41.5: = bound_method %.loc38_41.8, %Optional.HasValue.specific_fn -// CHECK:STDOUT: %.loc38_41.10: %Optional.3cc = acquire_value %.loc38_41.8 +// CHECK:STDOUT: %.loc38_41.10: %Optional.70f = acquire_value %.loc38_41.8 // CHECK:STDOUT: %Optional.HasValue.call: init bool = call %bound_method.loc38_41.5(%.loc38_41.10) // CHECK:STDOUT: %.loc38_41.11: bool = value_of_initializer %Optional.HasValue.call // CHECK:STDOUT: %.loc38_41.12: bool = converted %Optional.HasValue.call, %.loc38_41.11 // CHECK:STDOUT: if %.loc38_41.12 br !for.body else br !for.done // CHECK:STDOUT: // CHECK:STDOUT: !for.body: -// CHECK:STDOUT: %.loc38_41.13: %Optional.Get.type.9c5 = specific_constant imports.%Core.import_ref.dab, @Optional(constants.%OptionalStorage.facet.33d) [concrete = constants.%Optional.Get.323] -// CHECK:STDOUT: %Get.ref: %Optional.Get.type.9c5 = name_ref Get, %.loc38_41.13 [concrete = constants.%Optional.Get.323] +// CHECK:STDOUT: %.loc38_41.13: %Optional.Get.type.316 = specific_constant imports.%Core.import_ref.dab, @Optional(constants.%OptionalStorage.facet.e68) [concrete = constants.%Optional.Get.483] +// CHECK:STDOUT: %Get.ref: %Optional.Get.type.316 = name_ref Get, %.loc38_41.13 [concrete = constants.%Optional.Get.483] // CHECK:STDOUT: %Optional.Get.bound: = bound_method %.loc38_41.8, %Get.ref -// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%OptionalStorage.facet.33d) [concrete = constants.%Optional.Get.specific_fn.d62] +// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%OptionalStorage.facet.e68) [concrete = constants.%Optional.Get.specific_fn.296] // CHECK:STDOUT: %bound_method.loc38_41.6: = bound_method %.loc38_41.8, %Optional.Get.specific_fn // CHECK:STDOUT: %.loc38_41.14: ref %ValueType = temporary_storage -// CHECK:STDOUT: %.loc38_41.15: %Optional.3cc = acquire_value %.loc38_41.8 +// CHECK:STDOUT: %.loc38_41.15: %Optional.70f = acquire_value %.loc38_41.8 // CHECK:STDOUT: %Optional.Get.call: init %ValueType to %.loc38_41.14 = call %bound_method.loc38_41.6(%.loc38_41.15) // CHECK:STDOUT: %.loc38_41.16: ref %ValueType = temporary %.loc38_41.14, %Optional.Get.call // CHECK:STDOUT: %.loc38_41.17: %ValueType = acquire_value %.loc38_41.16 @@ -4408,52 +5883,104 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %.loc39_9.1: %ptr.403 = as_compatible %addr.loc39 // CHECK:STDOUT: %.loc39_9.2: %ptr.403 = converted %addr.loc39, %.loc39_9.1 // CHECK:STDOUT: %operator_PlusEqual__carbon_thunk.call: ref %ValueType = call imports.%operator_PlusEqual__carbon_thunk.decl(%sum.ref, %.loc39_9.2) -// CHECK:STDOUT: %ValueType.Op.bound.loc38: = bound_method %.loc38_41.16, constants.%ValueType.Op.038ea9.1 -// CHECK:STDOUT: %Op.ref.loc38: %ValueType.cpp_destructor.type = name_ref Op, imports.%ValueType.cpp_destructor.decl [concrete = constants.%ValueType.cpp_destructor] -// CHECK:STDOUT: %ValueType.cpp_destructor.bound.loc38: = bound_method %.loc38_41.16, %Op.ref.loc38 -// CHECK:STDOUT: %ValueType.cpp_destructor.call.loc38: init %empty_tuple.type = call %ValueType.cpp_destructor.bound.loc38(%.loc38_41.16) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc38_41.1: = bound_method %.loc38_41.8, constants.%Destroy.WithSelf.Op.403171.7 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc38_41.1: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc38_41.1(%.loc38_41.8) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc38_41.1: = bound_method %.loc38_41.16, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc38_41.1: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc38_41.1(%.loc38_41.16) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc38_41.2: = bound_method %.loc38_41.8, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.8 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc38_41.2: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc38_41.2(%.loc38_41.8) // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.done: -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc38_41.2: = bound_method %.loc38_41.8, constants.%Destroy.WithSelf.Op.403171.7 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc38_41.2: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc38_41.2(%.loc38_41.8) -// CHECK:STDOUT: %impl.elem0.loc38_41.1: @TestIterate.%.loc38_41.22 (%.32e) = impl_witness_access constants.%Destroy.lookup_impl_witness.95e, element0 [symbolic = %impl.elem0.loc38_41.2 (constants.%impl.elem0.87c)] -// CHECK:STDOUT: %bound_method.loc38_41.7: = bound_method %var, %impl.elem0.loc38_41.1 -// CHECK:STDOUT: %.loc38_41.18: %Destroy.type = converted constants.%as_type.04b, constants.%impl.elem1.9b3 [symbolic = %impl.elem1 (constants.%impl.elem1.9b3)] -// CHECK:STDOUT: %.loc38_41.19: %Destroy.type = converted constants.%as_type.04b, constants.%impl.elem1.9b3 [symbolic = %impl.elem1 (constants.%impl.elem1.9b3)] -// CHECK:STDOUT: %specific_impl_fn.loc38_41.3: = specific_impl_function %impl.elem0.loc38_41.1, @Destroy.WithSelf.Op.1(constants.%impl.elem1.9b3) [symbolic = %specific_impl_fn.loc38_41.6 (constants.%specific_impl_fn.65a)] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc38_41.3: = bound_method %.loc38_41.8, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.8 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc38_41.3: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc38_41.3(%.loc38_41.8) +// CHECK:STDOUT: %impl.elem2.loc38_41.2: @TestIterate.%.loc38_41.22 (%.b9e) = impl_witness_access constants.%Destroy.lookup_impl_witness.eb0, element2 [symbolic = %impl.elem2.loc38_41.4 (constants.%impl.elem2.570)] +// CHECK:STDOUT: %bound_method.loc38_41.7: = bound_method %var, %impl.elem2.loc38_41.2 +// CHECK:STDOUT: %.loc38_41.18: %Destroy.type = converted constants.%as_type.733, constants.%impl.elem1.751 [symbolic = %impl.elem1 (constants.%impl.elem1.751)] +// CHECK:STDOUT: %.loc38_41.19: %Destroy.type = converted constants.%as_type.733, constants.%impl.elem1.751 [symbolic = %impl.elem1 (constants.%impl.elem1.751)] +// CHECK:STDOUT: %specific_impl_fn.loc38_41.3: = specific_impl_function %impl.elem2.loc38_41.2, @Destroy.WithSelf.SelfDestruct.1(constants.%impl.elem1.751) [symbolic = %specific_impl_fn.loc38_41.6 (constants.%specific_impl_fn.74c)] // CHECK:STDOUT: %bound_method.loc38_41.8: = bound_method %var, %specific_impl_fn.loc38_41.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc38_41.3: init %empty_tuple.type = call %bound_method.loc38_41.8(%var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc38_41.4: init %empty_tuple.type = call %bound_method.loc38_41.8(%var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc38_41.1(%self.param: ref %.8f3) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc38_41.1(%self.param: ref %.8f3) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc38_41.2(%self.param: ref %MaybeUnformed.5d7) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc38_41.1(%self.param: ref %.8f3) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc38_41.1(%self.param: ref %.8f3) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc38_41.2(%self.param: ref %MaybeUnformed.0af) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc38_41.2(%self.param: ref %MaybeUnformed.0af) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc38_41.2(%self.param: ref %MaybeUnformed.0af) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc38_41.3(%self.param: ref bool) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc38_41.3(%self.param: ref bool) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc38_41.4(%self.param: ref %struct_type.value.has_value.bd1) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc38_41.3(%self.param: ref bool) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc38_41.4(%self.param: ref %struct_type.value.has_value.ac3) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc38_41.5(%self.param: ref %DefaultOptionalStorage.338) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc38_41.4(%self.param: ref %struct_type.value.has_value.ac3) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc38_41.4(%self.param: ref %struct_type.value.has_value.ac3) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.5(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc38_41.5(%self.param: ref %DefaultOptionalStorage.58e) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc38_41.6(%self.param: ref %Optional.3cc) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc38_41.5(%self.param: ref %DefaultOptionalStorage.58e) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc38_41.5(%self.param: ref %DefaultOptionalStorage.58e) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.6(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.5(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc38_41.6(%self.param: ref %Optional.70f) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc38_41.6(%self.param: ref %Optional.70f) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc38_41.6(%self.param: ref %Optional.70f) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.7(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.6(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -4464,13 +5991,13 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %i.patt: %pattern_type.e09 = value_binding_pattern i [concrete = constants.%i.patt] // CHECK:STDOUT: } // CHECK:STDOUT: %mc.ref: ref %MutableAndConstRange = name_ref mc, %mc -// CHECK:STDOUT: %impl.elem2: %.e94 = impl_witness_access constants.%Iterate.impl_witness.e93, element2 [concrete = constants.%T.as_type.as.Iterate.impl.NewCursor.237] +// CHECK:STDOUT: %impl.elem2: %.c8f = impl_witness_access constants.%Iterate.impl_witness.42b, element2 [concrete = constants.%T.as_type.as.Iterate.impl.NewCursor.4ab] // CHECK:STDOUT: %bound_method.loc80_42.1: = bound_method %mc.ref, %impl.elem2 -// CHECK:STDOUT: %facet_value.loc80_42.1: %CppRange_where.type.d682d6.1 = facet_value constants.%MutableAndConstRange, (constants.%custom_witness.ca2, constants.%custom_witness.1c5, constants.%custom_witness.660, constants.%custom_witness.a79, constants.%custom_witness.d56, constants.%custom_witness.68a, constants.%custom_witness.2ef) [concrete = constants.%facet_value.94c] -// CHECK:STDOUT: %.loc80_42.1: %CppRange_where.type.d682d6.1 = converted constants.%MutableAndConstRange, %facet_value.loc80_42.1 [concrete = constants.%facet_value.94c] -// CHECK:STDOUT: %facet_value.loc80_42.2: %CppRange_where.type.d682d6.1 = facet_value constants.%MutableAndConstRange, (constants.%custom_witness.ca2, constants.%custom_witness.1c5, constants.%custom_witness.660, constants.%custom_witness.a79, constants.%custom_witness.d56, constants.%custom_witness.68a, constants.%custom_witness.2ef) [concrete = constants.%facet_value.94c] -// CHECK:STDOUT: %.loc80_42.2: %CppRange_where.type.d682d6.1 = converted constants.%MutableAndConstRange, %facet_value.loc80_42.2 [concrete = constants.%facet_value.94c] -// CHECK:STDOUT: %specific_fn.loc80_42.1: = specific_function %impl.elem2, @T.as_type.as.Iterate.impl.NewCursor(constants.%facet_value.94c) [concrete = constants.%T.as_type.as.Iterate.impl.NewCursor.specific_fn] +// CHECK:STDOUT: %facet_value.loc80_42.1: %CppRange_where.type.d682d6.1 = facet_value constants.%MutableAndConstRange, (constants.%custom_witness.dc3, constants.%custom_witness.1c5, constants.%custom_witness.660, constants.%custom_witness.809, constants.%custom_witness.d56, constants.%custom_witness.68a, constants.%custom_witness.2ef) [concrete = constants.%facet_value.cc4] +// CHECK:STDOUT: %.loc80_42.1: %CppRange_where.type.d682d6.1 = converted constants.%MutableAndConstRange, %facet_value.loc80_42.1 [concrete = constants.%facet_value.cc4] +// CHECK:STDOUT: %facet_value.loc80_42.2: %CppRange_where.type.d682d6.1 = facet_value constants.%MutableAndConstRange, (constants.%custom_witness.dc3, constants.%custom_witness.1c5, constants.%custom_witness.660, constants.%custom_witness.809, constants.%custom_witness.d56, constants.%custom_witness.68a, constants.%custom_witness.2ef) [concrete = constants.%facet_value.cc4] +// CHECK:STDOUT: %.loc80_42.2: %CppRange_where.type.d682d6.1 = converted constants.%MutableAndConstRange, %facet_value.loc80_42.2 [concrete = constants.%facet_value.cc4] +// CHECK:STDOUT: %specific_fn.loc80_42.1: = specific_function %impl.elem2, @T.as_type.as.Iterate.impl.NewCursor(constants.%facet_value.cc4) [concrete = constants.%T.as_type.as.Iterate.impl.NewCursor.specific_fn] // CHECK:STDOUT: %bound_method.loc80_42.2: = bound_method %mc.ref, %specific_fn.loc80_42.1 // CHECK:STDOUT: %var: ref %tuple.type.de6 = var_storage invalid // CHECK:STDOUT: %.loc80_40.1: %MutableAndConstRange = acquire_value %mc.ref @@ -4480,37 +6007,37 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: // CHECK:STDOUT: !for.next: // CHECK:STDOUT: %addr.loc80: %ptr.b95 = addr_of %var -// CHECK:STDOUT: %impl.elem3: %.d53 = impl_witness_access constants.%Iterate.impl_witness.e93, element3 [concrete = constants.%T.as_type.as.Iterate.impl.Next.1b2] +// CHECK:STDOUT: %impl.elem3: %.d7e = impl_witness_access constants.%Iterate.impl_witness.42b, element3 [concrete = constants.%T.as_type.as.Iterate.impl.Next.214] // CHECK:STDOUT: %bound_method.loc80_42.3: = bound_method %mc.ref, %impl.elem3 -// CHECK:STDOUT: %facet_value.loc80_42.3: %CppRange_where.type.d682d6.1 = facet_value constants.%MutableAndConstRange, (constants.%custom_witness.ca2, constants.%custom_witness.1c5, constants.%custom_witness.660, constants.%custom_witness.a79, constants.%custom_witness.d56, constants.%custom_witness.68a, constants.%custom_witness.2ef) [concrete = constants.%facet_value.94c] -// CHECK:STDOUT: %.loc80_42.3: %CppRange_where.type.d682d6.1 = converted constants.%MutableAndConstRange, %facet_value.loc80_42.3 [concrete = constants.%facet_value.94c] -// CHECK:STDOUT: %facet_value.loc80_42.4: %CppRange_where.type.d682d6.1 = facet_value constants.%MutableAndConstRange, (constants.%custom_witness.ca2, constants.%custom_witness.1c5, constants.%custom_witness.660, constants.%custom_witness.a79, constants.%custom_witness.d56, constants.%custom_witness.68a, constants.%custom_witness.2ef) [concrete = constants.%facet_value.94c] -// CHECK:STDOUT: %.loc80_42.4: %CppRange_where.type.d682d6.1 = converted constants.%MutableAndConstRange, %facet_value.loc80_42.4 [concrete = constants.%facet_value.94c] -// CHECK:STDOUT: %specific_fn.loc80_42.2: = specific_function %impl.elem3, @T.as_type.as.Iterate.impl.Next(constants.%facet_value.94c) [concrete = constants.%T.as_type.as.Iterate.impl.Next.specific_fn] +// CHECK:STDOUT: %facet_value.loc80_42.3: %CppRange_where.type.d682d6.1 = facet_value constants.%MutableAndConstRange, (constants.%custom_witness.dc3, constants.%custom_witness.1c5, constants.%custom_witness.660, constants.%custom_witness.809, constants.%custom_witness.d56, constants.%custom_witness.68a, constants.%custom_witness.2ef) [concrete = constants.%facet_value.cc4] +// CHECK:STDOUT: %.loc80_42.3: %CppRange_where.type.d682d6.1 = converted constants.%MutableAndConstRange, %facet_value.loc80_42.3 [concrete = constants.%facet_value.cc4] +// CHECK:STDOUT: %facet_value.loc80_42.4: %CppRange_where.type.d682d6.1 = facet_value constants.%MutableAndConstRange, (constants.%custom_witness.dc3, constants.%custom_witness.1c5, constants.%custom_witness.660, constants.%custom_witness.809, constants.%custom_witness.d56, constants.%custom_witness.68a, constants.%custom_witness.2ef) [concrete = constants.%facet_value.cc4] +// CHECK:STDOUT: %.loc80_42.4: %CppRange_where.type.d682d6.1 = converted constants.%MutableAndConstRange, %facet_value.loc80_42.4 [concrete = constants.%facet_value.cc4] +// CHECK:STDOUT: %specific_fn.loc80_42.2: = specific_function %impl.elem3, @T.as_type.as.Iterate.impl.Next(constants.%facet_value.cc4) [concrete = constants.%T.as_type.as.Iterate.impl.Next.specific_fn] // CHECK:STDOUT: %bound_method.loc80_42.4: = bound_method %mc.ref, %specific_fn.loc80_42.2 -// CHECK:STDOUT: %.loc80_42.5: ref %Optional.3cc = temporary_storage +// CHECK:STDOUT: %.loc80_42.5: ref %Optional.70f = temporary_storage // CHECK:STDOUT: %.loc80_40.2: %MutableAndConstRange = acquire_value %mc.ref -// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.call: init %Optional.3cc to %.loc80_42.5 = call %bound_method.loc80_42.4(%.loc80_40.2, %addr.loc80) -// CHECK:STDOUT: %.loc80_42.6: ref %Optional.3cc = temporary %.loc80_42.5, %T.as_type.as.Iterate.impl.Next.call -// CHECK:STDOUT: %.loc80_42.7: %Optional.HasValue.type.f78 = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.33d) [concrete = constants.%Optional.HasValue.519] -// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.f78 = name_ref HasValue, %.loc80_42.7 [concrete = constants.%Optional.HasValue.519] +// CHECK:STDOUT: %T.as_type.as.Iterate.impl.Next.call: init %Optional.70f to %.loc80_42.5 = call %bound_method.loc80_42.4(%.loc80_40.2, %addr.loc80) +// CHECK:STDOUT: %.loc80_42.6: ref %Optional.70f = temporary %.loc80_42.5, %T.as_type.as.Iterate.impl.Next.call +// CHECK:STDOUT: %.loc80_42.7: %Optional.HasValue.type.74b = specific_constant imports.%Core.import_ref.bb6, @Optional(constants.%OptionalStorage.facet.e68) [concrete = constants.%Optional.HasValue.f75] +// CHECK:STDOUT: %HasValue.ref: %Optional.HasValue.type.74b = name_ref HasValue, %.loc80_42.7 [concrete = constants.%Optional.HasValue.f75] // CHECK:STDOUT: %Optional.HasValue.bound: = bound_method %.loc80_42.6, %HasValue.ref -// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%OptionalStorage.facet.33d) [concrete = constants.%Optional.HasValue.specific_fn.b3a] +// CHECK:STDOUT: %Optional.HasValue.specific_fn: = specific_function %HasValue.ref, @Optional.HasValue(constants.%OptionalStorage.facet.e68) [concrete = constants.%Optional.HasValue.specific_fn.e2e] // CHECK:STDOUT: %bound_method.loc80_42.5: = bound_method %.loc80_42.6, %Optional.HasValue.specific_fn -// CHECK:STDOUT: %.loc80_42.8: %Optional.3cc = acquire_value %.loc80_42.6 +// CHECK:STDOUT: %.loc80_42.8: %Optional.70f = acquire_value %.loc80_42.6 // CHECK:STDOUT: %Optional.HasValue.call: init bool = call %bound_method.loc80_42.5(%.loc80_42.8) // CHECK:STDOUT: %.loc80_42.9: bool = value_of_initializer %Optional.HasValue.call // CHECK:STDOUT: %.loc80_42.10: bool = converted %Optional.HasValue.call, %.loc80_42.9 // CHECK:STDOUT: if %.loc80_42.10 br !for.body else br !for.done // CHECK:STDOUT: // CHECK:STDOUT: !for.body: -// CHECK:STDOUT: %.loc80_42.11: %Optional.Get.type.9c5 = specific_constant imports.%Core.import_ref.dab, @Optional(constants.%OptionalStorage.facet.33d) [concrete = constants.%Optional.Get.323] -// CHECK:STDOUT: %Get.ref: %Optional.Get.type.9c5 = name_ref Get, %.loc80_42.11 [concrete = constants.%Optional.Get.323] +// CHECK:STDOUT: %.loc80_42.11: %Optional.Get.type.316 = specific_constant imports.%Core.import_ref.dab, @Optional(constants.%OptionalStorage.facet.e68) [concrete = constants.%Optional.Get.483] +// CHECK:STDOUT: %Get.ref: %Optional.Get.type.316 = name_ref Get, %.loc80_42.11 [concrete = constants.%Optional.Get.483] // CHECK:STDOUT: %Optional.Get.bound: = bound_method %.loc80_42.6, %Get.ref -// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%OptionalStorage.facet.33d) [concrete = constants.%Optional.Get.specific_fn.d62] +// CHECK:STDOUT: %Optional.Get.specific_fn: = specific_function %Get.ref, @Optional.Get(constants.%OptionalStorage.facet.e68) [concrete = constants.%Optional.Get.specific_fn.296] // CHECK:STDOUT: %bound_method.loc80_42.6: = bound_method %.loc80_42.6, %Optional.Get.specific_fn // CHECK:STDOUT: %.loc80_42.12: ref %ValueType = temporary_storage -// CHECK:STDOUT: %.loc80_42.13: %Optional.3cc = acquire_value %.loc80_42.6 +// CHECK:STDOUT: %.loc80_42.13: %Optional.70f = acquire_value %.loc80_42.6 // CHECK:STDOUT: %Optional.Get.call: init %ValueType to %.loc80_42.12 = call %bound_method.loc80_42.6(%.loc80_42.13) // CHECK:STDOUT: %.loc80_42.14: ref %ValueType = temporary %.loc80_42.12, %Optional.Get.call // CHECK:STDOUT: %.loc80_42.15: %ValueType = acquire_value %.loc80_42.14 @@ -4527,19 +6054,17 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %.loc81_9.1: %ptr.403 = as_compatible %addr.loc81 // CHECK:STDOUT: %.loc81_9.2: %ptr.403 = converted %addr.loc81, %.loc81_9.1 // CHECK:STDOUT: %operator_PlusEqual__carbon_thunk.call: ref %ValueType = call imports.%operator_PlusEqual__carbon_thunk.decl(%sum.ref, %.loc81_9.2) -// CHECK:STDOUT: %ValueType.Op.bound.loc80: = bound_method %.loc80_42.14, constants.%ValueType.Op.038ea9.1 -// CHECK:STDOUT: %Op.ref.loc80: %ValueType.cpp_destructor.type = name_ref Op, imports.%ValueType.cpp_destructor.decl [concrete = constants.%ValueType.cpp_destructor] -// CHECK:STDOUT: %ValueType.cpp_destructor.bound.loc80: = bound_method %.loc80_42.14, %Op.ref.loc80 -// CHECK:STDOUT: %ValueType.cpp_destructor.call.loc80: init %empty_tuple.type = call %ValueType.cpp_destructor.bound.loc80(%.loc80_42.14) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc80_42.1: = bound_method %.loc80_42.6, constants.%Destroy.WithSelf.Op.403171.7 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc80_42.1: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc80_42.1(%.loc80_42.6) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc80_42.1: = bound_method %.loc80_42.14, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc80_42.1: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc80_42.1(%.loc80_42.14) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc80_42.2: = bound_method %.loc80_42.6, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.8 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc80_42.2: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc80_42.2(%.loc80_42.6) // CHECK:STDOUT: br !for.next // CHECK:STDOUT: // CHECK:STDOUT: !for.done: -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc80_42.2: = bound_method %.loc80_42.6, constants.%Destroy.WithSelf.Op.403171.7 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc80_42.2: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc80_42.2(%.loc80_42.6) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc80_42.3: = bound_method %var, constants.%Destroy.WithSelf.Op.403171.8 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc80_42.3: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc80_42.3(%var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc80_42.3: = bound_method %.loc80_42.6, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.8 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc80_42.3: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc80_42.3(%.loc80_42.6) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc80_42.4: = bound_method %var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.10 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc80_42.4: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc80_42.4(%var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -4547,14 +6072,14 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: %R.patt.loc34_17.2 => constants.%R.patt // CHECK:STDOUT: %R.loc34_17.1 => constants.%R // CHECK:STDOUT: %R.as_type.loc34_83.1 => constants.%R.as_type -// CHECK:STDOUT: %pattern_type => constants.%pattern_type.447 -// CHECK:STDOUT: %r.param_patt.loc34_81.2 => constants.%r.param_patt.207 -// CHECK:STDOUT: %r.patt.loc34_81.2 => constants.%r.patt.e8b +// CHECK:STDOUT: %pattern_type => constants.%pattern_type.611 +// CHECK:STDOUT: %r.param_patt.loc34_81.2 => constants.%r.param_patt.e64 +// CHECK:STDOUT: %r.patt.loc34_81.2 => constants.%r.patt.dcb // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @TestIterate(constants.%facet_value.266) { +// CHECK:STDOUT: specific @TestIterate(constants.%facet_value.caf) { // CHECK:STDOUT: %R.patt.loc34_17.2 => constants.%R.patt -// CHECK:STDOUT: %R.loc34_17.1 => constants.%facet_value.266 +// CHECK:STDOUT: %R.loc34_17.1 => constants.%facet_value.caf // CHECK:STDOUT: %R.as_type.loc34_83.1 => constants.%MutableAndConstRange // CHECK:STDOUT: %pattern_type => constants.%pattern_type.fdb // CHECK:STDOUT: %r.param_patt.loc34_81.2 => constants.%r.param_patt.3a6 @@ -4562,24 +6087,24 @@ fn TestDriver(var no_begin_end: Cpp.NoBeginEnd, // CHECK:STDOUT: // CHECK:STDOUT: !definition: // CHECK:STDOUT: %require_complete.loc34 => constants.%complete_type.357 -// CHECK:STDOUT: %Iterate.lookup_impl_witness => constants.%Iterate.impl_witness.e93 -// CHECK:STDOUT: %Iterate.facet.loc38_41.5 => constants.%Iterate.facet.c00 -// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type => constants.%Iterate.WithSelf.NewCursor.type.d86 -// CHECK:STDOUT: %.loc38_41.20 => constants.%.e94 -// CHECK:STDOUT: %impl.elem2.loc38_41.2 => constants.%T.as_type.as.Iterate.impl.NewCursor.237 +// CHECK:STDOUT: %Iterate.lookup_impl_witness => constants.%Iterate.impl_witness.42b +// CHECK:STDOUT: %Iterate.facet.loc38_41.5 => constants.%Iterate.facet.c14 +// CHECK:STDOUT: %Iterate.WithSelf.NewCursor.type => constants.%Iterate.WithSelf.NewCursor.type.e77 +// CHECK:STDOUT: %.loc38_41.20 => constants.%.c8f +// CHECK:STDOUT: %impl.elem2.loc38_41.3 => constants.%T.as_type.as.Iterate.impl.NewCursor.4ab // CHECK:STDOUT: %specific_impl_fn.loc38_41.4 => constants.%T.as_type.as.Iterate.impl.NewCursor.specific_fn -// CHECK:STDOUT: %impl.elem1 => constants.%Destroy.facet.fb2 +// CHECK:STDOUT: %impl.elem1 => constants.%Destroy.facet.c9a // CHECK:STDOUT: %as_type => constants.%tuple.type.de6 // CHECK:STDOUT: %require_complete.1 => constants.%complete_type.95d // CHECK:STDOUT: %ptr => constants.%ptr.b95 -// CHECK:STDOUT: %Iterate.WithSelf.Next.type => constants.%Iterate.WithSelf.Next.type.4a6 -// CHECK:STDOUT: %.loc38_41.21 => constants.%.d53 -// CHECK:STDOUT: %impl.elem3.loc38_41.2 => constants.%T.as_type.as.Iterate.impl.Next.1b2 +// CHECK:STDOUT: %Iterate.WithSelf.Next.type => constants.%Iterate.WithSelf.Next.type.c27 +// CHECK:STDOUT: %.loc38_41.21 => constants.%.d7e +// CHECK:STDOUT: %impl.elem3.loc38_41.2 => constants.%T.as_type.as.Iterate.impl.Next.214 // CHECK:STDOUT: %specific_impl_fn.loc38_41.5 => constants.%T.as_type.as.Iterate.impl.Next.specific_fn -// CHECK:STDOUT: %Destroy.WithSelf.Op.type => constants.%Destroy.WithSelf.Op.type.b34 -// CHECK:STDOUT: %.loc38_41.22 => constants.%.d72 -// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.6c4ec3.8 -// CHECK:STDOUT: %impl.elem0.loc38_41.2 => constants.%Destroy.WithSelf.Op.403171.8 -// CHECK:STDOUT: %specific_impl_fn.loc38_41.6 => constants.%Destroy.WithSelf.Op.403171.8 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type => constants.%Destroy.WithSelf.SelfDestruct.type.c7c +// CHECK:STDOUT: %.loc38_41.22 => constants.%.c56 +// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.f8f19d.8 +// CHECK:STDOUT: %impl.elem2.loc38_41.4 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.10 +// CHECK:STDOUT: %specific_impl_fn.loc38_41.6 => constants.%Destroy.WithSelf.SelfDestruct.db3fdb.10 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/stdlib/initializer_list.carbon b/toolchain/check/testdata/interop/cpp/stdlib/initializer_list.carbon index 14112048c5a0..251367ee55f9 100644 --- a/toolchain/check/testdata/interop/cpp/stdlib/initializer_list.carbon +++ b/toolchain/check/testdata/interop/cpp/stdlib/initializer_list.carbon @@ -91,6 +91,7 @@ fn F() { // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.8eb: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%i32, %ImplicitAs.facet) [concrete] // CHECK:STDOUT: %.b7a: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.8eb, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.094: = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.e39 [concrete] +// CHECK:STDOUT: %pattern_type.6b6: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.e39, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete] // CHECK:STDOUT: %bound_method.953: = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.0c6: %i32 = int_value 1 [concrete] @@ -109,11 +110,36 @@ fn F() { // CHECK:STDOUT: %Consume__carbon_thunk: %Consume__carbon_thunk.type = struct_value () [concrete] // CHECK:STDOUT: %initializer_list.initializer_list.type.0fbcd7.2: type = fn_type @initializer_list.initializer_list.loc10 [concrete] // CHECK:STDOUT: %initializer_list.initializer_list.0db5f6.2: %initializer_list.initializer_list.type.0fbcd7.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.965: %pattern_type.7fc = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.a67: %pattern_type.7fc = wrapper_binding_pattern self, %self.param_patt.965 [concrete] // CHECK:STDOUT: %initializer_list.cpp_destructor.type: type = fn_type @initializer_list.cpp_destructor [concrete] // CHECK:STDOUT: %initializer_list.cpp_destructor: %initializer_list.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc10_23.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10_23.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_23.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc10_23.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_23.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc10_23.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.981, %Destroy.WithSelf.Op.403171.4 [concrete] +// CHECK:STDOUT: %self.param_patt.c42: %pattern_type.771 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.3bc: %pattern_type.771 = wrapper_binding_pattern self, %self.param_patt.c42 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_23.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.5: type = fn_type @Destroy.WithSelf.Op.loc10_23.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.5: %Destroy.WithSelf.Op.type.ef016f.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10_23.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.5: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.981, %Destroy.WithSelf.SelfDestruct.db3fdb.5 [concrete] // CHECK:STDOUT: %InitListConstructor: type = class_type @InitListConstructor [concrete] // CHECK:STDOUT: %pattern_type.ed6: type = pattern_type %InitListConstructor [concrete] // CHECK:STDOUT: %_.patt.100: %pattern_type.ed6 = value_binding_pattern _ [concrete] @@ -122,8 +148,14 @@ fn F() { // CHECK:STDOUT: %InitListConstructor__carbon_thunk: %InitListConstructor__carbon_thunk.type = struct_value () [concrete] // CHECK:STDOUT: %initializer_list.initializer_list.type.0fbcd7.3: type = fn_type @initializer_list.initializer_list.loc12 [concrete] // CHECK:STDOUT: %initializer_list.initializer_list.0db5f6.3: %initializer_list.initializer_list.type.0fbcd7.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.722: %pattern_type.ed6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.316: %pattern_type.ed6 = wrapper_binding_pattern self, %self.param_patt.722 [concrete] // CHECK:STDOUT: %InitListConstructor.cpp_destructor.type: type = fn_type @InitListConstructor.cpp_destructor [concrete] // CHECK:STDOUT: %InitListConstructor.cpp_destructor: %InitListConstructor.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.6: type = fn_type @Destroy.WithSelf.Op.loc12 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.6: %Destroy.WithSelf.Op.type.ef016f.6 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.6: type = fn_type @Destroy.WithSelf.SelfDestruct.loc12 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.6: %Destroy.WithSelf.SelfDestruct.type.fbceb5.6 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -147,12 +179,22 @@ fn F() { // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } +// CHECK:STDOUT: %initializer_list.cpp_destructor.decl: %initializer_list.cpp_destructor.type = fn_decl @initializer_list.cpp_destructor [concrete = constants.%initializer_list.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } // CHECK:STDOUT: %InitListConstructor.decl: type = class_decl @InitListConstructor [concrete = constants.%InitListConstructor] {} {} // CHECK:STDOUT: %InitListConstructor__carbon_thunk.decl: %InitListConstructor__carbon_thunk.type = fn_decl @InitListConstructor__carbon_thunk [concrete = constants.%InitListConstructor__carbon_thunk] { // CHECK:STDOUT: // CHECK:STDOUT: } { // CHECK:STDOUT: // CHECK:STDOUT: } +// CHECK:STDOUT: %InitListConstructor.cpp_destructor.decl: %InitListConstructor.cpp_destructor.type = fn_decl @InitListConstructor.cpp_destructor [concrete = constants.%InitListConstructor.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: generated { @@ -178,6 +220,55 @@ fn F() { // CHECK:STDOUT: %return.param: ref %initializer_list = out_param call_param1 // CHECK:STDOUT: %return: ref %initializer_list = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc10_23.1 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.7fc = ref_param_pattern [concrete = constants.%self.param_patt.965] +// CHECK:STDOUT: %self.patt: %pattern_type.7fc = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a67] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %initializer_list = ref_param call_param0 +// CHECK:STDOUT: %self: ref %initializer_list = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_23.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc10_23.2 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_23.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc10_23.3 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_23.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.771 = ref_param_pattern [concrete = constants.%self.param_patt.c42] +// CHECK:STDOUT: %self.patt: %pattern_type.771 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.3bc] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.5: %Destroy.WithSelf.Op.type.ef016f.5 = fn_decl @Destroy.WithSelf.Op.loc10_23.4 [concrete = constants.%Destroy.WithSelf.Op.403171.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.771 = ref_param_pattern [concrete = constants.%self.param_patt.c42] +// CHECK:STDOUT: %self.patt: %pattern_type.771 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.3bc] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %array_type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %array_type = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: %initializer_list.initializer_list.decl.f8e97d.3: %initializer_list.initializer_list.type.0fbcd7.3 = fn_decl @initializer_list.initializer_list.loc12 [concrete = constants.%initializer_list.initializer_list.0db5f6.3] { // CHECK:STDOUT: %_.param_patt: %pattern_type.771 = value_param_pattern [concrete = constants.%_.param_patt] // CHECK:STDOUT: %_.patt: %pattern_type.771 = wrapper_binding_pattern _, %_.param_patt [concrete = constants.%_.patt.03c] @@ -189,6 +280,13 @@ fn F() { // CHECK:STDOUT: %return.param: ref %initializer_list = out_param call_param1 // CHECK:STDOUT: %return: ref %initializer_list = return_slot %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.6: %Destroy.WithSelf.Op.type.ef016f.6 = fn_decl @Destroy.WithSelf.Op.loc12 [concrete = constants.%Destroy.WithSelf.Op.403171.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.ed6 = ref_param_pattern [concrete = constants.%self.param_patt.722] +// CHECK:STDOUT: %self.patt: %pattern_type.ed6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.316] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %InitListConstructor = ref_param call_param0 +// CHECK:STDOUT: %self: ref %InitListConstructor = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -297,9 +395,9 @@ fn F() { // CHECK:STDOUT: %.loc10_23.21: ref %initializer_list = value_as_ref %.loc10_23.20 // CHECK:STDOUT: %addr.loc10: %ptr.fac = addr_of %.loc10_23.21 // CHECK:STDOUT: %Consume__carbon_thunk.call: init %empty_tuple.type = call imports.%Consume__carbon_thunk.decl(%addr.loc10) -// CHECK:STDOUT: %initializer_list.cpp_destructor.bound.loc10: = bound_method %.loc10_23.19, constants.%initializer_list.cpp_destructor -// CHECK:STDOUT: %initializer_list.cpp_destructor.call.loc10: init %empty_tuple.type = call %initializer_list.cpp_destructor.bound.loc10(%.loc10_23.19) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc10: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.981) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10: = bound_method %.loc10_23.19, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10_23.1: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10(%.loc10_23.19) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10_23.2: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.981) // CHECK:STDOUT: %int_1.loc12_37: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %int_2.loc12_40: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %int_3.loc12_43: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba] @@ -362,14 +460,14 @@ fn F() { // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %_.patt.loc12: %pattern_type.ed6 = value_binding_pattern _ [concrete = constants.%_.patt.100] // CHECK:STDOUT: } -// CHECK:STDOUT: %InitListConstructor.cpp_destructor.bound: = bound_method %.loc12_44.25, constants.%InitListConstructor.cpp_destructor -// CHECK:STDOUT: %InitListConstructor.cpp_destructor.call: init %empty_tuple.type = call %InitListConstructor.cpp_destructor.bound(%.loc12_44.25) -// CHECK:STDOUT: %initializer_list.cpp_destructor.bound.loc12: = bound_method %.loc12_44.20, constants.%initializer_list.cpp_destructor -// CHECK:STDOUT: %initializer_list.cpp_destructor.call.loc12: init %empty_tuple.type = call %initializer_list.cpp_destructor.bound.loc12(%.loc12_44.20) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc12: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.981) -// CHECK:STDOUT: %initializer_list.cpp_destructor.bound.loc8: = bound_method %.loc8_50.19, constants.%initializer_list.cpp_destructor -// CHECK:STDOUT: %initializer_list.cpp_destructor.call.loc8: init %empty_tuple.type = call %initializer_list.cpp_destructor.bound.loc8(%.loc8_50.19) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc8: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.981) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc12_44.1: = bound_method %.loc12_44.25, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.6 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc12_44.1: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc12_44.1(%.loc12_44.25) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc12_44.2: = bound_method %.loc12_44.20, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc12_44.2: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc12_44.2(%.loc12_44.20) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc12_44.3: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.981) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: = bound_method %.loc8_50.19, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8_50.1: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%.loc8_50.19) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8_50.2: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.981) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -377,17 +475,62 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: fn @initializer_list.initializer_list.loc10(%_.param: %array_type) -> out %return.param: %initializer_list = "cpp.std.initializer_list.make"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_23.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_23.1(%self.param: ref %initializer_list) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_23.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_23.1(%self.param: ref %initializer_list) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %initializer_list.cpp_destructor.call: init %empty_tuple.type = call imports.%initializer_list.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_23.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_23.2(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_23.2(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_23.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_23.3(%self.param: ref %array_type) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_23.3(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_23.3(%self.param: ref %i32) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_23.3(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_23.4(%self.param: ref %array_type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_23.4(%self.param: ref %array_type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.5(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @initializer_list.initializer_list.loc12(%_.param: %array_type) -> out %return.param: %initializer_list = "cpp.std.initializer_list.make"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc12(%self.param: ref %InitListConstructor) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc12(%self.param: ref %InitListConstructor) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.6(%self.param) +// CHECK:STDOUT: %InitListConstructor.cpp_destructor.call: init %empty_tuple.type = call imports.%InitListConstructor.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/template/generic_call.carbon b/toolchain/check/testdata/interop/cpp/template/generic_call.carbon index 0eee384a868d..e831271cf55a 100644 --- a/toolchain/check/testdata/interop/cpp/template/generic_call.carbon +++ b/toolchain/check/testdata/interop/cpp/template/generic_call.carbon @@ -86,14 +86,14 @@ fn G() { // CHECK:STDOUT: %.e77: %.5cd = splice_inst @F.%.loc8_3.27 [template] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %Self.0e7: %Destroy.type = symbolic_binding Self, 0 [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.d3e: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Self.0e7) [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.42b: %Destroy.WithSelf.Op.type.d3e = struct_value () [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.4e5: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Self.0e7) [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.4a0: %Destroy.WithSelf.SelfDestruct.type.4e5 = struct_value () [symbolic] // CHECK:STDOUT: %Destroy.assoc_type: type = assoc_entity_type @Destroy [concrete] -// CHECK:STDOUT: %assoc0.ae8: %Destroy.assoc_type = assoc_entity element0, imports.%Core.import_ref.918 [concrete] -// CHECK:STDOUT: %.f94: type = type_of_inst @F.%.loc8_3.29 [template] -// CHECK:STDOUT: %.457: %.f94 = splice_inst @F.%.loc8_3.29 [template] -// CHECK:STDOUT: %.98a: type = type_of_inst @F.%.loc8_3.32 [template] -// CHECK:STDOUT: %.610: %.98a = splice_inst @F.%.loc8_3.32 [template] +// CHECK:STDOUT: %assoc2: %Destroy.assoc_type = assoc_entity element2, imports.%Core.import_ref.71d [concrete] +// CHECK:STDOUT: %.f97: type = type_of_inst @F.%.loc8_3.29 [template] +// CHECK:STDOUT: %.f14: %.f97 = splice_inst @F.%.loc8_3.29 [template] +// CHECK:STDOUT: %.2c7: type = type_of_inst @F.%.loc8_3.32 [template] +// CHECK:STDOUT: %.96f: %.2c7 = splice_inst @F.%.loc8_3.32 [template] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %X: type = class_type @X [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] @@ -111,9 +111,9 @@ fn G() { // CHECK:STDOUT: %v.patt.5fa: %pattern_type.981 = ref_binding_pattern v [concrete] // CHECK:STDOUT: %v.var_patt.e69: %pattern_type.981 = var_pattern %v.patt.5fa [concrete] // CHECK:STDOUT: %.e53: require_specific_def_type = require_specific_def @T.as.DefaultOrUnformed.impl(%S) [concrete] -// CHECK:STDOUT: %S.Op.type.83af6e.1: type = fn_type @S.Op.1 [concrete] -// CHECK:STDOUT: %S.Op.4dca31.1: %S.Op.type.83af6e.1 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.9b4: = custom_witness (%S.Op.4dca31.1), @Default [concrete] +// CHECK:STDOUT: %S.Op.type: type = fn_type @S.Op [concrete] +// CHECK:STDOUT: %S.Op: %S.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.9b4: = custom_witness (%S.Op), @Default [concrete] // CHECK:STDOUT: %Default.facet.602: %Default.type = facet_value %S, (%custom_witness.9b4) [concrete] // CHECK:STDOUT: %DefaultOrUnformed.impl_witness.1ff: = impl_witness imports.%DefaultOrUnformed.impl_witness_table.162, @T.as_type.as.DefaultOrUnformed.impl(%Default.facet.602) [concrete] // CHECK:STDOUT: %T.as_type.as.DefaultOrUnformed.impl.Op.type.c7b: type = fn_type @T.as_type.as.DefaultOrUnformed.impl.Op, @T.as_type.as.DefaultOrUnformed.impl(%Default.facet.602) [concrete] @@ -127,7 +127,7 @@ fn G() { // CHECK:STDOUT: %.64e: %.805 = splice_block %impl.elem0.9ae [concrete = %T.as_type.as.DefaultOrUnformed.impl.Op.83d] { // CHECK:STDOUT: %as_type: type = facet_access_type %DefaultOrUnformed.facet.ba3 [concrete = %S] // CHECK:STDOUT: %.bcb: type = converted %DefaultOrUnformed.facet.ba3, %as_type [concrete = %S] -// CHECK:STDOUT: %Op.ref.f8c: %DefaultOrUnformed.assoc_type = name_ref Op, imports.%Core.import_ref.6dc [concrete = %assoc0.b81] +// CHECK:STDOUT: %Op.ref: %DefaultOrUnformed.assoc_type = name_ref Op, imports.%Core.import_ref.6dc [concrete = %assoc0.b81] // CHECK:STDOUT: %impl.elem0.9ae: %.805 = impl_witness_access %DefaultOrUnformed.impl_witness.1ff, element0 [concrete = %T.as_type.as.DefaultOrUnformed.impl.Op.83d] // CHECK:STDOUT: } // CHECK:STDOUT: } @@ -152,28 +152,30 @@ fn G() { // CHECK:STDOUT: %.a03: %.94b = splice_inst %.9a4 [template] // CHECK:STDOUT: %.169: = convert_to_category_action %.a03, element10 [template] // CHECK:STDOUT: %.217: %S = splice_inst %.169 [template] +// CHECK:STDOUT: %self.param_patt.471: %pattern_type.981 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.5f0: %pattern_type.981 = wrapper_binding_pattern self, %self.param_patt.471 [concrete] // CHECK:STDOUT: %S.cpp_destructor.type: type = fn_type @S.cpp_destructor [concrete] // CHECK:STDOUT: %S.cpp_destructor: %S.cpp_destructor.type = struct_value () [concrete] -// CHECK:STDOUT: %S.Op.type.83af6e.2: type = fn_type @S.Op.2 [concrete] -// CHECK:STDOUT: %S.Op.4dca31.2: %S.Op.type.83af6e.2 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.e7a31c.2: = custom_witness (%S.Op.4dca31.2), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.2e5: %Destroy.type = facet_value %S, (%custom_witness.e7a31c.2) [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.5df: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.2e5) [concrete] -// CHECK:STDOUT: %.670: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.5df, %Destroy.facet.2e5 [concrete] -// CHECK:STDOUT: %inst.splice_block.b32: = inst_value [concrete] { -// CHECK:STDOUT: %.ef5: = splice_block %bound_method { +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %S.SubobjectDestroy.type: type = fn_type @S.SubobjectDestroy [concrete] +// CHECK:STDOUT: %S.SubobjectDestroy: %S.SubobjectDestroy.type = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.1bfa2a.2: = custom_witness (%Destroy.WithSelf.Op.403171.2, %S.SubobjectDestroy, %Destroy.WithSelf.SelfDestruct.db3fdb.2), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.edc: %Destroy.type = facet_value %S, (%custom_witness.1bfa2a.2) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.e44: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.edc) [concrete] +// CHECK:STDOUT: %.bb1: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.e44, %Destroy.facet.edc [concrete] +// CHECK:STDOUT: %inst.splice_block.80a: = inst_value [concrete] { +// CHECK:STDOUT: %.c7f: = splice_block %bound_method { // CHECK:STDOUT: %.e7d: ref %S = specific_inst @F.%v.var, @F(%X) // CHECK:STDOUT: -// CHECK:STDOUT: %impl.elem0.c3e: %.670 = impl_witness_access %custom_witness.e7a31c.2, element0 [concrete = %S.Op.4dca31.2] -// CHECK:STDOUT: %bound_method: = bound_method %.e7d, %impl.elem0.c3e +// CHECK:STDOUT: %impl.elem2: %.bb1 = impl_witness_access %custom_witness.1bfa2a.2, element2 [concrete = %Destroy.WithSelf.SelfDestruct.db3fdb.2] +// CHECK:STDOUT: %bound_method: = bound_method %.e7d, %impl.elem2 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %inst.splice_block.5c0: = inst_value [concrete] { -// CHECK:STDOUT: %.052: init %empty_tuple.type = splice_block %S.cpp_destructor.call { -// CHECK:STDOUT: %Op.ref.6a0: %S.cpp_destructor.type = name_ref Op, imports.%S.cpp_destructor.decl [concrete = %S.cpp_destructor] -// CHECK:STDOUT: %S.cpp_destructor.bound: = bound_method %.e7d, %Op.ref.6a0 -// CHECK:STDOUT: %S.cpp_destructor.call: init %empty_tuple.type = call %S.cpp_destructor.bound(%.e7d) -// CHECK:STDOUT: } +// CHECK:STDOUT: %inst.call: = inst_value [concrete] { +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %.c7f(%.e7d) // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -187,7 +189,7 @@ fn G() { // CHECK:STDOUT: %Core.import_ref.6dc: %DefaultOrUnformed.assoc_type = import_ref Core//prelude/parts/default, loc{{\d+_\d+}}, loaded [concrete = constants.%assoc0.b81] // CHECK:STDOUT: %Core.import_ref.c2f: @T.as_type.as.DefaultOrUnformed.impl.%T.as_type.as.DefaultOrUnformed.impl.Op.type (%T.as_type.as.DefaultOrUnformed.impl.Op.type.0c9) = import_ref Core//prelude/parts/default, loc{{\d+_\d+}}, loaded [symbolic = @T.as_type.as.DefaultOrUnformed.impl.%T.as_type.as.DefaultOrUnformed.impl.Op (constants.%T.as_type.as.DefaultOrUnformed.impl.Op.cfe)] // CHECK:STDOUT: %DefaultOrUnformed.impl_witness_table.162 = impl_witness_table (%Core.import_ref.c2f), @T.as_type.as.DefaultOrUnformed.impl [concrete] -// CHECK:STDOUT: %Core.import_ref.918: @Destroy.WithSelf.%Destroy.WithSelf.Op.type (%Destroy.WithSelf.Op.type.d3e) = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [symbolic = @Destroy.WithSelf.%Destroy.WithSelf.Op (constants.%Destroy.WithSelf.Op.42b)] +// CHECK:STDOUT: %Core.import_ref.71d: @Destroy.WithSelf.%Destroy.WithSelf.SelfDestruct.type (%Destroy.WithSelf.SelfDestruct.type.4e5) = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [symbolic = @Destroy.WithSelf.%Destroy.WithSelf.SelfDestruct (constants.%Destroy.WithSelf.SelfDestruct.4a0)] // CHECK:STDOUT: %X.decl: type = class_decl @X [concrete = constants.%X] {} {} // CHECK:STDOUT: %S.decl: type = class_decl @S [concrete = constants.%S] {} {} // CHECK:STDOUT: %Core.import_ref.d14: @DefaultOrUnformed.WithSelf.%DefaultOrUnformed.WithSelf.Op.type (%DefaultOrUnformed.WithSelf.Op.type.8f1) = import_ref Core//prelude/parts/default, loc{{\d+_\d+}}, loaded [symbolic = @DefaultOrUnformed.WithSelf.%DefaultOrUnformed.WithSelf.Op (constants.%DefaultOrUnformed.WithSelf.Op.ad7)] @@ -198,6 +200,16 @@ fn G() { // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc8 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.981 = ref_param_pattern [concrete = constants.%self.param_patt.471] +// CHECK:STDOUT: %self.patt: %pattern_type.981 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.5f0] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %S = ref_param call_param0 +// CHECK:STDOUT: %self: ref %S = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] { // CHECK:STDOUT: %T.patt.loc7_7.1: %pattern_type.9a5 = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc7_7.2 (constants.%T.patt.3a0)] @@ -257,12 +269,12 @@ fn G() { // CHECK:STDOUT: %.loc8_3.26: @F.%.loc8_3.25 (%.9f0) = splice_inst %.loc8_3.24 [template = %.loc8_3.26 (constants.%.0f3)] // CHECK:STDOUT: %.loc8_3.27: = convert_to_category_action %.loc8_3.9, element10 [template] // CHECK:STDOUT: %.loc8_3.28: @F.%.loc8_24.9 (%.5cd) = splice_inst %.loc8_3.27 [template = %.loc8_3.28 (constants.%.e77)] -// CHECK:STDOUT: %.loc8_3.29: = compound_member_access_action %v.var, constants.%assoc0.ae8 [template] -// CHECK:STDOUT: %.loc8_3.30: type = type_of_inst %.loc8_3.29 [template = %.loc8_3.30 (constants.%.f94)] -// CHECK:STDOUT: %.loc8_3.31: @F.%.loc8_3.30 (%.f94) = splice_inst %.loc8_3.29 [template = %.loc8_3.31 (constants.%.457)] +// CHECK:STDOUT: %.loc8_3.29: = compound_member_access_action %v.var, constants.%assoc2 [template] +// CHECK:STDOUT: %.loc8_3.30: type = type_of_inst %.loc8_3.29 [template = %.loc8_3.30 (constants.%.f97)] +// CHECK:STDOUT: %.loc8_3.31: @F.%.loc8_3.30 (%.f97) = splice_inst %.loc8_3.29 [template = %.loc8_3.31 (constants.%.f14)] // CHECK:STDOUT: %.loc8_3.32: = call_action (%.loc8_3.12), true [template] -// CHECK:STDOUT: %.loc8_3.33: type = type_of_inst %.loc8_3.32 [template = %.loc8_3.33 (constants.%.98a)] -// CHECK:STDOUT: %.loc8_3.34: @F.%.loc8_3.33 (%.98a) = splice_inst %.loc8_3.32 [template = %.loc8_3.34 (constants.%.610)] +// CHECK:STDOUT: %.loc8_3.33: type = type_of_inst %.loc8_3.32 [template = %.loc8_3.33 (constants.%.2c7)] +// CHECK:STDOUT: %.loc8_3.34: @F.%.loc8_3.33 (%.2c7) = splice_inst %.loc8_3.32 [template = %.loc8_3.34 (constants.%.96f)] // CHECK:STDOUT: // CHECK:STDOUT: fn(%x.param: @F.%T.loc7_7.1 (%T.67d)) { // CHECK:STDOUT: !entry: @@ -298,14 +310,23 @@ fn G() { // CHECK:STDOUT: %v.patt.loc8_15.1: @F.%pattern_type.loc8 (%pattern_type.a1f) = ref_binding_pattern v [template = %v.patt.loc8_15.2 (constants.%v.patt.019)] // CHECK:STDOUT: %v.var_patt.loc8_3.1: @F.%pattern_type.loc8 (%pattern_type.a1f) = var_pattern %v.patt.loc8_15.1 [template = %v.var_patt.loc8_3.2 (constants.%v.var_patt.d78)] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc8_3.11: type = type_of_inst %.loc8_3.29 [template = %.loc8_3.30 (constants.%.f94)] -// CHECK:STDOUT: %.loc8_3.12: @F.%.loc8_3.30 (%.f94) = splice_inst %.loc8_3.29 [template = %.loc8_3.31 (constants.%.457)] -// CHECK:STDOUT: %.loc8_3.13: type = type_of_inst %.loc8_3.32 [template = %.loc8_3.33 (constants.%.98a)] -// CHECK:STDOUT: %.loc8_3.14: @F.%.loc8_3.33 (%.98a) = splice_inst %.loc8_3.32 [template = %.loc8_3.34 (constants.%.610)] +// CHECK:STDOUT: %.loc8_3.11: type = type_of_inst %.loc8_3.29 [template = %.loc8_3.30 (constants.%.f97)] +// CHECK:STDOUT: %.loc8_3.12: @F.%.loc8_3.30 (%.f97) = splice_inst %.loc8_3.29 [template = %.loc8_3.31 (constants.%.f14)] +// CHECK:STDOUT: %.loc8_3.13: type = type_of_inst %.loc8_3.32 [template = %.loc8_3.33 (constants.%.2c7)] +// CHECK:STDOUT: %.loc8_3.14: @F.%.loc8_3.33 (%.2c7) = splice_inst %.loc8_3.32 [template = %.loc8_3.34 (constants.%.96f)] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8(%self.param: ref %S) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8(%self.param: ref %S) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %S.cpp_destructor.call: init %empty_tuple.type = call imports.%S.cpp_destructor.decl(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: specific @F(constants.%T.67d) { // CHECK:STDOUT: %T.patt.loc7_7.2 => constants.%T.patt.3a0 // CHECK:STDOUT: %T.loc7_7.1 => constants.%T.67d @@ -356,10 +377,10 @@ fn G() { // CHECK:STDOUT: %.loc8_3.26 => constants.%.a03 // CHECK:STDOUT: %.loc8_3.27 => constants.%.169 // CHECK:STDOUT: %.loc8_3.28 => constants.%.217 -// CHECK:STDOUT: %.loc8_3.29 => constants.%inst.splice_block.b32 +// CHECK:STDOUT: %.loc8_3.29 => constants.%inst.splice_block.80a // CHECK:STDOUT: %.loc8_3.30 => // CHECK:STDOUT: %.loc8_3.31 => invalid -// CHECK:STDOUT: %.loc8_3.32 => constants.%inst.splice_block.5c0 +// CHECK:STDOUT: %.loc8_3.32 => constants.%inst.call // CHECK:STDOUT: %.loc8_3.33 => constants.%empty_tuple.type // CHECK:STDOUT: %.loc8_3.34 => invalid // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interop/cpp/type_alias/import.carbon b/toolchain/check/testdata/interop/cpp/type_alias/import.carbon index 7880ae192f3e..562b1e554b8a 100644 --- a/toolchain/check/testdata/interop/cpp/type_alias/import.carbon +++ b/toolchain/check/testdata/interop/cpp/type_alias/import.carbon @@ -90,10 +90,29 @@ fn H(var c: Cpp.C, var d: Cpp.D) { // CHECK:STDOUT: %Copy.WithSelf.Op.type.36e: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet) [concrete] // CHECK:STDOUT: %.6d0: type = fn_type_with_self_type %Copy.WithSelf.Op.type.36e, %Copy.facet [concrete] // CHECK:STDOUT: %ptr.as.Copy.impl.Op.specific_fn: = specific_function %ptr.as.Copy.impl.Op.d1c, @ptr.as.Copy.impl.Op(%i32) [concrete] +// CHECK:STDOUT: %self.param_patt.af0: %pattern_type.f00 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.954: %pattern_type.f00 = wrapper_binding_pattern self, %self.param_patt.af0 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc10 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc8_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc8_3.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -108,6 +127,51 @@ fn H(var c: Cpp.C, var d: Cpp.D) { // CHECK:STDOUT: %Copy.impl_witness_table.fb0 = impl_witness_table (%Core.import_ref.e5f), @ptr.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f00 = ref_param_pattern [concrete = constants.%self.param_patt.af0] +// CHECK:STDOUT: %self.patt: %pattern_type.f00 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.954] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr.d08 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr.d08 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc10 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f00 = ref_param_pattern [concrete = constants.%self.param_patt.af0] +// CHECK:STDOUT: %self.patt: %pattern_type.f00 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.954] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr.d08 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr.d08 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc8_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc8_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %n.var: ref %i32 = var_storage %n.var_patt @@ -149,19 +213,46 @@ fn H(var c: Cpp.C, var d: Cpp.D) { // CHECK:STDOUT: %p.patt: %pattern_type.f00 = ref_binding_pattern p [concrete = constants.%p.patt] // CHECK:STDOUT: %p.var_patt: %pattern_type.f00 = var_pattern %p.patt [concrete = constants.%p.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc10: = bound_method %p.var, constants.%Destroy.WithSelf.Op.403171.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc10: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc10(%p.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc8: = bound_method %n.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc8(%n.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10: = bound_method %p.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10(%p.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: = bound_method %n.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%n.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10(%self.param: ref %ptr.d08) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10(%self.param: ref %ptr.d08) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10(%self.param: ref %ptr.d08) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.1(%self.param: ref %i32.builtin) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -188,8 +279,14 @@ fn H(var c: Cpp.C, var d: Cpp.D) { // CHECK:STDOUT: %ptr.as.Copy.impl.Op.specific_fn: = specific_function %ptr.as.Copy.impl.Op.4ad, @ptr.as.Copy.impl.Op(%C) [concrete] // CHECK:STDOUT: %pc.patt: %pattern_type.8fa = ref_binding_pattern pc [concrete] // CHECK:STDOUT: %pc.var_patt: %pattern_type.8fa = var_pattern %pc.patt [concrete] +// CHECK:STDOUT: %self.param_patt.7a2: %pattern_type.8fa = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.450: %pattern_type.8fa = wrapper_binding_pattern self, %self.param_patt.7a2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfc: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10 [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.loc10 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -203,6 +300,23 @@ fn H(var c: Cpp.C, var d: Cpp.D) { // CHECK:STDOUT: %Copy.impl_witness_table.fb0 = impl_witness_table (%Core.import_ref.e5f), @ptr.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl: %Destroy.WithSelf.SubobjectDestroy.type.dfc = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.8fa = ref_param_pattern [concrete = constants.%self.param_patt.7a2] +// CHECK:STDOUT: %self.patt: %pattern_type.8fa = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.450] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr.0a2 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr.0a2 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc10 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.8fa = ref_param_pattern [concrete = constants.%self.param_patt.7a2] +// CHECK:STDOUT: %self.patt: %pattern_type.8fa = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.450] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr.0a2 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr.0a2 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @H(%c.param: ref %C, %d.param: ref %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %pd.var: ref %ptr.0a2 = var_storage %pd.var_patt @@ -243,12 +357,21 @@ fn H(var c: Cpp.C, var d: Cpp.D) { // CHECK:STDOUT: %pc.patt: %pattern_type.8fa = ref_binding_pattern pc [concrete = constants.%pc.patt] // CHECK:STDOUT: %pc.var_patt: %pattern_type.8fa = var_pattern %pc.patt [concrete = constants.%pc.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc10: = bound_method %pc.var, constants.%Destroy.WithSelf.Op.403 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc10: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc10(%pc.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc9: = bound_method %pd.var, constants.%Destroy.WithSelf.Op.403 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc9(%pd.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10: = bound_method %pc.var, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10(%pc.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc9: = bound_method %pd.var, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc9(%pd.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10(%self.param: ref %ptr.0a2) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10(%self.param: ref %ptr.0a2) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10(%self.param: ref %ptr.0a2) { +// 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) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/let/lifetime.carbon b/toolchain/check/testdata/let/lifetime.carbon index 4b1b22b71910..4526f78bca77 100644 --- a/toolchain/check/testdata/let/lifetime.carbon +++ b/toolchain/check/testdata/let/lifetime.carbon @@ -47,9 +47,53 @@ fn F() { // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %.367: ref %A = temporary invalid, %A.val [concrete] // CHECK:STDOUT: %b.patt: %pattern_type.9ef = value_binding_pattern b [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_37.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc11_37.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.8fb: %pattern_type.9ef = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.e64: %pattern_type.9ef = wrapper_binding_pattern self, %self.param_patt.8fb [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11_37.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc11_37.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.367, %Destroy.WithSelf.Op.403171.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc11_37.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.367, %Destroy.WithSelf.SelfDestruct.db3fdb.2 [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_37.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc11_37.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11_37.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.9ef = ref_param_pattern [concrete = constants.%self.param_patt.8fb] +// CHECK:STDOUT: %self.patt: %pattern_type.9ef = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.e64] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %A = ref_param call_param0 +// CHECK:STDOUT: %self: ref %A = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc11_37.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.9ef = ref_param_pattern [concrete = constants.%self.param_patt.8fb] +// CHECK:STDOUT: %self.patt: %pattern_type.9ef = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.e64] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %A = ref_param call_param0 +// CHECK:STDOUT: %self: ref %A = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -96,18 +140,36 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %G.ref: %G.type = name_ref G, file.%G.decl [concrete = constants.%G] // CHECK:STDOUT: %G.call: init %empty_tuple.type = call %G.ref() -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.loc11_37.2, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc11_37: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%.loc11_37.2) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc11_25: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.367) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc10_34: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.367) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc10_25: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.367) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc11_37.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc11_37: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc11_37.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc11_25: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.367) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10_34: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.367) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10_25: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.367) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_37.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_37.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_37.2(%self.param: ref %A) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_37.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11_37.2(%self.param: ref %A) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11_37.2(%self.param: ref %A) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11_37.2(%self.param: ref %A) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/namespace/merging_with_indirections.carbon b/toolchain/check/testdata/namespace/merging_with_indirections.carbon index d4932e26b84e..19a10aed3b18 100644 --- a/toolchain/check/testdata/namespace/merging_with_indirections.carbon +++ b/toolchain/check/testdata/namespace/merging_with_indirections.carbon @@ -176,8 +176,21 @@ fn Run() { // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] // CHECK:STDOUT: %pattern_type.821: type = pattern_type %A [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc7_11.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc7_11.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.e92: %pattern_type.821 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.d98: %pattern_type.821 = wrapper_binding_pattern self, %self.param_patt.e92 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc7_11.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc7_11.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc7_11.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: %a.patt: %pattern_type.821 = ref_binding_pattern a [concrete] // CHECK:STDOUT: %a.var_patt: %pattern_type.821 = var_pattern %a.patt [concrete] // CHECK:STDOUT: %DefaultOrUnformed.type: type = facet_type <@DefaultOrUnformed> [concrete] @@ -220,6 +233,37 @@ fn Run() { // CHECK:STDOUT: %DefaultOrUnformed.impl_witness_table.856 = impl_witness_table (%Core.import_ref.cc8), @T.as.DefaultOrUnformed.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc7_11.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc7_11.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc7_11.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.821 = ref_param_pattern [concrete = constants.%self.param_patt.e92] +// CHECK:STDOUT: %self.patt: %pattern_type.821 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d98] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %A = ref_param call_param0 +// CHECK:STDOUT: %self: ref %A = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc7_11.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.821 = ref_param_pattern [concrete = constants.%self.param_patt.e92] +// CHECK:STDOUT: %self.patt: %pattern_type.821 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d98] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %A = ref_param call_param0 +// CHECK:STDOUT: %self: ref %A = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -245,8 +289,8 @@ fn Run() { // CHECK:STDOUT: %.loc7_11.1: ref %A = temporary_storage // CHECK:STDOUT: %F.call.loc7: init %A to %.loc7_11.1 = call %F.ref.loc7() // CHECK:STDOUT: %.loc7_11.2: ref %A = temporary %.loc7_11.1, %F.call.loc7 -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc7: = bound_method %.loc7_11.2, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc7: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc7(%.loc7_11.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc7: = bound_method %.loc7_11.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc7: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc7(%.loc7_11.2) // CHECK:STDOUT: %a.var: ref %A = var_storage %a.var_patt // CHECK:STDOUT: %DefaultOrUnformed.facet: %DefaultOrUnformed.type = facet_value constants.%A, (constants.%DefaultOrUnformed.impl_witness.967) [concrete = constants.%DefaultOrUnformed.facet] // CHECK:STDOUT: %.loc10_21.1: %DefaultOrUnformed.type = converted constants.%A, %DefaultOrUnformed.facet [concrete = constants.%DefaultOrUnformed.facet] @@ -272,17 +316,35 @@ fn Run() { // CHECK:STDOUT: %.loc13: ref %A = splice_block %a.ref {} // CHECK:STDOUT: %F.call.loc13: init %A to %.loc13 = call %F.ref.loc13() // CHECK:STDOUT: assign %a.ref, %F.call.loc13 -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc10: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc10: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc10(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10(%a.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F [from "b.carbon"]; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc7_11.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_11.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_11.2(%self.param: ref %A) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc7_11.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc7_11.2(%self.param: ref %A) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_11.2(%self.param: ref %A) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc7_11.2(%self.param: ref %A) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/namespace/shadow.carbon b/toolchain/check/testdata/namespace/shadow.carbon index 95d0c2fdf25e..a8a9c400792d 100644 --- a/toolchain/check/testdata/namespace/shadow.carbon +++ b/toolchain/check/testdata/namespace/shadow.carbon @@ -83,8 +83,21 @@ fn N.M.B() -> i32 { // CHECK:STDOUT: %.737: type = fn_type_with_self_type %Copy.WithSelf.Op.type.381, %Copy.facet [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.4f6, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc26_5.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc26_5.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc26_5.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc26_5.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc26_5.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -106,6 +119,37 @@ fn N.M.B() -> i32 { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc26_5.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc26_5.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc26_5.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc26_5.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -168,8 +212,8 @@ fn N.M.B() -> i32 { // CHECK:STDOUT: %specific_fn.loc29: = specific_function %impl.elem0.loc29, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] // CHECK:STDOUT: %bound_method.loc29_12.2: = bound_method %.loc29, %specific_fn.loc29 // CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc29_12.2(%.loc29) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %A.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%A.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %A.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%A.var) // CHECK:STDOUT: return %Int.as.Copy.impl.Op.call // CHECK:STDOUT: // CHECK:STDOUT: !if.else: @@ -183,10 +227,28 @@ fn N.M.B() -> i32 { // CHECK:STDOUT: return %.loc31 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc26_5.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc26_5.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc26_5.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc26_5.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc26_5.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc26_5.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc26_5.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/builtin/and.carbon b/toolchain/check/testdata/operators/builtin/and.carbon index c51a5ab97d86..7eb16b460af1 100644 --- a/toolchain/check/testdata/operators/builtin/and.carbon +++ b/toolchain/check/testdata/operators/builtin/and.carbon @@ -68,10 +68,22 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: %d.patt: %pattern_type.cb1 = ref_binding_pattern d [concrete] // CHECK:STDOUT: %d.var_patt: %pattern_type.cb1 = var_pattern %d.patt [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %self.param_patt.65a: %pattern_type.cb1 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.df1: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt.65a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc26 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc26 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc26 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.40d: %pattern_type.831 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.560: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt.40d [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc23 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc23 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc23 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: %x.param_patt: %pattern_type.831 = value_param_pattern [concrete] // CHECK:STDOUT: %x.patt: %pattern_type.831 = wrapper_binding_pattern x, %x.param_patt [concrete] // CHECK:STDOUT: %PartialConstant.type: type = fn_type @PartialConstant [concrete] @@ -95,6 +107,37 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc26 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc26 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc23 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d] +// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0 +// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc23 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d] +// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0 +// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -344,21 +387,39 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: %d.patt: %pattern_type.cb1 = ref_binding_pattern d [concrete = constants.%d.patt] // CHECK:STDOUT: %d.var_patt: %pattern_type.cb1 = var_pattern %d.patt [concrete = constants.%d.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc26: = bound_method %d.var, constants.%Destroy.WithSelf.Op.403171.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc26: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc26(%d.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc25: = bound_method %c.var, constants.%Destroy.WithSelf.Op.403171.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc25: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc25(%c.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc24: = bound_method %b.var, constants.%Destroy.WithSelf.Op.403171.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc24: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc24(%b.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc23: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc23: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc23(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc26: = bound_method %d.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc26: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc26(%d.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc25: = bound_method %c.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc25: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc25(%c.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc24: = bound_method %b.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc24: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc24(%b.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc23: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc23: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc23(%a.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc26(%self.param: ref %empty_tuple.type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc26(%self.param: ref %empty_tuple.type) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc26(%self.param: ref %empty_tuple.type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc23(%self.param: ref bool) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc23(%self.param: ref bool) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc23(%self.param: ref bool) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @PartialConstant(%x.param: bool) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.var: ref %empty_tuple.type = var_storage %a.var_patt @@ -400,8 +461,8 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: %a.patt: %pattern_type.cb1 = ref_binding_pattern a [concrete = constants.%a.patt.728] // CHECK:STDOUT: %a.var_patt: %pattern_type.cb1 = var_pattern %a.patt [concrete = constants.%a.var_patt.06f] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%a.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/builtin/assignment.carbon b/toolchain/check/testdata/operators/builtin/assignment.carbon index 8af5028e2a27..63aaadaba06c 100644 --- a/toolchain/check/testdata/operators/builtin/assignment.carbon +++ b/toolchain/check/testdata/operators/builtin/assignment.carbon @@ -124,14 +124,45 @@ fn Main() { // CHECK:STDOUT: %bound_method.1b6: = bound_method %int_10.64f, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_10.6bf: %i32 = int_value 10 [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %self.param_patt.af0: %pattern_type.f00 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.954: %pattern_type.f00 = wrapper_binding_pattern self, %self.param_patt.af0 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc27 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc27 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc27 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc23_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc23_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc23_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc23_3.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc23_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.3bf: %pattern_type.20e3 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.d0e: %pattern_type.20e3 = wrapper_binding_pattern self, %self.param_patt.3bf [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc23_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc23_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc23_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.f5e: %pattern_type.394 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.7eb: %pattern_type.394 = wrapper_binding_pattern self, %self.param_patt.f5e [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc19 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.5: type = fn_type @Destroy.WithSelf.Op.loc19 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.5: %Destroy.WithSelf.Op.type.ef016f.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5: type = fn_type @Destroy.WithSelf.SelfDestruct.loc19 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.5: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -153,6 +184,79 @@ fn Main() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc27 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f00 = ref_param_pattern [concrete = constants.%self.param_patt.af0] +// CHECK:STDOUT: %self.patt: %pattern_type.f00 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.954] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr.d08 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr.d08 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc27 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f00 = ref_param_pattern [concrete = constants.%self.param_patt.af0] +// CHECK:STDOUT: %self.patt: %pattern_type.f00 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.954] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr.d08 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr.d08 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc23_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc23_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc23_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc23_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc23_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.20e3 = ref_param_pattern [concrete = constants.%self.param_patt.3bf] +// CHECK:STDOUT: %self.patt: %pattern_type.20e3 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d0e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.a.b.b4c = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.a.b.b4c = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc23_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.20e3 = ref_param_pattern [concrete = constants.%self.param_patt.3bf] +// CHECK:STDOUT: %self.patt: %pattern_type.20e3 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d0e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.a.b.b4c = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.a.b.b4c = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc19 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.394 = ref_param_pattern [concrete = constants.%self.param_patt.f5e] +// CHECK:STDOUT: %self.patt: %pattern_type.394 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.7eb] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.e55 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.e55 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.5: %Destroy.WithSelf.Op.type.ef016f.5 = fn_decl @Destroy.WithSelf.Op.loc19 [concrete = constants.%Destroy.WithSelf.Op.403171.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.394 = ref_param_pattern [concrete = constants.%self.param_patt.f5e] +// CHECK:STDOUT: %self.patt: %pattern_type.394 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.7eb] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.e55 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.e55 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -350,33 +454,78 @@ fn Main() { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc30: init %i32 = call %bound_method.loc30_29.2(%int_10) [concrete = constants.%int_10.6bf] // CHECK:STDOUT: %.loc30_29: init %i32 = converted %int_10, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc30 [concrete = constants.%int_10.6bf] // CHECK:STDOUT: assign %.loc30_3, %.loc30_29 -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc27: = bound_method %p.var, constants.%Destroy.WithSelf.Op.403171.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc27: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc27(%p.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc23: = bound_method %c.var, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc23: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc23(%c.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc19: = bound_method %b.var, constants.%Destroy.WithSelf.Op.403171.5 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc19: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc19(%b.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc16: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc16: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc16(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc27: = bound_method %p.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc27: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc27(%p.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc23: = bound_method %c.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc23: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc23(%c.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc19: = bound_method %b.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc19: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc19(%b.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16(%a.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc27(%self.param: ref %ptr.d08) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc27(%self.param: ref %ptr.d08) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc27(%self.param: ref %ptr.d08) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc23_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc23_3.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc23_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc23_3.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc23_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc23_3.3(%self.param: ref %struct_type.a.b.b4c) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc23_3.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc23_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc23_3.3(%self.param: ref %struct_type.a.b.b4c) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc19(%self.param: ref %tuple.type.e55) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc23_3.3(%self.param: ref %struct_type.a.b.b4c) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc23_3.3(%self.param: ref %struct_type.a.b.b4c) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc19(%self.param: ref %tuple.type.e55) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc19(%self.param: ref %tuple.type.e55) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc19(%self.param: ref %tuple.type.e55) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.5(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.5(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon b/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon index 2bb7b4a73005..bd36b2e24bda 100644 --- a/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon @@ -154,8 +154,21 @@ fn Main() { // CHECK:STDOUT: %bound_method.1b6: = bound_method %int_10.64f, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_10.6bf: %i32 = int_value 10 [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc56_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc56_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc56_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc56_3.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc56_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -183,6 +196,37 @@ fn Main() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc56_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc56_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc56_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc56_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -387,17 +431,35 @@ fn Main() { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc61: init %i32 = call %bound_method.loc61_27.2(%int_10) [concrete = constants.%int_10.6bf] // CHECK:STDOUT: %.loc61_27: init %i32 = converted %int_10, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc61 [concrete = constants.%int_10.6bf] // CHECK:STDOUT: assign %.loc61_4, %.loc61_27 -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc56: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc56: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc56(%a.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc33: = bound_method %n.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc33: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc33(%n.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc56: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc56: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc56(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc33: = bound_method %n.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc33: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc33(%n.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc56_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc56_3.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc56_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc56_3.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc56_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc56_3.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc56_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon b/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon index c59cbe0d1817..85cfab5093ef 100644 --- a/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon @@ -81,8 +81,21 @@ fn Main() { // CHECK:STDOUT: %.737: type = fn_type_with_self_type %Copy.WithSelf.Op.type.381, %Copy.facet [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.4f6, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc18_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc18_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc18_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc18_3.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc18_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -104,6 +117,37 @@ fn Main() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc18_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc18_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc18_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc18_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -167,15 +211,33 @@ fn Main() { // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F] // CHECK:STDOUT: %F.call: init %i32 = call %F.ref() // CHECK:STDOUT: assign %a.ref.loc28_3, %F.call -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%a.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc18_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18_3.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc18_3.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc18_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18_3.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc18_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon b/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon index 7ccee6163bb9..064e6d0b1ac6 100644 --- a/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon @@ -37,8 +37,14 @@ fn Main() { // CHECK:STDOUT: %ImplicitAs.type.0ff: type = generic_interface_type @ImplicitAs [concrete] // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.0ff = struct_value () [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %self.param_patt.40d: %pattern_type.831 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.560: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt.40d [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfc: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc23 [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.loc23 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc23 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -54,6 +60,23 @@ fn Main() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl: %Destroy.WithSelf.SubobjectDestroy.type.dfc = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc23 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d] +// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0 +// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc23 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d] +// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0 +// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -76,10 +99,19 @@ fn Main() { // CHECK:STDOUT: %x.patt: %pattern_type.831 = ref_binding_pattern x [concrete = constants.%x.patt] // CHECK:STDOUT: %x.var_patt: %pattern_type.831 = var_pattern %x.patt [concrete = constants.%x.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %x.var, constants.%Destroy.WithSelf.Op.403 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%x.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %x.var, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%x.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc23(%self.param: ref bool) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc23(%self.param: ref bool) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc23(%self.param: ref bool) { +// 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) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon index a8299e06e4f4..32d028e9ef0a 100644 --- a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon @@ -58,8 +58,21 @@ fn Main() { // CHECK:STDOUT: %int_3.410: %i32 = int_value 3 [concrete] // CHECK:STDOUT: %float: Core.FloatLiteral = float_literal_value 56e-1 [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc16_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc16_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc16_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc16_3.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc16_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -77,6 +90,37 @@ fn Main() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc16_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc16_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc16_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc16_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -107,15 +151,33 @@ fn Main() { // CHECK:STDOUT: %float: Core.FloatLiteral = float_literal_value 56e-1 [concrete = constants.%float] // CHECK:STDOUT: %.loc24: %i32 = converted %float, [concrete = ] // CHECK:STDOUT: assign %a.ref, -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%a.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc16_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16_3.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc16_3.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc16_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16_3.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc16_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/builtin/or.carbon b/toolchain/check/testdata/operators/builtin/or.carbon index 991a5b1b5d60..02ee9e37076e 100644 --- a/toolchain/check/testdata/operators/builtin/or.carbon +++ b/toolchain/check/testdata/operators/builtin/or.carbon @@ -68,10 +68,22 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: %d.patt: %pattern_type.cb1 = ref_binding_pattern d [concrete] // CHECK:STDOUT: %d.var_patt: %pattern_type.cb1 = var_pattern %d.patt [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %self.param_patt.65a: %pattern_type.cb1 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.df1: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt.65a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc26 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc26 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc26 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.40d: %pattern_type.831 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.560: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt.40d [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc25 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc25 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc25 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: %x.param_patt: %pattern_type.831 = value_param_pattern [concrete] // CHECK:STDOUT: %x.patt: %pattern_type.831 = wrapper_binding_pattern x, %x.param_patt [concrete] // CHECK:STDOUT: %PartialConstant.type: type = fn_type @PartialConstant [concrete] @@ -95,6 +107,37 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc26 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc26 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc25 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d] +// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0 +// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc25 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d] +// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0 +// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -351,21 +394,39 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: %d.patt: %pattern_type.cb1 = ref_binding_pattern d [concrete = constants.%d.patt] // CHECK:STDOUT: %d.var_patt: %pattern_type.cb1 = var_pattern %d.patt [concrete = constants.%d.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc26: = bound_method %d.var, constants.%Destroy.WithSelf.Op.403171.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc26: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc26(%d.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc25: = bound_method %c.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc25: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc25(%c.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc24: = bound_method %b.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc24: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc24(%b.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc23: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc23: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc23(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc26: = bound_method %d.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc26: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc26(%d.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc25: = bound_method %c.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc25: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc25(%c.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc24: = bound_method %b.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc24: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc24(%b.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc23: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc23: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc23(%a.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc26(%self.param: ref %empty_tuple.type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc26(%self.param: ref %empty_tuple.type) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc26(%self.param: ref %empty_tuple.type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc25(%self.param: ref bool) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc25(%self.param: ref bool) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc25(%self.param: ref bool) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @PartialConstant(%x.param: bool) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.var: ref bool = var_storage %a.var_patt @@ -409,8 +470,8 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: %a.patt: %pattern_type.831 = ref_binding_pattern a [concrete = constants.%a.patt.d4ccad.2] // CHECK:STDOUT: %a.var_patt: %pattern_type.831 = var_pattern %a.patt [concrete = constants.%a.var_patt.41b89c.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%a.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/builtin/unary_op.carbon b/toolchain/check/testdata/operators/builtin/unary_op.carbon index 1e7852a08db3..234b4e9a6c30 100644 --- a/toolchain/check/testdata/operators/builtin/unary_op.carbon +++ b/toolchain/check/testdata/operators/builtin/unary_op.carbon @@ -58,10 +58,22 @@ fn Constant() { // CHECK:STDOUT: %b.var_patt: %pattern_type.831 = var_pattern %b.patt.454 [concrete] // CHECK:STDOUT: %bool.as.Copy.impl.Op.bound: = bound_method %true, %bool.as.Copy.impl.Op [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %self.param_patt.40d: %pattern_type.831 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.560: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt.40d [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc24 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc24 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc24 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.65a: %pattern_type.cb1 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.df1: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt.65a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc23 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc23 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc23 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -79,6 +91,37 @@ fn Constant() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc24 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d] +// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0 +// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc24 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d] +// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0 +// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc23 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc23 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -190,17 +233,35 @@ fn Constant() { // CHECK:STDOUT: %b.patt: %pattern_type.831 = ref_binding_pattern b [concrete = constants.%b.patt.454] // CHECK:STDOUT: %b.var_patt: %pattern_type.831 = var_pattern %b.patt [concrete = constants.%b.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc24: = bound_method %b.var, constants.%Destroy.WithSelf.Op.403171.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc24: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc24(%b.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc23: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc23: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc23(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc24: = bound_method %b.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc24: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc24(%b.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc23: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc23: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc23(%a.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc24(%self.param: ref bool) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24(%self.param: ref bool) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc24(%self.param: ref bool) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc23(%self.param: ref %empty_tuple.type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc23(%self.param: ref %empty_tuple.type) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc23(%self.param: ref %empty_tuple.type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %true: bool = bool_literal true [concrete = constants.%true] diff --git a/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon b/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon index 86fd9d3dcf92..75227929cf1e 100644 --- a/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon +++ b/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon @@ -79,8 +79,21 @@ fn TestRef(b: C) { // CHECK:STDOUT: %AddAssignWith.generic: %AddAssignWith.type.2fb = struct_value () [concrete] // CHECK:STDOUT: %Inc.type: type = facet_type <@Inc> [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc36_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc36_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.26a: %pattern_type.4a7 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.076: %pattern_type.4a7 = wrapper_binding_pattern self, %self.param_patt.26a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc36_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc36_3.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc36_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -100,6 +113,37 @@ fn TestRef(b: C) { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc36_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc36_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc36_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.4a7 = ref_param_pattern [concrete = constants.%self.param_patt.26a] +// CHECK:STDOUT: %self.patt: %pattern_type.4a7 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.076] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc36_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.4a7 = ref_param_pattern [concrete = constants.%self.param_patt.26a] +// CHECK:STDOUT: %self.patt: %pattern_type.4a7 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.076] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -190,15 +234,33 @@ fn TestRef(b: C) { // CHECK:STDOUT: %a.ref.loc41: ref %C = name_ref a, %a // CHECK:STDOUT: %b.ref: %C = name_ref b, %b // CHECK:STDOUT: %a.ref.loc46: ref %C = name_ref a, %a -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%a.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc36_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc36_3.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc36_3.2(%self.param: ref %C) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc36_3.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc36_3.2(%self.param: ref %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc36_3.2(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc36_3.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/implicit_as.carbon b/toolchain/check/testdata/operators/overloaded/implicit_as.carbon index ac0e50ed84d0..16ba1b5186f2 100644 --- a/toolchain/check/testdata/operators/overloaded/implicit_as.carbon +++ b/toolchain/check/testdata/operators/overloaded/implicit_as.carbon @@ -115,8 +115,34 @@ fn Test() { // CHECK:STDOUT: %Source.specific_fn.ca6: = specific_function %Source, @Source(%X) [concrete] // CHECK:STDOUT: %.9c6: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.1f0, %ImplicitAs.facet.1d0 [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc34_20.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc34_20.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc34_20.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc34_20.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.b13: type = pattern_type %struct_type.n [concrete] +// CHECK:STDOUT: %self.param_patt.e77: %pattern_type.b13 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.b1b: %pattern_type.b13 = wrapper_binding_pattern self, %self.param_patt.e77 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc34_20.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc34_20.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.925: %pattern_type.6cb = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.617: %pattern_type.6cb = wrapper_binding_pattern self, %self.param_patt.925 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc34_20.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc34_20.4 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc34_20.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] // CHECK:STDOUT: %Source.specific_fn.75e: = specific_function %Source, @Source(%i32) [concrete] // CHECK:STDOUT: %.64d: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.40d, %ImplicitAs.facet.1cc [concrete] // CHECK:STDOUT: } @@ -138,6 +164,65 @@ fn Test() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc34_20.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc34_20.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc34_20.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc34_20.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc34_20.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b13 = ref_param_pattern [concrete = constants.%self.param_patt.e77] +// CHECK:STDOUT: %self.patt: %pattern_type.b13 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.b1b] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.n = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.n = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc34_20.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.b13 = ref_param_pattern [concrete = constants.%self.param_patt.e77] +// CHECK:STDOUT: %self.patt: %pattern_type.b13 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.b1b] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.n = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.n = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc34_20.4 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6cb = ref_param_pattern [concrete = constants.%self.param_patt.925] +// CHECK:STDOUT: %self.patt: %pattern_type.6cb = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.617] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %X = ref_param call_param0 +// CHECK:STDOUT: %self: ref %X = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc34_20.4 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6cb = ref_param_pattern [concrete = constants.%self.param_patt.925] +// CHECK:STDOUT: %self.patt: %pattern_type.6cb = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.617] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %X = ref_param call_param0 +// CHECK:STDOUT: %self: ref %X = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -334,8 +419,8 @@ fn Test() { // CHECK:STDOUT: %.loc34_20.4: %i32 = value_of_initializer %X.as.ImplicitAs.impl.Convert.call // CHECK:STDOUT: %.loc34_20.5: %i32 = converted %Source.call.loc34, %.loc34_20.4 // CHECK:STDOUT: %Sink_i32.call: init %empty_tuple.type = call %Sink_i32.ref(%.loc34_20.5) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc34: = bound_method %.loc34_20.2, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc34: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc34(%.loc34_20.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc34: = bound_method %.loc34_20.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc34: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc34(%.loc34_20.2) // CHECK:STDOUT: %Sink_X.ref: %Sink_X.type = name_ref Sink_X, file.%Sink_X.decl [concrete = constants.%Sink_X] // CHECK:STDOUT: %Source.ref.loc35: %Source.type = name_ref Source, file.%Source.decl [concrete = constants.%Source] // CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32] @@ -351,25 +436,61 @@ fn Test() { // CHECK:STDOUT: %.loc35_20.5: ref %X = temporary %.loc35_20.1, %.loc35_20.4 // CHECK:STDOUT: %.loc35_20.6: %X = acquire_value %.loc35_20.5 // CHECK:STDOUT: %Sink_X.call: init %empty_tuple.type = call %Sink_X.ref(%.loc35_20.6) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc35: = bound_method %.loc35_20.5, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc35: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc35(%.loc35_20.5) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc35: = bound_method %.loc35_20.5, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc35: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc35(%.loc35_20.5) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc34_20.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc34_20.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc34_20.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc34_20.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc34_20.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc34_20.3(%self.param: ref %struct_type.n) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc34_20.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc34_20.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc34_20.3(%self.param: ref %struct_type.n) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc34_20.4(%self.param: ref %X) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc34_20.3(%self.param: ref %struct_type.n) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc34_20.3(%self.param: ref %struct_type.n) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc34_20.4(%self.param: ref %X) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc34_20.4(%self.param: ref %X) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc34_20.4(%self.param: ref %X) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/index.carbon b/toolchain/check/testdata/operators/overloaded/index.carbon index 6b9a318734f9..5005934c111b 100644 --- a/toolchain/check/testdata/operators/overloaded/index.carbon +++ b/toolchain/check/testdata/operators/overloaded/index.carbon @@ -440,9 +440,22 @@ fn F() { // CHECK:STDOUT: %C.val: %C = struct_value () [concrete] // CHECK:STDOUT: %.115: ref %C = temporary invalid, %C.val [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc15_15.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc15_15.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.99a: %pattern_type.98b = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.cbd: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt.99a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc15_15.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc15_15.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.115, %Destroy.WithSelf.Op.403171.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc15_15.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.115, %Destroy.WithSelf.SelfDestruct.db3fdb.2 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -466,6 +479,37 @@ fn F() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc15_15.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc15_15.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc15_15.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc15_15.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.98b = ref_param_pattern [concrete = constants.%self.param_patt.99a] +// CHECK:STDOUT: %self.patt: %pattern_type.98b = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cbd] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -592,14 +636,32 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %c.ref: %C = name_ref c, %c // CHECK:STDOUT: %.loc23: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.115) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.115) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc15_15.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc15_15.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc15_15.2(%self.param: ref %C) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc15_15.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc15_15.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc15_15.2(%self.param: ref %C) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc15_15.2(%self.param: ref %C) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/package_expr/syntax.carbon b/toolchain/check/testdata/package_expr/syntax.carbon index 3dc6a2aa6545..4454fae00dbc 100644 --- a/toolchain/check/testdata/package_expr/syntax.carbon +++ b/toolchain/check/testdata/package_expr/syntax.carbon @@ -202,8 +202,21 @@ fn Main() { // CHECK:STDOUT: %.737: type = fn_type_with_self_type %Copy.WithSelf.Op.type.381, %Copy.facet [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.4f6, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc9_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc9_3.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -225,6 +238,37 @@ fn Main() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc9_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc9_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -275,17 +319,35 @@ fn Main() { // CHECK:STDOUT: %y.patt: %pattern_type.6b6 = ref_binding_pattern y [concrete = constants.%y.patt] // CHECK:STDOUT: %y.var_patt: %pattern_type.6b6 = var_pattern %y.patt [concrete = constants.%y.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc9: = bound_method %y.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc9(%y.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc7: = bound_method %x.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc7: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc7(%x.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc9: = bound_method %y.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc9(%y.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc7: = bound_method %x.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc7: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc7(%x.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.1(%self.param: ref %i32.builtin) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9_3.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/patterns/underscore.carbon b/toolchain/check/testdata/patterns/underscore.carbon index 1a592eb7a32e..532ff9d16919 100644 --- a/toolchain/check/testdata/patterns/underscore.carbon +++ b/toolchain/check/testdata/patterns/underscore.carbon @@ -122,8 +122,14 @@ fn F() -> {} { // CHECK:STDOUT: %_.patt.3b4: %pattern_type.a96 = ref_binding_pattern _ [concrete] // CHECK:STDOUT: %_.var_patt.f52: %pattern_type.a96 = var_pattern %_.patt.3b4 [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [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.loc9 [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.loc9 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -135,6 +141,23 @@ fn F() -> {} { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl: %Destroy.WithSelf.SubobjectDestroy.type.dfc = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9 [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.loc9 [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: } { +// 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: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -191,13 +214,22 @@ fn F() -> {} { // CHECK:STDOUT: %_.patt.loc9: %pattern_type.a96 = ref_binding_pattern _ [concrete = constants.%_.patt.3b4] // CHECK:STDOUT: %_.var_patt: %pattern_type.a96 = var_pattern %_.patt.loc9 [concrete = constants.%_.var_patt.f52] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %_.var, constants.%Destroy.WithSelf.Op.403 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%_.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %_.var, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%_.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9(%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) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc4: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] diff --git a/toolchain/check/testdata/pointer/address_of_deref.carbon b/toolchain/check/testdata/pointer/address_of_deref.carbon index 3770ec903dc3..c5f10059d812 100644 --- a/toolchain/check/testdata/pointer/address_of_deref.carbon +++ b/toolchain/check/testdata/pointer/address_of_deref.carbon @@ -65,8 +65,21 @@ fn F() -> i32 { // CHECK:STDOUT: %.737: type = fn_type_with_self_type %Copy.WithSelf.Op.type.381, %Copy.facet [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.4f6, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc16_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc16_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc16_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc16_3.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc16_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -88,6 +101,37 @@ fn F() -> i32 { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc16_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc16_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc16_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc16_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -133,15 +177,33 @@ fn F() -> i32 { // CHECK:STDOUT: %specific_fn.loc17: = specific_function %impl.elem0.loc17, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] // CHECK:STDOUT: %bound_method.loc17_10.2: = bound_method %.loc17_10.2, %specific_fn.loc17 // CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc17_10.2(%.loc17_10.2) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %n.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%n.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %n.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%n.var) // CHECK:STDOUT: return %Int.as.Copy.impl.Op.call // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc16_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16_3.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc16_3.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc16_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16_3.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc16_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/pointer/address_of_lvalue.carbon b/toolchain/check/testdata/pointer/address_of_lvalue.carbon index 1cb3c4127fa7..25f2b3579189 100644 --- a/toolchain/check/testdata/pointer/address_of_lvalue.carbon +++ b/toolchain/check/testdata/pointer/address_of_lvalue.carbon @@ -58,6 +58,7 @@ fn F() { // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.8eb: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%i32, %ImplicitAs.facet) [concrete] // CHECK:STDOUT: %.b7a: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.8eb, %ImplicitAs.facet [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.094: = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.e39 [concrete] +// CHECK:STDOUT: %pattern_type.6b6: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.e39, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete] // CHECK:STDOUT: %bound_method.953: = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.0c6: %i32 = int_value 1 [concrete] @@ -107,14 +108,51 @@ fn F() { // CHECK:STDOUT: %t1.patt: %pattern_type.f00 = ref_binding_pattern t1 [concrete] // CHECK:STDOUT: %t1.var_patt: %pattern_type.f00 = var_pattern %t1.patt [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %self.param_patt.af0: %pattern_type.f00 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.954: %pattern_type.f00 = wrapper_binding_pattern self, %self.param_patt.af0 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc24 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc24 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc24 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc22_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc22_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc22_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc22_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.f5e: %pattern_type.394 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.7eb: %pattern_type.394 = wrapper_binding_pattern self, %self.param_patt.f5e [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc22_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc22_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc22_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.113: %pattern_type.88d = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.9e7: %pattern_type.88d = wrapper_binding_pattern self, %self.param_patt.113 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc18 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.5: type = fn_type @Destroy.WithSelf.Op.loc18 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.5: %Destroy.WithSelf.Op.type.ef016f.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5: type = fn_type @Destroy.WithSelf.SelfDestruct.loc18 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.5: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.3bf: %pattern_type.20e3 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.d0e: %pattern_type.20e3 = wrapper_binding_pattern self, %self.param_patt.3bf [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc16 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.6: type = fn_type @Destroy.WithSelf.Op.loc16 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.6: %Destroy.WithSelf.Op.type.ef016f.6 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.6: type = fn_type @Destroy.WithSelf.SelfDestruct.loc16 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.6: %Destroy.WithSelf.SelfDestruct.type.fbceb5.6 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -136,6 +174,93 @@ fn F() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc24 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f00 = ref_param_pattern [concrete = constants.%self.param_patt.af0] +// CHECK:STDOUT: %self.patt: %pattern_type.f00 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.954] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr.d08 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr.d08 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc24 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f00 = ref_param_pattern [concrete = constants.%self.param_patt.af0] +// CHECK:STDOUT: %self.patt: %pattern_type.f00 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.954] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr.d08 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr.d08 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc22_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc22_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc22_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc22_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc22_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.394 = ref_param_pattern [concrete = constants.%self.param_patt.f5e] +// CHECK:STDOUT: %self.patt: %pattern_type.394 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.7eb] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.e55 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.e55 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc22_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.394 = ref_param_pattern [concrete = constants.%self.param_patt.f5e] +// CHECK:STDOUT: %self.patt: %pattern_type.394 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.7eb] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.e55 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.e55 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc18 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.88d = ref_param_pattern [concrete = constants.%self.param_patt.113] +// CHECK:STDOUT: %self.patt: %pattern_type.88d = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.9e7] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr.939 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr.939 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.5: %Destroy.WithSelf.Op.type.ef016f.5 = fn_decl @Destroy.WithSelf.Op.loc18 [concrete = constants.%Destroy.WithSelf.Op.403171.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.88d = ref_param_pattern [concrete = constants.%self.param_patt.113] +// CHECK:STDOUT: %self.patt: %pattern_type.88d = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.9e7] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr.939 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr.939 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc16 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.20e3 = ref_param_pattern [concrete = constants.%self.param_patt.3bf] +// CHECK:STDOUT: %self.patt: %pattern_type.20e3 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d0e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.a.b.b4c = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.a.b.b4c = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.6: %Destroy.WithSelf.Op.type.ef016f.6 = fn_decl @Destroy.WithSelf.Op.loc16 [concrete = constants.%Destroy.WithSelf.Op.403171.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.20e3 = ref_param_pattern [concrete = constants.%self.param_patt.3bf] +// CHECK:STDOUT: %self.patt: %pattern_type.20e3 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d0e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.a.b.b4c = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.a.b.b4c = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -312,41 +437,95 @@ fn F() { // CHECK:STDOUT: %t1.patt: %pattern_type.f00 = ref_binding_pattern t1 [concrete = constants.%t1.patt] // CHECK:STDOUT: %t1.var_patt: %pattern_type.f00 = var_pattern %t1.patt [concrete = constants.%t1.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc24: = bound_method %t1.var, constants.%Destroy.WithSelf.Op.403171.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc24: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc24(%t1.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc23: = bound_method %t0.var, constants.%Destroy.WithSelf.Op.403171.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc23: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc23(%t0.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc22: = bound_method %t.var, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc22: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc22(%t.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc20: = bound_method %r.var, constants.%Destroy.WithSelf.Op.403171.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc20: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc20(%r.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc19: = bound_method %q.var, constants.%Destroy.WithSelf.Op.403171.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc19: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc19(%q.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc18: = bound_method %p.var, constants.%Destroy.WithSelf.Op.403171.5 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc18: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc18(%p.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc16: = bound_method %s.var, constants.%Destroy.WithSelf.Op.403171.6 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc16: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc16(%s.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc24: = bound_method %t1.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc24: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc24(%t1.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc23: = bound_method %t0.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc23: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc23(%t0.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc22: = bound_method %t.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc22: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc22(%t.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc20: = bound_method %r.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc20: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc20(%r.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc19: = bound_method %q.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc19: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc19(%q.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc18: = bound_method %p.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc18: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc18(%p.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16: = bound_method %s.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.6 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16(%s.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc24(%self.param: ref %ptr.d08) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24(%self.param: ref %ptr.d08) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc24(%self.param: ref %ptr.d08) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc22_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc22_3.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc22_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc22_3.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc22_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc22_3.3(%self.param: ref %tuple.type.e55) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc22_3.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc22_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc22_3.3(%self.param: ref %tuple.type.e55) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc22_3.3(%self.param: ref %tuple.type.e55) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc22_3.3(%self.param: ref %tuple.type.e55) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc18(%self.param: ref %ptr.939) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18(%self.param: ref %ptr.939) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16(%self.param: ref %struct_type.a.b.b4c) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc18(%self.param: ref %ptr.939) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.5(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.5(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc16(%self.param: ref %struct_type.a.b.b4c) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16(%self.param: ref %struct_type.a.b.b4c) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc16(%self.param: ref %struct_type.a.b.b4c) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.6(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.6(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/pointer/basic.carbon b/toolchain/check/testdata/pointer/basic.carbon index eb878cdac112..56f6f378cc33 100644 --- a/toolchain/check/testdata/pointer/basic.carbon +++ b/toolchain/check/testdata/pointer/basic.carbon @@ -80,10 +80,29 @@ fn F() -> i32 { // CHECK:STDOUT: %.737: type = fn_type_with_self_type %Copy.WithSelf.Op.type.381, %Copy.facet.1e1 [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.4f6, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %self.param_patt.af0: %pattern_type.f00 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.954: %pattern_type.f00 = wrapper_binding_pattern self, %self.param_patt.af0 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc17 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc17 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc17 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc16_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc16_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc16_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc16_3.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc16_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -107,6 +126,51 @@ fn F() -> i32 { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc17 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f00 = ref_param_pattern [concrete = constants.%self.param_patt.af0] +// CHECK:STDOUT: %self.patt: %pattern_type.f00 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.954] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr.d08 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr.d08 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc17 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f00 = ref_param_pattern [concrete = constants.%self.param_patt.af0] +// CHECK:STDOUT: %self.patt: %pattern_type.f00 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.954] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %ptr.d08 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %ptr.d08 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc16_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc16_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc16_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc16_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -168,19 +232,46 @@ fn F() -> i32 { // CHECK:STDOUT: %specific_fn.loc19: = specific_function %impl.elem0.loc19, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] // CHECK:STDOUT: %bound_method.loc19_10.2: = bound_method %.loc19_10.2, %specific_fn.loc19 // CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc19_10.2(%.loc19_10.2) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc17: = bound_method %p.var, constants.%Destroy.WithSelf.Op.403171.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc17: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc17(%p.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc16: = bound_method %n.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc16: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc16(%n.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc17: = bound_method %p.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc17: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc17(%p.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16: = bound_method %n.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16(%n.var) // CHECK:STDOUT: return %Int.as.Copy.impl.Op.call // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc17(%self.param: ref %ptr.d08) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc17(%self.param: ref %ptr.d08) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc17(%self.param: ref %ptr.d08) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc16_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16_3.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc16_3.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc16_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16_3.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc16_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/fail_return_with_returned_var.carbon b/toolchain/check/testdata/return/fail_return_with_returned_var.carbon index f61293077abe..0a2530685a38 100644 --- a/toolchain/check/testdata/return/fail_return_with_returned_var.carbon +++ b/toolchain/check/testdata/return/fail_return_with_returned_var.carbon @@ -74,8 +74,21 @@ fn G() -> C { // CHECK:STDOUT: %int_0.3c0: %i32 = int_value 0 [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc16_12.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc16_12.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc16_12.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc16_12.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc16_12.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %C.elem: type = unbound_element_type %C, %i32 [concrete] // CHECK:STDOUT: %struct_type.a.b.b4c: type = struct_type {.a: %i32, .b: %i32} [concrete] @@ -115,6 +128,37 @@ fn G() -> C { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc16_12.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc16_12.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc16_12.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc16_12.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -178,15 +222,33 @@ fn G() -> C { // CHECK:STDOUT: %v.var_patt: %pattern_type.6b6 = var_pattern %v.patt [concrete = constants.%v.var_patt] // CHECK:STDOUT: } // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %v.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%v.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %v.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%v.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc16_12.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16_12.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16_12.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc16_12.1(%self.param: ref %i32.builtin) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc16_12.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16_12.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc16_12.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/fail_returned_var_no_return_type.carbon b/toolchain/check/testdata/return/fail_returned_var_no_return_type.carbon index e0825e617066..7c1d820d6b01 100644 --- a/toolchain/check/testdata/return/fail_returned_var_no_return_type.carbon +++ b/toolchain/check/testdata/return/fail_returned_var_no_return_type.carbon @@ -60,8 +60,14 @@ fn ForgotReturnType() { // CHECK:STDOUT: %v.patt: %pattern_type.cb1 = ref_binding_pattern v [concrete] // CHECK:STDOUT: %v.var_patt: %pattern_type.cb1 = var_pattern %v.patt [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %self.param_patt.65a: %pattern_type.cb1 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.df1: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt.65a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfc: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc12 [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.loc12 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc12 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -73,6 +79,23 @@ fn ForgotReturnType() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl: %Destroy.WithSelf.SubobjectDestroy.type.dfc = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc12 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc12 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -98,13 +121,22 @@ fn ForgotReturnType() { // CHECK:STDOUT: %v.patt: %pattern_type.cb1 = ref_binding_pattern v [concrete = constants.%v.patt] // CHECK:STDOUT: %v.var_patt: %pattern_type.cb1 = var_pattern %v.patt [concrete = constants.%v.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %v.var, constants.%Destroy.WithSelf.Op.403 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%v.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %v.var, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%v.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc12(%self.param: ref %empty_tuple.type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc12(%self.param: ref %empty_tuple.type) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc12(%self.param: ref %empty_tuple.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) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_forgot_return_type.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -117,8 +149,14 @@ fn ForgotReturnType() { // CHECK:STDOUT: %v.patt: %pattern_type.cb1 = ref_binding_pattern v [concrete] // CHECK:STDOUT: %v.var_patt: %pattern_type.cb1 = var_pattern %v.patt [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %self.param_patt.65a: %pattern_type.cb1 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.df1: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt.65a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfc: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc12 [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.loc12 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc12 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -130,6 +168,23 @@ fn ForgotReturnType() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl: %Destroy.WithSelf.SubobjectDestroy.type.dfc = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc12 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc12 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -155,10 +210,19 @@ fn ForgotReturnType() { // CHECK:STDOUT: %v.patt: %pattern_type.cb1 = ref_binding_pattern v [concrete = constants.%v.patt] // CHECK:STDOUT: %v.var_patt: %pattern_type.cb1 = var_pattern %v.patt [concrete = constants.%v.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %v.var, constants.%Destroy.WithSelf.Op.403 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%v.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %v.var, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%v.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc12(%self.param: ref %empty_tuple.type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc12(%self.param: ref %empty_tuple.type) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc12(%self.param: ref %empty_tuple.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) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/fail_returned_var_shadow.carbon b/toolchain/check/testdata/return/fail_returned_var_shadow.carbon index db58c1cc19fd..3a1c0a0fda77 100644 --- a/toolchain/check/testdata/return/fail_returned_var_shadow.carbon +++ b/toolchain/check/testdata/return/fail_returned_var_shadow.carbon @@ -87,8 +87,21 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: %bound_method.953: = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_1.0c6: %i32 = int_value 1 [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc25_14.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc25_14.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc25_14.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc25_14.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc25_14.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: %DifferentScopes.type: type = fn_type @DifferentScopes [concrete] // CHECK:STDOUT: %DifferentScopes: %DifferentScopes.type = struct_value () [concrete] // CHECK:STDOUT: %w.patt.859340.2: %pattern_type.6b6 = ref_binding_pattern w [concrete] @@ -110,6 +123,37 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc25_14.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc25_14.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc25_14.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc25_14.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -173,10 +217,10 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: %w.patt: %pattern_type.6b6 = ref_binding_pattern w [concrete = constants.%w.patt.859340.1] // CHECK:STDOUT: %w.var_patt: %pattern_type.6b6 = var_pattern %w.patt [concrete = constants.%w.var_patt.82cc74.1] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc25: = bound_method %w.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc25: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc25(%w.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc17: = bound_method %v.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc17: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc17(%v.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc25: = bound_method %w.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc25: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc25(%w.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc17: = bound_method %v.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc17: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc17(%v.var) // CHECK:STDOUT: br !if.else // CHECK:STDOUT: // CHECK:STDOUT: !if.else: @@ -190,10 +234,28 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: return %.loc27 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc25_14.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc25_14.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc25_14.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc25_14.1(%self.param: ref %i32.builtin) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc25_14.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc25_14.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc25_14.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -237,13 +299,13 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: %w.patt: %pattern_type.6b6 = ref_binding_pattern w [concrete = constants.%w.patt.859340.2] // CHECK:STDOUT: %w.var_patt: %pattern_type.6b6 = var_pattern %w.patt [concrete = constants.%w.var_patt.82cc74.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc41: = bound_method %w.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc41: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc41(%w.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc41: = bound_method %w.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc41: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc41(%w.var) // CHECK:STDOUT: br !if.else.loc33 // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc33: -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc32: = bound_method %v.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc32: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc32(%v.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc32: = bound_method %v.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc32: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc32(%v.var) // CHECK:STDOUT: br !if.else.loc31 // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc31: diff --git a/toolchain/check/testdata/return/fail_returned_var_type.carbon b/toolchain/check/testdata/return/fail_returned_var_type.carbon index 8c555cfacbe7..17654b534d1e 100644 --- a/toolchain/check/testdata/return/fail_returned_var_type.carbon +++ b/toolchain/check/testdata/return/fail_returned_var_type.carbon @@ -65,8 +65,21 @@ fn Mismatch() -> i32 { // CHECK:STDOUT: %bound_method: = bound_method %float.1f7, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %float.895: %f64.dc1 = float_value 0 [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.79d: type = pattern_type %f64.794 [concrete] +// CHECK:STDOUT: %self.param_patt.727: %pattern_type.79d = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.141: %pattern_type.79d = wrapper_binding_pattern self, %self.param_patt.727 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc23_12.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc23_12.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.71c: %pattern_type.fb7 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.a1a: %pattern_type.fb7 = wrapper_binding_pattern self, %self.param_patt.71c [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc23_12.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc23_12.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc23_12.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -86,6 +99,37 @@ fn Mismatch() -> i32 { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc23_12.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.79d = ref_param_pattern [concrete = constants.%self.param_patt.727] +// CHECK:STDOUT: %self.patt: %pattern_type.79d = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.141] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f64.794 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f64.794 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc23_12.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.79d = ref_param_pattern [concrete = constants.%self.param_patt.727] +// CHECK:STDOUT: %self.patt: %pattern_type.79d = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.141] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f64.794 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f64.794 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc23_12.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.fb7 = ref_param_pattern [concrete = constants.%self.param_patt.71c] +// CHECK:STDOUT: %self.patt: %pattern_type.fb7 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a1a] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f64.dc1 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f64.dc1 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc23_12.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.fb7 = ref_param_pattern [concrete = constants.%self.param_patt.71c] +// CHECK:STDOUT: %self.patt: %pattern_type.fb7 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a1a] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %f64.dc1 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %f64.dc1 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -121,15 +165,33 @@ fn Mismatch() -> i32 { // CHECK:STDOUT: %v.var_patt: %pattern_type.fb7 = var_pattern %v.patt [concrete = constants.%v.var_patt] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc23_17: %f64.dc1 = acquire_value %v -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %v.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%v.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %v.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%v.var) // CHECK:STDOUT: return %.loc23_17 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc23_12.1(%self.param: ref %f64.794) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc23_12.1(%self.param: ref %f64.794) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc23_12.2(%self.param: ref %f64.dc1) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc23_12.1(%self.param: ref %f64.794) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc23_12.2(%self.param: ref %f64.dc1) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc23_12.2(%self.param: ref %f64.dc1) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc23_12.2(%self.param: ref %f64.dc1) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/import_convert_function.carbon b/toolchain/check/testdata/return/import_convert_function.carbon index e0c93edc80e4..d5c70191ee99 100644 --- a/toolchain/check/testdata/return/import_convert_function.carbon +++ b/toolchain/check/testdata/return/import_convert_function.carbon @@ -827,12 +827,26 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %.908: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.96f, %ImplicitAs.facet.45c [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.type.ae6f4c.1: type = fn_type @C.as.ImplicitAs.impl.Convert.1 [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.3cefb0.1: %C.as.ImplicitAs.impl.Convert.type.ae6f4c.1 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.84d: type = pattern_type %C.771 [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.bound.d30: = bound_method %C.val.d9b, %C.as.ImplicitAs.impl.Convert.3cefb0.1 [concrete] // CHECK:STDOUT: %.de3: ref %C.771 = temporary invalid, %C.val.d9b [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc7_26.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc7_26.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.c2e: %pattern_type.84d = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.f0c: %pattern_type.84d = wrapper_binding_pattern self, %self.param_patt.c2e [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc7_26.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc7_26.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.9e6: = bound_method %.de3, %Destroy.WithSelf.Op.403171.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc7_26.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.e66: = bound_method %.de3, %Destroy.WithSelf.SelfDestruct.db3fdb.2 [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.094: = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.e39 [concrete] // CHECK:STDOUT: %bound_method.953: = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] @@ -843,11 +857,18 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %.f99: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.d3e, %ImplicitAs.facet.374 [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.type.ae6f4c.2: type = fn_type @C.as.ImplicitAs.impl.Convert.2 [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.3cefb0.2: %C.as.ImplicitAs.impl.Convert.type.ae6f4c.2 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.91a: type = pattern_type %C.83b [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.bound.b85: = bound_method %C.val.399, %C.as.ImplicitAs.impl.Convert.3cefb0.2 [concrete] // CHECK:STDOUT: %.027: ref %C.83b = temporary invalid, %C.val.399 [concrete] +// CHECK:STDOUT: %self.param_patt.3b3: %pattern_type.91a = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.cc2: %pattern_type.91a = wrapper_binding_pattern self, %self.param_patt.3b3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc8 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.bd8: = bound_method %.027, %Destroy.WithSelf.Op.403171.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.418: = bound_method %.027, %Destroy.WithSelf.SelfDestruct.db3fdb.3 [concrete] // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.9f3: = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.e39 [concrete] // CHECK:STDOUT: %bound_method.3cb: = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] @@ -858,11 +879,18 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %.e16: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.5da, %ImplicitAs.facet.e02 [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.type.ae6f4c.3: type = fn_type @C.as.ImplicitAs.impl.Convert.3 [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.3cefb0.3: %C.as.ImplicitAs.impl.Convert.type.ae6f4c.3 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.7dd: type = pattern_type %C.5ce [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.bound.468: = bound_method %C.val.040, %C.as.ImplicitAs.impl.Convert.3cefb0.3 [concrete] // CHECK:STDOUT: %.ed7: ref %C.5ce = temporary invalid, %C.val.040 [concrete] +// CHECK:STDOUT: %self.param_patt.789: %pattern_type.7dd = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.69f: %pattern_type.7dd = wrapper_binding_pattern self, %self.param_patt.789 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc9 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.00c: = bound_method %.ed7, %Destroy.WithSelf.Op.403171.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.159: = bound_method %.ed7, %Destroy.WithSelf.SelfDestruct.db3fdb.4 [concrete] // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.485: = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert.e39 [concrete] // CHECK:STDOUT: %bound_method.763: = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] @@ -873,11 +901,18 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %.7ab: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.ffe, %ImplicitAs.facet.3c2 [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.type.ae6f4c.4: type = fn_type @C.as.ImplicitAs.impl.Convert.4 [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.3cefb0.4: %C.as.ImplicitAs.impl.Convert.type.ae6f4c.4 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.26a: type = pattern_type %C.b3e [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.bound.891: = bound_method %C.val.cf1, %C.as.ImplicitAs.impl.Convert.3cefb0.4 [concrete] // CHECK:STDOUT: %.dc8: ref %C.b3e = temporary invalid, %C.val.cf1 [concrete] +// CHECK:STDOUT: %self.param_patt.77b: %pattern_type.26a = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.d3e: %pattern_type.26a = wrapper_binding_pattern self, %self.param_patt.77b [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.5: type = fn_type @Destroy.WithSelf.Op.loc10 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.5: %Destroy.WithSelf.Op.type.ef016f.5 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.c47: = bound_method %.dc8, %Destroy.WithSelf.Op.403171.5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.5: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.ad1: = bound_method %.dc8, %Destroy.WithSelf.SelfDestruct.db3fdb.5 [concrete] // CHECK:STDOUT: %int_4.0c1: Core.IntLiteral = int_value 4 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.aad: = bound_method %int_4.0c1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.e39 [concrete] // CHECK:STDOUT: %bound_method.b7a: = bound_method %int_4.0c1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] @@ -888,11 +923,18 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %.c3a: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.210, %ImplicitAs.facet.b70 [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.type.ae6f4c.5: type = fn_type @C.as.ImplicitAs.impl.Convert.5 [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.3cefb0.5: %C.as.ImplicitAs.impl.Convert.type.ae6f4c.5 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.387: type = pattern_type %C.8ee [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.bound.65e: = bound_method %C.val.19e, %C.as.ImplicitAs.impl.Convert.3cefb0.5 [concrete] // CHECK:STDOUT: %.054: ref %C.8ee = temporary invalid, %C.val.19e [concrete] +// CHECK:STDOUT: %self.param_patt.9ed: %pattern_type.387 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.4b6: %pattern_type.387 = wrapper_binding_pattern self, %self.param_patt.9ed [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.6: type = fn_type @Destroy.WithSelf.Op.loc11 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.6: %Destroy.WithSelf.Op.type.ef016f.6 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.3c7: = bound_method %.054, %Destroy.WithSelf.Op.403171.6 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.6: type = fn_type @Destroy.WithSelf.SelfDestruct.loc11 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.6: %Destroy.WithSelf.SelfDestruct.type.fbceb5.6 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.8c0: = bound_method %.054, %Destroy.WithSelf.SelfDestruct.db3fdb.6 [concrete] // CHECK:STDOUT: %int_5.64b: Core.IntLiteral = int_value 5 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.f6c: = bound_method %int_5.64b, %Core.IntLiteral.as.ImplicitAs.impl.Convert.e39 [concrete] // CHECK:STDOUT: %bound_method.c9d: = bound_method %int_5.64b, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] @@ -903,11 +945,18 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %.9d4: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.42f, %ImplicitAs.facet.1ea [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.type.ae6f4c.6: type = fn_type @C.as.ImplicitAs.impl.Convert.6 [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.3cefb0.6: %C.as.ImplicitAs.impl.Convert.type.ae6f4c.6 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.05e: type = pattern_type %C.5c1 [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.bound.c06: = bound_method %C.val.6ca, %C.as.ImplicitAs.impl.Convert.3cefb0.6 [concrete] // CHECK:STDOUT: %.6f6: ref %C.5c1 = temporary invalid, %C.val.6ca [concrete] +// CHECK:STDOUT: %self.param_patt.501: %pattern_type.05e = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.eea: %pattern_type.05e = wrapper_binding_pattern self, %self.param_patt.501 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc12 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.7: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.7: type = fn_type @Destroy.WithSelf.Op.loc12 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.7: %Destroy.WithSelf.Op.type.ef016f.7 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.a32: = bound_method %.6f6, %Destroy.WithSelf.Op.403171.7 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.7: type = fn_type @Destroy.WithSelf.SelfDestruct.loc12 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.7: %Destroy.WithSelf.SelfDestruct.type.fbceb5.7 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.698: = bound_method %.6f6, %Destroy.WithSelf.SelfDestruct.db3fdb.7 [concrete] // CHECK:STDOUT: %int_6.462: Core.IntLiteral = int_value 6 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.13d: = bound_method %int_6.462, %Core.IntLiteral.as.ImplicitAs.impl.Convert.e39 [concrete] // CHECK:STDOUT: %bound_method.be9: = bound_method %int_6.462, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] @@ -918,11 +967,18 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %.2f9: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.b79, %ImplicitAs.facet.306 [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.type.ae6f4c.7: type = fn_type @C.as.ImplicitAs.impl.Convert.7 [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.3cefb0.7: %C.as.ImplicitAs.impl.Convert.type.ae6f4c.7 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.4b0: type = pattern_type %C.57b [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.bound.edd: = bound_method %C.val.225, %C.as.ImplicitAs.impl.Convert.3cefb0.7 [concrete] // CHECK:STDOUT: %.fa8: ref %C.57b = temporary invalid, %C.val.225 [concrete] +// CHECK:STDOUT: %self.param_patt.6db: %pattern_type.4b0 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.cc3: %pattern_type.4b0 = wrapper_binding_pattern self, %self.param_patt.6db [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.8: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc13 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.8: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.8 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.8: type = fn_type @Destroy.WithSelf.Op.loc13 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.8: %Destroy.WithSelf.Op.type.ef016f.8 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.6ec: = bound_method %.fa8, %Destroy.WithSelf.Op.403171.8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.8: type = fn_type @Destroy.WithSelf.SelfDestruct.loc13 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.8: %Destroy.WithSelf.SelfDestruct.type.fbceb5.8 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.68f: = bound_method %.fa8, %Destroy.WithSelf.SelfDestruct.db3fdb.8 [concrete] // CHECK:STDOUT: %int_7.29f: Core.IntLiteral = int_value 7 [concrete] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.66b: = bound_method %int_7.29f, %Core.IntLiteral.as.ImplicitAs.impl.Convert.e39 [concrete] // CHECK:STDOUT: %bound_method.7ff: = bound_method %int_7.29f, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] @@ -933,11 +989,18 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %.f0d: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.dca, %ImplicitAs.facet.997 [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.type.ae6f4c.8: type = fn_type @C.as.ImplicitAs.impl.Convert.8 [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.3cefb0.8: %C.as.ImplicitAs.impl.Convert.type.ae6f4c.8 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.bc2: type = pattern_type %C.b0a [concrete] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.bound.a06: = bound_method %C.val.79c, %C.as.ImplicitAs.impl.Convert.3cefb0.8 [concrete] // CHECK:STDOUT: %.a0a: ref %C.b0a = temporary invalid, %C.val.79c [concrete] +// CHECK:STDOUT: %self.param_patt.6d2: %pattern_type.bc2 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.c54: %pattern_type.bc2 = wrapper_binding_pattern self, %self.param_patt.6d2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.9: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc14 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.9: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.9 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.9: type = fn_type @Destroy.WithSelf.Op.loc14 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.9: %Destroy.WithSelf.Op.type.ef016f.9 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.81a: = bound_method %.a0a, %Destroy.WithSelf.Op.403171.9 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.9: type = fn_type @Destroy.WithSelf.SelfDestruct.loc14 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.9: %Destroy.WithSelf.SelfDestruct.type.fbceb5.9 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.dd3: = bound_method %.a0a, %Destroy.WithSelf.SelfDestruct.db3fdb.9 [concrete] // CHECK:STDOUT: %Make.type: type = fn_type @Make [concrete] // CHECK:STDOUT: %Make: %Make.type = struct_value () [concrete] // CHECK:STDOUT: } @@ -1013,6 +1076,135 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %P.Make: %Make.type = import_ref P//library, Make, loaded [concrete = constants.%Make] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc7_26.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc7_26.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc7_26.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.84d = ref_param_pattern [concrete = constants.%self.param_patt.c2e] +// CHECK:STDOUT: %self.patt: %pattern_type.84d = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.f0c] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C.771 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C.771 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc7_26.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.84d = ref_param_pattern [concrete = constants.%self.param_patt.c2e] +// CHECK:STDOUT: %self.patt: %pattern_type.84d = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.f0c] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C.771 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C.771 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.91a = ref_param_pattern [concrete = constants.%self.param_patt.3b3] +// CHECK:STDOUT: %self.patt: %pattern_type.91a = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cc2] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C.83b = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C.83b = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc8 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.91a = ref_param_pattern [concrete = constants.%self.param_patt.3b3] +// CHECK:STDOUT: %self.patt: %pattern_type.91a = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cc2] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C.83b = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C.83b = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.7dd = ref_param_pattern [concrete = constants.%self.param_patt.789] +// CHECK:STDOUT: %self.patt: %pattern_type.7dd = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.69f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C.5ce = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C.5ce = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc9 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.7dd = ref_param_pattern [concrete = constants.%self.param_patt.789] +// CHECK:STDOUT: %self.patt: %pattern_type.7dd = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.69f] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C.5ce = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C.5ce = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.26a = ref_param_pattern [concrete = constants.%self.param_patt.77b] +// CHECK:STDOUT: %self.patt: %pattern_type.26a = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d3e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C.b3e = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C.b3e = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.5: %Destroy.WithSelf.Op.type.ef016f.5 = fn_decl @Destroy.WithSelf.Op.loc10 [concrete = constants.%Destroy.WithSelf.Op.403171.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.26a = ref_param_pattern [concrete = constants.%self.param_patt.77b] +// CHECK:STDOUT: %self.patt: %pattern_type.26a = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d3e] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C.b3e = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C.b3e = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.6: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.6 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.387 = ref_param_pattern [concrete = constants.%self.param_patt.9ed] +// CHECK:STDOUT: %self.patt: %pattern_type.387 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.4b6] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C.8ee = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C.8ee = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.6: %Destroy.WithSelf.Op.type.ef016f.6 = fn_decl @Destroy.WithSelf.Op.loc11 [concrete = constants.%Destroy.WithSelf.Op.403171.6] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.387 = ref_param_pattern [concrete = constants.%self.param_patt.9ed] +// CHECK:STDOUT: %self.patt: %pattern_type.387 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.4b6] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C.8ee = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C.8ee = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.7: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.7 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc12 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.7] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.05e = ref_param_pattern [concrete = constants.%self.param_patt.501] +// CHECK:STDOUT: %self.patt: %pattern_type.05e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.eea] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C.5c1 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C.5c1 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.7: %Destroy.WithSelf.Op.type.ef016f.7 = fn_decl @Destroy.WithSelf.Op.loc12 [concrete = constants.%Destroy.WithSelf.Op.403171.7] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.05e = ref_param_pattern [concrete = constants.%self.param_patt.501] +// CHECK:STDOUT: %self.patt: %pattern_type.05e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.eea] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C.5c1 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C.5c1 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.8: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.8 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc13 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.8] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.4b0 = ref_param_pattern [concrete = constants.%self.param_patt.6db] +// CHECK:STDOUT: %self.patt: %pattern_type.4b0 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cc3] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C.57b = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C.57b = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.8: %Destroy.WithSelf.Op.type.ef016f.8 = fn_decl @Destroy.WithSelf.Op.loc13 [concrete = constants.%Destroy.WithSelf.Op.403171.8] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.4b0 = ref_param_pattern [concrete = constants.%self.param_patt.6db] +// CHECK:STDOUT: %self.patt: %pattern_type.4b0 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.cc3] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C.57b = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C.57b = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.9: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.9 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc14 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.9] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.bc2 = ref_param_pattern [concrete = constants.%self.param_patt.6d2] +// CHECK:STDOUT: %self.patt: %pattern_type.bc2 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.c54] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C.b0a = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C.b0a = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.9: %Destroy.WithSelf.Op.type.ef016f.9 = fn_decl @Destroy.WithSelf.Op.loc14 [concrete = constants.%Destroy.WithSelf.Op.403171.9] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.bc2 = ref_param_pattern [concrete = constants.%self.param_patt.6d2] +// CHECK:STDOUT: %self.patt: %pattern_type.bc2 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.c54] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %C.b0a = ref_param call_param0 +// CHECK:STDOUT: %self: ref %C.b0a = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -1129,7 +1321,7 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %.loc7_26.3: %C.771 = acquire_value %.loc7_26.2 [concrete = constants.%C.val.d9b] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.call.loc7: init %D to %.loc6_26.1 = call %bound_method.loc7_35(%.loc7_26.3) // CHECK:STDOUT: %.loc7_35: init %D = converted %.loc7_26.1, %C.as.ImplicitAs.impl.Convert.call.loc7 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc7: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound.9e6(constants.%.de3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc7: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound.e66(constants.%.de3) // CHECK:STDOUT: return %.loc7_35 to %return.param // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc7: @@ -1159,7 +1351,7 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %.loc8_26.3: %C.83b = acquire_value %.loc8_26.2 [concrete = constants.%C.val.399] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.call.loc8: init %D to %.loc6_26.2 = call %bound_method.loc8_35(%.loc8_26.3) // CHECK:STDOUT: %.loc8_35: init %D = converted %.loc8_26.1, %C.as.ImplicitAs.impl.Convert.call.loc8 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc8: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound.bd8(constants.%.027) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound.418(constants.%.027) // CHECK:STDOUT: return %.loc8_35 to %return.param // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc8: @@ -1189,7 +1381,7 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %.loc9_26.3: %C.5ce = acquire_value %.loc9_26.2 [concrete = constants.%C.val.040] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.call.loc9: init %D to %.loc6_26.3 = call %bound_method.loc9_35(%.loc9_26.3) // CHECK:STDOUT: %.loc9_35: init %D = converted %.loc9_26.1, %C.as.ImplicitAs.impl.Convert.call.loc9 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc9: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound.00c(constants.%.ed7) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc9: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound.159(constants.%.ed7) // CHECK:STDOUT: return %.loc9_35 to %return.param // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc9: @@ -1219,7 +1411,7 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %.loc10_26.3: %C.b3e = acquire_value %.loc10_26.2 [concrete = constants.%C.val.cf1] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.call.loc10: init %D to %.loc6_26.4 = call %bound_method.loc10_35(%.loc10_26.3) // CHECK:STDOUT: %.loc10_35: init %D = converted %.loc10_26.1, %C.as.ImplicitAs.impl.Convert.call.loc10 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc10: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound.c47(constants.%.dc8) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound.ad1(constants.%.dc8) // CHECK:STDOUT: return %.loc10_35 to %return.param // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc10: @@ -1249,7 +1441,7 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %.loc11_26.3: %C.8ee = acquire_value %.loc11_26.2 [concrete = constants.%C.val.19e] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.call.loc11: init %D to %.loc6_26.5 = call %bound_method.loc11_35(%.loc11_26.3) // CHECK:STDOUT: %.loc11_35: init %D = converted %.loc11_26.1, %C.as.ImplicitAs.impl.Convert.call.loc11 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc11: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound.3c7(constants.%.054) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc11: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound.8c0(constants.%.054) // CHECK:STDOUT: return %.loc11_35 to %return.param // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc11: @@ -1279,7 +1471,7 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %.loc12_26.3: %C.5c1 = acquire_value %.loc12_26.2 [concrete = constants.%C.val.6ca] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.call.loc12: init %D to %.loc6_26.6 = call %bound_method.loc12_35(%.loc12_26.3) // CHECK:STDOUT: %.loc12_35: init %D = converted %.loc12_26.1, %C.as.ImplicitAs.impl.Convert.call.loc12 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc12: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound.a32(constants.%.6f6) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc12: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound.698(constants.%.6f6) // CHECK:STDOUT: return %.loc12_35 to %return.param // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc12: @@ -1309,7 +1501,7 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %.loc13_26.3: %C.57b = acquire_value %.loc13_26.2 [concrete = constants.%C.val.225] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.call.loc13: init %D to %.loc6_26.7 = call %bound_method.loc13_35(%.loc13_26.3) // CHECK:STDOUT: %.loc13_35: init %D = converted %.loc13_26.1, %C.as.ImplicitAs.impl.Convert.call.loc13 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc13: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound.6ec(constants.%.fa8) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc13: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound.68f(constants.%.fa8) // CHECK:STDOUT: return %.loc13_35 to %return.param // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc13: @@ -1339,7 +1531,7 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: %.loc14_26.3: %C.b0a = acquire_value %.loc14_26.2 [concrete = constants.%C.val.79c] // CHECK:STDOUT: %C.as.ImplicitAs.impl.Convert.call.loc14: init %D to %.loc6_26.8 = call %bound_method.loc14_35(%.loc14_26.3) // CHECK:STDOUT: %.loc14_35: init %D = converted %.loc14_26.1, %C.as.ImplicitAs.impl.Convert.call.loc14 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc14: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound.81a(constants.%.a0a) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound.dd3(constants.%.a0a) // CHECK:STDOUT: return %.loc14_35 to %return.param // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc14: @@ -1352,62 +1544,143 @@ fn F0(unused n: i32) -> P.D { // CHECK:STDOUT: // CHECK:STDOUT: fn @C.as.ImplicitAs.impl.Convert.1 [from "library.carbon"]; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc7_26.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_26.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_26.2(%self.param: ref %C.771) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc7_26.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc7_26.2(%self.param: ref %C.771) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_26.2(%self.param: ref %C.771) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc7_26.2(%self.param: ref %C.771) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @C.as.ImplicitAs.impl.Convert.2 [from "library.carbon"]; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8(%self.param: ref %C.83b) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8(%self.param: ref %C.83b) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8(%self.param: ref %C.83b) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8(%self.param: ref %C.83b) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @C.as.ImplicitAs.impl.Convert.3 [from "library.carbon"]; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9(%self.param: ref %C.5ce) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9(%self.param: ref %C.5ce) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9(%self.param: ref %C.5ce) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9(%self.param: ref %C.5ce) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @C.as.ImplicitAs.impl.Convert.4 [from "library.carbon"]; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10(%self.param: ref %C.b3e) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10(%self.param: ref %C.b3e) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10(%self.param: ref %C.b3e) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10(%self.param: ref %C.b3e) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.5(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.5(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @C.as.ImplicitAs.impl.Convert.5 [from "library.carbon"]; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11(%self.param: ref %C.8ee) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11(%self.param: ref %C.8ee) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11(%self.param: ref %C.8ee) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11(%self.param: ref %C.8ee) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.6(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.6(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @C.as.ImplicitAs.impl.Convert.6 [from "library.carbon"]; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc12(%self.param: ref %C.5c1) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc12(%self.param: ref %C.5c1) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc12(%self.param: ref %C.5c1) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc12(%self.param: ref %C.5c1) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.7(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.7(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @C.as.ImplicitAs.impl.Convert.7 [from "library.carbon"]; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc13(%self.param: ref %C.57b) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc13(%self.param: ref %C.57b) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc13(%self.param: ref %C.57b) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc13(%self.param: ref %C.57b) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.8(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.8(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @C.as.ImplicitAs.impl.Convert.8 [from "library.carbon"]; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc14(%self.param: ref %C.b0a) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc14(%self.param: ref %C.b0a) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc14(%self.param: ref %C.b0a) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc14(%self.param: ref %C.b0a) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.9(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.9(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @Make [from "library.carbon"]; // CHECK:STDOUT: // CHECK:STDOUT: specific @C(constants.%N.37f) { diff --git a/toolchain/check/testdata/return/returned_var.carbon b/toolchain/check/testdata/return/returned_var.carbon index de860625f718..3db3e6886f27 100644 --- a/toolchain/check/testdata/return/returned_var.carbon +++ b/toolchain/check/testdata/return/returned_var.carbon @@ -86,8 +86,21 @@ fn G() -> i32 { // CHECK:STDOUT: %bound_method.6e0: = bound_method %int_0.5c6, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.3c0: %i32 = int_value 0 [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc26_12.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc26_12.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc26_12.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc26_12.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc26_12.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -105,6 +118,37 @@ fn G() -> i32 { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc26_12.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc26_12.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc26_12.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc26_12.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -202,15 +246,33 @@ fn G() -> i32 { // CHECK:STDOUT: %result.var_patt: %pattern_type.6b6 = var_pattern %result.patt [concrete = constants.%result.var_patt.a44] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc26_22: %i32 = acquire_value %result -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %result.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%result.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %result.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%result.var) // CHECK:STDOUT: return %.loc26_22 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc26_12.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc26_12.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc26_12.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc26_12.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc26_12.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc26_12.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc26_12.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/returned_var_scope.carbon b/toolchain/check/testdata/return/returned_var_scope.carbon index f9aa22babc46..8a249490a599 100644 --- a/toolchain/check/testdata/return/returned_var_scope.carbon +++ b/toolchain/check/testdata/return/returned_var_scope.carbon @@ -68,8 +68,21 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: %bound_method.6e0: = bound_method %int_0.5c6, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_0.3c0: %i32 = int_value 0 [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc17_14.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc17_14.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc17_14.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc17_14.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc17_14.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: %w.patt: %pattern_type.6b6 = ref_binding_pattern w [concrete] // CHECK:STDOUT: %w.var_patt: %pattern_type.6b6 = var_pattern %w.patt [concrete] // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] @@ -100,6 +113,37 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: %Core.Bool: type = import_ref Core//prelude/parts/bool, Bool, loaded [concrete = bool] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc17_14.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc17_14.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc17_14.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc17_14.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -153,8 +197,8 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: %v.patt: %pattern_type.6b6 = ref_binding_pattern v [concrete = constants.%v.patt] // CHECK:STDOUT: %v.var_patt: %pattern_type.6b6 = var_pattern %v.patt [concrete = constants.%v.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc17: = bound_method %v.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc17: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc17(%v.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc17: = bound_method %v.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc17: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc17(%v.var) // CHECK:STDOUT: br !if.else.loc16 // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc16: @@ -177,8 +221,8 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: %w.patt: %pattern_type.6b6 = ref_binding_pattern w [concrete = constants.%w.patt] // CHECK:STDOUT: %w.var_patt: %pattern_type.6b6 = var_pattern %w.patt [concrete = constants.%w.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc20: = bound_method %w.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc20: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc20(%w.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc20: = bound_method %w.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc20: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc20(%w.var) // CHECK:STDOUT: br !if.else.loc19 // CHECK:STDOUT: // CHECK:STDOUT: !if.else.loc19: @@ -192,10 +236,28 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: return %.loc22 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc17_14.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc17_14.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc17_14.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc17_14.1(%self.param: ref %i32.builtin) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc17_14.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc17_14.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc17_14.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -221,8 +283,8 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: %v.var_patt: %pattern_type.6b6 = var_pattern %v.patt [concrete = constants.%v.var_patt] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc27_19: %i32 = acquire_value %v -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc27: = bound_method %v.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc27: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc27(%v.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc27: = bound_method %v.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc27: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc27(%v.var) // CHECK:STDOUT: return %.loc27_19 // CHECK:STDOUT: // CHECK:STDOUT: !if.else: @@ -242,8 +304,8 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: %w.var_patt: %pattern_type.6b6 = var_pattern %w.patt [concrete = constants.%w.var_patt] // CHECK:STDOUT: } // CHECK:STDOUT: %.loc30_17: %i32 = acquire_value %w -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc30: = bound_method %w.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc30: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc30(%w.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc30: = bound_method %w.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc30: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc30(%w.var) // CHECK:STDOUT: return %.loc30_17 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/struct/literal_member_access.carbon b/toolchain/check/testdata/struct/literal_member_access.carbon index 403aa94d9756..e53392395fc1 100644 --- a/toolchain/check/testdata/struct/literal_member_access.carbon +++ b/toolchain/check/testdata/struct/literal_member_access.carbon @@ -56,8 +56,27 @@ fn F() -> i32 { // CHECK:STDOUT: %.737: type = fn_type_with_self_type %Copy.WithSelf.Op.type.381, %Copy.facet [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.4f6, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc18_26.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc18_26.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc18_26.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc18_26.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.267: %pattern_type.62c = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.ef2: %pattern_type.62c = wrapper_binding_pattern self, %self.param_patt.267 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc18_26.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc18_26.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc18_26.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -75,6 +94,51 @@ fn F() -> i32 { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc18_26.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc18_26.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc18_26.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc18_26.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc18_26.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.62c = ref_param_pattern [concrete = constants.%self.param_patt.267] +// CHECK:STDOUT: %self.patt: %pattern_type.62c = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ef2] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.x.y.z = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.x.y.z = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc18_26.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.62c = ref_param_pattern [concrete = constants.%self.param_patt.267] +// CHECK:STDOUT: %self.patt: %pattern_type.62c = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ef2] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.x.y.z = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.x.y.z = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -133,20 +197,47 @@ fn F() -> i32 { // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] // CHECK:STDOUT: %bound_method.loc18_38.2: = bound_method %.loc18_38, %specific_fn // CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc18_38.2(%.loc18_38) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.loc18_26.2, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%.loc18_26.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc18_26.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc18_26.2) // CHECK:STDOUT: return %Int.as.Copy.impl.Op.call // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc18_26.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18_26.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18_26.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc18_26.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc18_26.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18_26.3(%self.param: ref %struct_type.x.y.z) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18_26.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc18_26.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc18_26.3(%self.param: ref %struct_type.x.y.z) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18_26.3(%self.param: ref %struct_type.x.y.z) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc18_26.3(%self.param: ref %struct_type.x.y.z) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/struct/nested_struct_in_place.carbon b/toolchain/check/testdata/struct/nested_struct_in_place.carbon index ee0c478bf6dd..ed9d75b099bd 100644 --- a/toolchain/check/testdata/struct/nested_struct_in_place.carbon +++ b/toolchain/check/testdata/struct/nested_struct_in_place.carbon @@ -44,8 +44,34 @@ fn G() { // CHECK:STDOUT: %v.patt: %pattern_type.28f = ref_binding_pattern v [concrete] // CHECK:STDOUT: %v.var_patt: %pattern_type.28f = var_pattern %v.patt [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc18_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc18_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.6b6: type = pattern_type %i32 [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc18_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc18_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.bd8: %pattern_type.777 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.891: %pattern_type.777 = wrapper_binding_pattern self, %self.param_patt.bd8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc18_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc18_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.658: %pattern_type.28f = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.308: %pattern_type.28f = wrapper_binding_pattern self, %self.param_patt.658 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc18_3.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc18_3.4 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc18_3.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -59,6 +85,65 @@ fn G() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc18_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc18_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc18_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc18_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc18_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.777 = ref_param_pattern [concrete = constants.%self.param_patt.bd8] +// CHECK:STDOUT: %self.patt: %pattern_type.777 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.891] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.555 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.555 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc18_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.777 = ref_param_pattern [concrete = constants.%self.param_patt.bd8] +// CHECK:STDOUT: %self.patt: %pattern_type.777 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.891] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.555 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.555 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc18_3.4 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.28f = ref_param_pattern [concrete = constants.%self.param_patt.658] +// CHECK:STDOUT: %self.patt: %pattern_type.28f = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.308] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.a.b.2a0 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.a.b.2a0 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc18_3.4 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.28f = ref_param_pattern [concrete = constants.%self.param_patt.658] +// CHECK:STDOUT: %self.patt: %pattern_type.28f = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.308] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.a.b.2a0 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.a.b.2a0 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -115,25 +200,61 @@ fn G() { // CHECK:STDOUT: %v.patt: %pattern_type.28f = ref_binding_pattern v [concrete = constants.%v.patt] // CHECK:STDOUT: %v.var_patt: %pattern_type.28f = var_pattern %v.patt [concrete = constants.%v.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %v.var, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%v.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %v.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%v.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc18_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18_3.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc18_3.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc18_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18_3.3(%self.param: ref %tuple.type.555) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18_3.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc18_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc18_3.3(%self.param: ref %tuple.type.555) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18_3.4(%self.param: ref %struct_type.a.b.2a0) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18_3.3(%self.param: ref %tuple.type.555) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc18_3.3(%self.param: ref %tuple.type.555) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc18_3.4(%self.param: ref %struct_type.a.b.2a0) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18_3.4(%self.param: ref %struct_type.a.b.2a0) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc18_3.4(%self.param: ref %struct_type.a.b.2a0) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/tuple/in_place_tuple_init.carbon b/toolchain/check/testdata/tuple/in_place_tuple_init.carbon index 2fc739f55852..ea30cc3a7908 100644 --- a/toolchain/check/testdata/tuple/in_place_tuple_init.carbon +++ b/toolchain/check/testdata/tuple/in_place_tuple_init.carbon @@ -65,8 +65,28 @@ fn H() { // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %v.patt: %pattern_type.394 = ref_binding_pattern v [concrete] // CHECK:STDOUT: %v.var_patt: %pattern_type.394 = var_pattern %v.patt [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc7_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc7_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.6b6: type = pattern_type %i32 [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc7_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc7_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.f5e: %pattern_type.394 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.7eb: %pattern_type.394 = wrapper_binding_pattern self, %self.param_patt.f5e [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc7_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc7_3.3 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc7_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete] // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.type.ac8: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] @@ -85,6 +105,51 @@ fn H() { // CHECK:STDOUT: %Copy.impl_witness_table.8d2 = impl_witness_table (%Core.import_ref.cd6), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc7_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc7_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc7_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc7_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc7_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.394 = ref_param_pattern [concrete = constants.%self.param_patt.f5e] +// CHECK:STDOUT: %self.patt: %pattern_type.394 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.7eb] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.e55 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.e55 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc7_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.394 = ref_param_pattern [concrete = constants.%self.param_patt.f5e] +// CHECK:STDOUT: %self.patt: %pattern_type.394 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.7eb] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.e55 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.e55 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @G() -> out %return.param: %tuple.type.e55 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %v.var: ref %tuple.type.e55 = var_storage %v.var_patt @@ -111,20 +176,47 @@ fn H() { // CHECK:STDOUT: %F.ref.loc9: %F.type = name_ref F, file.%F.decl [concrete = constants.%F] // CHECK:STDOUT: // CHECK:STDOUT: %F.call.loc9: init %tuple.type.e55 to %.loc5_20.1 = call %F.ref.loc9() -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %v.var, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%v.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %v.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%v.var) // CHECK:STDOUT: return %F.call.loc9 to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc7_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_3.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc7_3.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc7_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_3.3(%self.param: ref %tuple.type.e55) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_3.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc7_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc7_3.3(%self.param: ref %tuple.type.e55) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_3.3(%self.param: ref %tuple.type.e55) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc7_3.3(%self.param: ref %tuple.type.e55) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -142,8 +234,8 @@ fn H() { // CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] // CHECK:STDOUT: %bound_method.loc15_13.2: = bound_method %.loc15_13, %specific_fn // CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc15_13.2(%.loc15_13) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.loc15_12.2, constants.%Destroy.WithSelf.Op.403171.3 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%.loc15_12.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc15_12.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc15_12.2) // CHECK:STDOUT: return %Int.as.Copy.impl.Op.call // CHECK:STDOUT: } // CHECK:STDOUT: @@ -157,6 +249,7 @@ fn H() { // CHECK:STDOUT: %tuple.type.531: type = tuple_type (type, type, type) [concrete] // CHECK:STDOUT: %tuple.276: %tuple.type.531 = tuple_value (%i32, %i32, %i32) [concrete] // CHECK:STDOUT: %tuple.type.555: type = tuple_type (%i32, %i32, %i32) [concrete] +// CHECK:STDOUT: %pattern_type.777: type = pattern_type %tuple.type.555 [concrete] // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] // CHECK:STDOUT: %tuple.type.d58: type = tuple_type (%tuple.type.531, %tuple.type.531) [concrete] @@ -166,8 +259,34 @@ fn H() { // CHECK:STDOUT: %pattern_type.e12: type = pattern_type %tuple.type.015 [concrete] // CHECK:STDOUT: %v.patt.dde: %pattern_type.e12 = ref_binding_pattern v [concrete] // CHECK:STDOUT: %v.var_patt.678: %pattern_type.e12 = var_pattern %v.patt.dde [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc7_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc7_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.6b6: type = pattern_type %i32 [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc7_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc7_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.bd8: %pattern_type.777 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.891: %pattern_type.777 = wrapper_binding_pattern self, %self.param_patt.bd8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc7_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc7_3.3 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.d13: %pattern_type.e12 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.ac8: %pattern_type.e12 = wrapper_binding_pattern self, %self.param_patt.d13 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc7_3.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.4: type = fn_type @Destroy.WithSelf.Op.loc7_3.4 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.4: %Destroy.WithSelf.Op.type.ef016f.4 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4: type = fn_type @Destroy.WithSelf.SelfDestruct.loc7_3.4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.4: %Destroy.WithSelf.SelfDestruct.type.fbceb5.4 = struct_value () [concrete] // CHECK:STDOUT: %tuple.type.f8d: type = tuple_type (type, %tuple.type.531, type) [concrete] // CHECK:STDOUT: %tuple.a61: %tuple.type.f8d = tuple_value (%i32, %tuple.276, %i32) [concrete] // CHECK:STDOUT: %tuple.type.b7e: type = tuple_type (%i32, %tuple.type.555, %i32) [concrete] @@ -194,8 +313,14 @@ fn H() { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.9f3: = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.e39 [concrete] // CHECK:STDOUT: %bound_method.3cb: = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_2.295: %i32 = int_value 2 [concrete] +// CHECK:STDOUT: %self.param_patt.337: %pattern_type.f8e = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.2a2: %pattern_type.f8e = wrapper_binding_pattern self, %self.param_patt.337 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc13 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.5: type = fn_type @Destroy.WithSelf.Op.loc13 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.5: %Destroy.WithSelf.Op.type.ef016f.5 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5: type = fn_type @Destroy.WithSelf.SelfDestruct.loc13 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.5: %Destroy.WithSelf.SelfDestruct.type.fbceb5.5 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -203,6 +328,79 @@ fn H() { // CHECK:STDOUT: %ImplicitAs.impl_witness_table.1aa = impl_witness_table (%Core.import_ref.edf), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc7_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc7_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc7_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc7_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc7_3.3 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.777 = ref_param_pattern [concrete = constants.%self.param_patt.bd8] +// CHECK:STDOUT: %self.patt: %pattern_type.777 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.891] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.555 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.555 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc7_3.3 [concrete = constants.%Destroy.WithSelf.Op.403171.3] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.777 = ref_param_pattern [concrete = constants.%self.param_patt.bd8] +// CHECK:STDOUT: %self.patt: %pattern_type.777 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.891] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.555 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.555 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.4: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.4 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc7_3.4 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e12 = ref_param_pattern [concrete = constants.%self.param_patt.d13] +// CHECK:STDOUT: %self.patt: %pattern_type.e12 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ac8] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.015 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.015 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.4: %Destroy.WithSelf.Op.type.ef016f.4 = fn_decl @Destroy.WithSelf.Op.loc7_3.4 [concrete = constants.%Destroy.WithSelf.Op.403171.4] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.e12 = ref_param_pattern [concrete = constants.%self.param_patt.d13] +// CHECK:STDOUT: %self.patt: %pattern_type.e12 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.ac8] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.015 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.015 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.5: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.5 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc13 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f8e = ref_param_pattern [concrete = constants.%self.param_patt.337] +// CHECK:STDOUT: %self.patt: %pattern_type.f8e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.2a2] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.b7e = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.b7e = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.5: %Destroy.WithSelf.Op.type.ef016f.5 = fn_decl @Destroy.WithSelf.Op.loc13 [concrete = constants.%Destroy.WithSelf.Op.403171.5] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.f8e = ref_param_pattern [concrete = constants.%self.param_patt.337] +// CHECK:STDOUT: %self.patt: %pattern_type.f8e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.2a2] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.b7e = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.b7e = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @G() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %v.var: ref %tuple.type.015 = var_storage %v.var_patt @@ -235,25 +433,61 @@ fn H() { // CHECK:STDOUT: %v.patt: %pattern_type.e12 = ref_binding_pattern v [concrete = constants.%v.patt.dde] // CHECK:STDOUT: %v.var_patt: %pattern_type.e12 = var_pattern %v.patt [concrete = constants.%v.var_patt.678] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %v.var, constants.%Destroy.WithSelf.Op.403171.4 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%v.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %v.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.4 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%v.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc7_3.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_3.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc7_3.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc7_3.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_3.3(%self.param: ref %tuple.type.555) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_3.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc7_3.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc7_3.3(%self.param: ref %tuple.type.555) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_3.4(%self.param: ref %tuple.type.015) { +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_3.3(%self.param: ref %tuple.type.555) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc7_3.3(%self.param: ref %tuple.type.555) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc7_3.4(%self.param: ref %tuple.type.015) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_3.4(%self.param: ref %tuple.type.015) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc7_3.4(%self.param: ref %tuple.type.015) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.4(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.4(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -301,13 +535,22 @@ fn H() { // CHECK:STDOUT: %v.patt: %pattern_type.f8e = ref_binding_pattern v [concrete = constants.%v.patt.7e2] // CHECK:STDOUT: %v.var_patt: %pattern_type.f8e = var_pattern %v.patt [concrete = constants.%v.var_patt.409] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %v.var, constants.%Destroy.WithSelf.Op.403171.5 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%v.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %v.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.5 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%v.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc13(%self.param: ref %tuple.type.b7e) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc13(%self.param: ref %tuple.type.b7e) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc13(%self.param: ref %tuple.type.b7e) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc13(%self.param: ref %tuple.type.b7e) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.5(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.5(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/tuple/tuple_pattern.carbon b/toolchain/check/testdata/tuple/tuple_pattern.carbon index 2bdd31806421..c85860041eb0 100644 --- a/toolchain/check/testdata/tuple/tuple_pattern.carbon +++ b/toolchain/check/testdata/tuple/tuple_pattern.carbon @@ -117,8 +117,51 @@ let (a: {}, b: {}) = ({}, {}, {}); // CHECK:STDOUT: %d.patt: %pattern_type.a96 = ref_binding_pattern d [concrete] // CHECK:STDOUT: %.a7b: %pattern_type.de4 = tuple_pattern (%c.patt, %d.patt) [concrete] // CHECK:STDOUT: %.var_patt.288: %pattern_type.de4 = var_pattern %.a7b [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc8_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.7a4: %pattern_type.de4 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.690: %pattern_type.de4 = wrapper_binding_pattern self, %self.param_patt.7a4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc8_3.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc8_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.de4 = ref_param_pattern [concrete = constants.%self.param_patt.7a4] +// CHECK:STDOUT: %self.patt: %pattern_type.de4 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.690] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.b6b = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.b6b = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc8_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.de4 = ref_param_pattern [concrete = constants.%self.param_patt.7a4] +// CHECK:STDOUT: %self.patt: %pattern_type.de4 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.690] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.b6b = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.b6b = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%v.param: %tuple.type.b6b) { @@ -211,17 +254,35 @@ let (a: {}, b: {}) = ({}, {}, {}); // CHECK:STDOUT: %.loc8_34: %pattern_type.de4 = tuple_pattern (%c.patt, %d.patt) [concrete = constants.%.a7b] // CHECK:STDOUT: %.var_patt.loc8: %pattern_type.de4 = var_pattern %.loc8_34 [concrete = constants.%.var_patt.288] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc8: = bound_method %.var.loc8, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc8(%.var.loc8) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc7: = bound_method %.var.loc7, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc7: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc7(%.var.loc7) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: = bound_method %.var.loc8, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%.var.loc8) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc7: = bound_method %.var.loc7, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc7: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc7(%.var.loc7) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.2(%self.param: ref %tuple.type.b6b) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.2(%self.param: ref %tuple.type.b6b) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.2(%self.param: ref %tuple.type.b6b) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.2(%self.param: ref %tuple.type.b6b) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -242,8 +303,20 @@ let (a: {}, b: {}) = ({}, {}, {}); // CHECK:STDOUT: %y.patt.a7119c.1: %pattern_type.a96 = ref_binding_pattern y [concrete] // CHECK:STDOUT: %.4ca32d.1: %pattern_type.de4 = tuple_pattern (%x.patt.691773.1, %y.patt.a7119c.1) [concrete] // CHECK:STDOUT: %.var_patt.c3725e.1: %pattern_type.de4 = var_pattern %.4ca32d.1 [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc7_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc7_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.7a4: %pattern_type.de4 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.690: %pattern_type.de4 = wrapper_binding_pattern self, %self.param_patt.7a4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc7_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc7_3.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc7_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: %tuple.patt.29f: %pattern_type.de4 = value_binding_pattern tuple [concrete] // CHECK:STDOUT: %x.patt.691773.2: %pattern_type.a96 = ref_binding_pattern x [concrete] // CHECK:STDOUT: %y.patt.a7119c.2: %pattern_type.a96 = ref_binding_pattern y [concrete] @@ -257,6 +330,37 @@ let (a: {}, b: {}) = ({}, {}, {}); // CHECK:STDOUT: %.var_patt.c3725e.3: %pattern_type.de4 = var_pattern %.4ca32d.3 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc7_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc7_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc7_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.de4 = ref_param_pattern [concrete = constants.%self.param_patt.7a4] +// CHECK:STDOUT: %self.patt: %pattern_type.de4 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.690] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.b6b = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.b6b = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc7_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.de4 = ref_param_pattern [concrete = constants.%self.param_patt.7a4] +// CHECK:STDOUT: %self.patt: %pattern_type.de4 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.690] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type.b6b = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type.b6b = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %tuple.var: ref %tuple.type.b6b = var_storage %tuple.var_patt @@ -320,17 +424,35 @@ let (a: {}, b: {}) = ({}, {}, {}); // CHECK:STDOUT: %.loc7_34: %pattern_type.de4 = tuple_pattern (%x.patt, %y.patt) [concrete = constants.%.4ca32d.1] // CHECK:STDOUT: %.var_patt: %pattern_type.de4 = var_pattern %.loc7_34 [concrete = constants.%.var_patt.c3725e.1] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc7: = bound_method %.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc7: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc7(%.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc6: = bound_method %tuple.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc6: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc6(%tuple.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc7: = bound_method %.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc7: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc7(%.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc6: = bound_method %tuple.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc6: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc6(%tuple.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc7_3.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_3.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_3.2(%self.param: ref %tuple.type.b6b) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc7_3.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc7_3.2(%self.param: ref %tuple.type.b6b) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_3.2(%self.param: ref %tuple.type.b6b) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc7_3.2(%self.param: ref %tuple.type.b6b) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -390,8 +512,8 @@ let (a: {}, b: {}) = ({}, {}, {}); // CHECK:STDOUT: %.loc14_34: %pattern_type.de4 = tuple_pattern (%x.patt, %y.patt) [concrete = constants.%.4ca32d.2] // CHECK:STDOUT: %.var_patt: %pattern_type.de4 = var_pattern %.loc14_34 [concrete = constants.%.var_patt.c3725e.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -420,8 +542,8 @@ let (a: {}, b: {}) = ({}, {}, {}); // CHECK:STDOUT: %.loc22_34: %pattern_type.de4 = tuple_pattern (%x.patt, %y.patt) [concrete = constants.%.4ca32d.3] // CHECK:STDOUT: %.var_patt: %pattern_type.de4 = var_pattern %.loc22_34 [concrete = constants.%.var_patt.c3725e.3] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/var/destroy_control_flow.carbon b/toolchain/check/testdata/var/destroy_control_flow.carbon index 542363c9bead..901d069b2eba 100644 --- a/toolchain/check/testdata/var/destroy_control_flow.carbon +++ b/toolchain/check/testdata/var/destroy_control_flow.carbon @@ -139,8 +139,21 @@ fn WhileContinue(cond: bool) { // CHECK:STDOUT: %Use: %Use.type = struct_value () [concrete] // CHECK:STDOUT: %b.patt: %pattern_type.397 = ref_binding_pattern b [concrete] // CHECK:STDOUT: %b.var_patt: %pattern_type.397 = var_pattern %b.patt [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_5.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc10_5.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.3eb: %pattern_type.397 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.474: %pattern_type.397 = wrapper_binding_pattern self, %self.param_patt.3eb [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_5.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc10_5.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10_5.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -148,6 +161,37 @@ fn WhileContinue(cond: bool) { // CHECK:STDOUT: %Main.Use: %Use.type = import_ref Main//destructible, Use, loaded [concrete = constants.%Use] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_5.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc10_5.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_5.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.397 = ref_param_pattern [concrete = constants.%self.param_patt.3eb] +// CHECK:STDOUT: %self.patt: %pattern_type.397 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.474] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Destructible = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Destructible = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc10_5.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.397 = ref_param_pattern [concrete = constants.%self.param_patt.3eb] +// CHECK:STDOUT: %self.patt: %pattern_type.397 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.474] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Destructible = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Destructible = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @IfThen(%cond.param: bool) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.var: ref %Destructible = var_storage %a.var_patt @@ -184,8 +228,8 @@ fn WhileContinue(cond: bool) { // CHECK:STDOUT: %b.ref: ref %Destructible = name_ref b, %b // CHECK:STDOUT: %.loc11: %Destructible = ref_tag %b.ref // CHECK:STDOUT: %Use.call.loc11: init %empty_tuple.type = call %Use.ref.loc11(%b.ref) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc10: = bound_method %b.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc10: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc10(%b.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10: = bound_method %b.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10(%b.var) // CHECK:STDOUT: br !if.else // CHECK:STDOUT: // CHECK:STDOUT: !if.else: @@ -193,15 +237,33 @@ fn WhileContinue(cond: bool) { // CHECK:STDOUT: %a.ref.loc13: ref %Destructible = name_ref a, %a // CHECK:STDOUT: %.loc13: %Destructible = ref_tag %a.ref.loc13 // CHECK:STDOUT: %Use.call.loc13: init %empty_tuple.type = call %Use.ref.loc13(%a.ref.loc13) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc7: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc7: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc7(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc7: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc7: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc7(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_5.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_5.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_5.2(%self.param: ref %Destructible) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_5.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_5.2(%self.param: ref %Destructible) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_5.2(%self.param: ref %Destructible) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_5.2(%self.param: ref %Destructible) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -221,8 +283,21 @@ fn WhileContinue(cond: bool) { // CHECK:STDOUT: %Use: %Use.type = struct_value () [concrete] // CHECK:STDOUT: %b.patt: %pattern_type.397 = ref_binding_pattern b [concrete] // CHECK:STDOUT: %b.var_patt: %pattern_type.397 = var_pattern %b.patt [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_5.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc10_5.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.3eb: %pattern_type.397 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.474: %pattern_type.397 = wrapper_binding_pattern self, %self.param_patt.3eb [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_5.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc10_5.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10_5.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: %c.patt: %pattern_type.397 = ref_binding_pattern c [concrete] // CHECK:STDOUT: %c.var_patt: %pattern_type.397 = var_pattern %c.patt [concrete] // CHECK:STDOUT: } @@ -232,6 +307,37 @@ fn WhileContinue(cond: bool) { // CHECK:STDOUT: %Main.Use: %Use.type = import_ref Main//destructible, Use, loaded [concrete = constants.%Use] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_5.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc10_5.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_5.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.397 = ref_param_pattern [concrete = constants.%self.param_patt.3eb] +// CHECK:STDOUT: %self.patt: %pattern_type.397 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.474] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Destructible = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Destructible = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc10_5.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.397 = ref_param_pattern [concrete = constants.%self.param_patt.3eb] +// CHECK:STDOUT: %self.patt: %pattern_type.397 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.474] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Destructible = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Destructible = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @IfElse(%cond.param: bool) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.var: ref %Destructible = var_storage %a.var_patt @@ -268,8 +374,8 @@ fn WhileContinue(cond: bool) { // CHECK:STDOUT: %b.ref: ref %Destructible = name_ref b, %b // CHECK:STDOUT: %.loc11: %Destructible = ref_tag %b.ref // CHECK:STDOUT: %Use.call.loc11: init %empty_tuple.type = call %Use.ref.loc11(%b.ref) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc10: = bound_method %b.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc10: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc10(%b.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10: = bound_method %b.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10(%b.var) // CHECK:STDOUT: br !if.done // CHECK:STDOUT: // CHECK:STDOUT: !if.else: @@ -288,8 +394,8 @@ fn WhileContinue(cond: bool) { // CHECK:STDOUT: %c.ref: ref %Destructible = name_ref c, %c // CHECK:STDOUT: %.loc14: %Destructible = ref_tag %c.ref // CHECK:STDOUT: %Use.call.loc14: init %empty_tuple.type = call %Use.ref.loc14(%c.ref) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc13: = bound_method %c.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc13: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc13(%c.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc13: = bound_method %c.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc13: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc13(%c.var) // CHECK:STDOUT: br !if.done // CHECK:STDOUT: // CHECK:STDOUT: !if.done: @@ -297,15 +403,33 @@ fn WhileContinue(cond: bool) { // CHECK:STDOUT: %a.ref.loc16: ref %Destructible = name_ref a, %a // CHECK:STDOUT: %.loc16: %Destructible = ref_tag %a.ref.loc16 // CHECK:STDOUT: %Use.call.loc16: init %empty_tuple.type = call %Use.ref.loc16(%a.ref.loc16) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc7: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc7: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc7(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc7: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc7: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc7(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_5.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_5.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_5.2(%self.param: ref %Destructible) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_5.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_5.2(%self.param: ref %Destructible) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_5.2(%self.param: ref %Destructible) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_5.2(%self.param: ref %Destructible) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -325,8 +449,21 @@ fn WhileContinue(cond: bool) { // CHECK:STDOUT: %Use: %Use.type = struct_value () [concrete] // CHECK:STDOUT: %b.patt: %pattern_type.397 = ref_binding_pattern b [concrete] // CHECK:STDOUT: %b.var_patt: %pattern_type.397 = var_pattern %b.patt [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_5.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc10_5.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.3eb: %pattern_type.397 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.474: %pattern_type.397 = wrapper_binding_pattern self, %self.param_patt.3eb [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10_5.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc10_5.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10_5.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -334,6 +471,37 @@ fn WhileContinue(cond: bool) { // CHECK:STDOUT: %Main.Use: %Use.type = import_ref Main//destructible, Use, loaded [concrete = constants.%Use] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_5.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc10_5.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10_5.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.397 = ref_param_pattern [concrete = constants.%self.param_patt.3eb] +// CHECK:STDOUT: %self.patt: %pattern_type.397 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.474] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Destructible = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Destructible = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc10_5.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.397 = ref_param_pattern [concrete = constants.%self.param_patt.3eb] +// CHECK:STDOUT: %self.patt: %pattern_type.397 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.474] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Destructible = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Destructible = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @IfReturn(%cond.param: bool) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.var: ref %Destructible = var_storage %a.var_patt @@ -370,22 +538,40 @@ fn WhileContinue(cond: bool) { // CHECK:STDOUT: %b.ref: ref %Destructible = name_ref b, %b // CHECK:STDOUT: %.loc11: %Destructible = ref_tag %b.ref // CHECK:STDOUT: %Use.call.loc11: init %empty_tuple.type = call %Use.ref.loc11(%b.ref) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc10: = bound_method %b.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc10: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc10(%b.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc7_3.1: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc7_3.1: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc7_3.1(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10: = bound_method %b.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10(%b.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc7_3.1: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc7_3.1: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc7_3.1(%a.var) // CHECK:STDOUT: return // CHECK:STDOUT: // CHECK:STDOUT: !if.else: -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc7_3.2: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc7_3.2: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc7_3.2(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc7_3.2: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc7_3.2: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc7_3.2(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_5.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_5.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_5.2(%self.param: ref %Destructible) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_5.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10_5.2(%self.param: ref %Destructible) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10_5.2(%self.param: ref %Destructible) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10_5.2(%self.param: ref %Destructible) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -407,8 +593,21 @@ fn WhileContinue(cond: bool) { // CHECK:STDOUT: %b.var_patt: %pattern_type.397 = var_pattern %b.patt [concrete] // CHECK:STDOUT: %c.patt: %pattern_type.397 = ref_binding_pattern c [concrete] // CHECK:STDOUT: %c.var_patt: %pattern_type.397 = var_pattern %c.patt [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc14_7.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc14_7.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.3eb: %pattern_type.397 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.474: %pattern_type.397 = wrapper_binding_pattern self, %self.param_patt.3eb [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc14_7.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc14_7.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc14_7.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -416,6 +615,37 @@ fn WhileContinue(cond: bool) { // CHECK:STDOUT: %Main.Use: %Use.type = import_ref Main//destructible, Use, loaded [concrete = constants.%Use] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc14_7.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc14_7.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc14_7.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.397 = ref_param_pattern [concrete = constants.%self.param_patt.3eb] +// CHECK:STDOUT: %self.patt: %pattern_type.397 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.474] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Destructible = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Destructible = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc14_7.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.397 = ref_param_pattern [concrete = constants.%self.param_patt.3eb] +// CHECK:STDOUT: %self.patt: %pattern_type.397 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.474] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Destructible = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Destructible = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @WhileBreak(%cond.param: bool) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.var: ref %Destructible = var_storage %a.var_patt @@ -478,15 +708,15 @@ fn WhileContinue(cond: bool) { // CHECK:STDOUT: %c.ref: ref %Destructible = name_ref c, %c // CHECK:STDOUT: %.loc15: %Destructible = ref_tag %c.ref // CHECK:STDOUT: %Use.call.loc15: init %empty_tuple.type = call %Use.ref.loc15(%c.ref) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc14: = bound_method %c.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc14: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc14(%c.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc11_5.1: = bound_method %b.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc11_5.1: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc11_5.1(%b.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14: = bound_method %c.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14(%c.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc11_5.1: = bound_method %b.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc11_5.1: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc11_5.1(%b.var) // CHECK:STDOUT: br !while.done // CHECK:STDOUT: // CHECK:STDOUT: !if.else: -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc11_5.2: = bound_method %b.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc11_5.2: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc11_5.2(%b.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc11_5.2: = bound_method %b.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc11_5.2: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc11_5.2(%b.var) // CHECK:STDOUT: br !while.cond // CHECK:STDOUT: // CHECK:STDOUT: !while.done: @@ -494,15 +724,33 @@ fn WhileContinue(cond: bool) { // CHECK:STDOUT: %a.ref.loc19: ref %Destructible = name_ref a, %a // CHECK:STDOUT: %.loc19: %Destructible = ref_tag %a.ref.loc19 // CHECK:STDOUT: %Use.call.loc19: init %empty_tuple.type = call %Use.ref.loc19(%a.ref.loc19) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc7: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc7: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc7(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc7: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc7: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc7(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc14_7.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc14_7.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc14_7.2(%self.param: ref %Destructible) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc14_7.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc14_7.2(%self.param: ref %Destructible) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc14_7.2(%self.param: ref %Destructible) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc14_7.2(%self.param: ref %Destructible) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -524,8 +772,21 @@ fn WhileContinue(cond: bool) { // CHECK:STDOUT: %b.var_patt: %pattern_type.397 = var_pattern %b.patt [concrete] // CHECK:STDOUT: %c.patt: %pattern_type.397 = ref_binding_pattern c [concrete] // CHECK:STDOUT: %c.var_patt: %pattern_type.397 = var_pattern %c.patt [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc14_7.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc14_7.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.3eb: %pattern_type.397 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.474: %pattern_type.397 = wrapper_binding_pattern self, %self.param_patt.3eb [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc14_7.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc14_7.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc14_7.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -533,6 +794,37 @@ fn WhileContinue(cond: bool) { // CHECK:STDOUT: %Main.Use: %Use.type = import_ref Main//destructible, Use, loaded [concrete = constants.%Use] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc14_7.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc14_7.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc14_7.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.397 = ref_param_pattern [concrete = constants.%self.param_patt.3eb] +// CHECK:STDOUT: %self.patt: %pattern_type.397 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.474] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Destructible = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Destructible = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc14_7.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.397 = ref_param_pattern [concrete = constants.%self.param_patt.3eb] +// CHECK:STDOUT: %self.patt: %pattern_type.397 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.474] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %Destructible = ref_param call_param0 +// CHECK:STDOUT: %self: ref %Destructible = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @WhileContinue(%cond.param: bool) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %a.var: ref %Destructible = var_storage %a.var_patt @@ -595,15 +887,15 @@ fn WhileContinue(cond: bool) { // CHECK:STDOUT: %c.ref: ref %Destructible = name_ref c, %c // CHECK:STDOUT: %.loc15: %Destructible = ref_tag %c.ref // CHECK:STDOUT: %Use.call.loc15: init %empty_tuple.type = call %Use.ref.loc15(%c.ref) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc14: = bound_method %c.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc14: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc14(%c.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc11_5.1: = bound_method %b.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc11_5.1: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc11_5.1(%b.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14: = bound_method %c.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14(%c.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc11_5.1: = bound_method %b.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc11_5.1: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc11_5.1(%b.var) // CHECK:STDOUT: br !while.cond // CHECK:STDOUT: // CHECK:STDOUT: !if.else: -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc11_5.2: = bound_method %b.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc11_5.2: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc11_5.2(%b.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc11_5.2: = bound_method %b.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc11_5.2: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc11_5.2(%b.var) // CHECK:STDOUT: br !while.cond // CHECK:STDOUT: // CHECK:STDOUT: !while.done: @@ -611,15 +903,33 @@ fn WhileContinue(cond: bool) { // CHECK:STDOUT: %a.ref.loc19: ref %Destructible = name_ref a, %a // CHECK:STDOUT: %.loc19: %Destructible = ref_tag %a.ref.loc19 // CHECK:STDOUT: %Use.call.loc19: init %empty_tuple.type = call %Use.ref.loc19(%a.ref.loc19) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc7: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc7: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc7(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc7: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc7: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc7(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc14_7.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc14_7.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc14_7.2(%self.param: ref %Destructible) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc14_7.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc14_7.2(%self.param: ref %Destructible) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc14_7.2(%self.param: ref %Destructible) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc14_7.2(%self.param: ref %Destructible) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/var/fail_duplicate_decl.carbon b/toolchain/check/testdata/var/fail_duplicate_decl.carbon index b9465cb8c33e..c9da412cea4a 100644 --- a/toolchain/check/testdata/var/fail_duplicate_decl.carbon +++ b/toolchain/check/testdata/var/fail_duplicate_decl.carbon @@ -40,8 +40,14 @@ fn Main() { // CHECK:STDOUT: %x.patt.06838d.2: %pattern_type.cb1 = ref_binding_pattern x [concrete] // CHECK:STDOUT: %x.var_patt.28d573.2: %pattern_type.cb1 = var_pattern %x.patt.06838d.2 [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %self.param_patt.65a: %pattern_type.cb1 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.df1: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt.65a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfc: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc11 [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.loc11 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc11 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -53,6 +59,23 @@ fn Main() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl: %Destroy.WithSelf.SubobjectDestroy.type.dfc = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc11 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc11 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -92,12 +115,21 @@ fn Main() { // CHECK:STDOUT: %x.patt.loc11: %pattern_type.cb1 = ref_binding_pattern x [concrete = constants.%x.patt.06838d.2] // CHECK:STDOUT: %x.var_patt.loc11: %pattern_type.cb1 = var_pattern %x.patt.loc11 [concrete = constants.%x.var_patt.28d573.2] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc11: = bound_method %x.var.loc11, constants.%Destroy.WithSelf.Op.403 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc11: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc11(%x.var.loc11) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc3: = bound_method %x.var.loc3, constants.%Destroy.WithSelf.Op.403 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc3: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc3(%x.var.loc3) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc11: = bound_method %x.var.loc11, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc11: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc11(%x.var.loc11) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc3: = bound_method %x.var.loc3, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc3: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc3(%x.var.loc3) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc11(%self.param: ref %empty_tuple.type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11(%self.param: ref %empty_tuple.type) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11(%self.param: ref %empty_tuple.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) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/var/fail_init_with_self.carbon b/toolchain/check/testdata/var/fail_init_with_self.carbon index e97b9c1e2141..cb8ce817c659 100644 --- a/toolchain/check/testdata/var/fail_init_with_self.carbon +++ b/toolchain/check/testdata/var/fail_init_with_self.carbon @@ -41,8 +41,14 @@ fn Main() { // CHECK:STDOUT: %x.patt: %pattern_type.cb1 = ref_binding_pattern x [concrete] // CHECK:STDOUT: %x.var_patt: %pattern_type.cb1 = var_pattern %x.patt [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %self.param_patt.65a: %pattern_type.cb1 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.df1: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt.65a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfc: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc14 [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.loc14 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc14 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -54,6 +60,23 @@ fn Main() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl: %Destroy.WithSelf.SubobjectDestroy.type.dfc = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc14 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc14 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -77,10 +100,19 @@ fn Main() { // CHECK:STDOUT: %x.patt: %pattern_type.cb1 = ref_binding_pattern x [concrete = constants.%x.patt] // CHECK:STDOUT: %x.var_patt: %pattern_type.cb1 = var_pattern %x.patt [concrete = constants.%x.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %x.var, constants.%Destroy.WithSelf.Op.403 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%x.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %x.var, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%x.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc14(%self.param: ref %empty_tuple.type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc14(%self.param: ref %empty_tuple.type) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc14(%self.param: ref %empty_tuple.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) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/var/global_lookup_in_scope.carbon b/toolchain/check/testdata/var/global_lookup_in_scope.carbon index 76342179f105..34aca8e7b26b 100644 --- a/toolchain/check/testdata/var/global_lookup_in_scope.carbon +++ b/toolchain/check/testdata/var/global_lookup_in_scope.carbon @@ -37,8 +37,21 @@ fn Main() { // CHECK:STDOUT: %y.patt: %pattern_type.c4c = ref_binding_pattern y [concrete] // CHECK:STDOUT: %y.var_patt: %pattern_type.c4c = var_pattern %y.patt [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete] +// CHECK:STDOUT: %self.param_patt.65a: %pattern_type.cb1 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.df1: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt.65a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc5_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc5_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.37e: %pattern_type.c4c = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.fc9: %pattern_type.c4c = wrapper_binding_pattern self, %self.param_patt.37e [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc5_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc5_3.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc5_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -50,6 +63,37 @@ fn Main() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc5_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc5_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc5_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.c4c = ref_param_pattern [concrete = constants.%self.param_patt.37e] +// CHECK:STDOUT: %self.patt: %pattern_type.c4c = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.fc9] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.v = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.v = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc5_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.c4c = ref_param_pattern [concrete = constants.%self.param_patt.37e] +// CHECK:STDOUT: %self.patt: %pattern_type.c4c = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.fc9] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %struct_type.v = ref_param call_param0 +// CHECK:STDOUT: %self: ref %struct_type.v = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -92,15 +136,33 @@ fn Main() { // CHECK:STDOUT: %y.patt: %pattern_type.c4c = ref_binding_pattern y [concrete = constants.%y.patt] // CHECK:STDOUT: %y.var_patt: %pattern_type.c4c = var_pattern %y.patt [concrete = constants.%y.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %y.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%y.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %y.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%y.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc5_3.1(%self.param: ref %empty_tuple.type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc5_3.1(%self.param: ref %empty_tuple.type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc5_3.2(%self.param: ref %struct_type.v) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc5_3.1(%self.param: ref %empty_tuple.type) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc5_3.2(%self.param: ref %struct_type.v) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc5_3.2(%self.param: ref %struct_type.v) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc5_3.2(%self.param: ref %struct_type.v) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/var/initialization.carbon b/toolchain/check/testdata/var/initialization.carbon index 50e3f53d13aa..211d602bcf3a 100644 --- a/toolchain/check/testdata/var/initialization.carbon +++ b/toolchain/check/testdata/var/initialization.carbon @@ -2,7 +2,7 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/none.carbon +// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/destroy.carbon // // AUTOUPDATE // TIP: To test this file alone, run: @@ -18,10 +18,6 @@ interface DefaultOrUnformed { fn Op() -> Self; } -interface Destroy { - fn Op(ref self); -} - impl () as DefaultOrUnformed { fn Op() -> Self { return (); } } @@ -75,8 +71,31 @@ fn Main() { // CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete] // CHECK:STDOUT: %x.patt: %pattern_type.cb1 = ref_binding_pattern x [concrete] // CHECK:STDOUT: %x.var_patt: %pattern_type.cb1 = var_pattern %x.patt [concrete] +// CHECK:STDOUT: %self.param_patt.65a: %pattern_type.cb1 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.df1: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt.65a [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.loc8 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// 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.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// 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.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { @@ -95,13 +114,22 @@ fn Main() { // CHECK:STDOUT: %x.patt: %pattern_type.cb1 = ref_binding_pattern x [concrete = constants.%x.patt] // CHECK:STDOUT: %x.var_patt: %pattern_type.cb1 = var_pattern %x.patt [concrete = constants.%x.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %x.var, constants.%Destroy.WithSelf.Op.403 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%x.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %x.var, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%x.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8(%self.param: ref %empty_tuple.type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8(%self.param: ref %empty_tuple.type) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8(%self.param: ref %empty_tuple.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) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- uninitialized.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -116,8 +144,14 @@ fn Main() { // CHECK:STDOUT: %DefaultOrUnformed.facet: %DefaultOrUnformed.type = facet_value %empty_tuple.type, (%DefaultOrUnformed.impl_witness) [concrete] // CHECK:STDOUT: %empty_tuple.type.as.DefaultOrUnformed.impl.Op.type: type = fn_type @empty_tuple.type.as.DefaultOrUnformed.impl.Op [concrete] // CHECK:STDOUT: %empty_tuple.type.as.DefaultOrUnformed.impl.Op: %empty_tuple.type.as.DefaultOrUnformed.impl.Op.type = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.65a: %pattern_type.cb1 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.df1: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt.65a [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.loc8 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -125,6 +159,23 @@ fn Main() { // CHECK:STDOUT: %DefaultOrUnformed.impl_witness_table = impl_witness_table (%Core.import_ref.9c3), @empty_tuple.type.as.DefaultOrUnformed.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// 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.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// 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.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: fn @Main() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %x.var: ref %empty_tuple.type = var_storage %x.var_patt @@ -143,10 +194,19 @@ fn Main() { // CHECK:STDOUT: %x.patt: %pattern_type.cb1 = ref_binding_pattern x [concrete = constants.%x.patt] // CHECK:STDOUT: %x.var_patt: %pattern_type.cb1 = var_pattern %x.patt [concrete = constants.%x.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %x.var, constants.%Destroy.WithSelf.Op.403 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%x.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %x.var, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%x.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8(%self.param: ref %empty_tuple.type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8(%self.param: ref %empty_tuple.type) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8(%self.param: ref %empty_tuple.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) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/var/lifetime.carbon b/toolchain/check/testdata/var/lifetime.carbon index 2a95bb454e9e..94e4a88d4795 100644 --- a/toolchain/check/testdata/var/lifetime.carbon +++ b/toolchain/check/testdata/var/lifetime.carbon @@ -63,9 +63,53 @@ fn F() { // CHECK:STDOUT: %A.as.Copy.impl.Op.bound: = bound_method %A.val, %A.as.Copy.impl.Op [concrete] // CHECK:STDOUT: %b.patt: %pattern_type.9ef = ref_binding_pattern b [concrete] // CHECK:STDOUT: %b.var_patt: %pattern_type.9ef = var_pattern %b.patt [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc16_25.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc16_25.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.8fb: %pattern_type.9ef = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.e64: %pattern_type.9ef = wrapper_binding_pattern self, %self.param_patt.8fb [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc16_25.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc16_25.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.367, %Destroy.WithSelf.Op.403171.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc16_25.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.367, %Destroy.WithSelf.SelfDestruct.db3fdb.2 [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc16_25.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc16_25.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc16_25.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.9ef = ref_param_pattern [concrete = constants.%self.param_patt.8fb] +// CHECK:STDOUT: %self.patt: %pattern_type.9ef = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.e64] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %A = ref_param call_param0 +// CHECK:STDOUT: %self: ref %A = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc16_25.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.9ef = ref_param_pattern [concrete = constants.%self.param_patt.8fb] +// CHECK:STDOUT: %self.patt: %pattern_type.9ef = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.e64] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %A = ref_param call_param0 +// CHECK:STDOUT: %self: ref %A = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -120,20 +164,38 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %G.ref: %G.type = name_ref G, file.%G.decl [concrete = constants.%G] // CHECK:STDOUT: %G.call: init %empty_tuple.type = call %G.ref() -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc16_25: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.367) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc16: = bound_method %b.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc16_3: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc16(%b.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc15_34: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.367) -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc15_25: init %empty_tuple.type = call constants.%Destroy.WithSelf.Op.bound(constants.%.367) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc15: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc15_3: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc15(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_25: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.367) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16: = bound_method %b.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16(%b.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc15_34: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.367) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc15_25: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.367) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc15: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc15_3: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc15(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc16_25.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16_25.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16_25.2(%self.param: ref %A) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc16_25.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc16_25.2(%self.param: ref %A) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16_25.2(%self.param: ref %A) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc16_25.2(%self.param: ref %A) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/var/lookup.carbon b/toolchain/check/testdata/var/lookup.carbon index b1ef063c584e..74839ef6afc4 100644 --- a/toolchain/check/testdata/var/lookup.carbon +++ b/toolchain/check/testdata/var/lookup.carbon @@ -29,8 +29,14 @@ fn Main() { // CHECK:STDOUT: %x.patt: %pattern_type.cb1 = ref_binding_pattern x [concrete] // CHECK:STDOUT: %x.var_patt: %pattern_type.cb1 = var_pattern %x.patt [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %self.param_patt.65a: %pattern_type.cb1 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.df1: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt.65a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfc: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc16 [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.loc16 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc16 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -42,6 +48,23 @@ fn Main() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl: %Destroy.WithSelf.SubobjectDestroy.type.dfc = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc16 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc16 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -68,10 +91,19 @@ fn Main() { // CHECK:STDOUT: %x.var_patt: %pattern_type.cb1 = var_pattern %x.patt [concrete = constants.%x.var_patt] // CHECK:STDOUT: } // CHECK:STDOUT: %x.ref: ref %empty_tuple.type = name_ref x, %x -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %x.var, constants.%Destroy.WithSelf.Op.403 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%x.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %x.var, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%x.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc16(%self.param: ref %empty_tuple.type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16(%self.param: ref %empty_tuple.type) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc16(%self.param: ref %empty_tuple.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) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/var/shadowing.carbon b/toolchain/check/testdata/var/shadowing.carbon index b41b9233c450..e6b10481219a 100644 --- a/toolchain/check/testdata/var/shadowing.carbon +++ b/toolchain/check/testdata/var/shadowing.carbon @@ -46,8 +46,14 @@ fn Main() { // CHECK:STDOUT: %x.patt.06838d.2: %pattern_type.cb1 = ref_binding_pattern x [concrete] // CHECK:STDOUT: %x.var_patt.28d573.2: %pattern_type.cb1 = var_pattern %x.patt.06838d.2 [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %self.param_patt.65a: %pattern_type.cb1 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.df1: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt.65a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfc: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc10 [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.loc10 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -59,6 +65,23 @@ fn Main() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl: %Destroy.WithSelf.SubobjectDestroy.type.dfc = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc10 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc10 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -128,17 +151,26 @@ fn Main() { // CHECK:STDOUT: %.loc13_10.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc13_7: init %empty_tuple.type = converted %.loc13_10.1, %.loc13_10.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: assign %x.ref, %.loc13_7 -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc10: = bound_method %x.var.loc10, constants.%Destroy.WithSelf.Op.403 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc10: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc10(%x.var.loc10) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10: = bound_method %x.var.loc10, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10(%x.var.loc10) // CHECK:STDOUT: br !if.else // CHECK:STDOUT: // CHECK:STDOUT: !if.else: -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc8: = bound_method %x.var.loc8, constants.%Destroy.WithSelf.Op.403 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc8(%x.var.loc8) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc5: = bound_method %NS.var, constants.%Destroy.WithSelf.Op.403 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc5: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc5(%NS.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: = bound_method %x.var.loc8, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%x.var.loc8) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc5: = bound_method %NS.var, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc5: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc5(%NS.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc10(%self.param: ref %empty_tuple.type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10(%self.param: ref %empty_tuple.type) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10(%self.param: ref %empty_tuple.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) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/var/var_pattern.carbon b/toolchain/check/testdata/var/var_pattern.carbon index 948ffe6a8e23..cd8d1af83a17 100644 --- a/toolchain/check/testdata/var/var_pattern.carbon +++ b/toolchain/check/testdata/var/var_pattern.carbon @@ -189,8 +189,14 @@ fn Call() { // CHECK:STDOUT: %x.patt: %pattern_type.cb1 = ref_binding_pattern x [concrete] // CHECK:STDOUT: %x.var_patt: %pattern_type.cb1 = var_pattern %x.patt [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %self.param_patt.65a: %pattern_type.cb1 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.df1: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt.65a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfc: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc5 [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.loc5 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -202,6 +208,23 @@ fn Call() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl: %Destroy.WithSelf.SubobjectDestroy.type.dfc = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc5 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc5 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -227,13 +250,22 @@ fn Call() { // CHECK:STDOUT: %x.patt: %pattern_type.cb1 = ref_binding_pattern x [concrete = constants.%x.patt] // CHECK:STDOUT: %x.var_patt: %pattern_type.cb1 = var_pattern %x.patt [concrete = constants.%x.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %x.var, constants.%Destroy.WithSelf.Op.403 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%x.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %x.var, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%x.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc5(%self.param: ref %empty_tuple.type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc5(%self.param: ref %empty_tuple.type) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc5(%self.param: ref %empty_tuple.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) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- var_in_tuple.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -251,8 +283,14 @@ fn Call() { // CHECK:STDOUT: %.5ae: %pattern_type.5b8 = tuple_pattern (%x.patt, %y.var_patt) [concrete] // CHECK:STDOUT: %tuple: %tuple.type = tuple_value (%empty_tuple, %empty_tuple) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %self.param_patt.65a: %pattern_type.cb1 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.df1: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt.65a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfc: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc5 [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.loc5 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -264,6 +302,23 @@ fn Call() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl: %Destroy.WithSelf.SubobjectDestroy.type.dfc = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc5 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc5 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -300,13 +355,22 @@ fn Call() { // CHECK:STDOUT: %y.var_patt: %pattern_type.cb1 = var_pattern %y.patt [concrete = constants.%y.var_patt] // CHECK:STDOUT: %.loc5_38: %pattern_type.5b8 = tuple_pattern (%x.patt, %y.var_patt) [concrete = constants.%.5ae] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %y.var, constants.%Destroy.WithSelf.Op.403 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%y.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %y.var, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%y.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc5(%self.param: ref %empty_tuple.type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc5(%self.param: ref %empty_tuple.type) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc5(%self.param: ref %empty_tuple.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) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- tuple_in_var.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -324,8 +388,20 @@ fn Call() { // CHECK:STDOUT: %.var_patt: %pattern_type.5b8 = var_pattern %.8b4 [concrete] // CHECK:STDOUT: %tuple: %tuple.type = tuple_value (%empty_tuple, %empty_tuple) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %self.param_patt.65a: %pattern_type.cb1 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.df1: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt.65a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc5_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc5_3.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.cd0: %pattern_type.5b8 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.6c3: %pattern_type.5b8 = wrapper_binding_pattern self, %self.param_patt.cd0 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc5_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc5_3.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc5_3.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -337,6 +413,37 @@ fn Call() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc5_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc5_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc5_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.5b8 = ref_param_pattern [concrete = constants.%self.param_patt.cd0] +// CHECK:STDOUT: %self.patt: %pattern_type.5b8 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.6c3] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc5_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.5b8 = ref_param_pattern [concrete = constants.%self.param_patt.cd0] +// CHECK:STDOUT: %self.patt: %pattern_type.5b8 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.6c3] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -381,15 +488,33 @@ fn Call() { // CHECK:STDOUT: %.loc5_34: %pattern_type.5b8 = tuple_pattern (%x.patt, %y.patt) [concrete = constants.%.8b4] // CHECK:STDOUT: %.var_patt: %pattern_type.5b8 = var_pattern %.loc5_34 [concrete = constants.%.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc5_3.1(%self.param: ref %empty_tuple.type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc5_3.1(%self.param: ref %empty_tuple.type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc5_3.2(%self.param: ref %tuple.type) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc5_3.1(%self.param: ref %empty_tuple.type) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc5_3.2(%self.param: ref %tuple.type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc5_3.2(%self.param: ref %tuple.type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc5_3.2(%self.param: ref %tuple.type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -410,8 +535,20 @@ fn Call() { // CHECK:STDOUT: %.var_patt: %pattern_type.5b8 = var_pattern %.8b4 [concrete] // CHECK:STDOUT: %tuple: %tuple.type = tuple_value (%empty_tuple, %empty_tuple) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %self.param_patt.65a: %pattern_type.cb1 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.df1: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt.65a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc5_7.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc5_7.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.cd0: %pattern_type.5b8 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.6c3: %pattern_type.5b8 = wrapper_binding_pattern self, %self.param_patt.cd0 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc5_7.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc5_7.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc5_7.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -423,6 +560,37 @@ fn Call() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc5_7.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc5_7.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc5_7.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.5b8 = ref_param_pattern [concrete = constants.%self.param_patt.cd0] +// CHECK:STDOUT: %self.patt: %pattern_type.5b8 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.6c3] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc5_7.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.5b8 = ref_param_pattern [concrete = constants.%self.param_patt.cd0] +// CHECK:STDOUT: %self.patt: %pattern_type.5b8 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.6c3] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -467,15 +635,33 @@ fn Call() { // CHECK:STDOUT: %.loc5_38: %pattern_type.5b8 = tuple_pattern (%x.patt, %y.patt) [concrete = constants.%.8b4] // CHECK:STDOUT: %.var_patt: %pattern_type.5b8 = var_pattern %.loc5_38 [concrete = constants.%.var_patt] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc5_7.1(%self.param: ref %empty_tuple.type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc5_7.1(%self.param: ref %empty_tuple.type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc5_7.2(%self.param: ref %tuple.type) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc5_7.1(%self.param: ref %empty_tuple.type) { // CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc5_7.2(%self.param: ref %tuple.type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc5_7.2(%self.param: ref %tuple.type) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc5_7.2(%self.param: ref %tuple.type) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -497,8 +683,14 @@ fn Call() { // CHECK:STDOUT: %v.patt: %pattern_type.cb1 = ref_binding_pattern v [concrete] // CHECK:STDOUT: %v.var_patt: %pattern_type.cb1 = var_pattern %v.patt [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %self.param_patt.65a: %pattern_type.cb1 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.df1: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt.65a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfc: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc4 [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.loc4 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc4 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -510,6 +702,23 @@ fn Call() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl: %Destroy.WithSelf.SubobjectDestroy.type.dfc = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc4 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc4 [concrete = constants.%Destroy.WithSelf.Op.403] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -567,15 +776,24 @@ fn Call() { // CHECK:STDOUT: %.loc4: init %empty_tuple.type = converted %.loc8_9.1, %.loc8_9.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: assign %y.var, %.loc4 // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.ref(%.loc8_5, %y.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc4: = bound_method %y.var, constants.%Destroy.WithSelf.Op.403 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc4: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc4(%y.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc7: = bound_method %v.var, constants.%Destroy.WithSelf.Op.403 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc7: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc7(%v.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc4: = bound_method %y.var, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc4: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc4(%y.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc7: = bound_method %v.var, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc7: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc7(%v.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc4(%self.param: ref %empty_tuple.type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc4(%self.param: ref %empty_tuple.type) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc4(%self.param: ref %empty_tuple.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) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- public_function.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -698,16 +916,22 @@ fn Call() { // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %Self: %Destroy.type = symbolic_binding Self, 0 [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.d3e: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Self) [symbolic] -// CHECK:STDOUT: %Destroy.WithSelf.Op.42b: %Destroy.WithSelf.Op.type.d3e = struct_value () [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.4e5: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Self) [symbolic] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.4a0: %Destroy.WithSelf.SelfDestruct.type.4e5 = struct_value () [symbolic] // CHECK:STDOUT: %Destroy.assoc_type: type = assoc_entity_type @Destroy [concrete] -// CHECK:STDOUT: %assoc0: %Destroy.assoc_type = assoc_entity element0, imports.%Core.import_ref.918 [concrete] +// CHECK:STDOUT: %assoc2: %Destroy.assoc_type = assoc_entity element2, imports.%Core.import_ref.71d [concrete] +// CHECK:STDOUT: %self.param_patt.65a: %pattern_type.cb1 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.df1: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt.65a [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfc: type = fn_type @Destroy.WithSelf.SubobjectDestroy.2 [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.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] -// CHECK:STDOUT: %custom_witness.6c4: = custom_witness (%Destroy.WithSelf.Op.403), @Destroy [concrete] -// CHECK:STDOUT: %Destroy.facet.eb5: %Destroy.type = facet_value %empty_tuple.type, (%custom_witness.6c4) [concrete] -// CHECK:STDOUT: %Destroy.WithSelf.Op.type.2c7: type = fn_type @Destroy.WithSelf.Op.1, @Destroy.WithSelf(%Destroy.facet.eb5) [concrete] -// CHECK:STDOUT: %.59e: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.2c7, %Destroy.facet.eb5 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.f8f: = custom_witness (%Destroy.WithSelf.Op.403, %Destroy.WithSelf.SubobjectDestroy.d01, %Destroy.WithSelf.SelfDestruct.db3), @Destroy [concrete] +// CHECK:STDOUT: %Destroy.facet.c98: %Destroy.type = facet_value %empty_tuple.type, (%custom_witness.f8f) [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.43d: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.c98) [concrete] +// CHECK:STDOUT: %.bb8: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.43d, %Destroy.facet.c98 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -722,8 +946,25 @@ fn Call() { // CHECK:STDOUT: } // CHECK:STDOUT: %P.F: %F.type = import_ref P//default, F, loaded [concrete = constants.%F] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] -// CHECK:STDOUT: %Core.import_ref.c64: %Destroy.assoc_type = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [concrete = constants.%assoc0] -// CHECK:STDOUT: %Core.import_ref.918: @Destroy.WithSelf.%Destroy.WithSelf.Op.type (%Destroy.WithSelf.Op.type.d3e) = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [symbolic = @Destroy.WithSelf.%Destroy.WithSelf.Op (constants.%Destroy.WithSelf.Op.42b)] +// CHECK:STDOUT: %Core.import_ref.e39: %Destroy.assoc_type = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [concrete = constants.%assoc2] +// CHECK:STDOUT: %Core.import_ref.71d: @Destroy.WithSelf.%Destroy.WithSelf.SelfDestruct.type (%Destroy.WithSelf.SelfDestruct.type.4e5) = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [symbolic = @Destroy.WithSelf.%Destroy.WithSelf.SelfDestruct (constants.%Destroy.WithSelf.SelfDestruct.4a0)] +// 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: %self.param_patt: %pattern_type.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.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: %self.param_patt: %pattern_type.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -750,17 +991,26 @@ fn Call() { // CHECK:STDOUT: %.1: init %empty_tuple.type = converted %.loc7_12.1, %.loc7_12.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: assign %y.var, %.1 // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.ref(%.loc7_8.2, %y.var) -// CHECK:STDOUT: %Op.ref: %Destroy.assoc_type = name_ref Op, imports.%Core.import_ref.c64 [concrete = constants.%assoc0] -// CHECK:STDOUT: %impl.elem0: %.59e = impl_witness_access constants.%custom_witness.6c4, element0 [concrete = constants.%Destroy.WithSelf.Op.403] -// CHECK:STDOUT: %bound_method: = bound_method %y.var, %impl.elem0 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %bound_method(%y.var) +// CHECK:STDOUT: %SelfDestruct.ref: %Destroy.assoc_type = name_ref SelfDestruct, imports.%Core.import_ref.e39 [concrete = constants.%assoc2] +// CHECK:STDOUT: %impl.elem2: %.bb8 = impl_witness_access constants.%custom_witness.f8f, element2 [concrete = constants.%Destroy.WithSelf.SelfDestruct.db3] +// CHECK:STDOUT: %bound_method: = bound_method %y.var, %impl.elem2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %bound_method(%y.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F [from "public_function.carbon"]; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.2(%self.param: ref %empty_tuple.type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.2(%self.param: ref %empty_tuple.type) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.2(%self.param: ref %empty_tuple.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) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_nested.carbon // CHECK:STDOUT: // CHECK:STDOUT: fn @F(); @@ -875,8 +1125,14 @@ fn Call() { // CHECK:STDOUT: %pattern_type.8c1: type = pattern_type %tuple.type [concrete] // CHECK:STDOUT: %.b14: %pattern_type.8c1 = tuple_pattern (%x.patt, %y.var_patt, %z.patt) [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %self.param_patt.65a: %pattern_type.cb1 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.df1: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt.65a [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.loc8 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -888,6 +1144,23 @@ fn Call() { // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// 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.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// 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.cb1 = ref_param_pattern [concrete = constants.%self.param_patt.65a] +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.df1] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %empty_tuple.type = ref_param call_param0 +// CHECK:STDOUT: %self: ref %empty_tuple.type = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core @@ -951,17 +1224,26 @@ fn Call() { // CHECK:STDOUT: %z.patt: %pattern_type.cb1 = value_binding_pattern z [concrete = constants.%z.patt] // CHECK:STDOUT: %.loc8_52: %pattern_type.8c1 = tuple_pattern (%x.patt, %y.var_patt, %z.patt) [concrete = constants.%.b14] // CHECK:STDOUT: } -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc8_69: = bound_method %.loc8_69.2, constants.%Destroy.WithSelf.Op.403 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc8_69: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc8_69(%.loc8_69.2) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc8_59: = bound_method %.loc8_59.2, constants.%Destroy.WithSelf.Op.403 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc8_59: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc8_59(%.loc8_59.2) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc8_22: = bound_method %y.var, constants.%Destroy.WithSelf.Op.403 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc8_22: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc8_22(%y.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8_69: = bound_method %.loc8_69.2, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8_69: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8_69(%.loc8_69.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8_59: = bound_method %.loc8_59.2, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8_59: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8_59(%.loc8_59.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8_22: = bound_method %y.var, constants.%Destroy.WithSelf.SelfDestruct.db3 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8_22: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8_22(%y.var) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8(%self.param: ref %empty_tuple.type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8(%self.param: ref %empty_tuple.type) = "no_op"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8(%self.param: ref %empty_tuple.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) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- var_param_from_init.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -976,8 +1258,52 @@ fn Call() { // CHECK:STDOUT: %TakeVar: %TakeVar.type = struct_value () [concrete] // CHECK:STDOUT: %MakeInit.type: type = fn_type @MakeInit [concrete] // CHECK:STDOUT: %MakeInit: %MakeInit.type = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc7_12.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc7_12.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.925: %pattern_type.6cb = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.617: %pattern_type.6cb = wrapper_binding_pattern self, %self.param_patt.925 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc7_12.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc7_12.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc7_12.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc7_12.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc7_12.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc7_12.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6cb = ref_param_pattern [concrete = constants.%self.param_patt.925] +// CHECK:STDOUT: %self.patt: %pattern_type.6cb = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.617] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %X = ref_param call_param0 +// CHECK:STDOUT: %self: ref %X = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc7_12.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6cb = ref_param_pattern [concrete = constants.%self.param_patt.925] +// CHECK:STDOUT: %self.patt: %pattern_type.6cb = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.617] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %X = ref_param call_param0 +// CHECK:STDOUT: %self: ref %X = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -1001,15 +1327,33 @@ fn Call() { // CHECK:STDOUT: %MakeInit.call: init %X to %a.var = call %MakeInit.ref() // CHECK:STDOUT: assign %a.var, %MakeInit.call // CHECK:STDOUT: %TakeVar.call: init %empty_tuple.type = call %TakeVar.ref(%a.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%a.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%a.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc7_12.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_12.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_12.2(%self.param: ref %X) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc7_12.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc7_12.2(%self.param: ref %X) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc7_12.2(%self.param: ref %X) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc7_12.2(%self.param: ref %X) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1041,8 +1385,21 @@ fn Call() { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.e39, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete] // CHECK:STDOUT: %bound_method: = bound_method %int_123.fff, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_123.2bf: %i32 = int_value 123 [concrete] +// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete] +// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc5_12.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc5_12.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc5_12.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc5_12.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc5_12.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -1050,6 +1407,37 @@ fn Call() { // CHECK:STDOUT: %ImplicitAs.impl_witness_table.1aa = impl_witness_table (%Core.import_ref.edf), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc5_12.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc5_12.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331] +// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc5_12.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc5_12.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705] +// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0 +// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: %TakeVar.decl: %TakeVar.type = fn_decl @TakeVar [concrete = constants.%TakeVar] { // CHECK:STDOUT: %n.patt: %pattern_type.6b6 = ref_binding_pattern n [concrete = constants.%n.patt] @@ -1076,15 +1464,33 @@ fn Call() { // CHECK:STDOUT: %n.var: ref %i32 = var_storage @TakeVar.%n.param_patt // CHECK:STDOUT: assign %n.var, %.loc5 // CHECK:STDOUT: %TakeVar.call: init %empty_tuple.type = call %TakeVar.ref(%n.var) -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %n.var, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%n.var) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %n.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%n.var) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc5_12.1(%self.param: ref %i32.builtin) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc5_12.1(%self.param: ref %i32.builtin) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc5_12.2(%self.param: ref %i32) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc5_12.1(%self.param: ref %i32.builtin) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc5_12.2(%self.param: ref %i32) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc5_12.2(%self.param: ref %i32) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc5_12.2(%self.param: ref %i32) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/while/lifetime.carbon b/toolchain/check/testdata/while/lifetime.carbon index dd6988ea75ea..ddc5117fc6f7 100644 --- a/toolchain/check/testdata/while/lifetime.carbon +++ b/toolchain/check/testdata/while/lifetime.carbon @@ -39,12 +39,57 @@ fn F() { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %A.F: %A.F.type = struct_value () [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] +// CHECK:STDOUT: %pattern_type.9ef: type = pattern_type %A [concrete] // CHECK:STDOUT: %Make.type: type = fn_type @Make [concrete] // CHECK:STDOUT: %Make: %Make.type = struct_value () [concrete] // CHECK:STDOUT: %G.type: type = fn_type @G [concrete] // CHECK:STDOUT: %G: %G.type = struct_value () [concrete] +// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [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.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc14_15.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc14_15.1 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete] +// CHECK:STDOUT: %self.param_patt.8fb: %pattern_type.9ef = ref_param_pattern [concrete] +// CHECK:STDOUT: %self.patt.e64: %pattern_type.9ef = wrapper_binding_pattern self, %self.param_patt.8fb [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc14_15.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc14_15.2 [concrete] // CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc14_15.2 [concrete] +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generated { +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc14_15.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] { +// 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.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc14_15.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] { +// 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.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc14_15.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.9ef = ref_param_pattern [concrete = constants.%self.param_patt.8fb] +// CHECK:STDOUT: %self.patt: %pattern_type.9ef = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.e64] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %A = ref_param call_param0 +// CHECK:STDOUT: %self: ref %A = wrapper_binding self, %self.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc14_15.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] { +// CHECK:STDOUT: %self.param_patt: %pattern_type.9ef = ref_param_pattern [concrete = constants.%self.param_patt.8fb] +// CHECK:STDOUT: %self.patt: %pattern_type.9ef = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.e64] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %self.param: ref %A = ref_param call_param0 +// CHECK:STDOUT: %self: ref %A = wrapper_binding self, %self.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F() { @@ -60,8 +105,8 @@ fn F() { // CHECK:STDOUT: %A.F.call: init bool = call %F.ref() // CHECK:STDOUT: %.loc14_20.1: bool = value_of_initializer %A.F.call // CHECK:STDOUT: %.loc14_20.2: bool = converted %A.F.call, %.loc14_20.1 -// CHECK:STDOUT: %Destroy.WithSelf.Op.bound: = bound_method %.loc14_15.2, constants.%Destroy.WithSelf.Op.403171.2 -// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound(%.loc14_15.2) +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: = bound_method %.loc14_15.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2 +// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc14_15.2) // CHECK:STDOUT: if %.loc14_20.2 br !while.body else br !while.done // CHECK:STDOUT: // CHECK:STDOUT: !while.body: @@ -73,10 +118,28 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc14_15.1(%self.param: ref %empty_struct_type) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc14_15.1(%self.param: ref %empty_struct_type) = "no_op"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc14_15.2(%self.param: ref %A) { +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc14_15.1(%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.5f94cf.1(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc14_15.2(%self.param: ref %A) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc14_15.2(%self.param: ref %A) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc14_15.2(%self.param: ref %A) { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param) +// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/thunk.cpp b/toolchain/check/thunk.cpp index e2577575d0ab..2fb618884b0b 100644 --- a/toolchain/check/thunk.cpp +++ b/toolchain/check/thunk.cpp @@ -554,9 +554,11 @@ auto BuildDestroyThunk(Context& context, SemIR::LocId loc_id, auto self_inst_id = params[0]; // Build the function body. This calls the `Destroy` operator on `self`. - auto destroy_inst_id = BuildUnaryOperator( - context, loc_id, {.interface_name = CoreIdentifier::Destroy}, - self_inst_id); + auto destroy_inst_id = + BuildUnaryOperator(context, loc_id, + {.interface_name = CoreIdentifier::Destroy, + .op_name = CoreIdentifier::SelfDestruct}, + self_inst_id); DiscardExpr(context, destroy_inst_id); BuildReturnWithNoExpr(context, loc_id); diff --git a/toolchain/driver/testdata/compile/optimize/optimize_debug.carbon b/toolchain/driver/testdata/compile/optimize/optimize_debug.carbon index cb448db453c7..8ad2d7707094 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 !89 +// CHECK:STDOUT: %Rand.call.loc4_24.i = tail call i32 @_CRand.Main() #0, !dbg !90 +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call.i = add i32 %Rand.call.loc4_24.i, %Rand.call.loc4_15.i, !dbg !89 // 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 !100 // 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: @@ -82,16 +82,28 @@ fn VectorizedWithOptSpeed(a: array(i32, 65536)*) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) local_unnamed_addr #0 !dbg !37 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) local_unnamed_addr #0 !dbg !37 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !39 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) local_unnamed_addr #0 !dbg !41 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) local_unnamed_addr #0 !dbg !45 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !47 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { nofree norecurse nosync nounwind memory(argmem: readwrite) } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!1} -// CHECK:STDOUT: !llvm.module.flags = !{!75, !76} +// CHECK:STDOUT: !llvm.module.flags = !{!83, !84} // CHECK:STDOUT: // CHECK:STDOUT: !0 = !DIFile(filename: "foo.carbon", directory: "") // CHECK:STDOUT: !1 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !0, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) @@ -116,26 +128,34 @@ fn VectorizedWithOptSpeed(a: array(i32, 65536)*) { // CHECK:STDOUT: !31 = !DILocation(line: 16, column: 5, scope: !21) // CHECK:STDOUT: !35 = !DILocation(line: 12, column: 1, scope: !21) // CHECK:STDOUT: !36 = !{!22} -// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !0, line: 14, type: !9, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !40) +// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !0, line: 14, type: !9, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !40) // CHECK:STDOUT: !38 = !DILocalVariable(arg: 1, scope: !37, type: !2) // CHECK:STDOUT: !39 = !DILocation(line: 14, column: 3, scope: !37) // CHECK:STDOUT: !40 = !{!38} -// CHECK:STDOUT: !41 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "") -// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !41, line: 396, type: !9, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !49) -// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !42, type: !2) -// CHECK:STDOUT: !46 = !{null, !2, !2} -// CHECK:STDOUT: !47 = !DISubroutineType(types: !46) -// CHECK:STDOUT: !49 = !{!43} -// CHECK:STDOUT: !50 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895", scope: null, file: !41, line: 331, type: !47, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !57) +// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !0, line: 14, type: !9, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !44) +// CHECK:STDOUT: !42 = !DILocalVariable(arg: 1, scope: !41, type: !2) +// CHECK:STDOUT: !43 = !DILocation(line: 14, column: 3, scope: !41) +// CHECK:STDOUT: !44 = !{!42} +// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !0, line: 14, type: !9, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !48) +// CHECK:STDOUT: !46 = !DILocalVariable(arg: 1, scope: !45, type: !2) +// CHECK:STDOUT: !47 = !DILocation(line: 14, column: 3, scope: !45) +// CHECK:STDOUT: !48 = !{!46} +// CHECK:STDOUT: !49 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "") +// CHECK:STDOUT: !50 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !49, line: 396, type: !9, 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: !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: !54 = !{null, !2, !2} +// CHECK:STDOUT: !55 = !DISubroutineType(types: !54) +// CHECK:STDOUT: !57 = !{!51} +// CHECK:STDOUT: !58 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895", scope: null, file: !49, line: 331, type: !55, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !65) +// CHECK:STDOUT: !59 = !DILocalVariable(arg: 1, scope: !58, type: !2) +// CHECK:STDOUT: !60 = !DILocalVariable(arg: 2, scope: !58, type: !2) +// CHECK:STDOUT: !65 = !{!59, !60} +// CHECK:STDOUT: !83 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !84 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !88 = distinct !DILocation(line: 9, column: 10, scope: !16) +// CHECK:STDOUT: !89 = distinct !DILocation(line: 4, column: 10, scope: !10, inlinedAt: !88) +// CHECK:STDOUT: !90 = distinct !DILocation(line: 4, column: 19, scope: !10, inlinedAt: !88) +// CHECK:STDOUT: !98 = distinct !DILocation(line: 17, column: 5, scope: !21) +// CHECK:STDOUT: !99 = distinct !DILocation(line: 398, column: 5, scope: !50, inlinedAt: !98) +// CHECK:STDOUT: !100 = distinct !DILocation(line: 331, column: 3, scope: !58, inlinedAt: !99) // CHECK:STDOUT: diff --git a/toolchain/driver/testdata/compile/optimize/optimize_default.carbon b/toolchain/driver/testdata/compile/optimize/optimize_default.carbon index 0922b02a2468..3f346a3c18d8 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 !89 +// CHECK:STDOUT: %Rand.call.loc4_24.i = tail call i32 @_CRand.Main() #0, !dbg !90 +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call.i = add i32 %Rand.call.loc4_24.i, %Rand.call.loc4_15.i, !dbg !89 // 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 !100 // 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: @@ -82,16 +82,28 @@ fn VectorizedWithOptSpeed(a: array(i32, 65536)*) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) local_unnamed_addr #0 !dbg !37 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) local_unnamed_addr #0 !dbg !37 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !39 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) local_unnamed_addr #0 !dbg !41 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) local_unnamed_addr #0 !dbg !45 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !47 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { nofree norecurse nosync nounwind memory(argmem: readwrite) } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!1} -// CHECK:STDOUT: !llvm.module.flags = !{!75, !76} +// CHECK:STDOUT: !llvm.module.flags = !{!83, !84} // CHECK:STDOUT: // CHECK:STDOUT: !0 = !DIFile(filename: "foo.carbon", directory: "") // CHECK:STDOUT: !1 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !0, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) @@ -116,26 +128,34 @@ fn VectorizedWithOptSpeed(a: array(i32, 65536)*) { // CHECK:STDOUT: !31 = !DILocation(line: 16, column: 5, scope: !21) // CHECK:STDOUT: !35 = !DILocation(line: 12, column: 1, scope: !21) // CHECK:STDOUT: !36 = !{!22} -// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !0, line: 14, type: !9, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !40) +// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !0, line: 14, type: !9, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !40) // CHECK:STDOUT: !38 = !DILocalVariable(arg: 1, scope: !37, type: !2) // CHECK:STDOUT: !39 = !DILocation(line: 14, column: 3, scope: !37) // CHECK:STDOUT: !40 = !{!38} -// CHECK:STDOUT: !41 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "") -// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !41, line: 396, type: !9, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !49) -// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !42, type: !2) -// CHECK:STDOUT: !46 = !{null, !2, !2} -// CHECK:STDOUT: !47 = !DISubroutineType(types: !46) -// CHECK:STDOUT: !49 = !{!43} -// CHECK:STDOUT: !50 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895", scope: null, file: !41, line: 331, type: !47, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !57) +// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !0, line: 14, type: !9, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !44) +// CHECK:STDOUT: !42 = !DILocalVariable(arg: 1, scope: !41, type: !2) +// CHECK:STDOUT: !43 = !DILocation(line: 14, column: 3, scope: !41) +// CHECK:STDOUT: !44 = !{!42} +// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !0, line: 14, type: !9, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !48) +// CHECK:STDOUT: !46 = !DILocalVariable(arg: 1, scope: !45, type: !2) +// CHECK:STDOUT: !47 = !DILocation(line: 14, column: 3, scope: !45) +// CHECK:STDOUT: !48 = !{!46} +// CHECK:STDOUT: !49 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "") +// CHECK:STDOUT: !50 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !49, line: 396, type: !9, 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: !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: !54 = !{null, !2, !2} +// CHECK:STDOUT: !55 = !DISubroutineType(types: !54) +// CHECK:STDOUT: !57 = !{!51} +// CHECK:STDOUT: !58 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895", scope: null, file: !49, line: 331, type: !55, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !65) +// CHECK:STDOUT: !59 = !DILocalVariable(arg: 1, scope: !58, type: !2) +// CHECK:STDOUT: !60 = !DILocalVariable(arg: 2, scope: !58, type: !2) +// CHECK:STDOUT: !65 = !{!59, !60} +// CHECK:STDOUT: !83 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !84 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !88 = distinct !DILocation(line: 9, column: 10, scope: !16) +// CHECK:STDOUT: !89 = distinct !DILocation(line: 4, column: 10, scope: !10, inlinedAt: !88) +// CHECK:STDOUT: !90 = distinct !DILocation(line: 4, column: 19, scope: !10, inlinedAt: !88) +// CHECK:STDOUT: !98 = distinct !DILocation(line: 17, column: 5, scope: !21) +// CHECK:STDOUT: !99 = distinct !DILocation(line: 398, column: 5, scope: !50, inlinedAt: !98) +// CHECK:STDOUT: !100 = distinct !DILocation(line: 331, column: 3, scope: !58, inlinedAt: !99) // CHECK:STDOUT: diff --git a/toolchain/driver/testdata/compile/optimize/optimize_none.carbon b/toolchain/driver/testdata/compile/optimize/optimize_none.carbon index dec059c9400b..23a311e2652e 100644 --- a/toolchain/driver/testdata/compile/optimize/optimize_none.carbon +++ b/toolchain/driver/testdata/compile/optimize/optimize_none.carbon @@ -77,50 +77,63 @@ fn VectorizedWithOptSpeed(a: array(i32, 65536)*) { // CHECK:STDOUT: br label %while.cond, !dbg !34 // CHECK:STDOUT: // CHECK:STDOUT: while.done: ; preds = %while.cond -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %n.var), !dbg !24 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %n.var), !dbg !24 // CHECK:STDOUT: ret void, !dbg !35 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: noinline nounwind optnone -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !37 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !37 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !39 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: noinline nounwind optnone +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !41 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: noinline nounwind optnone +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !45 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !47 +// CHECK:STDOUT: ret void, !dbg !47 +// 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: noinline nounwind optnone -// CHECK:STDOUT: define linkonce_odr void @"_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8"(ptr %self) #0 !dbg !42 { -// CHECK:STDOUT: call void @"_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895"(ptr %self, i32 1), !dbg !45 -// CHECK:STDOUT: ret void, !dbg !48 +// CHECK:STDOUT: define linkonce_odr void @"_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8"(ptr %self) #0 !dbg !50 { +// CHECK:STDOUT: call void @"_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895"(ptr %self, i32 1), !dbg !53 +// CHECK:STDOUT: ret void, !dbg !56 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: noinline nounwind optnone -// CHECK:STDOUT: define linkonce_odr void @"_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895"(ptr %self, i32 %other) #0 !dbg !50 { -// CHECK:STDOUT: %1 = call i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044"(i32 %other), !dbg !53 -// 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 -// CHECK:STDOUT: ret void, !dbg !54 +// CHECK:STDOUT: define linkonce_odr void @"_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895"(ptr %self, i32 %other) #0 !dbg !58 { +// CHECK:STDOUT: %1 = call i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044"(i32 %other), !dbg !61 +// CHECK:STDOUT: %2 = load i32, ptr %self, align 4, !dbg !62 +// CHECK:STDOUT: %3 = add i32 %2, %1, !dbg !62 +// CHECK:STDOUT: store i32 %3, ptr %self, align 4, !dbg !62 +// CHECK:STDOUT: ret void, !dbg !62 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: noinline nounwind optnone -// CHECK:STDOUT: define linkonce_odr i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044"(i32 %self) #0 !dbg !58 { -// CHECK:STDOUT: %1 = call i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self), !dbg !63 -// CHECK:STDOUT: ret i32 %1, !dbg !65 +// CHECK:STDOUT: define linkonce_odr i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044"(i32 %self) #0 !dbg !66 { +// CHECK:STDOUT: %1 = call i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self), !dbg !71 +// CHECK:STDOUT: ret i32 %1, !dbg !73 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: noinline nounwind optnone -// CHECK:STDOUT: define linkonce_odr i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self) #0 !dbg !67 { -// CHECK:STDOUT: ret i32 %self, !dbg !73 +// CHECK:STDOUT: define linkonce_odr i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self) #0 !dbg !75 { +// CHECK:STDOUT: ret i32 %self, !dbg !81 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { noinline nounwind optnone } // CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!1} -// CHECK:STDOUT: !llvm.module.flags = !{!75, !76} +// CHECK:STDOUT: !llvm.module.flags = !{!83, !84} // CHECK:STDOUT: // CHECK:STDOUT: !0 = !DIFile(filename: "foo.carbon", directory: "") // CHECK:STDOUT: !1 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !0, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) @@ -150,35 +163,43 @@ fn VectorizedWithOptSpeed(a: array(i32, 65536)*) { // CHECK:STDOUT: !34 = !DILocation(line: 15, column: 3, scope: !21) // CHECK:STDOUT: !35 = !DILocation(line: 12, column: 1, scope: !21) // CHECK:STDOUT: !36 = !{!22} -// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !0, line: 14, type: !9, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !40) +// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !0, line: 14, type: !9, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !40) // CHECK:STDOUT: !38 = !DILocalVariable(arg: 1, scope: !37, type: !2) // CHECK:STDOUT: !39 = !DILocation(line: 14, column: 3, scope: !37) // CHECK:STDOUT: !40 = !{!38} -// CHECK:STDOUT: !41 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "") -// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !41, line: 396, type: !9, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !49) -// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !42, type: !2) -// CHECK:STDOUT: !45 = !DILocation(line: 398, column: 5, scope: !42) -// CHECK:STDOUT: !46 = !{null, !2, !2} -// CHECK:STDOUT: !47 = !DISubroutineType(types: !46) -// CHECK:STDOUT: !48 = !DILocation(line: 396, column: 3, scope: !42) -// CHECK:STDOUT: !49 = !{!43} -// CHECK:STDOUT: !50 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895", scope: null, file: !41, line: 331, type: !47, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !57) +// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !0, line: 14, type: !9, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !44) +// CHECK:STDOUT: !42 = !DILocalVariable(arg: 1, scope: !41, type: !2) +// CHECK:STDOUT: !43 = !DILocation(line: 14, column: 3, scope: !41) +// CHECK:STDOUT: !44 = !{!42} +// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !0, line: 14, type: !9, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !48) +// CHECK:STDOUT: !46 = !DILocalVariable(arg: 1, scope: !45, type: !2) +// CHECK:STDOUT: !47 = !DILocation(line: 14, column: 3, scope: !45) +// CHECK:STDOUT: !48 = !{!46} +// CHECK:STDOUT: !49 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "") +// CHECK:STDOUT: !50 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !49, line: 396, type: !9, 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) -// CHECK:STDOUT: !57 = !{!51, !52} -// CHECK:STDOUT: !58 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044", scope: null, file: !41, line: 64, type: !56, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !66) +// CHECK:STDOUT: !53 = !DILocation(line: 398, column: 5, scope: !50) +// CHECK:STDOUT: !54 = !{null, !2, !2} +// CHECK:STDOUT: !55 = !DISubroutineType(types: !54) +// CHECK:STDOUT: !56 = !DILocation(line: 396, column: 3, scope: !50) +// CHECK:STDOUT: !57 = !{!51} +// CHECK:STDOUT: !58 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895", scope: null, file: !49, line: 331, type: !55, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !65) // CHECK:STDOUT: !59 = !DILocalVariable(arg: 1, scope: !58, type: !2) -// CHECK:STDOUT: !63 = !DILocation(line: 66, column: 17, scope: !58) -// CHECK:STDOUT: !65 = !DILocation(line: 66, column: 5, scope: !58) -// CHECK:STDOUT: !66 = !{!59} -// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !41, line: 59, type: !56, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !74) -// CHECK:STDOUT: !68 = !DILocalVariable(arg: 1, scope: !67, type: !2) -// CHECK:STDOUT: !73 = !DILocation(line: 59, column: 28, scope: !67) -// CHECK:STDOUT: !74 = !{!68} -// CHECK:STDOUT: !75 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !76 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !60 = !DILocalVariable(arg: 2, scope: !58, type: !2) +// CHECK:STDOUT: !61 = !DILocation(line: 0, scope: !58) +// CHECK:STDOUT: !62 = !DILocation(line: 331, column: 3, scope: !58) +// CHECK:STDOUT: !63 = !{!2, !2} +// CHECK:STDOUT: !64 = !DISubroutineType(types: !63) +// CHECK:STDOUT: !65 = !{!59, !60} +// CHECK:STDOUT: !66 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044", scope: null, file: !49, line: 64, type: !64, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !74) +// CHECK:STDOUT: !67 = !DILocalVariable(arg: 1, scope: !66, type: !2) +// CHECK:STDOUT: !71 = !DILocation(line: 66, column: 17, scope: !66) +// CHECK:STDOUT: !73 = !DILocation(line: 66, column: 5, scope: !66) +// CHECK:STDOUT: !74 = !{!67} +// CHECK:STDOUT: !75 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !49, line: 59, type: !64, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !82) +// CHECK:STDOUT: !76 = !DILocalVariable(arg: 1, scope: !75, type: !2) +// CHECK:STDOUT: !81 = !DILocation(line: 59, column: 28, scope: !75) +// CHECK:STDOUT: !82 = !{!76} +// CHECK:STDOUT: !83 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !84 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: diff --git a/toolchain/driver/testdata/compile/optimize/optimize_size.carbon b/toolchain/driver/testdata/compile/optimize/optimize_size.carbon index 9a047e18e66e..5da1338294e2 100644 --- a/toolchain/driver/testdata/compile/optimize/optimize_size.carbon +++ b/toolchain/driver/testdata/compile/optimize/optimize_size.carbon @@ -76,43 +76,56 @@ fn VectorizedWithOptSpeed(a: array(i32, 65536)*) { // CHECK:STDOUT: br label %while.cond, !dbg !34 // CHECK:STDOUT: // CHECK:STDOUT: while.done: ; preds = %while.cond -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %n.var), !dbg !24 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %n.var), !dbg !24 // CHECK:STDOUT: ret void, !dbg !35 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: minsize nounwind optsize -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !37 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !37 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !39 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: minsize nounwind optsize +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !41 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: minsize nounwind optsize +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !45 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !47 +// CHECK:STDOUT: ret void, !dbg !47 +// 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: minsize nounwind optsize -// CHECK:STDOUT: define linkonce_odr void @"_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8"(ptr %self) #0 !dbg !42 { -// CHECK:STDOUT: call void @"_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895"(ptr %self, i32 1), !dbg !45 -// CHECK:STDOUT: ret void, !dbg !48 +// CHECK:STDOUT: define linkonce_odr void @"_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8"(ptr %self) #0 !dbg !50 { +// CHECK:STDOUT: call void @"_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895"(ptr %self, i32 1), !dbg !53 +// CHECK:STDOUT: ret void, !dbg !56 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline minsize nounwind optsize -// CHECK:STDOUT: define linkonce_odr void @"_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895"(ptr %self, i32 %other) #2 !dbg !50 { -// CHECK:STDOUT: %1 = call i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044"(i32 %other), !dbg !53 -// 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 -// CHECK:STDOUT: ret void, !dbg !54 +// CHECK:STDOUT: define linkonce_odr void @"_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895"(ptr %self, i32 %other) #2 !dbg !58 { +// CHECK:STDOUT: %1 = call i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044"(i32 %other), !dbg !61 +// CHECK:STDOUT: %2 = load i32, ptr %self, align 4, !dbg !62 +// CHECK:STDOUT: %3 = add i32 %2, %1, !dbg !62 +// CHECK:STDOUT: store i32 %3, ptr %self, align 4, !dbg !62 +// CHECK:STDOUT: ret void, !dbg !62 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: minsize nounwind optsize -// CHECK:STDOUT: define linkonce_odr i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044"(i32 %self) #0 !dbg !58 { -// CHECK:STDOUT: %1 = call i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self), !dbg !63 -// CHECK:STDOUT: ret i32 %1, !dbg !65 +// CHECK:STDOUT: define linkonce_odr i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044"(i32 %self) #0 !dbg !66 { +// CHECK:STDOUT: %1 = call i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self), !dbg !71 +// CHECK:STDOUT: ret i32 %1, !dbg !73 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: minsize nounwind optsize -// CHECK:STDOUT: define linkonce_odr i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self) #0 !dbg !67 { -// CHECK:STDOUT: ret i32 %self, !dbg !73 +// CHECK:STDOUT: define linkonce_odr i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self) #0 !dbg !75 { +// CHECK:STDOUT: ret i32 %self, !dbg !81 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { minsize nounwind optsize } @@ -120,7 +133,7 @@ fn VectorizedWithOptSpeed(a: array(i32, 65536)*) { // CHECK:STDOUT: attributes #2 = { alwaysinline minsize nounwind optsize } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!1} -// CHECK:STDOUT: !llvm.module.flags = !{!75, !76} +// CHECK:STDOUT: !llvm.module.flags = !{!83, !84} // CHECK:STDOUT: // CHECK:STDOUT: !0 = !DIFile(filename: "foo.carbon", directory: "") // CHECK:STDOUT: !1 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !0, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) @@ -150,35 +163,43 @@ fn VectorizedWithOptSpeed(a: array(i32, 65536)*) { // CHECK:STDOUT: !34 = !DILocation(line: 15, column: 3, scope: !21) // CHECK:STDOUT: !35 = !DILocation(line: 12, column: 1, scope: !21) // CHECK:STDOUT: !36 = !{!22} -// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !0, line: 14, type: !9, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !40) +// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !0, line: 14, type: !9, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !40) // CHECK:STDOUT: !38 = !DILocalVariable(arg: 1, scope: !37, type: !2) // CHECK:STDOUT: !39 = !DILocation(line: 14, column: 3, scope: !37) // CHECK:STDOUT: !40 = !{!38} -// CHECK:STDOUT: !41 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "") -// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !41, line: 396, type: !9, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !49) -// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !42, type: !2) -// CHECK:STDOUT: !45 = !DILocation(line: 398, column: 5, scope: !42) -// CHECK:STDOUT: !46 = !{null, !2, !2} -// CHECK:STDOUT: !47 = !DISubroutineType(types: !46) -// CHECK:STDOUT: !48 = !DILocation(line: 396, column: 3, scope: !42) -// CHECK:STDOUT: !49 = !{!43} -// CHECK:STDOUT: !50 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895", scope: null, file: !41, line: 331, type: !47, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !57) +// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !0, line: 14, type: !9, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !44) +// CHECK:STDOUT: !42 = !DILocalVariable(arg: 1, scope: !41, type: !2) +// CHECK:STDOUT: !43 = !DILocation(line: 14, column: 3, scope: !41) +// CHECK:STDOUT: !44 = !{!42} +// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !0, line: 14, type: !9, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !48) +// CHECK:STDOUT: !46 = !DILocalVariable(arg: 1, scope: !45, type: !2) +// CHECK:STDOUT: !47 = !DILocation(line: 14, column: 3, scope: !45) +// CHECK:STDOUT: !48 = !{!46} +// CHECK:STDOUT: !49 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "") +// CHECK:STDOUT: !50 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !49, line: 396, type: !9, 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) -// CHECK:STDOUT: !57 = !{!51, !52} -// CHECK:STDOUT: !58 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044", scope: null, file: !41, line: 64, type: !56, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !66) +// CHECK:STDOUT: !53 = !DILocation(line: 398, column: 5, scope: !50) +// CHECK:STDOUT: !54 = !{null, !2, !2} +// CHECK:STDOUT: !55 = !DISubroutineType(types: !54) +// CHECK:STDOUT: !56 = !DILocation(line: 396, column: 3, scope: !50) +// CHECK:STDOUT: !57 = !{!51} +// CHECK:STDOUT: !58 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895", scope: null, file: !49, line: 331, type: !55, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !65) // CHECK:STDOUT: !59 = !DILocalVariable(arg: 1, scope: !58, type: !2) -// CHECK:STDOUT: !63 = !DILocation(line: 66, column: 17, scope: !58) -// CHECK:STDOUT: !65 = !DILocation(line: 66, column: 5, scope: !58) -// CHECK:STDOUT: !66 = !{!59} -// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !41, line: 59, type: !56, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !74) -// CHECK:STDOUT: !68 = !DILocalVariable(arg: 1, scope: !67, type: !2) -// CHECK:STDOUT: !73 = !DILocation(line: 59, column: 28, scope: !67) -// CHECK:STDOUT: !74 = !{!68} -// CHECK:STDOUT: !75 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !76 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !60 = !DILocalVariable(arg: 2, scope: !58, type: !2) +// CHECK:STDOUT: !61 = !DILocation(line: 0, scope: !58) +// CHECK:STDOUT: !62 = !DILocation(line: 331, column: 3, scope: !58) +// CHECK:STDOUT: !63 = !{!2, !2} +// CHECK:STDOUT: !64 = !DISubroutineType(types: !63) +// CHECK:STDOUT: !65 = !{!59, !60} +// CHECK:STDOUT: !66 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044", scope: null, file: !49, line: 64, type: !64, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !74) +// CHECK:STDOUT: !67 = !DILocalVariable(arg: 1, scope: !66, type: !2) +// CHECK:STDOUT: !71 = !DILocation(line: 66, column: 17, scope: !66) +// CHECK:STDOUT: !73 = !DILocation(line: 66, column: 5, scope: !66) +// CHECK:STDOUT: !74 = !{!67} +// CHECK:STDOUT: !75 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !49, line: 59, type: !64, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !82) +// CHECK:STDOUT: !76 = !DILocalVariable(arg: 1, scope: !75, type: !2) +// CHECK:STDOUT: !81 = !DILocation(line: 59, column: 28, scope: !75) +// CHECK:STDOUT: !82 = !{!76} +// CHECK:STDOUT: !83 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !84 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: diff --git a/toolchain/driver/testdata/compile/optimize/optimize_speed.carbon b/toolchain/driver/testdata/compile/optimize/optimize_speed.carbon index 8eb194d58417..caa07e86b47c 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 !89 +// CHECK:STDOUT: %Rand.call.loc4_24.i = tail call i32 @_CRand.Main() #0, !dbg !90 +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call.i = add i32 %Rand.call.loc4_24.i, %Rand.call.loc4_15.i, !dbg !89 // 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 !100 // 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 !100 // 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 !108 // CHECK:STDOUT: // CHECK:STDOUT: while.done: ; preds = %vector.body // CHECK:STDOUT: ret void, !dbg !35 @@ -98,16 +98,28 @@ fn VectorizedWithOptSpeed(a: array(i32, 65536)*) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) local_unnamed_addr #0 !dbg !37 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) local_unnamed_addr #0 !dbg !37 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !39 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) local_unnamed_addr #0 !dbg !41 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) local_unnamed_addr #0 !dbg !45 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !47 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { nofree norecurse nosync nounwind memory(argmem: readwrite) } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!1} -// CHECK:STDOUT: !llvm.module.flags = !{!75, !76} +// CHECK:STDOUT: !llvm.module.flags = !{!83, !84} // CHECK:STDOUT: // CHECK:STDOUT: !0 = !DIFile(filename: "foo.carbon", directory: "") // CHECK:STDOUT: !1 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !0, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) @@ -131,29 +143,37 @@ fn VectorizedWithOptSpeed(a: array(i32, 65536)*) { // CHECK:STDOUT: !31 = !DILocation(line: 16, column: 5, scope: !21) // CHECK:STDOUT: !35 = !DILocation(line: 12, column: 1, scope: !21) // CHECK:STDOUT: !36 = !{!22} -// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !0, line: 14, type: !9, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !40) +// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !0, line: 14, type: !9, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !40) // CHECK:STDOUT: !38 = !DILocalVariable(arg: 1, scope: !37, type: !2) // CHECK:STDOUT: !39 = !DILocation(line: 14, column: 3, scope: !37) // CHECK:STDOUT: !40 = !{!38} -// CHECK:STDOUT: !41 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "") -// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !41, line: 396, type: !9, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !49) -// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !42, type: !2) -// CHECK:STDOUT: !46 = !{null, !2, !2} -// CHECK:STDOUT: !47 = !DISubroutineType(types: !46) -// CHECK:STDOUT: !49 = !{!43} -// CHECK:STDOUT: !50 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895", scope: null, file: !41, line: 331, type: !47, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !57) +// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !0, line: 14, type: !9, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !44) +// CHECK:STDOUT: !42 = !DILocalVariable(arg: 1, scope: !41, type: !2) +// CHECK:STDOUT: !43 = !DILocation(line: 14, column: 3, scope: !41) +// CHECK:STDOUT: !44 = !{!42} +// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !0, line: 14, type: !9, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !48) +// CHECK:STDOUT: !46 = !DILocalVariable(arg: 1, scope: !45, type: !2) +// CHECK:STDOUT: !47 = !DILocation(line: 14, column: 3, scope: !45) +// CHECK:STDOUT: !48 = !{!46} +// CHECK:STDOUT: !49 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "") +// CHECK:STDOUT: !50 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !49, line: 396, type: !9, 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: !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: !54 = !{null, !2, !2} +// CHECK:STDOUT: !55 = !DISubroutineType(types: !54) +// CHECK:STDOUT: !57 = !{!51} +// CHECK:STDOUT: !58 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895", scope: null, file: !49, line: 331, type: !55, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !65) +// CHECK:STDOUT: !59 = !DILocalVariable(arg: 1, scope: !58, type: !2) +// CHECK:STDOUT: !60 = !DILocalVariable(arg: 2, scope: !58, type: !2) +// CHECK:STDOUT: !65 = !{!59, !60} +// CHECK:STDOUT: !83 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !84 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !88 = distinct !DILocation(line: 9, column: 10, scope: !16) +// CHECK:STDOUT: !89 = distinct !DILocation(line: 4, column: 10, scope: !10, inlinedAt: !88) +// CHECK:STDOUT: !90 = distinct !DILocation(line: 4, column: 19, scope: !10, inlinedAt: !88) +// CHECK:STDOUT: !98 = distinct !DILocation(line: 17, column: 5, scope: !21) +// CHECK:STDOUT: !99 = distinct !DILocation(line: 398, column: 5, scope: !50, inlinedAt: !98) +// CHECK:STDOUT: !100 = distinct !DILocation(line: 331, column: 3, scope: !58, inlinedAt: !99) +// CHECK:STDOUT: !105 = !{!"llvm.loop.isvectorized", i32 1} +// CHECK:STDOUT: !107 = !{!"llvm.loop.unroll.runtime.disable"} +// CHECK:STDOUT: !108 = distinct !{!108, !105, !107} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/array/array_in_place.carbon b/toolchain/lower/testdata/array/array_in_place.carbon index 25bb2e3812e6..342383a98c56 100644 --- a/toolchain/lower/testdata/array/array_in_place.carbon +++ b/toolchain/lower/testdata/array/array_in_place.carbon @@ -31,28 +31,55 @@ fn G() { // CHECK:STDOUT: call void @_CF.Main(ptr %.loc16_47.6.array.index), !dbg !33 // CHECK:STDOUT: %.loc16_47.5.array.index = getelementptr inbounds [2 x { i32, i32, i32 }], ptr %_.var, i32 0, i64 1, !dbg !32 // CHECK:STDOUT: call void @_CF.Main(ptr %.loc16_47.5.array.index), !dbg !34 -// CHECK:STDOUT: call void @"_COp.133da171e935f2c5:core.Destroy.Core"(ptr %_.var), !dbg !31 +// CHECK:STDOUT: call void @"_CSelfDestruct.133da171e935f2c5:core.Destroy.Core"(ptr %_.var), !dbg !31 // CHECK:STDOUT: ret void, !dbg !36 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !37 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !37 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !39 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.555b1314256372b8:core.Destroy.Core"(ptr %self) #0 !dbg !41 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !41 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !43 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.133da171e935f2c5:core.Destroy.Core"(ptr %self) #0 !dbg !45 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !45 { // CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !47 // CHECK:STDOUT: ret void, !dbg !47 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.555b1314256372b8:core.Destroy.Core"(ptr %self) #0 !dbg !49 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !51 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.555b1314256372b8:core.Destroy.Core"(ptr %self) #0 !dbg !53 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.555b1314256372b8:core.Destroy.Core"(ptr %self), !dbg !55 +// CHECK:STDOUT: ret void, !dbg !55 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.133da171e935f2c5:core.Destroy.Core"(ptr %self) #0 !dbg !57 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !59 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.133da171e935f2c5:core.Destroy.Core"(ptr %self) #0 !dbg !61 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.133da171e935f2c5:core.Destroy.Core"(ptr %self), !dbg !63 +// CHECK:STDOUT: ret void, !dbg !63 +// 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: @@ -80,16 +107,32 @@ fn G() { // CHECK:STDOUT: !33 = !DILocation(line: 16, column: 39, scope: !30) // CHECK:STDOUT: !34 = !DILocation(line: 16, column: 44, scope: !30) // CHECK:STDOUT: !36 = !DILocation(line: 15, column: 1, scope: !30) -// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 16, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !40) +// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !18, line: 16, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !40) // CHECK:STDOUT: !38 = !DILocalVariable(arg: 1, scope: !37, type: !20) // CHECK:STDOUT: !39 = !DILocation(line: 16, column: 3, scope: !37) // CHECK:STDOUT: !40 = !{!38} -// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "Op", linkageName: "_COp.555b1314256372b8:core.Destroy.Core", scope: null, file: !18, line: 16, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !44) -// CHECK:STDOUT: !42 = !DILocalVariable(arg: 1, scope: !41, type: !21) +// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 16, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !44) +// CHECK:STDOUT: !42 = !DILocalVariable(arg: 1, scope: !41, type: !20) // CHECK:STDOUT: !43 = !DILocation(line: 16, column: 3, scope: !41) // CHECK:STDOUT: !44 = !{!42} -// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "Op", linkageName: "_COp.133da171e935f2c5:core.Destroy.Core", scope: null, file: !18, line: 16, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !48) -// CHECK:STDOUT: !46 = !DILocalVariable(arg: 1, scope: !45, type: !21) +// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 16, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !48) +// CHECK:STDOUT: !46 = !DILocalVariable(arg: 1, scope: !45, type: !20) // CHECK:STDOUT: !47 = !DILocation(line: 16, column: 3, scope: !45) // CHECK:STDOUT: !48 = !{!46} +// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.555b1314256372b8:core.Destroy.Core", scope: null, file: !18, line: 16, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !52) +// CHECK:STDOUT: !50 = !DILocalVariable(arg: 1, scope: !49, type: !21) +// CHECK:STDOUT: !51 = !DILocation(line: 16, column: 3, scope: !49) +// CHECK:STDOUT: !52 = !{!50} +// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.555b1314256372b8:core.Destroy.Core", scope: null, file: !18, line: 16, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !56) +// CHECK:STDOUT: !54 = !DILocalVariable(arg: 1, scope: !53, type: !21) +// CHECK:STDOUT: !55 = !DILocation(line: 16, column: 3, scope: !53) +// CHECK:STDOUT: !56 = !{!54} +// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.133da171e935f2c5:core.Destroy.Core", scope: null, file: !18, line: 16, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !60) +// CHECK:STDOUT: !58 = !DILocalVariable(arg: 1, scope: !57, type: !21) +// CHECK:STDOUT: !59 = !DILocation(line: 16, column: 3, scope: !57) +// CHECK:STDOUT: !60 = !{!58} +// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.133da171e935f2c5:core.Destroy.Core", scope: null, file: !18, line: 16, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !64) +// CHECK:STDOUT: !62 = !DILocalVariable(arg: 1, scope: !61, type: !21) +// CHECK:STDOUT: !63 = !DILocation(line: 16, column: 3, scope: !61) +// CHECK:STDOUT: !64 = !{!62} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/array/assign_return_value.carbon b/toolchain/lower/testdata/array/assign_return_value.carbon index f63afdbf33fa..6656b6fd1d75 100644 --- a/toolchain/lower/testdata/array/assign_return_value.carbon +++ b/toolchain/lower/testdata/array/assign_return_value.carbon @@ -47,29 +47,56 @@ fn Run() { // CHECK:STDOUT: %.loc16_28.6 = load i32, ptr %tuple.elem1.tuple.elem, align 4, !dbg !37 // CHECK:STDOUT: %.loc16_28.7.array.index = getelementptr inbounds [2 x i32], ptr %_.var, i32 0, i64 1, !dbg !37 // CHECK:STDOUT: store i32 %.loc16_28.6, ptr %.loc16_28.7.array.index, align 4, !dbg !37 -// CHECK:STDOUT: call void @"_COp.e554695bf635d9c1:core.Destroy.Core"(ptr %.loc16_28.1.temp), !dbg !37 -// CHECK:STDOUT: call void @"_COp.8014ee1b1a984df0:core.Destroy.Core"(ptr %_.var), !dbg !36 +// CHECK:STDOUT: call void @"_CSelfDestruct.e554695bf635d9c1:core.Destroy.Core"(ptr %.loc16_28.1.temp), !dbg !37 +// CHECK:STDOUT: call void @"_CSelfDestruct.8014ee1b1a984df0:core.Destroy.Core"(ptr %_.var), !dbg !36 // CHECK:STDOUT: ret i32 0, !dbg !39 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !40 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !40 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !42 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.e554695bf635d9c1:core.Destroy.Core"(ptr %self) #0 !dbg !44 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !44 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !46 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.8014ee1b1a984df0:core.Destroy.Core"(ptr %self) #0 !dbg !48 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !48 { // CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !50 // CHECK:STDOUT: ret void, !dbg !50 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.e554695bf635d9c1:core.Destroy.Core"(ptr %self) #0 !dbg !52 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !54 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.e554695bf635d9c1:core.Destroy.Core"(ptr %self) #0 !dbg !56 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.e554695bf635d9c1:core.Destroy.Core"(ptr %self), !dbg !58 +// CHECK:STDOUT: ret void, !dbg !58 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.8014ee1b1a984df0:core.Destroy.Core"(ptr %self) #0 !dbg !60 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !62 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.8014ee1b1a984df0:core.Destroy.Core"(ptr %self) #0 !dbg !64 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.8014ee1b1a984df0:core.Destroy.Core"(ptr %self), !dbg !66 +// CHECK:STDOUT: ret void, !dbg !66 +// 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: @@ -106,16 +133,32 @@ fn Run() { // CHECK:STDOUT: !36 = !DILocation(line: 16, column: 3, scope: !35) // CHECK:STDOUT: !37 = !DILocation(line: 16, column: 26, scope: !35) // CHECK:STDOUT: !39 = !DILocation(line: 15, column: 1, scope: !35) -// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 16, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !43) +// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !18, line: 16, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !43) // CHECK:STDOUT: !41 = !DILocalVariable(arg: 1, scope: !40, type: !20) // CHECK:STDOUT: !42 = !DILocation(line: 16, column: 26, scope: !40) // CHECK:STDOUT: !43 = !{!41} -// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "Op", linkageName: "_COp.e554695bf635d9c1:core.Destroy.Core", scope: null, file: !18, line: 16, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !47) -// CHECK:STDOUT: !45 = !DILocalVariable(arg: 1, scope: !44, type: !21) +// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 16, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !47) +// CHECK:STDOUT: !45 = !DILocalVariable(arg: 1, scope: !44, type: !20) // CHECK:STDOUT: !46 = !DILocation(line: 16, column: 26, scope: !44) // CHECK:STDOUT: !47 = !{!45} -// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "Op", linkageName: "_COp.8014ee1b1a984df0:core.Destroy.Core", scope: null, file: !18, line: 16, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !51) -// CHECK:STDOUT: !49 = !DILocalVariable(arg: 1, scope: !48, type: !21) -// CHECK:STDOUT: !50 = !DILocation(line: 16, column: 3, scope: !48) +// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 16, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !51) +// CHECK:STDOUT: !49 = !DILocalVariable(arg: 1, scope: !48, type: !20) +// CHECK:STDOUT: !50 = !DILocation(line: 16, column: 26, scope: !48) // CHECK:STDOUT: !51 = !{!49} +// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.e554695bf635d9c1:core.Destroy.Core", scope: null, file: !18, line: 16, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !55) +// CHECK:STDOUT: !53 = !DILocalVariable(arg: 1, scope: !52, type: !21) +// CHECK:STDOUT: !54 = !DILocation(line: 16, column: 26, scope: !52) +// CHECK:STDOUT: !55 = !{!53} +// CHECK:STDOUT: !56 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.e554695bf635d9c1:core.Destroy.Core", scope: null, file: !18, line: 16, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !59) +// CHECK:STDOUT: !57 = !DILocalVariable(arg: 1, scope: !56, type: !21) +// CHECK:STDOUT: !58 = !DILocation(line: 16, column: 26, scope: !56) +// CHECK:STDOUT: !59 = !{!57} +// CHECK:STDOUT: !60 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.8014ee1b1a984df0:core.Destroy.Core", scope: null, file: !18, line: 16, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !63) +// CHECK:STDOUT: !61 = !DILocalVariable(arg: 1, scope: !60, type: !21) +// CHECK:STDOUT: !62 = !DILocation(line: 16, column: 3, scope: !60) +// CHECK:STDOUT: !63 = !{!61} +// CHECK:STDOUT: !64 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.8014ee1b1a984df0:core.Destroy.Core", scope: null, file: !18, line: 16, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !67) +// CHECK:STDOUT: !65 = !DILocalVariable(arg: 1, scope: !64, type: !21) +// CHECK:STDOUT: !66 = !DILocation(line: 16, column: 3, scope: !64) +// CHECK:STDOUT: !67 = !{!65} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/array/base.carbon b/toolchain/lower/testdata/array/base.carbon index a4770b5cf006..c202eb7ff982 100644 --- a/toolchain/lower/testdata/array/base.carbon +++ b/toolchain/lower/testdata/array/base.carbon @@ -67,56 +67,123 @@ fn Run() { // CHECK:STDOUT: %.loc18_26.7 = load i32, ptr %tuple.elem2.loc18.tuple.elem, align 4, !dbg !56 // CHECK:STDOUT: %.loc18_26.8.array.index = getelementptr inbounds [3 x i32], ptr %_.var.loc18, i32 0, i64 2, !dbg !56 // CHECK:STDOUT: store i32 %.loc18_26.7, ptr %.loc18_26.8.array.index, align 4, !dbg !56 -// CHECK:STDOUT: call void @"_COp.dc7dedd104b837b2:core.Destroy.Core"(ptr %_.var.loc18), !dbg !55 -// CHECK:STDOUT: call void @"_COp.555b1314256372b8:core.Destroy.Core"(ptr %d.var), !dbg !52 -// CHECK:STDOUT: call void @"_COp.c135263f75f7214d:core.Destroy.Core"(ptr %_.var.loc16), !dbg !49 -// CHECK:STDOUT: call void @"_COp.8815565a27e3ec8c:core.Destroy.Core"(ptr %_.var.loc15), !dbg !46 -// CHECK:STDOUT: call void @"_COp.d277540f487baeed:core.Destroy.Core"(ptr %_.var.loc14), !dbg !43 +// CHECK:STDOUT: call void @"_CSelfDestruct.dc7dedd104b837b2:core.Destroy.Core"(ptr %_.var.loc18), !dbg !55 +// CHECK:STDOUT: call void @"_CSelfDestruct.555b1314256372b8:core.Destroy.Core"(ptr %d.var), !dbg !52 +// CHECK:STDOUT: call void @"_CSelfDestruct.c135263f75f7214d:core.Destroy.Core"(ptr %_.var.loc16), !dbg !49 +// CHECK:STDOUT: call void @"_CSelfDestruct.8815565a27e3ec8c:core.Destroy.Core"(ptr %_.var.loc15), !dbg !46 +// CHECK:STDOUT: call void @"_CSelfDestruct.d277540f487baeed:core.Destroy.Core"(ptr %_.var.loc14), !dbg !43 // CHECK:STDOUT: ret i32 0, !dbg !58 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !59 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !59 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !61 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.dc7dedd104b837b2:core.Destroy.Core"(ptr %self) #0 !dbg !63 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !63 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !65 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.555b1314256372b8:core.Destroy.Core"(ptr %self) #0 !dbg !67 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !67 { // CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !69 // CHECK:STDOUT: ret void, !dbg !69 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.c135263f75f7214d:core.Destroy.Core"(ptr %self) #0 !dbg !71 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.dc7dedd104b837b2:core.Destroy.Core"(ptr %self) #0 !dbg !71 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !73 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.dc14d4dd21801791:core.Destroy.Core"(ptr %self) #0 !dbg !75 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.dc7dedd104b837b2:core.Destroy.Core"(ptr %self) #0 !dbg !75 { // CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.dc7dedd104b837b2:core.Destroy.Core"(ptr %self), !dbg !77 // CHECK:STDOUT: ret void, !dbg !77 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.8815565a27e3ec8c:core.Destroy.Core"(ptr %self) #0 !dbg !79 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.555b1314256372b8:core.Destroy.Core"(ptr %self) #0 !dbg !79 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !81 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.d277540f487baeed:core.Destroy.Core"(ptr %self) #0 !dbg !83 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.555b1314256372b8:core.Destroy.Core"(ptr %self) #0 !dbg !83 { // CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.555b1314256372b8:core.Destroy.Core"(ptr %self), !dbg !85 // CHECK:STDOUT: ret void, !dbg !85 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.61ea2aba74ab3bf1:core.Destroy.Core"(ptr %self) #0 !dbg !87 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !89 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.c135263f75f7214d:core.Destroy.Core"(ptr %self) #0 !dbg !91 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !93 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.c135263f75f7214d:core.Destroy.Core"(ptr %self) #0 !dbg !95 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.c135263f75f7214d:core.Destroy.Core"(ptr %self), !dbg !97 +// CHECK:STDOUT: ret void, !dbg !97 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.7945ecba5c505fc0:core.Destroy.Core"(ptr %self) #0 !dbg !99 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !101 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.dc14d4dd21801791:core.Destroy.Core"(ptr %self) #0 !dbg !103 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !105 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.dc14d4dd21801791:core.Destroy.Core"(ptr %self) #0 !dbg !107 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.dc14d4dd21801791:core.Destroy.Core"(ptr %self), !dbg !109 +// CHECK:STDOUT: ret void, !dbg !109 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.8815565a27e3ec8c:core.Destroy.Core"(ptr %self) #0 !dbg !111 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !113 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.8815565a27e3ec8c:core.Destroy.Core"(ptr %self) #0 !dbg !115 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.8815565a27e3ec8c:core.Destroy.Core"(ptr %self), !dbg !117 +// CHECK:STDOUT: ret void, !dbg !117 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.d277540f487baeed:core.Destroy.Core"(ptr %self) #0 !dbg !119 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !121 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.d277540f487baeed:core.Destroy.Core"(ptr %self) #0 !dbg !123 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.d277540f487baeed:core.Destroy.Core"(ptr %self), !dbg !125 +// CHECK:STDOUT: ret void, !dbg !125 +// 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: @@ -157,32 +224,72 @@ fn Run() { // CHECK:STDOUT: !55 = !DILocation(line: 18, column: 3, scope: !42) // CHECK:STDOUT: !56 = !DILocation(line: 18, column: 26, scope: !42) // CHECK:STDOUT: !58 = !DILocation(line: 13, column: 1, scope: !42) -// CHECK:STDOUT: !59 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !32, line: 18, type: !38, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !62) +// CHECK:STDOUT: !59 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !32, line: 18, type: !38, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !62) // CHECK:STDOUT: !60 = !DILocalVariable(arg: 1, scope: !59, type: !34) // CHECK:STDOUT: !61 = !DILocation(line: 18, column: 3, scope: !59) // CHECK:STDOUT: !62 = !{!60} -// CHECK:STDOUT: !63 = distinct !DISubprogram(name: "Op", linkageName: "_COp.dc7dedd104b837b2:core.Destroy.Core", scope: null, file: !32, line: 18, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !66) -// CHECK:STDOUT: !64 = !DILocalVariable(arg: 1, scope: !63, type: !39) +// CHECK:STDOUT: !63 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !32, line: 18, type: !38, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !66) +// CHECK:STDOUT: !64 = !DILocalVariable(arg: 1, scope: !63, type: !34) // CHECK:STDOUT: !65 = !DILocation(line: 18, column: 3, scope: !63) // CHECK:STDOUT: !66 = !{!64} -// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "Op", linkageName: "_COp.555b1314256372b8:core.Destroy.Core", scope: null, file: !32, line: 17, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !70) -// CHECK:STDOUT: !68 = !DILocalVariable(arg: 1, scope: !67, type: !39) -// CHECK:STDOUT: !69 = !DILocation(line: 17, column: 3, scope: !67) +// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !32, line: 18, type: !38, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !70) +// CHECK:STDOUT: !68 = !DILocalVariable(arg: 1, scope: !67, type: !34) +// CHECK:STDOUT: !69 = !DILocation(line: 18, column: 3, scope: !67) // CHECK:STDOUT: !70 = !{!68} -// CHECK:STDOUT: !71 = distinct !DISubprogram(name: "Op", linkageName: "_COp.c135263f75f7214d:core.Destroy.Core", scope: null, file: !32, line: 16, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !74) +// CHECK:STDOUT: !71 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.dc7dedd104b837b2:core.Destroy.Core", scope: null, file: !32, line: 18, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !74) // CHECK:STDOUT: !72 = !DILocalVariable(arg: 1, scope: !71, type: !39) -// CHECK:STDOUT: !73 = !DILocation(line: 16, column: 3, scope: !71) +// CHECK:STDOUT: !73 = !DILocation(line: 18, column: 3, scope: !71) // CHECK:STDOUT: !74 = !{!72} -// CHECK:STDOUT: !75 = distinct !DISubprogram(name: "Op", linkageName: "_COp.dc14d4dd21801791:core.Destroy.Core", scope: null, file: !32, line: 15, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !78) +// CHECK:STDOUT: !75 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.dc7dedd104b837b2:core.Destroy.Core", scope: null, file: !32, line: 18, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !78) // CHECK:STDOUT: !76 = !DILocalVariable(arg: 1, scope: !75, type: !39) -// CHECK:STDOUT: !77 = !DILocation(line: 15, column: 3, scope: !75) +// CHECK:STDOUT: !77 = !DILocation(line: 18, column: 3, scope: !75) // CHECK:STDOUT: !78 = !{!76} -// CHECK:STDOUT: !79 = distinct !DISubprogram(name: "Op", linkageName: "_COp.8815565a27e3ec8c:core.Destroy.Core", scope: null, file: !32, line: 15, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !82) +// CHECK:STDOUT: !79 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.555b1314256372b8:core.Destroy.Core", scope: null, file: !32, line: 17, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !82) // CHECK:STDOUT: !80 = !DILocalVariable(arg: 1, scope: !79, type: !39) -// CHECK:STDOUT: !81 = !DILocation(line: 15, column: 3, scope: !79) +// CHECK:STDOUT: !81 = !DILocation(line: 17, column: 3, scope: !79) // CHECK:STDOUT: !82 = !{!80} -// CHECK:STDOUT: !83 = distinct !DISubprogram(name: "Op", linkageName: "_COp.d277540f487baeed:core.Destroy.Core", scope: null, file: !32, line: 14, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !86) +// CHECK:STDOUT: !83 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.555b1314256372b8:core.Destroy.Core", scope: null, file: !32, line: 17, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !86) // CHECK:STDOUT: !84 = !DILocalVariable(arg: 1, scope: !83, type: !39) -// CHECK:STDOUT: !85 = !DILocation(line: 14, column: 3, scope: !83) +// CHECK:STDOUT: !85 = !DILocation(line: 17, column: 3, scope: !83) // CHECK:STDOUT: !86 = !{!84} +// CHECK:STDOUT: !87 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.61ea2aba74ab3bf1:core.Destroy.Core", scope: null, file: !32, line: 16, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !90) +// CHECK:STDOUT: !88 = !DILocalVariable(arg: 1, scope: !87, type: !39) +// CHECK:STDOUT: !89 = !DILocation(line: 16, column: 3, scope: !87) +// CHECK:STDOUT: !90 = !{!88} +// CHECK:STDOUT: !91 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.c135263f75f7214d:core.Destroy.Core", scope: null, file: !32, line: 16, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !94) +// CHECK:STDOUT: !92 = !DILocalVariable(arg: 1, scope: !91, type: !39) +// CHECK:STDOUT: !93 = !DILocation(line: 16, column: 3, scope: !91) +// CHECK:STDOUT: !94 = !{!92} +// CHECK:STDOUT: !95 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.c135263f75f7214d:core.Destroy.Core", scope: null, file: !32, line: 16, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !98) +// CHECK:STDOUT: !96 = !DILocalVariable(arg: 1, scope: !95, type: !39) +// CHECK:STDOUT: !97 = !DILocation(line: 16, column: 3, scope: !95) +// CHECK:STDOUT: !98 = !{!96} +// CHECK:STDOUT: !99 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.7945ecba5c505fc0:core.Destroy.Core", scope: null, file: !32, line: 15, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !102) +// CHECK:STDOUT: !100 = !DILocalVariable(arg: 1, scope: !99, type: !39) +// CHECK:STDOUT: !101 = !DILocation(line: 15, column: 3, scope: !99) +// CHECK:STDOUT: !102 = !{!100} +// CHECK:STDOUT: !103 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.dc14d4dd21801791:core.Destroy.Core", scope: null, file: !32, line: 15, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !106) +// CHECK:STDOUT: !104 = !DILocalVariable(arg: 1, scope: !103, type: !39) +// CHECK:STDOUT: !105 = !DILocation(line: 15, column: 3, scope: !103) +// CHECK:STDOUT: !106 = !{!104} +// CHECK:STDOUT: !107 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.dc14d4dd21801791:core.Destroy.Core", scope: null, file: !32, line: 15, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !110) +// CHECK:STDOUT: !108 = !DILocalVariable(arg: 1, scope: !107, type: !39) +// CHECK:STDOUT: !109 = !DILocation(line: 15, column: 3, scope: !107) +// CHECK:STDOUT: !110 = !{!108} +// CHECK:STDOUT: !111 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.8815565a27e3ec8c:core.Destroy.Core", scope: null, file: !32, line: 15, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !114) +// CHECK:STDOUT: !112 = !DILocalVariable(arg: 1, scope: !111, type: !39) +// CHECK:STDOUT: !113 = !DILocation(line: 15, column: 3, scope: !111) +// CHECK:STDOUT: !114 = !{!112} +// CHECK:STDOUT: !115 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.8815565a27e3ec8c:core.Destroy.Core", scope: null, file: !32, line: 15, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !118) +// CHECK:STDOUT: !116 = !DILocalVariable(arg: 1, scope: !115, type: !39) +// CHECK:STDOUT: !117 = !DILocation(line: 15, column: 3, scope: !115) +// CHECK:STDOUT: !118 = !{!116} +// CHECK:STDOUT: !119 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.d277540f487baeed:core.Destroy.Core", scope: null, file: !32, line: 14, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !122) +// CHECK:STDOUT: !120 = !DILocalVariable(arg: 1, scope: !119, type: !39) +// CHECK:STDOUT: !121 = !DILocation(line: 14, column: 3, scope: !119) +// CHECK:STDOUT: !122 = !{!120} +// CHECK:STDOUT: !123 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.d277540f487baeed:core.Destroy.Core", scope: null, file: !32, line: 14, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !126) +// CHECK:STDOUT: !124 = !DILocalVariable(arg: 1, scope: !123, type: !39) +// CHECK:STDOUT: !125 = !DILocation(line: 14, column: 3, scope: !123) +// CHECK:STDOUT: !126 = !{!124} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/array/function_param.carbon b/toolchain/lower/testdata/array/function_param.carbon index 3e29c631c0b3..d6a85a8438fe 100644 --- a/toolchain/lower/testdata/array/function_param.carbon +++ b/toolchain/lower/testdata/array/function_param.carbon @@ -42,22 +42,42 @@ fn G() -> i32 { // CHECK:STDOUT: %.loc18_20.7.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_20.3.temp, i32 0, i64 1, !dbg !44 // CHECK:STDOUT: %.loc18_20.10.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_20.3.temp, i32 0, i64 2, !dbg !44 // CHECK:STDOUT: %F.call = call i32 @_CF.Main(ptr @array.loc18_20.15, i32 1), !dbg !45 -// CHECK:STDOUT: call void @"_COp.dc7dedd104b837b2:core.Destroy.Core"(ptr @array), !dbg !44 +// CHECK:STDOUT: call void @"_CSelfDestruct.dc7dedd104b837b2:core.Destroy.Core"(ptr @array), !dbg !44 // CHECK:STDOUT: ret i32 %F.call, !dbg !46 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !47 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !47 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !49 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.dc7dedd104b837b2:core.Destroy.Core"(ptr %self) #0 !dbg !51 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !51 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !53 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !55 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !57 +// CHECK:STDOUT: ret void, !dbg !57 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.dc7dedd104b837b2:core.Destroy.Core"(ptr %self) #0 !dbg !59 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !61 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.dc7dedd104b837b2:core.Destroy.Core"(ptr %self) #0 !dbg !63 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.dc7dedd104b837b2:core.Destroy.Core"(ptr %self), !dbg !65 +// CHECK:STDOUT: ret void, !dbg !65 +// 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: @@ -91,12 +111,24 @@ fn G() -> i32 { // CHECK:STDOUT: !44 = !DILocation(line: 18, column: 12, scope: !41) // CHECK:STDOUT: !45 = !DILocation(line: 18, column: 10, scope: !41) // CHECK:STDOUT: !46 = !DILocation(line: 18, column: 3, scope: !41) -// CHECK:STDOUT: !47 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 18, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !50) +// CHECK:STDOUT: !47 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !18, line: 18, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !50) // CHECK:STDOUT: !48 = !DILocalVariable(arg: 1, scope: !47, type: !20) // CHECK:STDOUT: !49 = !DILocation(line: 18, column: 12, scope: !47) // CHECK:STDOUT: !50 = !{!48} -// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "Op", linkageName: "_COp.dc7dedd104b837b2:core.Destroy.Core", scope: null, file: !18, line: 18, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !54) -// CHECK:STDOUT: !52 = !DILocalVariable(arg: 1, scope: !51, type: !21) +// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 18, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !54) +// CHECK:STDOUT: !52 = !DILocalVariable(arg: 1, scope: !51, type: !20) // CHECK:STDOUT: !53 = !DILocation(line: 18, column: 12, scope: !51) // CHECK:STDOUT: !54 = !{!52} +// CHECK:STDOUT: !55 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 18, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !58) +// CHECK:STDOUT: !56 = !DILocalVariable(arg: 1, scope: !55, type: !20) +// CHECK:STDOUT: !57 = !DILocation(line: 18, column: 12, scope: !55) +// CHECK:STDOUT: !58 = !{!56} +// CHECK:STDOUT: !59 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.dc7dedd104b837b2:core.Destroy.Core", scope: null, file: !18, line: 18, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !62) +// CHECK:STDOUT: !60 = !DILocalVariable(arg: 1, scope: !59, type: !21) +// CHECK:STDOUT: !61 = !DILocation(line: 18, column: 12, scope: !59) +// CHECK:STDOUT: !62 = !{!60} +// CHECK:STDOUT: !63 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.dc7dedd104b837b2:core.Destroy.Core", scope: null, file: !18, line: 18, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !66) +// CHECK:STDOUT: !64 = !DILocalVariable(arg: 1, scope: !63, type: !21) +// CHECK:STDOUT: !65 = !DILocation(line: 18, column: 12, scope: !63) +// CHECK:STDOUT: !66 = !{!64} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/array/iterate.carbon b/toolchain/lower/testdata/array/iterate.carbon index dc04be6baa1a..e33861c04486 100644 --- a/toolchain/lower/testdata/array/iterate.carbon +++ b/toolchain/lower/testdata/array/iterate.carbon @@ -41,179 +41,235 @@ fn F() { // CHECK:STDOUT: %.loc16_43.13.array.index = getelementptr inbounds [6 x i32], ptr %.loc16_43.3.temp, i32 0, i64 3, !dbg !15 // CHECK:STDOUT: %.loc16_43.16.array.index = getelementptr inbounds [6 x i32], ptr %.loc16_43.3.temp, i32 0, i64 4, !dbg !15 // CHECK:STDOUT: %.loc16_43.19.array.index = getelementptr inbounds [6 x i32], ptr %.loc16_43.3.temp, i32 0, i64 5, !dbg !15 -// CHECK:STDOUT: %array_type.as.Iterate.impl.NewCursor.call = call i32 @"_CNewCursor.e163a239f9fa927c:Iterate.Core.b21ad873d2e8cb91"(ptr @array.loc16_43.24), !dbg !20 +// CHECK:STDOUT: %array_type.as.Iterate.impl.NewCursor.call = call i32 @"_CNewCursor.e163a239f9fa927c:Iterate.Core.64c6854216281bef"(ptr @array.loc16_43.24), !dbg !20 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %var), !dbg !20 // CHECK:STDOUT: store i32 %array_type.as.Iterate.impl.NewCursor.call, ptr %var, align 4, !dbg !20 // CHECK:STDOUT: br label %for.next, !dbg !20 // CHECK:STDOUT: // CHECK:STDOUT: for.next: ; preds = %for.body, %entry // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc17_19.5.temp), !dbg !20 -// CHECK:STDOUT: call void @"_CNext.e163a239f9fa927c:Iterate.Core.b21ad873d2e8cb91"(ptr %.loc17_19.5.temp, ptr @array.loc16_43.24, ptr %var), !dbg !20 -// CHECK:STDOUT: %Optional.HasValue.call = call i1 @_CHasValue.Optional.Core.63bc0bf740b17859(ptr %.loc17_19.5.temp), !dbg !20 +// CHECK:STDOUT: call void @"_CNext.e163a239f9fa927c:Iterate.Core.64c6854216281bef"(ptr %.loc17_19.5.temp, ptr @array.loc16_43.24, ptr %var), !dbg !20 +// CHECK:STDOUT: %Optional.HasValue.call = call i1 @_CHasValue.Optional.Core.fc4496a6c25d418b(ptr %.loc17_19.5.temp), !dbg !20 // CHECK:STDOUT: br i1 %Optional.HasValue.call, label %for.body, label %for.done, !dbg !20 // CHECK:STDOUT: // CHECK:STDOUT: for.body: ; preds = %for.next -// CHECK:STDOUT: %Optional.Get.call = call i32 @_CGet.Optional.Core.63bc0bf740b17859(ptr %.loc17_19.5.temp), !dbg !20 +// CHECK:STDOUT: %Optional.Get.call = call i32 @_CGet.Optional.Core.fc4496a6c25d418b(ptr %.loc17_19.5.temp), !dbg !20 // CHECK:STDOUT: call void @_CG.Main(i32 %Optional.Get.call), !dbg !28 -// CHECK:STDOUT: call void @"_COp.1423d794a4867d77:core.Destroy.Core"(ptr %.loc17_19.5.temp), !dbg !20 +// CHECK:STDOUT: call void @"_CSelfDestruct.a8a4e50b707d8bfe:core.Destroy.Core"(ptr %.loc17_19.5.temp), !dbg !20 // CHECK:STDOUT: br label %for.next, !dbg !29 // CHECK:STDOUT: // CHECK:STDOUT: for.done: ; preds = %for.next -// CHECK:STDOUT: call void @"_COp.1423d794a4867d77:core.Destroy.Core"(ptr %.loc17_19.5.temp), !dbg !20 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %var), !dbg !20 -// CHECK:STDOUT: call void @"_COp.1366a4d5330239bd:core.Destroy.Core"(ptr @array), !dbg !15 +// CHECK:STDOUT: call void @"_CSelfDestruct.a8a4e50b707d8bfe:core.Destroy.Core"(ptr %.loc17_19.5.temp), !dbg !20 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %var), !dbg !20 +// CHECK:STDOUT: call void @"_CSelfDestruct.1366a4d5330239bd:core.Destroy.Core"(ptr @array), !dbg !15 // CHECK:STDOUT: ret void, !dbg !30 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: declare void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr) +// CHECK:STDOUT: declare void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr) +// CHECK:STDOUT: +// CHECK:STDOUT: declare void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.1d6a7672bf2f14c6:core.Destroy.Core"(ptr %self) #0 !dbg !31 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !31 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !33 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.c1dffdf44e31057b:core.Destroy.Core"(ptr %self) #0 !dbg !35 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.1d6a7672bf2f14c6:core.Destroy.Core"(ptr %self) #0 !dbg !35 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !37 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.271d79a4f33942b3:core.Destroy.Core"(ptr %self) #0 !dbg !39 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.1d6a7672bf2f14c6:core.Destroy.Core"(ptr %self) #0 !dbg !39 { // CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.1d6a7672bf2f14c6:core.Destroy.Core"(ptr %self), !dbg !41 // CHECK:STDOUT: ret void, !dbg !41 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.aef98596d3a9e1eb:core.Destroy.Core"(ptr %self) #0 !dbg !43 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.51569357b34b54dc:core.Destroy.Core"(ptr %self) #0 !dbg !43 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !45 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.1423d794a4867d77:core.Destroy.Core"(ptr %self) #0 !dbg !47 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.51569357b34b54dc:core.Destroy.Core"(ptr %self) #0 !dbg !47 { // CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.51569357b34b54dc:core.Destroy.Core"(ptr %self), !dbg !49 // CHECK:STDOUT: ret void, !dbg !49 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.1366a4d5330239bd:core.Destroy.Core"(ptr %self) #0 !dbg !51 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.48e0adf639fe7af4:core.Destroy.Core"(ptr %self) #0 !dbg !51 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !53 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f6a63055ea5a1824:core.Destroy.Core"(ptr %self) #0 !dbg !55 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !57 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f6a63055ea5a1824:core.Destroy.Core"(ptr %self) #0 !dbg !59 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f6a63055ea5a1824:core.Destroy.Core"(ptr %self), !dbg !61 +// CHECK:STDOUT: ret void, !dbg !61 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.b7a533f3082ff11b:core.Destroy.Core"(ptr %self) #0 !dbg !63 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !65 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.b7a533f3082ff11b:core.Destroy.Core"(ptr %self) #0 !dbg !67 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.b7a533f3082ff11b:core.Destroy.Core"(ptr %self), !dbg !69 +// CHECK:STDOUT: ret void, !dbg !69 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.a8a4e50b707d8bfe:core.Destroy.Core"(ptr %self) #0 !dbg !71 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !73 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.a8a4e50b707d8bfe:core.Destroy.Core"(ptr %self) #0 !dbg !75 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.a8a4e50b707d8bfe:core.Destroy.Core"(ptr %self), !dbg !77 +// CHECK:STDOUT: ret void, !dbg !77 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.1366a4d5330239bd:core.Destroy.Core"(ptr %self) #0 !dbg !79 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !81 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.1366a4d5330239bd:core.Destroy.Core"(ptr %self) #0 !dbg !83 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.1366a4d5330239bd:core.Destroy.Core"(ptr %self), !dbg !85 +// CHECK:STDOUT: ret void, !dbg !85 +// 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 i32 @"_CNewCursor.e163a239f9fa927c:Iterate.Core.b21ad873d2e8cb91"(ptr %self) #0 !dbg !56 { -// CHECK:STDOUT: ret i32 0, !dbg !61 +// CHECK:STDOUT: define linkonce_odr i32 @"_CNewCursor.e163a239f9fa927c:Iterate.Core.64c6854216281bef"(ptr %self) #0 !dbg !88 { +// CHECK:STDOUT: ret i32 0, !dbg !93 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CNext.e163a239f9fa927c:Iterate.Core.b21ad873d2e8cb91"(ptr sret(<{ i32, i1 }>) %return, ptr %self, ptr %cursor) #0 !dbg !63 { -// CHECK:STDOUT: %1 = load i32, ptr %cursor, align 4, !dbg !71 -// CHECK:STDOUT: %2 = icmp slt i32 %1, 6, !dbg !71 -// CHECK:STDOUT: br i1 %2, label %3, label %7, !dbg !72 +// CHECK:STDOUT: define linkonce_odr void @"_CNext.e163a239f9fa927c:Iterate.Core.64c6854216281bef"(ptr sret(<{ i32, i1 }>) %return, ptr %self, ptr %cursor) #0 !dbg !95 { +// CHECK:STDOUT: %1 = load i32, ptr %cursor, align 4, !dbg !103 +// CHECK:STDOUT: %2 = icmp slt i32 %1, 6, !dbg !103 +// CHECK:STDOUT: br i1 %2, label %3, label %7, !dbg !104 // CHECK:STDOUT: // CHECK:STDOUT: 3: ; preds = %0 -// CHECK:STDOUT: call void @"_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8"(ptr %cursor), !dbg !75 -// CHECK:STDOUT: %4 = load i32, ptr %cursor, align 4, !dbg !78 -// CHECK:STDOUT: %5 = sub i32 %4, 1, !dbg !78 -// CHECK:STDOUT: %array.index = getelementptr inbounds [6 x i32], ptr %self, i32 0, i32 %5, !dbg !76 -// CHECK:STDOUT: %6 = load i32, ptr %array.index, align 4, !dbg !76 -// CHECK:STDOUT: call void @_CSome.Optional.Core.63bc0bf740b17859(ptr %return, i32 %6), !dbg !79 -// CHECK:STDOUT: ret void, !dbg !82 +// CHECK:STDOUT: call void @"_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8"(ptr %cursor), !dbg !107 +// CHECK:STDOUT: %4 = load i32, ptr %cursor, align 4, !dbg !110 +// CHECK:STDOUT: %5 = sub i32 %4, 1, !dbg !110 +// CHECK:STDOUT: %array.index = getelementptr inbounds [6 x i32], ptr %self, i32 0, i32 %5, !dbg !108 +// CHECK:STDOUT: %6 = load i32, ptr %array.index, align 4, !dbg !108 +// CHECK:STDOUT: call void @_CSome.Optional.Core.fc4496a6c25d418b(ptr %return, i32 %6), !dbg !111 +// CHECK:STDOUT: ret void, !dbg !114 // CHECK:STDOUT: // CHECK:STDOUT: 7: ; preds = %0 -// CHECK:STDOUT: call void @_CNone.Optional.Core.63bc0bf740b17859(ptr %return), !dbg !83 -// CHECK:STDOUT: ret void, !dbg !86 +// CHECK:STDOUT: call void @_CNone.Optional.Core.fc4496a6c25d418b(ptr %return), !dbg !115 +// CHECK:STDOUT: ret void, !dbg !118 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.63bc0bf740b17859(ptr %self) #0 !dbg !89 { -// CHECK:STDOUT: %1 = call i1 @"_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.89a3e87df6fdafe1"(ptr %self), !dbg !95 -// CHECK:STDOUT: ret i1 %1, !dbg !96 +// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.fc4496a6c25d418b(ptr %self) #0 !dbg !121 { +// CHECK:STDOUT: %1 = call i1 @"_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %self), !dbg !127 +// CHECK:STDOUT: ret i1 %1, !dbg !128 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CGet.Optional.Core.63bc0bf740b17859(ptr %self) #0 !dbg !98 { -// CHECK:STDOUT: %1 = call i32 @"_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.89a3e87df6fdafe1"(ptr %self), !dbg !104 -// CHECK:STDOUT: ret i32 %1, !dbg !105 +// CHECK:STDOUT: define linkonce_odr i32 @_CGet.Optional.Core.fc4496a6c25d418b(ptr %self) #0 !dbg !130 { +// CHECK:STDOUT: %1 = call i32 @"_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %self), !dbg !136 +// CHECK:STDOUT: ret i32 %1, !dbg !137 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8"(ptr %self) #0 !dbg !108 { -// CHECK:STDOUT: call void @"_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895"(ptr %self, i32 1), !dbg !111 -// CHECK:STDOUT: ret void, !dbg !114 +// CHECK:STDOUT: define linkonce_odr void @"_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8"(ptr %self) #0 !dbg !140 { +// CHECK:STDOUT: call void @"_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895"(ptr %self, i32 1), !dbg !143 +// CHECK:STDOUT: ret void, !dbg !146 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSome.Optional.Core.63bc0bf740b17859(ptr sret(<{ i32, i1 }>) %return, i32 %value) #0 !dbg !116 { -// CHECK:STDOUT: call void @"_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.89a3e87df6fdafe1"(ptr %return, i32 %value), !dbg !121 -// CHECK:STDOUT: ret void, !dbg !122 +// CHECK:STDOUT: define linkonce_odr void @_CSome.Optional.Core.fc4496a6c25d418b(ptr sret(<{ i32, i1 }>) %return, i32 %value) #0 !dbg !148 { +// CHECK:STDOUT: call void @"_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %return, i32 %value), !dbg !153 +// CHECK:STDOUT: ret void, !dbg !154 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CNone.Optional.Core.63bc0bf740b17859(ptr sret(<{ i32, i1 }>) %return) #0 !dbg !124 { -// CHECK:STDOUT: call void @"_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.89a3e87df6fdafe1"(ptr %return), !dbg !127 -// CHECK:STDOUT: ret void, !dbg !128 +// CHECK:STDOUT: define linkonce_odr void @_CNone.Optional.Core.fc4496a6c25d418b(ptr sret(<{ i32, i1 }>) %return) #0 !dbg !156 { +// CHECK:STDOUT: call void @"_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %return), !dbg !159 +// CHECK:STDOUT: ret void, !dbg !160 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @"_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.89a3e87df6fdafe1"(ptr %value) #0 !dbg !129 { -// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %value, i32 0, i32 1, !dbg !134 -// CHECK:STDOUT: %1 = load i8, ptr %has_value, align 1, !dbg !134 -// CHECK:STDOUT: %2 = trunc i8 %1 to i1, !dbg !134 -// CHECK:STDOUT: ret i1 %2, !dbg !135 +// CHECK:STDOUT: define linkonce_odr i1 @"_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %value) #0 !dbg !161 { +// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %value, i32 0, i32 1, !dbg !166 +// CHECK:STDOUT: %1 = load i8, ptr %has_value, align 1, !dbg !166 +// CHECK:STDOUT: %2 = trunc i8 %1 to i1, !dbg !166 +// CHECK:STDOUT: ret i1 %2, !dbg !167 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @"_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.89a3e87df6fdafe1"(ptr %value) #0 !dbg !137 { -// CHECK:STDOUT: %value1 = getelementptr inbounds nuw <{ i32, i1 }>, ptr %value, i32 0, i32 0, !dbg !142 -// CHECK:STDOUT: %1 = load i32, ptr %value1, align 4, !dbg !142 -// CHECK:STDOUT: ret i32 %1, !dbg !143 +// CHECK:STDOUT: define linkonce_odr i32 @"_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %value) #0 !dbg !169 { +// CHECK:STDOUT: %value1 = getelementptr inbounds nuw <{ i32, i1 }>, ptr %value, i32 0, i32 0, !dbg !174 +// CHECK:STDOUT: %1 = load i32, ptr %value1, align 4, !dbg !174 +// CHECK:STDOUT: ret i32 %1, !dbg !175 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define linkonce_odr void @"_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895"(ptr %self, i32 %other) #2 !dbg !145 { -// CHECK:STDOUT: %1 = call i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044"(i32 %other), !dbg !148 -// CHECK:STDOUT: %2 = load i32, ptr %self, align 4, !dbg !149 -// CHECK:STDOUT: %3 = add i32 %2, %1, !dbg !149 -// CHECK:STDOUT: store i32 %3, ptr %self, align 4, !dbg !149 -// CHECK:STDOUT: ret void, !dbg !149 +// CHECK:STDOUT: define linkonce_odr void @"_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895"(ptr %self, i32 %other) #2 !dbg !177 { +// CHECK:STDOUT: %1 = call i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044"(i32 %other), !dbg !180 +// CHECK:STDOUT: %2 = load i32, ptr %self, align 4, !dbg !181 +// CHECK:STDOUT: %3 = add i32 %2, %1, !dbg !181 +// CHECK:STDOUT: store i32 %3, ptr %self, align 4, !dbg !181 +// CHECK:STDOUT: ret void, !dbg !181 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.89a3e87df6fdafe1"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !153 { -// CHECK:STDOUT: %value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 0, !dbg !162 -// CHECK:STDOUT: store i32 %self, ptr %value, align 4, !dbg !162 -// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 1, !dbg !164 -// CHECK:STDOUT: store i8 1, ptr %has_value, align 1, !dbg !164 -// CHECK:STDOUT: ret void, !dbg !165 +// CHECK:STDOUT: define linkonce_odr void @"_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !185 { +// CHECK:STDOUT: %value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 0, !dbg !194 +// CHECK:STDOUT: store i32 %self, ptr %value, align 4, !dbg !194 +// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 1, !dbg !196 +// CHECK:STDOUT: store i8 1, ptr %has_value, align 1, !dbg !196 +// CHECK:STDOUT: ret void, !dbg !197 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.89a3e87df6fdafe1"(ptr sret(<{ i32, i1 }>) %return) #0 !dbg !167 { -// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 1, !dbg !174 -// CHECK:STDOUT: store i8 0, ptr %has_value, align 1, !dbg !174 -// CHECK:STDOUT: ret void, !dbg !175 +// CHECK:STDOUT: define linkonce_odr void @"_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr sret(<{ i32, i1 }>) %return) #0 !dbg !199 { +// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 1, !dbg !206 +// CHECK:STDOUT: store i8 0, ptr %has_value, align 1, !dbg !206 +// CHECK:STDOUT: ret void, !dbg !207 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044"(i32 %self) #0 !dbg !176 { -// CHECK:STDOUT: %1 = call i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self), !dbg !181 -// CHECK:STDOUT: ret i32 %1, !dbg !183 +// CHECK:STDOUT: define linkonce_odr i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044"(i32 %self) #0 !dbg !208 { +// CHECK:STDOUT: %1 = call i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self), !dbg !213 +// CHECK:STDOUT: ret i32 %1, !dbg !215 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self) #0 !dbg !185 { -// CHECK:STDOUT: ret i32 %self, !dbg !191 +// CHECK:STDOUT: define linkonce_odr i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self) #0 !dbg !217 { +// CHECK:STDOUT: ret i32 %self, !dbg !223 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives -// CHECK:STDOUT: uselistorder ptr @"_COp.1423d794a4867d77:core.Destroy.Core", { 1, 0 } +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.a8a4e50b707d8bfe:core.Destroy.Core", { 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 2, 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -247,113 +303,145 @@ fn F() { // CHECK:STDOUT: !28 = !DILocation(line: 18, column: 5, scope: !14) // CHECK:STDOUT: !29 = !DILocation(line: 17, column: 3, scope: !14) // CHECK:STDOUT: !30 = !DILocation(line: 15, column: 1, scope: !14) -// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "Op", linkageName: "_COp.1d6a7672bf2f14c6:core.Destroy.Core", scope: null, file: !4, line: 17, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !34) -// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !31, type: !11) +// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !4, line: 17, type: !8, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !34) +// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !31, type: !6) // CHECK:STDOUT: !33 = !DILocation(line: 17, column: 7, scope: !31) // CHECK:STDOUT: !34 = !{!32} -// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "Op", linkageName: "_COp.c1dffdf44e31057b:core.Destroy.Core", scope: null, file: !4, line: 17, type: !8, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !38) -// CHECK:STDOUT: !36 = !DILocalVariable(arg: 1, scope: !35, type: !6) +// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.1d6a7672bf2f14c6:core.Destroy.Core", scope: null, file: !4, line: 17, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !38) +// CHECK:STDOUT: !36 = !DILocalVariable(arg: 1, scope: !35, type: !11) // CHECK:STDOUT: !37 = !DILocation(line: 17, column: 7, scope: !35) // CHECK:STDOUT: !38 = !{!36} -// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "Op", linkageName: "_COp.271d79a4f33942b3:core.Destroy.Core", scope: null, file: !4, line: 17, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !42) +// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.1d6a7672bf2f14c6:core.Destroy.Core", scope: null, file: !4, line: 17, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !42) // CHECK:STDOUT: !40 = !DILocalVariable(arg: 1, scope: !39, type: !11) // CHECK:STDOUT: !41 = !DILocation(line: 17, column: 7, scope: !39) // CHECK:STDOUT: !42 = !{!40} -// CHECK:STDOUT: !43 = distinct !DISubprogram(name: "Op", linkageName: "_COp.aef98596d3a9e1eb:core.Destroy.Core", scope: null, file: !4, line: 17, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !46) -// CHECK:STDOUT: !44 = !DILocalVariable(arg: 1, scope: !43, type: !11) +// CHECK:STDOUT: !43 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.51569357b34b54dc:core.Destroy.Core", scope: null, file: !4, line: 17, type: !8, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !46) +// CHECK:STDOUT: !44 = !DILocalVariable(arg: 1, scope: !43, type: !6) // CHECK:STDOUT: !45 = !DILocation(line: 17, column: 7, scope: !43) // CHECK:STDOUT: !46 = !{!44} -// CHECK:STDOUT: !47 = distinct !DISubprogram(name: "Op", linkageName: "_COp.1423d794a4867d77:core.Destroy.Core", scope: null, file: !4, line: 17, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !50) -// CHECK:STDOUT: !48 = !DILocalVariable(arg: 1, scope: !47, type: !11) +// CHECK:STDOUT: !47 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.51569357b34b54dc:core.Destroy.Core", scope: null, file: !4, line: 17, type: !8, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !50) +// CHECK:STDOUT: !48 = !DILocalVariable(arg: 1, scope: !47, type: !6) // CHECK:STDOUT: !49 = !DILocation(line: 17, column: 7, scope: !47) // CHECK:STDOUT: !50 = !{!48} -// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "Op", linkageName: "_COp.1366a4d5330239bd:core.Destroy.Core", scope: null, file: !4, line: 16, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !54) +// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.48e0adf639fe7af4:core.Destroy.Core", scope: null, file: !4, line: 17, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !54) // CHECK:STDOUT: !52 = !DILocalVariable(arg: 1, scope: !51, type: !11) -// CHECK:STDOUT: !53 = !DILocation(line: 16, column: 26, scope: !51) +// CHECK:STDOUT: !53 = !DILocation(line: 17, column: 7, scope: !51) // CHECK:STDOUT: !54 = !{!52} -// CHECK:STDOUT: !55 = !DIFile(filename: "{{.*}}/prelude/iterate.carbon", directory: "") -// CHECK:STDOUT: !56 = distinct !DISubprogram(name: "NewCursor", linkageName: "_CNewCursor.e163a239f9fa927c:Iterate.Core.b21ad873d2e8cb91", scope: null, file: !55, line: 23, type: !22, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !62) -// CHECK:STDOUT: !57 = !DILocalVariable(arg: 1, scope: !56, type: !11) -// CHECK:STDOUT: !61 = !DILocation(line: 23, column: 38, scope: !56) -// CHECK:STDOUT: !62 = !{!57} -// CHECK:STDOUT: !63 = distinct !DISubprogram(name: "Next", linkageName: "_CNext.e163a239f9fa927c:Iterate.Core.b21ad873d2e8cb91", scope: null, file: !55, line: 24, type: !24, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !87) +// CHECK:STDOUT: !55 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f6a63055ea5a1824:core.Destroy.Core", scope: null, file: !4, line: 17, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !58) +// CHECK:STDOUT: !56 = !DILocalVariable(arg: 1, scope: !55, type: !11) +// CHECK:STDOUT: !57 = !DILocation(line: 17, column: 7, scope: !55) +// CHECK:STDOUT: !58 = !{!56} +// CHECK:STDOUT: !59 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f6a63055ea5a1824:core.Destroy.Core", scope: null, file: !4, line: 17, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !62) +// CHECK:STDOUT: !60 = !DILocalVariable(arg: 1, scope: !59, type: !11) +// CHECK:STDOUT: !61 = !DILocation(line: 17, column: 7, scope: !59) +// CHECK:STDOUT: !62 = !{!60} +// CHECK:STDOUT: !63 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.b7a533f3082ff11b:core.Destroy.Core", scope: null, file: !4, line: 17, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !66) // CHECK:STDOUT: !64 = !DILocalVariable(arg: 1, scope: !63, type: !11) -// CHECK:STDOUT: !65 = !DILocalVariable(arg: 2, scope: !63, type: !11) -// CHECK:STDOUT: !71 = !DILocation(line: 25, column: 9, scope: !63) -// CHECK:STDOUT: !72 = !DILocation(line: 25, column: 8, scope: !63) -// CHECK:STDOUT: !75 = !DILocation(line: 26, column: 7, scope: !63) -// CHECK:STDOUT: !76 = !DILocation(line: 27, column: 31, scope: !63) -// CHECK:STDOUT: !78 = !DILocation(line: 27, column: 36, scope: !63) -// CHECK:STDOUT: !79 = !DILocation(line: 27, column: 14, scope: !63) -// CHECK:STDOUT: !80 = !{!11, !6} -// CHECK:STDOUT: !81 = !DISubroutineType(types: !80) -// CHECK:STDOUT: !82 = !DILocation(line: 27, column: 7, scope: !63) -// CHECK:STDOUT: !83 = !DILocation(line: 29, column: 14, scope: !63) -// CHECK:STDOUT: !84 = !{!11} -// CHECK:STDOUT: !85 = !DISubroutineType(types: !84) -// CHECK:STDOUT: !86 = !DILocation(line: 29, column: 7, scope: !63) -// CHECK:STDOUT: !87 = !{!64, !65} -// CHECK:STDOUT: !88 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") -// CHECK:STDOUT: !89 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.63bc0bf740b17859", scope: null, file: !88, line: 36, type: !26, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !97) -// CHECK:STDOUT: !90 = !DILocalVariable(arg: 1, scope: !89, type: !11) -// CHECK:STDOUT: !95 = !DILocation(line: 37, column: 12, scope: !89) -// CHECK:STDOUT: !96 = !DILocation(line: 37, column: 5, scope: !89) -// CHECK:STDOUT: !97 = !{!90} -// CHECK:STDOUT: !98 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.63bc0bf740b17859", scope: null, file: !88, line: 39, type: !22, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !106) -// CHECK:STDOUT: !99 = !DILocalVariable(arg: 1, scope: !98, type: !11) -// CHECK:STDOUT: !104 = !DILocation(line: 40, column: 12, scope: !98) -// CHECK:STDOUT: !105 = !DILocation(line: 40, column: 5, scope: !98) -// CHECK:STDOUT: !106 = !{!99} -// CHECK:STDOUT: !107 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "") -// CHECK:STDOUT: !108 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !107, line: 396, type: !8, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !115) -// CHECK:STDOUT: !109 = !DILocalVariable(arg: 1, scope: !108, type: !6) -// CHECK:STDOUT: !111 = !DILocation(line: 398, column: 5, scope: !108) -// CHECK:STDOUT: !112 = !{null, !6, !6} +// CHECK:STDOUT: !65 = !DILocation(line: 17, column: 7, scope: !63) +// CHECK:STDOUT: !66 = !{!64} +// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.b7a533f3082ff11b:core.Destroy.Core", scope: null, file: !4, line: 17, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !70) +// CHECK:STDOUT: !68 = !DILocalVariable(arg: 1, scope: !67, type: !11) +// CHECK:STDOUT: !69 = !DILocation(line: 17, column: 7, scope: !67) +// CHECK:STDOUT: !70 = !{!68} +// CHECK:STDOUT: !71 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.a8a4e50b707d8bfe:core.Destroy.Core", scope: null, file: !4, line: 17, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !74) +// CHECK:STDOUT: !72 = !DILocalVariable(arg: 1, scope: !71, type: !11) +// CHECK:STDOUT: !73 = !DILocation(line: 17, column: 7, scope: !71) +// CHECK:STDOUT: !74 = !{!72} +// CHECK:STDOUT: !75 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.a8a4e50b707d8bfe:core.Destroy.Core", scope: null, file: !4, line: 17, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !78) +// CHECK:STDOUT: !76 = !DILocalVariable(arg: 1, scope: !75, type: !11) +// CHECK:STDOUT: !77 = !DILocation(line: 17, column: 7, scope: !75) +// CHECK:STDOUT: !78 = !{!76} +// CHECK:STDOUT: !79 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.1366a4d5330239bd:core.Destroy.Core", scope: null, file: !4, line: 16, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !82) +// CHECK:STDOUT: !80 = !DILocalVariable(arg: 1, scope: !79, type: !11) +// CHECK:STDOUT: !81 = !DILocation(line: 16, column: 26, scope: !79) +// CHECK:STDOUT: !82 = !{!80} +// CHECK:STDOUT: !83 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.1366a4d5330239bd:core.Destroy.Core", scope: null, file: !4, line: 16, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !86) +// CHECK:STDOUT: !84 = !DILocalVariable(arg: 1, scope: !83, type: !11) +// CHECK:STDOUT: !85 = !DILocation(line: 16, column: 26, scope: !83) +// CHECK:STDOUT: !86 = !{!84} +// CHECK:STDOUT: !87 = !DIFile(filename: "{{.*}}/prelude/iterate.carbon", directory: "") +// CHECK:STDOUT: !88 = distinct !DISubprogram(name: "NewCursor", linkageName: "_CNewCursor.e163a239f9fa927c:Iterate.Core.64c6854216281bef", scope: null, file: !87, line: 23, type: !22, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !94) +// CHECK:STDOUT: !89 = !DILocalVariable(arg: 1, scope: !88, type: !11) +// CHECK:STDOUT: !93 = !DILocation(line: 23, column: 38, scope: !88) +// CHECK:STDOUT: !94 = !{!89} +// CHECK:STDOUT: !95 = distinct !DISubprogram(name: "Next", linkageName: "_CNext.e163a239f9fa927c:Iterate.Core.64c6854216281bef", scope: null, file: !87, line: 24, type: !24, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !119) +// CHECK:STDOUT: !96 = !DILocalVariable(arg: 1, scope: !95, type: !11) +// CHECK:STDOUT: !97 = !DILocalVariable(arg: 2, scope: !95, type: !11) +// CHECK:STDOUT: !103 = !DILocation(line: 25, column: 9, scope: !95) +// CHECK:STDOUT: !104 = !DILocation(line: 25, column: 8, scope: !95) +// CHECK:STDOUT: !107 = !DILocation(line: 26, column: 7, scope: !95) +// CHECK:STDOUT: !108 = !DILocation(line: 27, column: 31, scope: !95) +// CHECK:STDOUT: !110 = !DILocation(line: 27, column: 36, scope: !95) +// CHECK:STDOUT: !111 = !DILocation(line: 27, column: 14, scope: !95) +// CHECK:STDOUT: !112 = !{!11, !6} // CHECK:STDOUT: !113 = !DISubroutineType(types: !112) -// CHECK:STDOUT: !114 = !DILocation(line: 396, column: 3, scope: !108) -// CHECK:STDOUT: !115 = !{!109} -// CHECK:STDOUT: !116 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.63bc0bf740b17859", scope: null, file: !88, line: 33, type: !81, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !123) -// CHECK:STDOUT: !117 = !DILocalVariable(arg: 1, scope: !116, type: !6) -// CHECK:STDOUT: !121 = !DILocation(line: 34, column: 12, scope: !116) -// CHECK:STDOUT: !122 = !DILocation(line: 34, column: 5, scope: !116) -// CHECK:STDOUT: !123 = !{!117} -// CHECK:STDOUT: !124 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.63bc0bf740b17859", scope: null, file: !88, line: 30, type: !85, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !127 = !DILocation(line: 31, column: 12, scope: !124) -// CHECK:STDOUT: !128 = !DILocation(line: 31, column: 5, scope: !124) -// CHECK:STDOUT: !129 = distinct !DISubprogram(name: "Has", linkageName: "_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.89a3e87df6fdafe1", scope: null, file: !88, line: 141, type: !26, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !136) -// CHECK:STDOUT: !130 = !DILocalVariable(arg: 1, scope: !129, type: !11) -// CHECK:STDOUT: !134 = !DILocation(line: 142, column: 12, scope: !129) -// CHECK:STDOUT: !135 = !DILocation(line: 142, column: 5, scope: !129) -// CHECK:STDOUT: !136 = !{!130} -// CHECK:STDOUT: !137 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.89a3e87df6fdafe1", scope: null, file: !88, line: 144, type: !22, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !144) -// CHECK:STDOUT: !138 = !DILocalVariable(arg: 1, scope: !137, type: !11) -// CHECK:STDOUT: !142 = !DILocation(line: 145, column: 12, scope: !137) -// CHECK:STDOUT: !143 = !DILocation(line: 145, column: 5, scope: !137) -// CHECK:STDOUT: !144 = !{!138} -// CHECK:STDOUT: !145 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895", scope: null, file: !107, line: 331, type: !113, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !152) -// CHECK:STDOUT: !146 = !DILocalVariable(arg: 1, scope: !145, type: !6) -// CHECK:STDOUT: !147 = !DILocalVariable(arg: 2, scope: !145, type: !6) -// CHECK:STDOUT: !148 = !DILocation(line: 0, scope: !145) -// CHECK:STDOUT: !149 = !DILocation(line: 331, column: 3, scope: !145) -// CHECK:STDOUT: !150 = !{!6, !6} -// CHECK:STDOUT: !151 = !DISubroutineType(types: !150) -// CHECK:STDOUT: !152 = !{!146, !147} -// CHECK:STDOUT: !153 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.89a3e87df6fdafe1", scope: null, file: !88, line: 131, type: !81, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !166) -// CHECK:STDOUT: !154 = !DILocalVariable(arg: 1, scope: !153, type: !6) -// CHECK:STDOUT: !162 = !DILocation(line: 137, column: 5, scope: !153) -// CHECK:STDOUT: !164 = !DILocation(line: 138, column: 5, scope: !153) -// CHECK:STDOUT: !165 = !DILocation(line: 139, column: 5, scope: !153) -// CHECK:STDOUT: !166 = !{!154} -// CHECK:STDOUT: !167 = distinct !DISubprogram(name: "None", linkageName: "_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.89a3e87df6fdafe1", scope: null, file: !88, line: 125, type: !85, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !174 = !DILocation(line: 128, column: 5, scope: !167) -// CHECK:STDOUT: !175 = !DILocation(line: 129, column: 5, scope: !167) -// CHECK:STDOUT: !176 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044", scope: null, file: !107, line: 64, type: !151, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !184) -// CHECK:STDOUT: !177 = !DILocalVariable(arg: 1, scope: !176, type: !6) -// CHECK:STDOUT: !181 = !DILocation(line: 66, column: 17, scope: !176) -// CHECK:STDOUT: !183 = !DILocation(line: 66, column: 5, scope: !176) -// CHECK:STDOUT: !184 = !{!177} -// CHECK:STDOUT: !185 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !107, line: 59, type: !151, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !192) +// CHECK:STDOUT: !114 = !DILocation(line: 27, column: 7, scope: !95) +// CHECK:STDOUT: !115 = !DILocation(line: 29, column: 14, scope: !95) +// CHECK:STDOUT: !116 = !{!11} +// CHECK:STDOUT: !117 = !DISubroutineType(types: !116) +// CHECK:STDOUT: !118 = !DILocation(line: 29, column: 7, scope: !95) +// CHECK:STDOUT: !119 = !{!96, !97} +// CHECK:STDOUT: !120 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") +// CHECK:STDOUT: !121 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.fc4496a6c25d418b", scope: null, file: !120, line: 36, type: !26, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !129) +// CHECK:STDOUT: !122 = !DILocalVariable(arg: 1, scope: !121, type: !11) +// CHECK:STDOUT: !127 = !DILocation(line: 37, column: 12, scope: !121) +// CHECK:STDOUT: !128 = !DILocation(line: 37, column: 5, scope: !121) +// CHECK:STDOUT: !129 = !{!122} +// CHECK:STDOUT: !130 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.fc4496a6c25d418b", scope: null, file: !120, line: 39, type: !22, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !138) +// CHECK:STDOUT: !131 = !DILocalVariable(arg: 1, scope: !130, type: !11) +// CHECK:STDOUT: !136 = !DILocation(line: 40, column: 12, scope: !130) +// CHECK:STDOUT: !137 = !DILocation(line: 40, column: 5, scope: !130) +// CHECK:STDOUT: !138 = !{!131} +// CHECK:STDOUT: !139 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "") +// CHECK:STDOUT: !140 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !139, line: 396, type: !8, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !147) +// CHECK:STDOUT: !141 = !DILocalVariable(arg: 1, scope: !140, type: !6) +// CHECK:STDOUT: !143 = !DILocation(line: 398, column: 5, scope: !140) +// CHECK:STDOUT: !144 = !{null, !6, !6} +// CHECK:STDOUT: !145 = !DISubroutineType(types: !144) +// CHECK:STDOUT: !146 = !DILocation(line: 396, column: 3, scope: !140) +// CHECK:STDOUT: !147 = !{!141} +// CHECK:STDOUT: !148 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.fc4496a6c25d418b", scope: null, file: !120, line: 33, type: !113, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !155) +// CHECK:STDOUT: !149 = !DILocalVariable(arg: 1, scope: !148, type: !6) +// CHECK:STDOUT: !153 = !DILocation(line: 34, column: 12, scope: !148) +// CHECK:STDOUT: !154 = !DILocation(line: 34, column: 5, scope: !148) +// CHECK:STDOUT: !155 = !{!149} +// CHECK:STDOUT: !156 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.fc4496a6c25d418b", scope: null, file: !120, line: 30, type: !117, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !159 = !DILocation(line: 31, column: 12, scope: !156) +// CHECK:STDOUT: !160 = !DILocation(line: 31, column: 5, scope: !156) +// CHECK:STDOUT: !161 = distinct !DISubprogram(name: "Has", linkageName: "_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f", scope: null, file: !120, line: 141, type: !26, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !168) +// CHECK:STDOUT: !162 = !DILocalVariable(arg: 1, scope: !161, type: !11) +// CHECK:STDOUT: !166 = !DILocation(line: 142, column: 12, scope: !161) +// CHECK:STDOUT: !167 = !DILocation(line: 142, column: 5, scope: !161) +// CHECK:STDOUT: !168 = !{!162} +// CHECK:STDOUT: !169 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f", scope: null, file: !120, line: 144, type: !22, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !176) +// CHECK:STDOUT: !170 = !DILocalVariable(arg: 1, scope: !169, type: !11) +// CHECK:STDOUT: !174 = !DILocation(line: 145, column: 12, scope: !169) +// CHECK:STDOUT: !175 = !DILocation(line: 145, column: 5, scope: !169) +// CHECK:STDOUT: !176 = !{!170} +// CHECK:STDOUT: !177 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895", scope: null, file: !139, line: 331, type: !145, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !184) +// CHECK:STDOUT: !178 = !DILocalVariable(arg: 1, scope: !177, type: !6) +// CHECK:STDOUT: !179 = !DILocalVariable(arg: 2, scope: !177, type: !6) +// CHECK:STDOUT: !180 = !DILocation(line: 0, scope: !177) +// CHECK:STDOUT: !181 = !DILocation(line: 331, column: 3, scope: !177) +// CHECK:STDOUT: !182 = !{!6, !6} +// CHECK:STDOUT: !183 = !DISubroutineType(types: !182) +// CHECK:STDOUT: !184 = !{!178, !179} +// CHECK:STDOUT: !185 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f", scope: null, file: !120, line: 131, type: !113, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !198) // CHECK:STDOUT: !186 = !DILocalVariable(arg: 1, scope: !185, type: !6) -// CHECK:STDOUT: !191 = !DILocation(line: 59, column: 28, scope: !185) -// CHECK:STDOUT: !192 = !{!186} +// CHECK:STDOUT: !194 = !DILocation(line: 137, column: 5, scope: !185) +// CHECK:STDOUT: !196 = !DILocation(line: 138, column: 5, scope: !185) +// CHECK:STDOUT: !197 = !DILocation(line: 139, column: 5, scope: !185) +// CHECK:STDOUT: !198 = !{!186} +// CHECK:STDOUT: !199 = distinct !DISubprogram(name: "None", linkageName: "_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f", scope: null, file: !120, line: 125, type: !117, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !206 = !DILocation(line: 128, column: 5, scope: !199) +// CHECK:STDOUT: !207 = !DILocation(line: 129, column: 5, scope: !199) +// CHECK:STDOUT: !208 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044", scope: null, file: !139, line: 64, type: !183, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !216) +// CHECK:STDOUT: !209 = !DILocalVariable(arg: 1, scope: !208, type: !6) +// CHECK:STDOUT: !213 = !DILocation(line: 66, column: 17, scope: !208) +// CHECK:STDOUT: !215 = !DILocation(line: 66, column: 5, scope: !208) +// CHECK:STDOUT: !216 = !{!209} +// CHECK:STDOUT: !217 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !139, line: 59, type: !183, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !224) +// CHECK:STDOUT: !218 = !DILocalVariable(arg: 1, scope: !217, type: !6) +// CHECK:STDOUT: !223 = !DILocation(line: 59, column: 28, scope: !217) +// CHECK:STDOUT: !224 = !{!218} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/array/layout.carbon b/toolchain/lower/testdata/array/layout.carbon index 160f3de4f894..cd718b9a874d 100644 --- a/toolchain/lower/testdata/array/layout.carbon +++ b/toolchain/lower/testdata/array/layout.carbon @@ -50,28 +50,61 @@ var c: array(Core.Int(257), 5) = (1, 2, 3, 4, 5); // CHECK:STDOUT: %.loc12_13.array.index = getelementptr inbounds [3 x <{ <{ ptr, i32 }>, [4 x i8] }>], ptr %v.var, i32 0, i32 2, !dbg !37 // CHECK:STDOUT: %.loc12_14.b = getelementptr inbounds nuw <{ ptr, i32 }>, ptr %.loc12_13.array.index, i32 0, i32 1, !dbg !37 // CHECK:STDOUT: call void @_CCheck.Main(ptr %.loc12_14.b), !dbg !39 -// CHECK:STDOUT: call void @"_COp.9e05708f03266b13:core.Destroy.Core"(ptr %v.var), !dbg !29 +// CHECK:STDOUT: call void @"_CSelfDestruct.9e05708f03266b13:core.Destroy.Core"(ptr %v.var), !dbg !29 // CHECK:STDOUT: ret void, !dbg !40 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !41 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.8436f795915f0543:core.Destroy.Core"(ptr %self) #0 !dbg !41 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !43 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.0bcbe81284b6bcb5:core.Destroy.Core"(ptr %self) #0 !dbg !45 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !45 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !47 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.9e05708f03266b13:core.Destroy.Core"(ptr %self) #0 !dbg !49 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !49 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !51 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !53 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !55 +// CHECK:STDOUT: ret void, !dbg !55 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.0bcbe81284b6bcb5:core.Destroy.Core"(ptr %self) #0 !dbg !57 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !59 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.0bcbe81284b6bcb5:core.Destroy.Core"(ptr %self) #0 !dbg !61 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.0bcbe81284b6bcb5:core.Destroy.Core"(ptr %self), !dbg !63 +// CHECK:STDOUT: ret void, !dbg !63 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.9e05708f03266b13:core.Destroy.Core"(ptr %self) #0 !dbg !65 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !67 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.9e05708f03266b13:core.Destroy.Core"(ptr %self) #0 !dbg !69 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.9e05708f03266b13:core.Destroy.Core"(ptr %self), !dbg !71 +// CHECK:STDOUT: ret void, !dbg !71 +// 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: @@ -102,18 +135,38 @@ var c: array(Core.Int(257), 5) = (1, 2, 3, 4, 5); // CHECK:STDOUT: !37 = !DILocation(line: 12, column: 10, scope: !28) // CHECK:STDOUT: !39 = !DILocation(line: 12, column: 3, scope: !28) // CHECK:STDOUT: !40 = !DILocation(line: 5, column: 1, scope: !28) -// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 9, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !44) -// CHECK:STDOUT: !42 = !DILocalVariable(arg: 1, scope: !41, type: !20) +// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.8436f795915f0543:core.Destroy.Core", scope: null, file: !18, line: 9, type: !23, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !44) +// CHECK:STDOUT: !42 = !DILocalVariable(arg: 1, scope: !41, type: !21) // CHECK:STDOUT: !43 = !DILocation(line: 9, column: 3, scope: !41) // CHECK:STDOUT: !44 = !{!42} -// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "Op", linkageName: "_COp.0bcbe81284b6bcb5:core.Destroy.Core", scope: null, file: !18, line: 9, type: !23, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !48) -// CHECK:STDOUT: !46 = !DILocalVariable(arg: 1, scope: !45, type: !21) +// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !18, line: 9, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !48) +// CHECK:STDOUT: !46 = !DILocalVariable(arg: 1, scope: !45, type: !20) // CHECK:STDOUT: !47 = !DILocation(line: 9, column: 3, scope: !45) // CHECK:STDOUT: !48 = !{!46} -// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "Op", linkageName: "_COp.9e05708f03266b13:core.Destroy.Core", scope: null, file: !18, line: 9, type: !23, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !52) -// CHECK:STDOUT: !50 = !DILocalVariable(arg: 1, scope: !49, type: !21) +// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 9, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !52) +// CHECK:STDOUT: !50 = !DILocalVariable(arg: 1, scope: !49, type: !20) // CHECK:STDOUT: !51 = !DILocation(line: 9, column: 3, scope: !49) // CHECK:STDOUT: !52 = !{!50} +// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 9, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !56) +// CHECK:STDOUT: !54 = !DILocalVariable(arg: 1, scope: !53, type: !20) +// CHECK:STDOUT: !55 = !DILocation(line: 9, column: 3, scope: !53) +// CHECK:STDOUT: !56 = !{!54} +// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.0bcbe81284b6bcb5:core.Destroy.Core", scope: null, file: !18, line: 9, type: !23, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !60) +// CHECK:STDOUT: !58 = !DILocalVariable(arg: 1, scope: !57, type: !21) +// CHECK:STDOUT: !59 = !DILocation(line: 9, column: 3, scope: !57) +// CHECK:STDOUT: !60 = !{!58} +// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.0bcbe81284b6bcb5:core.Destroy.Core", scope: null, file: !18, line: 9, type: !23, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !64) +// CHECK:STDOUT: !62 = !DILocalVariable(arg: 1, scope: !61, type: !21) +// CHECK:STDOUT: !63 = !DILocation(line: 9, column: 3, scope: !61) +// CHECK:STDOUT: !64 = !{!62} +// CHECK:STDOUT: !65 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.9e05708f03266b13:core.Destroy.Core", scope: null, file: !18, line: 9, type: !23, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !68) +// CHECK:STDOUT: !66 = !DILocalVariable(arg: 1, scope: !65, type: !21) +// CHECK:STDOUT: !67 = !DILocation(line: 9, column: 3, scope: !65) +// CHECK:STDOUT: !68 = !{!66} +// CHECK:STDOUT: !69 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.9e05708f03266b13:core.Destroy.Core", scope: null, file: !18, line: 9, type: !23, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !72) +// CHECK:STDOUT: !70 = !DILocalVariable(arg: 1, scope: !69, type: !21) +// CHECK:STDOUT: !71 = !DILocation(line: 9, column: 3, scope: !69) +// CHECK:STDOUT: !72 = !{!70} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'constant_with_padding.carbon' @@ -124,10 +177,10 @@ var c: array(Core.Int(257), 5) = (1, 2, 3, 4, 5); // CHECK:STDOUT: @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @_C__global_init.Main, ptr null }] // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define internal void @_C__global_init.Main() #0 !dbg !56 { +// CHECK:STDOUT: define internal void @_C__global_init.Main() #0 !dbg !76 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 32 @_Cc.Main, ptr align 32 @array.loc3_1, i64 320, i1 false), !dbg !58 -// CHECK:STDOUT: ret void, !dbg !59 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 32 @_Cc.Main, ptr align 32 @array.loc3_1, i64 320, i1 false), !dbg !78 +// CHECK:STDOUT: ret void, !dbg !79 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -136,16 +189,16 @@ var c: array(Core.Int(257), 5) = (1, 2, 3, 4, 5); // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!54} +// CHECK:STDOUT: !llvm.dbg.cu = !{!74} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !24 = !{null} // CHECK:STDOUT: !25 = !DISubroutineType(types: !24) -// CHECK:STDOUT: !53 = !DIFile(filename: "constant_with_padding.carbon", directory: "") -// CHECK:STDOUT: !54 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !53, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !56 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !53, type: !25, spFlags: DISPFlagDefinition, unit: !54) -// CHECK:STDOUT: !58 = !DILocation(line: 3, column: 1, scope: !56) -// CHECK:STDOUT: !59 = !DILocation(line: 0, scope: !56) +// CHECK:STDOUT: !73 = !DIFile(filename: "constant_with_padding.carbon", directory: "") +// CHECK:STDOUT: !74 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !73, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !76 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !73, type: !25, spFlags: DISPFlagDefinition, unit: !74) +// CHECK:STDOUT: !78 = !DILocation(line: 3, column: 1, scope: !76) +// CHECK:STDOUT: !79 = !DILocation(line: 0, scope: !76) // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/builtins/char.carbon b/toolchain/lower/testdata/builtins/char.carbon index c254264dd0f9..42381d7c199c 100644 --- a/toolchain/lower/testdata/builtins/char.carbon +++ b/toolchain/lower/testdata/builtins/char.carbon @@ -30,22 +30,42 @@ fn Example() -> char { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !14 // CHECK:STDOUT: store i8 97, ptr %c.var, align 1, !dbg !14 // CHECK:STDOUT: %.loc6 = load i8, ptr %c.var, align 1, !dbg !16 -// CHECK:STDOUT: call void @"_COp.8839c9ace2be9137:core.Destroy.Core"(ptr %c.var), !dbg !14 +// CHECK:STDOUT: call void @"_CSelfDestruct.8839c9ace2be9137:core.Destroy.Core"(ptr %c.var), !dbg !14 // CHECK:STDOUT: ret i8 %.loc6, !dbg !17 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.be60742f00557eec:core.Destroy.Core"(ptr %self) #0 !dbg !18 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.04514f1c5a56b0cb:core.Destroy.Core"(ptr %self) #0 !dbg !18 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !20 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.8839c9ace2be9137:core.Destroy.Core"(ptr %self) #0 !dbg !22 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.be60742f00557eec:core.Destroy.Core"(ptr %self) #0 !dbg !22 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !24 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.be60742f00557eec:core.Destroy.Core"(ptr %self) #0 !dbg !26 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.be60742f00557eec:core.Destroy.Core"(ptr %self), !dbg !28 +// CHECK:STDOUT: ret void, !dbg !28 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.8839c9ace2be9137:core.Destroy.Core"(ptr %self) #0 !dbg !30 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !32 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.8839c9ace2be9137:core.Destroy.Core"(ptr %self) #0 !dbg !34 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.8839c9ace2be9137:core.Destroy.Core"(ptr %self), !dbg !36 +// CHECK:STDOUT: ret void, !dbg !36 +// 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: @@ -68,12 +88,24 @@ fn Example() -> char { // CHECK:STDOUT: !14 = !DILocation(line: 5, column: 3, scope: !11) // CHECK:STDOUT: !16 = !DILocation(line: 6, column: 10, scope: !11) // CHECK:STDOUT: !17 = !DILocation(line: 6, column: 3, scope: !11) -// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "Op", linkageName: "_COp.be60742f00557eec:core.Destroy.Core", scope: null, file: !4, line: 5, type: !10, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !21) +// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.04514f1c5a56b0cb:core.Destroy.Core", scope: null, file: !4, line: 5, type: !10, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !21) // CHECK:STDOUT: !19 = !DILocalVariable(arg: 1, scope: !18, type: !6) // CHECK:STDOUT: !20 = !DILocation(line: 5, column: 3, scope: !18) // CHECK:STDOUT: !21 = !{!19} -// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "Op", linkageName: "_COp.8839c9ace2be9137:core.Destroy.Core", scope: null, file: !4, line: 5, type: !10, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !25) +// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.be60742f00557eec:core.Destroy.Core", scope: null, file: !4, line: 5, type: !10, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !25) // CHECK:STDOUT: !23 = !DILocalVariable(arg: 1, scope: !22, type: !6) // CHECK:STDOUT: !24 = !DILocation(line: 5, column: 3, scope: !22) // CHECK:STDOUT: !25 = !{!23} +// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.be60742f00557eec:core.Destroy.Core", scope: null, file: !4, line: 5, type: !10, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !29) +// CHECK:STDOUT: !27 = !DILocalVariable(arg: 1, scope: !26, type: !6) +// CHECK:STDOUT: !28 = !DILocation(line: 5, column: 3, scope: !26) +// CHECK:STDOUT: !29 = !{!27} +// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.8839c9ace2be9137:core.Destroy.Core", scope: null, file: !4, line: 5, type: !10, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !33) +// CHECK:STDOUT: !31 = !DILocalVariable(arg: 1, scope: !30, type: !6) +// CHECK:STDOUT: !32 = !DILocation(line: 5, column: 3, scope: !30) +// CHECK:STDOUT: !33 = !{!31} +// CHECK:STDOUT: !34 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.8839c9ace2be9137:core.Destroy.Core", scope: null, file: !4, line: 5, type: !10, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !37) +// CHECK:STDOUT: !35 = !DILocalVariable(arg: 1, scope: !34, type: !6) +// CHECK:STDOUT: !36 = !DILocation(line: 5, column: 3, scope: !34) +// CHECK:STDOUT: !37 = !{!35} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/builtins/cpp.carbon b/toolchain/lower/testdata/builtins/cpp.carbon index 99551844067f..99f827ec26a9 100644 --- a/toolchain/lower/testdata/builtins/cpp.carbon +++ b/toolchain/lower/testdata/builtins/cpp.carbon @@ -48,69 +48,109 @@ fn Test() { // CHECK:STDOUT: @array = internal constant [4 x i32] [i32 1, i32 2, i32 3, i32 4] // CHECK:STDOUT: @array.loc25_52.18 = internal constant [4 x i32] [i32 1, i32 2, i32 3, i32 4] // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.d088c7eb746488be:core.Destroy.Core"(ptr %self) #0 !dbg !16 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !18 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: declare void @_CTakePointerPointer.Main(ptr) // CHECK:STDOUT: // CHECK:STDOUT: declare void @_CTakePointerSize.Main(ptr) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CTest.Main() #0 !dbg !15 { +// CHECK:STDOUT: define void @_CTest.Main() #0 !dbg !20 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc25_53.1.temp = alloca [16 x i8], align 8, !dbg !16 -// CHECK:STDOUT: %.loc25_52.3.temp = alloca [4 x i32], align 4, !dbg !17 -// CHECK:STDOUT: %.loc26_47.1.temp = alloca [16 x i8], align 8, !dbg !19 -// CHECK:STDOUT: %.loc26_46.3.temp = alloca [4 x i32], align 4, !dbg !20 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc25_53.1.temp), !dbg !16 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc25_52.3.temp), !dbg !17 -// CHECK:STDOUT: %.loc25_52.4.array.index = getelementptr inbounds [4 x i32], ptr %.loc25_52.3.temp, i32 0, i64 0, !dbg !17 -// CHECK:STDOUT: %.loc25_52.7.array.index = getelementptr inbounds [4 x i32], ptr %.loc25_52.3.temp, i32 0, i64 1, !dbg !17 -// CHECK:STDOUT: %.loc25_52.10.array.index = getelementptr inbounds [4 x i32], ptr %.loc25_52.3.temp, i32 0, i64 2, !dbg !17 -// CHECK:STDOUT: %.loc25_52.13.array.index = getelementptr inbounds [4 x i32], ptr %.loc25_52.3.temp, i32 0, i64 3, !dbg !17 -// CHECK:STDOUT: %MakePointerPointer.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %.loc25_53.1.temp, i32 0, i32 0, !dbg !16 -// CHECK:STDOUT: store ptr @array.loc25_52.18, ptr %MakePointerPointer.call.init_list.begin, align 8, !dbg !16 -// CHECK:STDOUT: %MakePointerPointer.call.init_list.end = getelementptr inbounds nuw [16 x i8], ptr %.loc25_53.1.temp, i32 0, i32 8, !dbg !16 -// CHECK:STDOUT: store ptr getelementptr inbounds ([4 x i32], ptr @array.loc25_52.18, i32 1), ptr %MakePointerPointer.call.init_list.end, align 8, !dbg !16 -// CHECK:STDOUT: call void @_CTakePointerPointer.Main(ptr %.loc25_53.1.temp), !dbg !18 -// CHECK:STDOUT: call void @"_COp.88cc3346b7991af5:core.Destroy.Core"(ptr @array), !dbg !17 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc26_47.1.temp), !dbg !19 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc26_46.3.temp), !dbg !20 -// CHECK:STDOUT: %.loc26_46.4.array.index = getelementptr inbounds [4 x i32], ptr %.loc26_46.3.temp, i32 0, i64 0, !dbg !20 -// CHECK:STDOUT: %.loc26_46.7.array.index = getelementptr inbounds [4 x i32], ptr %.loc26_46.3.temp, i32 0, i64 1, !dbg !20 -// CHECK:STDOUT: %.loc26_46.10.array.index = getelementptr inbounds [4 x i32], ptr %.loc26_46.3.temp, i32 0, i64 2, !dbg !20 -// CHECK:STDOUT: %.loc26_46.13.array.index = getelementptr inbounds [4 x i32], ptr %.loc26_46.3.temp, i32 0, i64 3, !dbg !20 -// CHECK:STDOUT: %MakePointerSize.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %.loc26_47.1.temp, i32 0, i32 0, !dbg !19 -// CHECK:STDOUT: store ptr @array.loc25_52.18, ptr %MakePointerSize.call.init_list.begin, align 8, !dbg !19 -// CHECK:STDOUT: %MakePointerSize.call.init_list.size = getelementptr inbounds nuw [16 x i8], ptr %.loc26_47.1.temp, i32 0, i32 8, !dbg !19 -// CHECK:STDOUT: store i64 4, ptr %MakePointerSize.call.init_list.size, align 8, !dbg !19 -// CHECK:STDOUT: call void @_CTakePointerSize.Main(ptr %.loc26_47.1.temp), !dbg !21 -// CHECK:STDOUT: call void @"_COp.88cc3346b7991af5:core.Destroy.Core"(ptr @array), !dbg !20 -// CHECK:STDOUT: ret void, !dbg !22 +// CHECK:STDOUT: %.loc25_53.1.temp = alloca [16 x i8], align 8, !dbg !21 +// CHECK:STDOUT: %.loc25_52.3.temp = alloca [4 x i32], align 4, !dbg !22 +// CHECK:STDOUT: %.loc26_47.1.temp = alloca [16 x i8], align 8, !dbg !24 +// CHECK:STDOUT: %.loc26_46.3.temp = alloca [4 x i32], align 4, !dbg !25 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc25_53.1.temp), !dbg !21 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc25_52.3.temp), !dbg !22 +// CHECK:STDOUT: %.loc25_52.4.array.index = getelementptr inbounds [4 x i32], ptr %.loc25_52.3.temp, i32 0, i64 0, !dbg !22 +// CHECK:STDOUT: %.loc25_52.7.array.index = getelementptr inbounds [4 x i32], ptr %.loc25_52.3.temp, i32 0, i64 1, !dbg !22 +// CHECK:STDOUT: %.loc25_52.10.array.index = getelementptr inbounds [4 x i32], ptr %.loc25_52.3.temp, i32 0, i64 2, !dbg !22 +// CHECK:STDOUT: %.loc25_52.13.array.index = getelementptr inbounds [4 x i32], ptr %.loc25_52.3.temp, i32 0, i64 3, !dbg !22 +// CHECK:STDOUT: %MakePointerPointer.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %.loc25_53.1.temp, i32 0, i32 0, !dbg !21 +// CHECK:STDOUT: store ptr @array.loc25_52.18, ptr %MakePointerPointer.call.init_list.begin, align 8, !dbg !21 +// CHECK:STDOUT: %MakePointerPointer.call.init_list.end = getelementptr inbounds nuw [16 x i8], ptr %.loc25_53.1.temp, i32 0, i32 8, !dbg !21 +// CHECK:STDOUT: store ptr getelementptr inbounds ([4 x i32], ptr @array.loc25_52.18, i32 1), ptr %MakePointerPointer.call.init_list.end, align 8, !dbg !21 +// CHECK:STDOUT: call void @_CTakePointerPointer.Main(ptr %.loc25_53.1.temp), !dbg !23 +// CHECK:STDOUT: call void @"_CSelfDestruct.f2bbdd6ca1ad449b:core.Destroy.Core"(ptr %.loc25_53.1.temp), !dbg !21 +// CHECK:STDOUT: call void @"_CSelfDestruct.88cc3346b7991af5:core.Destroy.Core"(ptr @array), !dbg !22 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc26_47.1.temp), !dbg !24 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc26_46.3.temp), !dbg !25 +// CHECK:STDOUT: %.loc26_46.4.array.index = getelementptr inbounds [4 x i32], ptr %.loc26_46.3.temp, i32 0, i64 0, !dbg !25 +// CHECK:STDOUT: %.loc26_46.7.array.index = getelementptr inbounds [4 x i32], ptr %.loc26_46.3.temp, i32 0, i64 1, !dbg !25 +// CHECK:STDOUT: %.loc26_46.10.array.index = getelementptr inbounds [4 x i32], ptr %.loc26_46.3.temp, i32 0, i64 2, !dbg !25 +// CHECK:STDOUT: %.loc26_46.13.array.index = getelementptr inbounds [4 x i32], ptr %.loc26_46.3.temp, i32 0, i64 3, !dbg !25 +// CHECK:STDOUT: %MakePointerSize.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %.loc26_47.1.temp, i32 0, i32 0, !dbg !24 +// CHECK:STDOUT: store ptr @array.loc25_52.18, ptr %MakePointerSize.call.init_list.begin, align 8, !dbg !24 +// CHECK:STDOUT: %MakePointerSize.call.init_list.size = getelementptr inbounds nuw [16 x i8], ptr %.loc26_47.1.temp, i32 0, i32 8, !dbg !24 +// CHECK:STDOUT: store i64 4, ptr %MakePointerSize.call.init_list.size, align 8, !dbg !24 +// CHECK:STDOUT: call void @_CTakePointerSize.Main(ptr %.loc26_47.1.temp), !dbg !26 +// CHECK:STDOUT: call void @"_CSelfDestruct.f6ab4fc1968c35c6:core.Destroy.Core"(ptr %.loc26_47.1.temp), !dbg !24 +// CHECK:STDOUT: call void @"_CSelfDestruct.88cc3346b7991af5:core.Destroy.Core"(ptr @array), !dbg !25 +// CHECK:STDOUT: ret void, !dbg !27 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !23 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f2bbdd6ca1ad449b:core.Destroy.Core"(ptr %self) #0 !dbg !28 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !25 +// CHECK:STDOUT: ret void, !dbg !30 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.88cc3346b7991af5:core.Destroy.Core"(ptr %self) #0 !dbg !27 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !32 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !29 +// CHECK:STDOUT: ret void, !dbg !34 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !36 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !38 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !40 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !42 +// CHECK:STDOUT: ret void, !dbg !42 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.88cc3346b7991af5:core.Destroy.Core"(ptr %self) #0 !dbg !44 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !46 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.88cc3346b7991af5:core.Destroy.Core"(ptr %self) #0 !dbg !48 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.88cc3346b7991af5:core.Destroy.Core"(ptr %self), !dbg !50 +// CHECK:STDOUT: ret void, !dbg !50 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f6ab4fc1968c35c6:core.Destroy.Core"(ptr %self) #0 !dbg !52 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !54 // 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: ; uselistorder directives -// CHECK:STDOUT: uselistorder ptr @"_COp.88cc3346b7991af5:core.Destroy.Core", { 1, 0 } +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.88cc3346b7991af5:core.Destroy.Core", { 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 3, 2, 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!5} -// CHECK:STDOUT: !llvm.module.flags = !{!31, !32, !33, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!38} +// CHECK:STDOUT: !llvm.module.flags = !{!56, !57, !58, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!63} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -124,28 +164,53 @@ fn Test() { // CHECK:STDOUT: !12 = !DISubroutineType(types: !11) // CHECK:STDOUT: !13 = !{null, !6} // CHECK:STDOUT: !14 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "Test", linkageName: "_CTest.Main", scope: null, file: !4, line: 24, type: !12, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !16 = !DILocation(line: 25, column: 22, scope: !15) -// CHECK:STDOUT: !17 = !DILocation(line: 25, column: 41, scope: !15) -// CHECK:STDOUT: !18 = !DILocation(line: 25, column: 3, scope: !15) -// CHECK:STDOUT: !19 = !DILocation(line: 26, column: 19, scope: !15) -// CHECK:STDOUT: !20 = !DILocation(line: 26, column: 35, scope: !15) -// CHECK:STDOUT: !21 = !DILocation(line: 26, column: 3, scope: !15) -// CHECK:STDOUT: !22 = !DILocation(line: 24, column: 1, scope: !15) -// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 25, type: !14, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !26) -// CHECK:STDOUT: !24 = !DILocalVariable(arg: 1, scope: !23, type: !6) -// CHECK:STDOUT: !25 = !DILocation(line: 25, column: 41, scope: !23) -// CHECK:STDOUT: !26 = !{!24} -// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "Op", linkageName: "_COp.88cc3346b7991af5:core.Destroy.Core", scope: null, file: !4, line: 25, type: !10, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !30) -// CHECK:STDOUT: !28 = !DILocalVariable(arg: 1, scope: !27, type: !8) -// CHECK:STDOUT: !29 = !DILocation(line: 25, column: 41, scope: !27) -// CHECK:STDOUT: !30 = !{!28} -// CHECK:STDOUT: !31 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !32 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !33 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !34 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !35 = !{!"omnipotent char", !34, i64 0} -// CHECK:STDOUT: !36 = !{!"int", !35, i64 0} -// CHECK:STDOUT: !37 = !{!"__libc_errno", !36, i64 0} -// CHECK:STDOUT: !38 = !{!37, !36, i64 0} +// CHECK:STDOUT: !15 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") +// CHECK:STDOUT: !16 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.d088c7eb746488be:core.Destroy.Core", scope: null, file: !15, line: 164, type: !10, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !19) +// CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !16, type: !8) +// CHECK:STDOUT: !18 = !DILocation(line: 164, column: 19, scope: !16) +// CHECK:STDOUT: !19 = !{!17} +// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "Test", linkageName: "_CTest.Main", scope: null, file: !4, line: 24, type: !12, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !21 = !DILocation(line: 25, column: 22, scope: !20) +// CHECK:STDOUT: !22 = !DILocation(line: 25, column: 41, scope: !20) +// CHECK:STDOUT: !23 = !DILocation(line: 25, column: 3, scope: !20) +// CHECK:STDOUT: !24 = !DILocation(line: 26, column: 19, scope: !20) +// CHECK:STDOUT: !25 = !DILocation(line: 26, column: 35, scope: !20) +// CHECK:STDOUT: !26 = !DILocation(line: 26, column: 3, scope: !20) +// CHECK:STDOUT: !27 = !DILocation(line: 24, column: 1, scope: !20) +// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f2bbdd6ca1ad449b:core.Destroy.Core", scope: null, file: !4, line: 25, type: !10, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !31) +// CHECK:STDOUT: !29 = !DILocalVariable(arg: 1, scope: !28, type: !8) +// CHECK:STDOUT: !30 = !DILocation(line: 25, column: 22, scope: !28) +// CHECK:STDOUT: !31 = !{!29} +// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !4, line: 25, type: !14, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !35) +// CHECK:STDOUT: !33 = !DILocalVariable(arg: 1, scope: !32, type: !6) +// CHECK:STDOUT: !34 = !DILocation(line: 25, column: 41, scope: !32) +// CHECK:STDOUT: !35 = !{!33} +// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 25, type: !14, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !39) +// CHECK:STDOUT: !37 = !DILocalVariable(arg: 1, scope: !36, type: !6) +// CHECK:STDOUT: !38 = !DILocation(line: 25, column: 41, scope: !36) +// CHECK:STDOUT: !39 = !{!37} +// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 25, type: !14, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !43) +// CHECK:STDOUT: !41 = !DILocalVariable(arg: 1, scope: !40, type: !6) +// CHECK:STDOUT: !42 = !DILocation(line: 25, column: 41, scope: !40) +// CHECK:STDOUT: !43 = !{!41} +// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.88cc3346b7991af5:core.Destroy.Core", scope: null, file: !4, line: 25, type: !10, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !47) +// CHECK:STDOUT: !45 = !DILocalVariable(arg: 1, scope: !44, type: !8) +// CHECK:STDOUT: !46 = !DILocation(line: 25, column: 41, scope: !44) +// CHECK:STDOUT: !47 = !{!45} +// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.88cc3346b7991af5:core.Destroy.Core", scope: null, file: !4, line: 25, type: !10, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !51) +// CHECK:STDOUT: !49 = !DILocalVariable(arg: 1, scope: !48, type: !8) +// CHECK:STDOUT: !50 = !DILocation(line: 25, column: 41, scope: !48) +// CHECK:STDOUT: !51 = !{!49} +// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f6ab4fc1968c35c6:core.Destroy.Core", scope: null, file: !4, line: 26, type: !10, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !55) +// CHECK:STDOUT: !53 = !DILocalVariable(arg: 1, scope: !52, type: !8) +// CHECK:STDOUT: !54 = !DILocation(line: 26, column: 19, scope: !52) +// CHECK:STDOUT: !55 = !{!53} +// CHECK:STDOUT: !56 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !57 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !58 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !59 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !60 = !{!"omnipotent char", !59, i64 0} +// CHECK:STDOUT: !61 = !{!"int", !60, i64 0} +// CHECK:STDOUT: !62 = !{!"__libc_errno", !61, i64 0} +// CHECK:STDOUT: !63 = !{!62, !61, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/builtins/maybe_unformed.carbon b/toolchain/lower/testdata/builtins/maybe_unformed.carbon index f52e4d110e0e..99a08d01ec63 100644 --- a/toolchain/lower/testdata/builtins/maybe_unformed.carbon +++ b/toolchain/lower/testdata/builtins/maybe_unformed.carbon @@ -90,85 +90,132 @@ fn PassAdapterBool() { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc28_21.1.temp), !dbg !61 // CHECK:STDOUT: call void @_CMakeBool.Main(ptr %.loc28_21.1.temp), !dbg !61 // CHECK:STDOUT: call void @_CTakeBool.Main(ptr %.loc28_21.1.temp), !dbg !62 -// CHECK:STDOUT: call void @"_COp.2ec8e1132c6ccd4f:core.Destroy.Core"(ptr %.loc28_21.1.temp), !dbg !61 +// CHECK:STDOUT: call void @"_CSelfDestruct.2ec8e1132c6ccd4f:core.Destroy.Core"(ptr %.loc28_21.1.temp), !dbg !61 // CHECK:STDOUT: ret void, !dbg !63 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.2ec8e1132c6ccd4f:core.Destroy.Core"(ptr %self) #0 !dbg !64 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.48e0adf639fe7af4:core.Destroy.Core"(ptr %self) #0 !dbg !64 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !66 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CConvertBoolToUnformedBool.Main(ptr %b) #0 !dbg !68 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.2ec8e1132c6ccd4f:core.Destroy.Core"(ptr %self) #0 !dbg !68 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CTakeBool.Main(ptr %b), !dbg !73 +// CHECK:STDOUT: ret void, !dbg !70 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.2ec8e1132c6ccd4f:core.Destroy.Core"(ptr %self) #0 !dbg !72 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.2ec8e1132c6ccd4f:core.Destroy.Core"(ptr %self), !dbg !74 // CHECK:STDOUT: ret void, !dbg !74 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CTakeAdapterI32.Main(i32 %_) #0 !dbg !76 { +// CHECK:STDOUT: define void @_CConvertBoolToUnformedBool.Main(ptr %b) #0 !dbg !76 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !79 +// CHECK:STDOUT: call void @_CTakeBool.Main(ptr %b), !dbg !81 +// CHECK:STDOUT: ret void, !dbg !82 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CTakeAdapterI32.Main(i32 %_) #0 !dbg !84 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !87 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare i32 @_CMakeAdapterI32.Main() // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassAdapterI32.Main() #0 !dbg !81 { +// CHECK:STDOUT: define void @_CPassAdapterI32.Main() #0 !dbg !89 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc48_33.1.temp = alloca i32, align 4, !dbg !82 -// CHECK:STDOUT: %MakeAdapterI32.call = call i32 @_CMakeAdapterI32.Main(), !dbg !82 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc48_33.1.temp), !dbg !82 -// CHECK:STDOUT: store i32 %MakeAdapterI32.call, ptr %.loc48_33.1.temp, align 4, !dbg !82 -// CHECK:STDOUT: %.loc48_33.3 = load i32, ptr %.loc48_33.1.temp, align 4, !dbg !82 -// CHECK:STDOUT: call void @_CTakeAdapterI32.Main(i32 %.loc48_33.3), !dbg !83 -// CHECK:STDOUT: call void @"_COp.4615e23332cd8b4c:core.Destroy.Core"(ptr %.loc48_33.1.temp), !dbg !82 -// CHECK:STDOUT: ret void, !dbg !84 +// CHECK:STDOUT: %.loc48_33.1.temp = alloca i32, align 4, !dbg !90 +// CHECK:STDOUT: %MakeAdapterI32.call = call i32 @_CMakeAdapterI32.Main(), !dbg !90 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc48_33.1.temp), !dbg !90 +// CHECK:STDOUT: store i32 %MakeAdapterI32.call, ptr %.loc48_33.1.temp, align 4, !dbg !90 +// CHECK:STDOUT: %.loc48_33.3 = load i32, ptr %.loc48_33.1.temp, align 4, !dbg !90 +// CHECK:STDOUT: call void @_CTakeAdapterI32.Main(i32 %.loc48_33.3), !dbg !91 +// CHECK:STDOUT: call void @"_CSelfDestruct.4615e23332cd8b4c:core.Destroy.Core"(ptr %.loc48_33.1.temp), !dbg !90 +// CHECK:STDOUT: ret void, !dbg !92 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !85 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !87 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.1d6a7672bf2f14c6:core.Destroy.Core"(ptr %self) #0 !dbg !89 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !91 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.4615e23332cd8b4c:core.Destroy.Core"(ptr %self) #0 !dbg !93 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !93 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !95 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CTakeAdapterBool.Main(ptr %_) #0 !dbg !97 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !97 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !100 +// CHECK:STDOUT: ret void, !dbg !99 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !101 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !103 +// CHECK:STDOUT: ret void, !dbg !103 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.1d6a7672bf2f14c6:core.Destroy.Core"(ptr %self) #0 !dbg !105 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !107 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.1d6a7672bf2f14c6:core.Destroy.Core"(ptr %self) #0 !dbg !109 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.1d6a7672bf2f14c6:core.Destroy.Core"(ptr %self), !dbg !111 +// CHECK:STDOUT: ret void, !dbg !111 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.4615e23332cd8b4c:core.Destroy.Core"(ptr %self) #0 !dbg !113 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !115 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.4615e23332cd8b4c:core.Destroy.Core"(ptr %self) #0 !dbg !117 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.4615e23332cd8b4c:core.Destroy.Core"(ptr %self), !dbg !119 +// CHECK:STDOUT: ret void, !dbg !119 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CTakeAdapterBool.Main(ptr %_) #0 !dbg !121 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !124 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_CMakeAdapterBool.Main(ptr sret(i1)) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassAdapterBool.Main() #0 !dbg !102 { +// CHECK:STDOUT: define void @_CPassAdapterBool.Main() #0 !dbg !126 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc55_35.1.temp = alloca i1, align 1, !dbg !103 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc55_35.1.temp), !dbg !103 -// CHECK:STDOUT: call void @_CMakeAdapterBool.Main(ptr %.loc55_35.1.temp), !dbg !103 -// CHECK:STDOUT: call void @_CTakeAdapterBool.Main(ptr %.loc55_35.1.temp), !dbg !104 -// CHECK:STDOUT: call void @"_COp.c9abcd82dd2173d7:core.Destroy.Core"(ptr %.loc55_35.1.temp), !dbg !103 -// CHECK:STDOUT: ret void, !dbg !105 +// CHECK:STDOUT: %.loc55_35.1.temp = alloca i1, align 1, !dbg !127 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc55_35.1.temp), !dbg !127 +// CHECK:STDOUT: call void @_CMakeAdapterBool.Main(ptr %.loc55_35.1.temp), !dbg !127 +// CHECK:STDOUT: call void @_CTakeAdapterBool.Main(ptr %.loc55_35.1.temp), !dbg !128 +// CHECK:STDOUT: call void @"_CSelfDestruct.c9abcd82dd2173d7:core.Destroy.Core"(ptr %.loc55_35.1.temp), !dbg !127 +// CHECK:STDOUT: ret void, !dbg !129 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.c9abcd82dd2173d7:core.Destroy.Core"(ptr %self) #0 !dbg !106 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.c9abcd82dd2173d7:core.Destroy.Core"(ptr %self) #0 !dbg !130 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !108 +// CHECK:STDOUT: ret void, !dbg !132 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.c9abcd82dd2173d7:core.Destroy.Core"(ptr %self) #0 !dbg !134 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.c9abcd82dd2173d7:core.Destroy.Core"(ptr %self), !dbg !136 +// CHECK:STDOUT: ret void, !dbg !136 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -211,45 +258,73 @@ fn PassAdapterBool() { // CHECK:STDOUT: !61 = !DILocation(line: 28, column: 12, scope: !60) // CHECK:STDOUT: !62 = !DILocation(line: 28, column: 3, scope: !60) // CHECK:STDOUT: !63 = !DILocation(line: 26, column: 1, scope: !60) -// CHECK:STDOUT: !64 = distinct !DISubprogram(name: "Op", linkageName: "_COp.2ec8e1132c6ccd4f:core.Destroy.Core", scope: null, file: !32, line: 28, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !67) +// CHECK:STDOUT: !64 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.48e0adf639fe7af4:core.Destroy.Core", scope: null, file: !32, line: 28, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !67) // CHECK:STDOUT: !65 = !DILocalVariable(arg: 1, scope: !64, type: !37) // CHECK:STDOUT: !66 = !DILocation(line: 28, column: 12, scope: !64) // CHECK:STDOUT: !67 = !{!65} -// CHECK:STDOUT: !68 = distinct !DISubprogram(name: "ConvertBoolToUnformedBool", linkageName: "_CConvertBoolToUnformedBool.Main", scope: null, file: !32, line: 31, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !75) +// CHECK:STDOUT: !68 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.2ec8e1132c6ccd4f:core.Destroy.Core", scope: null, file: !32, line: 28, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !71) // CHECK:STDOUT: !69 = !DILocalVariable(arg: 1, scope: !68, type: !37) -// CHECK:STDOUT: !73 = !DILocation(line: 32, column: 3, scope: !68) -// CHECK:STDOUT: !74 = !DILocation(line: 31, column: 1, scope: !68) -// CHECK:STDOUT: !75 = !{!69} -// CHECK:STDOUT: !76 = distinct !DISubprogram(name: "TakeAdapterI32", linkageName: "_CTakeAdapterI32.Main", scope: null, file: !32, line: 42, type: !36, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !80) -// CHECK:STDOUT: !77 = !DILocalVariable(arg: 1, scope: !76, type: !34) -// CHECK:STDOUT: !79 = !DILocation(line: 42, column: 1, scope: !76) -// CHECK:STDOUT: !80 = !{!77} -// CHECK:STDOUT: !81 = distinct !DISubprogram(name: "PassAdapterI32", linkageName: "_CPassAdapterI32.Main", scope: null, file: !32, line: 45, type: !43, spFlags: DISPFlagDefinition, unit: !33) -// CHECK:STDOUT: !82 = !DILocation(line: 48, column: 18, scope: !81) -// CHECK:STDOUT: !83 = !DILocation(line: 48, column: 3, scope: !81) -// CHECK:STDOUT: !84 = !DILocation(line: 45, column: 1, scope: !81) -// CHECK:STDOUT: !85 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !32, line: 48, type: !36, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !88) -// CHECK:STDOUT: !86 = !DILocalVariable(arg: 1, scope: !85, type: !34) -// CHECK:STDOUT: !87 = !DILocation(line: 48, column: 18, scope: !85) -// CHECK:STDOUT: !88 = !{!86} -// CHECK:STDOUT: !89 = distinct !DISubprogram(name: "Op", linkageName: "_COp.1d6a7672bf2f14c6:core.Destroy.Core", scope: null, file: !32, line: 48, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !92) -// CHECK:STDOUT: !90 = !DILocalVariable(arg: 1, scope: !89, type: !37) -// CHECK:STDOUT: !91 = !DILocation(line: 48, column: 18, scope: !89) -// CHECK:STDOUT: !92 = !{!90} -// CHECK:STDOUT: !93 = distinct !DISubprogram(name: "Op", linkageName: "_COp.4615e23332cd8b4c:core.Destroy.Core", scope: null, file: !32, line: 48, type: !36, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !96) +// CHECK:STDOUT: !70 = !DILocation(line: 28, column: 12, scope: !68) +// CHECK:STDOUT: !71 = !{!69} +// CHECK:STDOUT: !72 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.2ec8e1132c6ccd4f:core.Destroy.Core", scope: null, file: !32, line: 28, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !75) +// CHECK:STDOUT: !73 = !DILocalVariable(arg: 1, scope: !72, type: !37) +// CHECK:STDOUT: !74 = !DILocation(line: 28, column: 12, scope: !72) +// CHECK:STDOUT: !75 = !{!73} +// CHECK:STDOUT: !76 = distinct !DISubprogram(name: "ConvertBoolToUnformedBool", linkageName: "_CConvertBoolToUnformedBool.Main", scope: null, file: !32, line: 31, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !83) +// CHECK:STDOUT: !77 = !DILocalVariable(arg: 1, scope: !76, type: !37) +// CHECK:STDOUT: !81 = !DILocation(line: 32, column: 3, scope: !76) +// CHECK:STDOUT: !82 = !DILocation(line: 31, column: 1, scope: !76) +// CHECK:STDOUT: !83 = !{!77} +// CHECK:STDOUT: !84 = distinct !DISubprogram(name: "TakeAdapterI32", linkageName: "_CTakeAdapterI32.Main", scope: null, file: !32, line: 42, type: !36, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !88) +// CHECK:STDOUT: !85 = !DILocalVariable(arg: 1, scope: !84, type: !34) +// CHECK:STDOUT: !87 = !DILocation(line: 42, column: 1, scope: !84) +// CHECK:STDOUT: !88 = !{!85} +// CHECK:STDOUT: !89 = distinct !DISubprogram(name: "PassAdapterI32", linkageName: "_CPassAdapterI32.Main", scope: null, file: !32, line: 45, type: !43, spFlags: DISPFlagDefinition, unit: !33) +// CHECK:STDOUT: !90 = !DILocation(line: 48, column: 18, scope: !89) +// CHECK:STDOUT: !91 = !DILocation(line: 48, column: 3, scope: !89) +// CHECK:STDOUT: !92 = !DILocation(line: 45, column: 1, scope: !89) +// CHECK:STDOUT: !93 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !32, line: 48, type: !36, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !96) // CHECK:STDOUT: !94 = !DILocalVariable(arg: 1, scope: !93, type: !34) // CHECK:STDOUT: !95 = !DILocation(line: 48, column: 18, scope: !93) // CHECK:STDOUT: !96 = !{!94} -// CHECK:STDOUT: !97 = distinct !DISubprogram(name: "TakeAdapterBool", linkageName: "_CTakeAdapterBool.Main", scope: null, file: !32, line: 51, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !101) -// CHECK:STDOUT: !98 = !DILocalVariable(arg: 1, scope: !97, type: !37) -// CHECK:STDOUT: !100 = !DILocation(line: 51, column: 1, scope: !97) -// CHECK:STDOUT: !101 = !{!98} -// CHECK:STDOUT: !102 = distinct !DISubprogram(name: "PassAdapterBool", linkageName: "_CPassAdapterBool.Main", scope: null, file: !32, line: 54, type: !43, spFlags: DISPFlagDefinition, unit: !33) -// CHECK:STDOUT: !103 = !DILocation(line: 55, column: 19, scope: !102) -// CHECK:STDOUT: !104 = !DILocation(line: 55, column: 3, scope: !102) -// CHECK:STDOUT: !105 = !DILocation(line: 54, column: 1, scope: !102) -// CHECK:STDOUT: !106 = distinct !DISubprogram(name: "Op", linkageName: "_COp.c9abcd82dd2173d7:core.Destroy.Core", scope: null, file: !32, line: 55, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !109) -// CHECK:STDOUT: !107 = !DILocalVariable(arg: 1, scope: !106, type: !37) -// CHECK:STDOUT: !108 = !DILocation(line: 55, column: 19, scope: !106) -// CHECK:STDOUT: !109 = !{!107} +// CHECK:STDOUT: !97 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !32, line: 48, type: !36, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !100) +// CHECK:STDOUT: !98 = !DILocalVariable(arg: 1, scope: !97, type: !34) +// CHECK:STDOUT: !99 = !DILocation(line: 48, column: 18, scope: !97) +// CHECK:STDOUT: !100 = !{!98} +// CHECK:STDOUT: !101 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !32, line: 48, type: !36, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !104) +// CHECK:STDOUT: !102 = !DILocalVariable(arg: 1, scope: !101, type: !34) +// CHECK:STDOUT: !103 = !DILocation(line: 48, column: 18, scope: !101) +// CHECK:STDOUT: !104 = !{!102} +// CHECK:STDOUT: !105 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.1d6a7672bf2f14c6:core.Destroy.Core", scope: null, file: !32, line: 48, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !108) +// CHECK:STDOUT: !106 = !DILocalVariable(arg: 1, scope: !105, type: !37) +// CHECK:STDOUT: !107 = !DILocation(line: 48, column: 18, scope: !105) +// CHECK:STDOUT: !108 = !{!106} +// CHECK:STDOUT: !109 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.1d6a7672bf2f14c6:core.Destroy.Core", scope: null, file: !32, line: 48, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !112) +// CHECK:STDOUT: !110 = !DILocalVariable(arg: 1, scope: !109, type: !37) +// CHECK:STDOUT: !111 = !DILocation(line: 48, column: 18, scope: !109) +// CHECK:STDOUT: !112 = !{!110} +// CHECK:STDOUT: !113 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.4615e23332cd8b4c:core.Destroy.Core", scope: null, file: !32, line: 48, type: !36, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !116) +// CHECK:STDOUT: !114 = !DILocalVariable(arg: 1, scope: !113, type: !34) +// CHECK:STDOUT: !115 = !DILocation(line: 48, column: 18, scope: !113) +// CHECK:STDOUT: !116 = !{!114} +// CHECK:STDOUT: !117 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.4615e23332cd8b4c:core.Destroy.Core", scope: null, file: !32, line: 48, type: !36, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !120) +// CHECK:STDOUT: !118 = !DILocalVariable(arg: 1, scope: !117, type: !34) +// CHECK:STDOUT: !119 = !DILocation(line: 48, column: 18, scope: !117) +// CHECK:STDOUT: !120 = !{!118} +// CHECK:STDOUT: !121 = distinct !DISubprogram(name: "TakeAdapterBool", linkageName: "_CTakeAdapterBool.Main", scope: null, file: !32, line: 51, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !125) +// CHECK:STDOUT: !122 = !DILocalVariable(arg: 1, scope: !121, type: !37) +// CHECK:STDOUT: !124 = !DILocation(line: 51, column: 1, scope: !121) +// CHECK:STDOUT: !125 = !{!122} +// CHECK:STDOUT: !126 = distinct !DISubprogram(name: "PassAdapterBool", linkageName: "_CPassAdapterBool.Main", scope: null, file: !32, line: 54, type: !43, spFlags: DISPFlagDefinition, unit: !33) +// CHECK:STDOUT: !127 = !DILocation(line: 55, column: 19, scope: !126) +// CHECK:STDOUT: !128 = !DILocation(line: 55, column: 3, scope: !126) +// CHECK:STDOUT: !129 = !DILocation(line: 54, column: 1, scope: !126) +// CHECK:STDOUT: !130 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.c9abcd82dd2173d7:core.Destroy.Core", scope: null, file: !32, line: 55, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !133) +// CHECK:STDOUT: !131 = !DILocalVariable(arg: 1, scope: !130, type: !37) +// CHECK:STDOUT: !132 = !DILocation(line: 55, column: 19, scope: !130) +// CHECK:STDOUT: !133 = !{!131} +// CHECK:STDOUT: !134 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.c9abcd82dd2173d7:core.Destroy.Core", scope: null, file: !32, line: 55, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !137) +// CHECK:STDOUT: !135 = !DILocalVariable(arg: 1, scope: !134, type: !37) +// CHECK:STDOUT: !136 = !DILocation(line: 55, column: 19, scope: !134) +// CHECK:STDOUT: !137 = !{!135} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/builtins/no_op.carbon b/toolchain/lower/testdata/builtins/no_op.carbon index 5ca4d22cf956..0e76a1fe30ee 100644 --- a/toolchain/lower/testdata/builtins/no_op.carbon +++ b/toolchain/lower/testdata/builtins/no_op.carbon @@ -38,34 +38,42 @@ fn J() { // CHECK:STDOUT: source_filename = "no_op.carbon" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !10 { +// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !13 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !11 +// CHECK:STDOUT: ret void, !dbg !14 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CG.Main() #0 !dbg !12 { +// CHECK:STDOUT: define void @_CG.Main() #0 !dbg !15 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %a.var = alloca {}, align 1, !dbg !15 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !15 -// CHECK:STDOUT: ret void, !dbg !18 +// CHECK:STDOUT: %a.var = alloca {}, align 1, !dbg !18 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !18 +// CHECK:STDOUT: call void @"_CSelfDestruct.61ea2aba74ab3bf1:core.Destroy.Core"(ptr %a.var), !dbg !18 +// CHECK:STDOUT: ret void, !dbg !21 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CH.Main() #0 !dbg !19 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.61ea2aba74ab3bf1:core.Destroy.Core"(ptr %self) #0 !dbg !22 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !22 +// CHECK:STDOUT: ret void, !dbg !24 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CH.Main() #0 !dbg !26 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !29 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_CI.Main() // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CJ.Main() #0 !dbg !23 { +// CHECK:STDOUT: define void @_CJ.Main() #0 !dbg !30 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc33_11.1.temp = alloca {}, align 1, !dbg !24 -// CHECK:STDOUT: call void @_CI.Main(), !dbg !24 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc33_11.1.temp), !dbg !24 -// CHECK:STDOUT: ret void, !dbg !25 +// CHECK:STDOUT: %.loc33_11.1.temp = alloca {}, align 1, !dbg !31 +// CHECK:STDOUT: call void @_CI.Main(), !dbg !31 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc33_11.1.temp), !dbg !31 +// CHECK:STDOUT: call void @"_CSelfDestruct.61ea2aba74ab3bf1:core.Destroy.Core"(ptr %.loc33_11.1.temp), !dbg !31 +// CHECK:STDOUT: ret void, !dbg !32 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -86,14 +94,21 @@ fn J() { // CHECK:STDOUT: !7 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !6, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) // CHECK:STDOUT: !8 = !{null} // CHECK:STDOUT: !9 = !DISubroutineType(types: !8) -// CHECK:STDOUT: !10 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !6, line: 17, type: !9, spFlags: DISPFlagDefinition, unit: !7) -// CHECK:STDOUT: !11 = !DILocation(line: 17, column: 1, scope: !10) -// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !6, line: 21, type: !9, spFlags: DISPFlagDefinition, unit: !7) -// CHECK:STDOUT: !15 = !DILocation(line: 22, column: 3, scope: !12) -// CHECK:STDOUT: !18 = !DILocation(line: 23, column: 3, scope: !12) -// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "H", linkageName: "_CH.Main", scope: null, file: !6, line: 26, type: !9, spFlags: DISPFlagDefinition, unit: !7) -// CHECK:STDOUT: !22 = !DILocation(line: 27, column: 3, scope: !19) -// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "J", linkageName: "_CJ.Main", scope: null, file: !6, line: 32, type: !9, spFlags: DISPFlagDefinition, unit: !7) -// CHECK:STDOUT: !24 = !DILocation(line: 33, column: 9, scope: !23) -// CHECK:STDOUT: !25 = !DILocation(line: 32, column: 1, scope: !23) +// CHECK:STDOUT: !10 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !11 = !{null, !10} +// CHECK:STDOUT: !12 = !DISubroutineType(types: !11) +// CHECK:STDOUT: !13 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !6, line: 17, type: !9, spFlags: DISPFlagDefinition, unit: !7) +// CHECK:STDOUT: !14 = !DILocation(line: 17, column: 1, scope: !13) +// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !6, line: 21, type: !9, spFlags: DISPFlagDefinition, unit: !7) +// CHECK:STDOUT: !18 = !DILocation(line: 22, column: 3, scope: !15) +// CHECK:STDOUT: !21 = !DILocation(line: 23, column: 3, scope: !15) +// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.61ea2aba74ab3bf1:core.Destroy.Core", scope: null, file: !6, line: 22, type: !12, spFlags: DISPFlagDefinition, unit: !7, retainedNodes: !25) +// CHECK:STDOUT: !23 = !DILocalVariable(arg: 1, scope: !22, type: !10) +// CHECK:STDOUT: !24 = !DILocation(line: 22, column: 3, scope: !22) +// CHECK:STDOUT: !25 = !{!23} +// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "H", linkageName: "_CH.Main", scope: null, file: !6, line: 26, type: !9, spFlags: DISPFlagDefinition, unit: !7) +// CHECK:STDOUT: !29 = !DILocation(line: 27, column: 3, scope: !26) +// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "J", linkageName: "_CJ.Main", scope: null, file: !6, line: 32, type: !9, spFlags: DISPFlagDefinition, unit: !7) +// CHECK:STDOUT: !31 = !DILocation(line: 33, column: 9, scope: !30) +// CHECK:STDOUT: !32 = !DILocation(line: 32, column: 1, scope: !30) // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/class/adapt.carbon b/toolchain/lower/testdata/class/adapt.carbon index e31a27aa50ae..a29ffc1bc546 100644 --- a/toolchain/lower/testdata/class/adapt.carbon +++ b/toolchain/lower/testdata/class/adapt.carbon @@ -94,34 +94,68 @@ fn DoStuff(a: Int) -> Int { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %pa.var), !dbg !56 // CHECK:STDOUT: call void @_CMake.PairAdapter.Main(ptr %pa.var), !dbg !57 // CHECK:STDOUT: %PairAdapter.GetB.call = call i32 @_CGetB.PairAdapter.Main(ptr %pa.var), !dbg !59 -// CHECK:STDOUT: call void @"_COp.865f2ef613cc5c67:core.Destroy.Core"(ptr %pa.var), !dbg !56 +// CHECK:STDOUT: call void @"_CSelfDestruct.865f2ef613cc5c67:core.Destroy.Core"(ptr %pa.var), !dbg !56 // CHECK:STDOUT: ret i32 %PairAdapter.GetB.call, !dbg !60 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !61 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !61 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !63 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.b4c762864cd9a02b:core.Destroy.Core"(ptr %self) #0 !dbg !65 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !65 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !67 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.a031f5a2c623d311:core.Destroy.Core"(ptr %self) #0 !dbg !69 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !69 { // CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !71 // CHECK:STDOUT: ret void, !dbg !71 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.865f2ef613cc5c67:core.Destroy.Core"(ptr %self) #0 !dbg !73 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.b4c762864cd9a02b:core.Destroy.Core"(ptr %self) #0 !dbg !73 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !75 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.b4c762864cd9a02b:core.Destroy.Core"(ptr %self) #0 !dbg !77 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.b4c762864cd9a02b:core.Destroy.Core"(ptr %self), !dbg !79 +// CHECK:STDOUT: ret void, !dbg !79 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.a031f5a2c623d311:core.Destroy.Core"(ptr %self) #0 !dbg !81 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !83 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.a031f5a2c623d311:core.Destroy.Core"(ptr %self) #0 !dbg !85 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.a031f5a2c623d311:core.Destroy.Core"(ptr %self), !dbg !87 +// CHECK:STDOUT: ret void, !dbg !87 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.865f2ef613cc5c67:core.Destroy.Core"(ptr %self) #0 !dbg !89 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !91 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.865f2ef613cc5c67:core.Destroy.Core"(ptr %self) #0 !dbg !93 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.865f2ef613cc5c67:core.Destroy.Core"(ptr %self), !dbg !95 +// CHECK:STDOUT: ret void, !dbg !95 +// 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: @@ -166,59 +200,79 @@ fn DoStuff(a: Int) -> Int { // CHECK:STDOUT: !57 = !DILocation(line: 27, column: 25, scope: !53) // CHECK:STDOUT: !59 = !DILocation(line: 28, column: 10, scope: !53) // CHECK:STDOUT: !60 = !DILocation(line: 28, column: 3, scope: !53) -// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 27, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !64) +// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !18, line: 27, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !64) // CHECK:STDOUT: !62 = !DILocalVariable(arg: 1, scope: !61, type: !20) // CHECK:STDOUT: !63 = !DILocation(line: 27, column: 3, scope: !61) // CHECK:STDOUT: !64 = !{!62} -// CHECK:STDOUT: !65 = distinct !DISubprogram(name: "Op", linkageName: "_COp.b4c762864cd9a02b:core.Destroy.Core", scope: null, file: !18, line: 27, type: !31, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !68) -// CHECK:STDOUT: !66 = !DILocalVariable(arg: 1, scope: !65, type: !21) +// CHECK:STDOUT: !65 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 27, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !68) +// CHECK:STDOUT: !66 = !DILocalVariable(arg: 1, scope: !65, type: !20) // CHECK:STDOUT: !67 = !DILocation(line: 27, column: 3, scope: !65) // CHECK:STDOUT: !68 = !{!66} -// CHECK:STDOUT: !69 = distinct !DISubprogram(name: "Op", linkageName: "_COp.a031f5a2c623d311:core.Destroy.Core", scope: null, file: !18, line: 27, type: !31, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !72) -// CHECK:STDOUT: !70 = !DILocalVariable(arg: 1, scope: !69, type: !21) +// CHECK:STDOUT: !69 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 27, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !72) +// CHECK:STDOUT: !70 = !DILocalVariable(arg: 1, scope: !69, type: !20) // CHECK:STDOUT: !71 = !DILocation(line: 27, column: 3, scope: !69) // CHECK:STDOUT: !72 = !{!70} -// CHECK:STDOUT: !73 = distinct !DISubprogram(name: "Op", linkageName: "_COp.865f2ef613cc5c67:core.Destroy.Core", scope: null, file: !18, line: 27, type: !31, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !76) +// CHECK:STDOUT: !73 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.b4c762864cd9a02b:core.Destroy.Core", scope: null, file: !18, line: 27, type: !31, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !76) // CHECK:STDOUT: !74 = !DILocalVariable(arg: 1, scope: !73, type: !21) // CHECK:STDOUT: !75 = !DILocation(line: 27, column: 3, scope: !73) // CHECK:STDOUT: !76 = !{!74} +// CHECK:STDOUT: !77 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.b4c762864cd9a02b:core.Destroy.Core", scope: null, file: !18, line: 27, type: !31, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !80) +// CHECK:STDOUT: !78 = !DILocalVariable(arg: 1, scope: !77, type: !21) +// CHECK:STDOUT: !79 = !DILocation(line: 27, column: 3, scope: !77) +// CHECK:STDOUT: !80 = !{!78} +// CHECK:STDOUT: !81 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.a031f5a2c623d311:core.Destroy.Core", scope: null, file: !18, line: 27, type: !31, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !84) +// CHECK:STDOUT: !82 = !DILocalVariable(arg: 1, scope: !81, type: !21) +// CHECK:STDOUT: !83 = !DILocation(line: 27, column: 3, scope: !81) +// CHECK:STDOUT: !84 = !{!82} +// CHECK:STDOUT: !85 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.a031f5a2c623d311:core.Destroy.Core", scope: null, file: !18, line: 27, type: !31, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !88) +// CHECK:STDOUT: !86 = !DILocalVariable(arg: 1, scope: !85, type: !21) +// CHECK:STDOUT: !87 = !DILocation(line: 27, column: 3, scope: !85) +// CHECK:STDOUT: !88 = !{!86} +// CHECK:STDOUT: !89 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.865f2ef613cc5c67:core.Destroy.Core", scope: null, file: !18, line: 27, type: !31, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !92) +// CHECK:STDOUT: !90 = !DILocalVariable(arg: 1, scope: !89, type: !21) +// CHECK:STDOUT: !91 = !DILocation(line: 27, column: 3, scope: !89) +// CHECK:STDOUT: !92 = !{!90} +// CHECK:STDOUT: !93 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.865f2ef613cc5c67:core.Destroy.Core", scope: null, file: !18, line: 27, type: !31, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !96) +// CHECK:STDOUT: !94 = !DILocalVariable(arg: 1, scope: !93, type: !21) +// CHECK:STDOUT: !95 = !DILocation(line: 27, column: 3, scope: !93) +// CHECK:STDOUT: !96 = !{!94} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'adapt_int.carbon' // CHECK:STDOUT: source_filename = "adapt_int.carbon" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @"_COp.Int.Main:Copy.Core"(i32 %self) #0 !dbg !81 { +// CHECK:STDOUT: define i32 @"_COp.Int.Main:Copy.Core"(i32 %self) #0 !dbg !101 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret i32 %self, !dbg !88 +// CHECK:STDOUT: ret i32 %self, !dbg !108 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CDoStuff.Main(i32 %a) #0 !dbg !90 { +// CHECK:STDOUT: define i32 @_CDoStuff.Main(i32 %a) #0 !dbg !110 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.Copy.impl.Op.call = call i32 @"_COp.Int.Main:Copy.Core"(i32 %a), !dbg !95 -// CHECK:STDOUT: ret i32 %Int.as.Copy.impl.Op.call, !dbg !96 +// CHECK:STDOUT: %Int.as.Copy.impl.Op.call = call i32 @"_COp.Int.Main:Copy.Core"(i32 %a), !dbg !115 +// CHECK:STDOUT: ret i32 %Int.as.Copy.impl.Op.call, !dbg !116 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!78} +// CHECK:STDOUT: !llvm.dbg.cu = !{!98} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !20 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !77 = !DIFile(filename: "adapt_int.carbon", directory: "") -// CHECK:STDOUT: !78 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !77, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !79 = !{!20, !20} -// CHECK:STDOUT: !80 = !DISubroutineType(types: !79) -// CHECK:STDOUT: !81 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.Main:Copy.Core", scope: null, file: !77, line: 8, type: !80, spFlags: DISPFlagDefinition, unit: !78, retainedNodes: !89) -// CHECK:STDOUT: !82 = !DILocalVariable(arg: 1, scope: !81, type: !20) -// CHECK:STDOUT: !88 = !DILocation(line: 8, column: 27, scope: !81) -// CHECK:STDOUT: !89 = !{!82} -// CHECK:STDOUT: !90 = distinct !DISubprogram(name: "DoStuff", linkageName: "_CDoStuff.Main", scope: null, file: !77, line: 12, type: !80, spFlags: DISPFlagDefinition, unit: !78, retainedNodes: !97) -// CHECK:STDOUT: !91 = !DILocalVariable(arg: 1, scope: !90, type: !20) -// CHECK:STDOUT: !95 = !DILocation(line: 13, column: 10, scope: !90) -// CHECK:STDOUT: !96 = !DILocation(line: 13, column: 3, scope: !90) -// CHECK:STDOUT: !97 = !{!91} +// CHECK:STDOUT: !97 = !DIFile(filename: "adapt_int.carbon", directory: "") +// CHECK:STDOUT: !98 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !97, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !99 = !{!20, !20} +// CHECK:STDOUT: !100 = !DISubroutineType(types: !99) +// CHECK:STDOUT: !101 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.Main:Copy.Core", scope: null, file: !97, line: 8, type: !100, spFlags: DISPFlagDefinition, unit: !98, retainedNodes: !109) +// CHECK:STDOUT: !102 = !DILocalVariable(arg: 1, scope: !101, type: !20) +// CHECK:STDOUT: !108 = !DILocation(line: 8, column: 27, scope: !101) +// CHECK:STDOUT: !109 = !{!102} +// CHECK:STDOUT: !110 = distinct !DISubprogram(name: "DoStuff", linkageName: "_CDoStuff.Main", scope: null, file: !97, line: 12, type: !100, spFlags: DISPFlagDefinition, unit: !98, retainedNodes: !117) +// CHECK:STDOUT: !111 = !DILocalVariable(arg: 1, scope: !110, type: !20) +// CHECK:STDOUT: !115 = !DILocation(line: 13, column: 10, scope: !110) +// CHECK:STDOUT: !116 = !DILocation(line: 13, column: 3, scope: !110) +// CHECK:STDOUT: !117 = !{!111} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/class/basic.carbon b/toolchain/lower/testdata/class/basic.carbon index 6f8feba05d35..ffcc77d3d6ad 100644 --- a/toolchain/lower/testdata/class/basic.carbon +++ b/toolchain/lower/testdata/class/basic.carbon @@ -36,34 +36,67 @@ fn Run() { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !31 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !33 // CHECK:STDOUT: call void @_CF.Main(ptr %_.var, ptr %c.var), !dbg !35 -// CHECK:STDOUT: call void @"_COp.08d9e38b928ba575:core.Destroy.Core"(ptr %_.var), !dbg !33 -// CHECK:STDOUT: call void @"_COp.08d9e38b928ba575:core.Destroy.Core"(ptr %c.var), !dbg !31 +// CHECK:STDOUT: call void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr %_.var), !dbg !33 +// CHECK:STDOUT: call void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr %c.var), !dbg !31 // CHECK:STDOUT: ret i32 0, !dbg !37 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !38 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !38 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !40 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.09861f44a9b84abf:core.Destroy.Core"(ptr %self) #0 !dbg !42 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !42 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !44 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !46 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !46 { // CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !48 // CHECK:STDOUT: ret void, !dbg !48 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6b633cf020343e69:core.Destroy.Core"(ptr %self) #0 !dbg !50 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !52 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.09861f44a9b84abf:core.Destroy.Core"(ptr %self) #0 !dbg !54 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !56 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.09861f44a9b84abf:core.Destroy.Core"(ptr %self) #0 !dbg !58 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.09861f44a9b84abf:core.Destroy.Core"(ptr %self), !dbg !60 +// CHECK:STDOUT: ret void, !dbg !60 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !62 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !64 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !66 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core"(ptr %self), !dbg !68 +// CHECK:STDOUT: ret void, !dbg !68 +// 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: ; uselistorder directives -// CHECK:STDOUT: uselistorder ptr @"_COp.08d9e38b928ba575:core.Destroy.Core", { 1, 0 } +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core", { 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -89,16 +122,36 @@ fn Run() { // CHECK:STDOUT: !33 = !DILocation(line: 22, column: 3, scope: !30) // CHECK:STDOUT: !35 = !DILocation(line: 22, column: 14, scope: !30) // CHECK:STDOUT: !37 = !DILocation(line: 20, column: 1, scope: !30) -// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 22, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !41) +// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !18, line: 22, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !41) // CHECK:STDOUT: !39 = !DILocalVariable(arg: 1, scope: !38, type: !20) // CHECK:STDOUT: !40 = !DILocation(line: 22, column: 3, scope: !38) // CHECK:STDOUT: !41 = !{!39} -// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "Op", linkageName: "_COp.09861f44a9b84abf:core.Destroy.Core", scope: null, file: !18, line: 22, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !45) -// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !42, type: !21) +// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 22, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !45) +// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !42, type: !20) // CHECK:STDOUT: !44 = !DILocation(line: 22, column: 3, scope: !42) // CHECK:STDOUT: !45 = !{!43} -// CHECK:STDOUT: !46 = distinct !DISubprogram(name: "Op", linkageName: "_COp.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !18, line: 22, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !49) -// CHECK:STDOUT: !47 = !DILocalVariable(arg: 1, scope: !46, type: !21) +// CHECK:STDOUT: !46 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 22, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !49) +// CHECK:STDOUT: !47 = !DILocalVariable(arg: 1, scope: !46, type: !20) // CHECK:STDOUT: !48 = !DILocation(line: 22, column: 3, scope: !46) // CHECK:STDOUT: !49 = !{!47} +// CHECK:STDOUT: !50 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6b633cf020343e69:core.Destroy.Core", scope: null, file: !18, line: 22, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !53) +// CHECK:STDOUT: !51 = !DILocalVariable(arg: 1, scope: !50, type: !21) +// CHECK:STDOUT: !52 = !DILocation(line: 22, column: 3, scope: !50) +// CHECK:STDOUT: !53 = !{!51} +// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.09861f44a9b84abf:core.Destroy.Core", scope: null, file: !18, line: 22, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !57) +// CHECK:STDOUT: !55 = !DILocalVariable(arg: 1, scope: !54, type: !21) +// CHECK:STDOUT: !56 = !DILocation(line: 22, column: 3, scope: !54) +// CHECK:STDOUT: !57 = !{!55} +// CHECK:STDOUT: !58 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.09861f44a9b84abf:core.Destroy.Core", scope: null, file: !18, line: 22, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !61) +// CHECK:STDOUT: !59 = !DILocalVariable(arg: 1, scope: !58, type: !21) +// CHECK:STDOUT: !60 = !DILocation(line: 22, column: 3, scope: !58) +// CHECK:STDOUT: !61 = !{!59} +// CHECK:STDOUT: !62 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !18, line: 22, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !65) +// CHECK:STDOUT: !63 = !DILocalVariable(arg: 1, scope: !62, type: !21) +// CHECK:STDOUT: !64 = !DILocation(line: 22, column: 3, scope: !62) +// CHECK:STDOUT: !65 = !{!63} +// CHECK:STDOUT: !66 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !18, line: 22, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !69) +// CHECK:STDOUT: !67 = !DILocalVariable(arg: 1, scope: !66, type: !21) +// CHECK:STDOUT: !68 = !DILocation(line: 22, column: 3, scope: !66) +// CHECK:STDOUT: !69 = !{!67} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/class/convert.carbon b/toolchain/lower/testdata/class/convert.carbon index 4fb2a529c1a4..19ca9f8b2171 100644 --- a/toolchain/lower/testdata/class/convert.carbon +++ b/toolchain/lower/testdata/class/convert.carbon @@ -67,28 +67,55 @@ fn F(ref d: partial D) -> ref partial B { // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %w.var, ptr align 4 @IntWrapper.val.loc14_3, i64 4, i1 false), !dbg !44 // CHECK:STDOUT: %IntWrapper.as.ImplicitAs.impl.Convert.call = call i32 @"_CConvert.IntWrapper.Main:ImplicitAs.84588f41d61dafba.Core"(ptr %w.var), !dbg !47 // CHECK:STDOUT: call void @_CConsume.Main(i32 %IntWrapper.as.ImplicitAs.impl.Convert.call), !dbg !48 -// CHECK:STDOUT: call void @"_COp.aecc0ff76a42614a:core.Destroy.Core"(ptr %w.var), !dbg !44 +// CHECK:STDOUT: call void @"_CSelfDestruct.aecc0ff76a42614a:core.Destroy.Core"(ptr %w.var), !dbg !44 // CHECK:STDOUT: ret void, !dbg !49 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !50 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !50 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !52 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.9edb2ca1f7e7a271:core.Destroy.Core"(ptr %self) #0 !dbg !54 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !54 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !56 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.aecc0ff76a42614a:core.Destroy.Core"(ptr %self) #0 !dbg !58 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !58 { // CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !60 // CHECK:STDOUT: ret void, !dbg !60 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.9edb2ca1f7e7a271:core.Destroy.Core"(ptr %self) #0 !dbg !62 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !64 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.9edb2ca1f7e7a271:core.Destroy.Core"(ptr %self) #0 !dbg !66 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.9edb2ca1f7e7a271:core.Destroy.Core"(ptr %self), !dbg !68 +// CHECK:STDOUT: ret void, !dbg !68 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.aecc0ff76a42614a:core.Destroy.Core"(ptr %self) #0 !dbg !70 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !72 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.aecc0ff76a42614a:core.Destroy.Core"(ptr %self) #0 !dbg !74 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.aecc0ff76a42614a:core.Destroy.Core"(ptr %self), !dbg !76 +// CHECK:STDOUT: ret void, !dbg !76 +// 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: @@ -130,44 +157,60 @@ fn F(ref d: partial D) -> ref partial B { // CHECK:STDOUT: !47 = !DILocation(line: 15, column: 11, scope: !43) // CHECK:STDOUT: !48 = !DILocation(line: 15, column: 3, scope: !43) // CHECK:STDOUT: !49 = !DILocation(line: 13, column: 1, scope: !43) -// CHECK:STDOUT: !50 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 14, type: !25, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !53) +// CHECK:STDOUT: !50 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !18, line: 14, type: !25, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !53) // CHECK:STDOUT: !51 = !DILocalVariable(arg: 1, scope: !50, type: !20) // CHECK:STDOUT: !52 = !DILocation(line: 14, column: 3, scope: !50) // CHECK:STDOUT: !53 = !{!51} -// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "Op", linkageName: "_COp.9edb2ca1f7e7a271:core.Destroy.Core", scope: null, file: !18, line: 14, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !57) -// CHECK:STDOUT: !55 = !DILocalVariable(arg: 1, scope: !54, type: !21) +// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 14, type: !25, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !57) +// CHECK:STDOUT: !55 = !DILocalVariable(arg: 1, scope: !54, type: !20) // CHECK:STDOUT: !56 = !DILocation(line: 14, column: 3, scope: !54) // CHECK:STDOUT: !57 = !{!55} -// CHECK:STDOUT: !58 = distinct !DISubprogram(name: "Op", linkageName: "_COp.aecc0ff76a42614a:core.Destroy.Core", scope: null, file: !18, line: 14, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !61) -// CHECK:STDOUT: !59 = !DILocalVariable(arg: 1, scope: !58, type: !21) +// CHECK:STDOUT: !58 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 14, type: !25, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !61) +// CHECK:STDOUT: !59 = !DILocalVariable(arg: 1, scope: !58, type: !20) // CHECK:STDOUT: !60 = !DILocation(line: 14, column: 3, scope: !58) // CHECK:STDOUT: !61 = !{!59} +// CHECK:STDOUT: !62 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.9edb2ca1f7e7a271:core.Destroy.Core", scope: null, file: !18, line: 14, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !65) +// CHECK:STDOUT: !63 = !DILocalVariable(arg: 1, scope: !62, type: !21) +// CHECK:STDOUT: !64 = !DILocation(line: 14, column: 3, scope: !62) +// CHECK:STDOUT: !65 = !{!63} +// CHECK:STDOUT: !66 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.9edb2ca1f7e7a271:core.Destroy.Core", scope: null, file: !18, line: 14, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !69) +// CHECK:STDOUT: !67 = !DILocalVariable(arg: 1, scope: !66, type: !21) +// CHECK:STDOUT: !68 = !DILocation(line: 14, column: 3, scope: !66) +// CHECK:STDOUT: !69 = !{!67} +// CHECK:STDOUT: !70 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.aecc0ff76a42614a:core.Destroy.Core", scope: null, file: !18, line: 14, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !73) +// CHECK:STDOUT: !71 = !DILocalVariable(arg: 1, scope: !70, type: !21) +// CHECK:STDOUT: !72 = !DILocation(line: 14, column: 3, scope: !70) +// CHECK:STDOUT: !73 = !{!71} +// CHECK:STDOUT: !74 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.aecc0ff76a42614a:core.Destroy.Core", scope: null, file: !18, line: 14, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !77) +// CHECK:STDOUT: !75 = !DILocalVariable(arg: 1, scope: !74, type: !21) +// CHECK:STDOUT: !76 = !DILocation(line: 14, column: 3, scope: !74) +// CHECK:STDOUT: !77 = !{!75} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'partial_class_to_partial_base.carbon' // CHECK:STDOUT: source_filename = "partial_class_to_partial_base.carbon" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define ptr @_CF.Main(ptr %d) #0 !dbg !66 { +// CHECK:STDOUT: define ptr @_CF.Main(ptr %d) #0 !dbg !82 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc7_13.1.base = getelementptr inbounds nuw { {} }, ptr %d, i32 0, i32 0, !dbg !72 -// CHECK:STDOUT: ret ptr %.loc7_13.1.base, !dbg !72 +// CHECK:STDOUT: %.loc7_13.1.base = getelementptr inbounds nuw { {} }, ptr %d, i32 0, i32 0, !dbg !88 +// CHECK:STDOUT: ret ptr %.loc7_13.1.base, !dbg !88 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!63} +// CHECK:STDOUT: !llvm.dbg.cu = !{!79} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !21 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !62 = !DIFile(filename: "partial_class_to_partial_base.carbon", directory: "") -// CHECK:STDOUT: !63 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !62, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !64 = !{!21, !21} -// CHECK:STDOUT: !65 = !DISubroutineType(types: !64) -// CHECK:STDOUT: !66 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !62, line: 6, type: !65, spFlags: DISPFlagDefinition, unit: !63, retainedNodes: !73) -// CHECK:STDOUT: !67 = !DILocalVariable(arg: 1, scope: !66, type: !21) -// CHECK:STDOUT: !72 = !DILocation(line: 7, column: 5, scope: !66) -// CHECK:STDOUT: !73 = !{!67} +// CHECK:STDOUT: !78 = !DIFile(filename: "partial_class_to_partial_base.carbon", directory: "") +// CHECK:STDOUT: !79 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !78, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !80 = !{!21, !21} +// CHECK:STDOUT: !81 = !DISubroutineType(types: !80) +// CHECK:STDOUT: !82 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !78, line: 6, type: !81, spFlags: DISPFlagDefinition, unit: !79, retainedNodes: !89) +// CHECK:STDOUT: !83 = !DILocalVariable(arg: 1, scope: !82, type: !21) +// CHECK:STDOUT: !88 = !DILocation(line: 7, column: 5, scope: !82) +// CHECK:STDOUT: !89 = !{!83} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/class/field.carbon b/toolchain/lower/testdata/class/field.carbon index 83491dfd1e02..d0fac7ea1696 100644 --- a/toolchain/lower/testdata/class/field.carbon +++ b/toolchain/lower/testdata/class/field.carbon @@ -92,28 +92,61 @@ fn Run() { // CHECK:STDOUT: %.loc16.b = getelementptr inbounds nuw { i32, ptr }, ptr %c.var, i32 0, i32 1, !dbg !46 // CHECK:STDOUT: store ptr %c.var, ptr %.loc16.b, align 8, !dbg !46 // CHECK:STDOUT: %F.call = call i32 @_CF.Main(ptr %c.var), !dbg !50 -// CHECK:STDOUT: call void @"_COp.08d9e38b928ba575:core.Destroy.Core"(ptr %c.var), !dbg !43 +// CHECK:STDOUT: call void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr %c.var), !dbg !43 // CHECK:STDOUT: ret i32 %F.call, !dbg !51 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !52 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !52 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !54 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.09861f44a9b84abf:core.Destroy.Core"(ptr %self) #0 !dbg !56 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !56 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !58 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !60 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !60 { // CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !62 // CHECK:STDOUT: ret void, !dbg !62 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6b633cf020343e69:core.Destroy.Core"(ptr %self) #0 !dbg !64 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !66 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.09861f44a9b84abf:core.Destroy.Core"(ptr %self) #0 !dbg !68 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !70 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.09861f44a9b84abf:core.Destroy.Core"(ptr %self) #0 !dbg !72 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.09861f44a9b84abf:core.Destroy.Core"(ptr %self), !dbg !74 +// CHECK:STDOUT: ret void, !dbg !74 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !76 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !78 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !80 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core"(ptr %self), !dbg !82 +// CHECK:STDOUT: ret void, !dbg !82 +// 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: @@ -149,18 +182,38 @@ fn Run() { // CHECK:STDOUT: !46 = !DILocation(line: 16, column: 3, scope: !40) // CHECK:STDOUT: !50 = !DILocation(line: 17, column: 10, scope: !40) // CHECK:STDOUT: !51 = !DILocation(line: 17, column: 3, scope: !40) -// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 14, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !55) +// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !18, line: 14, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !55) // CHECK:STDOUT: !53 = !DILocalVariable(arg: 1, scope: !52, type: !20) // CHECK:STDOUT: !54 = !DILocation(line: 14, column: 3, scope: !52) // CHECK:STDOUT: !55 = !{!53} -// CHECK:STDOUT: !56 = distinct !DISubprogram(name: "Op", linkageName: "_COp.09861f44a9b84abf:core.Destroy.Core", scope: null, file: !18, line: 14, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !59) -// CHECK:STDOUT: !57 = !DILocalVariable(arg: 1, scope: !56, type: !21) +// CHECK:STDOUT: !56 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 14, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !59) +// CHECK:STDOUT: !57 = !DILocalVariable(arg: 1, scope: !56, type: !20) // CHECK:STDOUT: !58 = !DILocation(line: 14, column: 3, scope: !56) // CHECK:STDOUT: !59 = !{!57} -// CHECK:STDOUT: !60 = distinct !DISubprogram(name: "Op", linkageName: "_COp.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !18, line: 14, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !63) -// CHECK:STDOUT: !61 = !DILocalVariable(arg: 1, scope: !60, type: !21) +// CHECK:STDOUT: !60 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 14, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !63) +// CHECK:STDOUT: !61 = !DILocalVariable(arg: 1, scope: !60, type: !20) // CHECK:STDOUT: !62 = !DILocation(line: 14, column: 3, scope: !60) // CHECK:STDOUT: !63 = !{!61} +// CHECK:STDOUT: !64 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6b633cf020343e69:core.Destroy.Core", scope: null, file: !18, line: 14, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !67) +// CHECK:STDOUT: !65 = !DILocalVariable(arg: 1, scope: !64, type: !21) +// CHECK:STDOUT: !66 = !DILocation(line: 14, column: 3, scope: !64) +// CHECK:STDOUT: !67 = !{!65} +// CHECK:STDOUT: !68 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.09861f44a9b84abf:core.Destroy.Core", scope: null, file: !18, line: 14, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !71) +// CHECK:STDOUT: !69 = !DILocalVariable(arg: 1, scope: !68, type: !21) +// CHECK:STDOUT: !70 = !DILocation(line: 14, column: 3, scope: !68) +// CHECK:STDOUT: !71 = !{!69} +// CHECK:STDOUT: !72 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.09861f44a9b84abf:core.Destroy.Core", scope: null, file: !18, line: 14, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !75) +// CHECK:STDOUT: !73 = !DILocalVariable(arg: 1, scope: !72, type: !21) +// CHECK:STDOUT: !74 = !DILocation(line: 14, column: 3, scope: !72) +// CHECK:STDOUT: !75 = !{!73} +// CHECK:STDOUT: !76 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !18, line: 14, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !79) +// CHECK:STDOUT: !77 = !DILocalVariable(arg: 1, scope: !76, type: !21) +// CHECK:STDOUT: !78 = !DILocation(line: 14, column: 3, scope: !76) +// CHECK:STDOUT: !79 = !{!77} +// CHECK:STDOUT: !80 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !18, line: 14, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !83) +// CHECK:STDOUT: !81 = !DILocalVariable(arg: 1, scope: !80, type: !21) +// CHECK:STDOUT: !82 = !DILocation(line: 14, column: 3, scope: !80) +// CHECK:STDOUT: !83 = !{!81} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'inplace_init_with_nonconst.carbon' @@ -169,37 +222,70 @@ fn Run() { // CHECK:STDOUT: @Other.val.loc15_33.5 = internal constant {} zeroinitializer // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @main() #0 !dbg !66 { +// CHECK:STDOUT: define i32 @main() #0 !dbg !86 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %o.var = alloca {}, align 1, !dbg !67 -// CHECK:STDOUT: %_.var = alloca { ptr, {} }, align 8, !dbg !69 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %o.var), !dbg !67 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !69 -// CHECK:STDOUT: %.loc15_33.2.a = getelementptr inbounds nuw { ptr, {} }, ptr %_.var, i32 0, i32 0, !dbg !72 -// CHECK:STDOUT: store ptr %o.var, ptr %.loc15_33.2.a, align 8, !dbg !72 -// CHECK:STDOUT: %.loc15_33.4.b = getelementptr inbounds nuw { ptr, {} }, ptr %_.var, i32 0, i32 1, !dbg !72 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %.loc15_33.4.b, ptr align 1 @Other.val.loc15_33.5, i64 0, i1 false), !dbg !72 -// CHECK:STDOUT: call void @"_COp.2fbae80a61a11ec7:core.Destroy.Core"(ptr %_.var), !dbg !69 -// CHECK:STDOUT: call void @"_COp.6a519b95f6f059eb:core.Destroy.Core"(ptr %o.var), !dbg !67 -// CHECK:STDOUT: ret i32 0, !dbg !74 +// CHECK:STDOUT: %o.var = alloca {}, align 1, !dbg !87 +// CHECK:STDOUT: %_.var = alloca { ptr, {} }, align 8, !dbg !89 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %o.var), !dbg !87 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !89 +// CHECK:STDOUT: %.loc15_33.2.a = getelementptr inbounds nuw { ptr, {} }, ptr %_.var, i32 0, i32 0, !dbg !92 +// CHECK:STDOUT: store ptr %o.var, ptr %.loc15_33.2.a, align 8, !dbg !92 +// CHECK:STDOUT: %.loc15_33.4.b = getelementptr inbounds nuw { ptr, {} }, ptr %_.var, i32 0, i32 1, !dbg !92 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %.loc15_33.4.b, ptr align 1 @Other.val.loc15_33.5, i64 0, i1 false), !dbg !92 +// CHECK:STDOUT: call void @"_CSelfDestruct.2fbae80a61a11ec7:core.Destroy.Core"(ptr %_.var), !dbg !89 +// CHECK:STDOUT: call void @"_CSelfDestruct.6a519b95f6f059eb:core.Destroy.Core"(ptr %o.var), !dbg !87 +// CHECK:STDOUT: ret i32 0, !dbg !94 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.6a519b95f6f059eb:core.Destroy.Core"(ptr %self) #0 !dbg !75 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.d7c3fbe4c84d0842:core.Destroy.Core"(ptr %self) #0 !dbg !95 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !77 +// CHECK:STDOUT: ret void, !dbg !97 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.fa5d2a8a45149476:core.Destroy.Core"(ptr %self) #0 !dbg !79 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %self) #0 !dbg !99 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !81 +// CHECK:STDOUT: ret void, !dbg !101 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.2fbae80a61a11ec7:core.Destroy.Core"(ptr %self) #0 !dbg !83 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.6a519b95f6f059eb:core.Destroy.Core"(ptr %self) #0 !dbg !103 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !85 +// CHECK:STDOUT: ret void, !dbg !105 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6a519b95f6f059eb:core.Destroy.Core"(ptr %self) #0 !dbg !107 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.6a519b95f6f059eb:core.Destroy.Core"(ptr %self), !dbg !109 +// CHECK:STDOUT: ret void, !dbg !109 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.fa5d2a8a45149476:core.Destroy.Core"(ptr %self) #0 !dbg !111 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !113 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.fa5d2a8a45149476:core.Destroy.Core"(ptr %self) #0 !dbg !115 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.fa5d2a8a45149476:core.Destroy.Core"(ptr %self), !dbg !117 +// CHECK:STDOUT: ret void, !dbg !117 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.2fbae80a61a11ec7:core.Destroy.Core"(ptr %self) #0 !dbg !119 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !121 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.2fbae80a61a11ec7:core.Destroy.Core"(ptr %self) #0 !dbg !123 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.2fbae80a61a11ec7:core.Destroy.Core"(ptr %self), !dbg !125 +// CHECK:STDOUT: ret void, !dbg !125 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -214,7 +300,7 @@ fn Run() { // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!65} +// CHECK:STDOUT: !llvm.dbg.cu = !{!85} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} @@ -225,25 +311,45 @@ fn Run() { // CHECK:STDOUT: !25 = !DISubroutineType(types: !24) // CHECK:STDOUT: !28 = !{null, !21} // CHECK:STDOUT: !29 = !DISubroutineType(types: !28) -// CHECK:STDOUT: !64 = !DIFile(filename: "inplace_init_with_nonconst.carbon", directory: "") -// CHECK:STDOUT: !65 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !64, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !66 = distinct !DISubprogram(name: "Run", linkageName: "main", scope: null, file: !64, line: 11, type: !25, spFlags: DISPFlagDefinition, unit: !65) -// CHECK:STDOUT: !67 = !DILocation(line: 12, column: 3, scope: !66) -// CHECK:STDOUT: !69 = !DILocation(line: 15, column: 3, scope: !66) -// CHECK:STDOUT: !72 = !DILocation(line: 15, column: 16, scope: !66) -// CHECK:STDOUT: !74 = !DILocation(line: 11, column: 1, scope: !66) -// CHECK:STDOUT: !75 = distinct !DISubprogram(name: "Op", linkageName: "_COp.6a519b95f6f059eb:core.Destroy.Core", scope: null, file: !64, line: 15, type: !29, spFlags: DISPFlagDefinition, unit: !65, retainedNodes: !78) -// CHECK:STDOUT: !76 = !DILocalVariable(arg: 1, scope: !75, type: !21) -// CHECK:STDOUT: !77 = !DILocation(line: 15, column: 3, scope: !75) -// CHECK:STDOUT: !78 = !{!76} -// CHECK:STDOUT: !79 = distinct !DISubprogram(name: "Op", linkageName: "_COp.fa5d2a8a45149476:core.Destroy.Core", scope: null, file: !64, line: 15, type: !29, spFlags: DISPFlagDefinition, unit: !65, retainedNodes: !82) -// CHECK:STDOUT: !80 = !DILocalVariable(arg: 1, scope: !79, type: !21) -// CHECK:STDOUT: !81 = !DILocation(line: 15, column: 3, scope: !79) -// CHECK:STDOUT: !82 = !{!80} -// CHECK:STDOUT: !83 = distinct !DISubprogram(name: "Op", linkageName: "_COp.2fbae80a61a11ec7:core.Destroy.Core", scope: null, file: !64, line: 15, type: !29, spFlags: DISPFlagDefinition, unit: !65, retainedNodes: !86) -// CHECK:STDOUT: !84 = !DILocalVariable(arg: 1, scope: !83, type: !21) -// CHECK:STDOUT: !85 = !DILocation(line: 15, column: 3, scope: !83) -// CHECK:STDOUT: !86 = !{!84} +// CHECK:STDOUT: !84 = !DIFile(filename: "inplace_init_with_nonconst.carbon", directory: "") +// CHECK:STDOUT: !85 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !84, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !86 = distinct !DISubprogram(name: "Run", linkageName: "main", scope: null, file: !84, line: 11, type: !25, spFlags: DISPFlagDefinition, unit: !85) +// CHECK:STDOUT: !87 = !DILocation(line: 12, column: 3, scope: !86) +// CHECK:STDOUT: !89 = !DILocation(line: 15, column: 3, scope: !86) +// CHECK:STDOUT: !92 = !DILocation(line: 15, column: 16, scope: !86) +// CHECK:STDOUT: !94 = !DILocation(line: 11, column: 1, scope: !86) +// CHECK:STDOUT: !95 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.d7c3fbe4c84d0842:core.Destroy.Core", scope: null, file: !84, line: 15, type: !29, spFlags: DISPFlagDefinition, unit: !85, retainedNodes: !98) +// CHECK:STDOUT: !96 = !DILocalVariable(arg: 1, scope: !95, type: !21) +// CHECK:STDOUT: !97 = !DILocation(line: 15, column: 3, scope: !95) +// CHECK:STDOUT: !98 = !{!96} +// CHECK:STDOUT: !99 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !84, line: 15, type: !29, spFlags: DISPFlagDefinition, unit: !85, retainedNodes: !102) +// CHECK:STDOUT: !100 = !DILocalVariable(arg: 1, scope: !99, type: !21) +// CHECK:STDOUT: !101 = !DILocation(line: 15, column: 3, scope: !99) +// CHECK:STDOUT: !102 = !{!100} +// CHECK:STDOUT: !103 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.6a519b95f6f059eb:core.Destroy.Core", scope: null, file: !84, line: 15, type: !29, spFlags: DISPFlagDefinition, unit: !85, retainedNodes: !106) +// CHECK:STDOUT: !104 = !DILocalVariable(arg: 1, scope: !103, type: !21) +// CHECK:STDOUT: !105 = !DILocation(line: 15, column: 3, scope: !103) +// CHECK:STDOUT: !106 = !{!104} +// CHECK:STDOUT: !107 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6a519b95f6f059eb:core.Destroy.Core", scope: null, file: !84, line: 15, type: !29, spFlags: DISPFlagDefinition, unit: !85, retainedNodes: !110) +// CHECK:STDOUT: !108 = !DILocalVariable(arg: 1, scope: !107, type: !21) +// CHECK:STDOUT: !109 = !DILocation(line: 15, column: 3, scope: !107) +// CHECK:STDOUT: !110 = !{!108} +// CHECK:STDOUT: !111 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.fa5d2a8a45149476:core.Destroy.Core", scope: null, file: !84, line: 15, type: !29, spFlags: DISPFlagDefinition, unit: !85, retainedNodes: !114) +// CHECK:STDOUT: !112 = !DILocalVariable(arg: 1, scope: !111, type: !21) +// CHECK:STDOUT: !113 = !DILocation(line: 15, column: 3, scope: !111) +// CHECK:STDOUT: !114 = !{!112} +// CHECK:STDOUT: !115 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.fa5d2a8a45149476:core.Destroy.Core", scope: null, file: !84, line: 15, type: !29, spFlags: DISPFlagDefinition, unit: !85, retainedNodes: !118) +// CHECK:STDOUT: !116 = !DILocalVariable(arg: 1, scope: !115, type: !21) +// CHECK:STDOUT: !117 = !DILocation(line: 15, column: 3, scope: !115) +// CHECK:STDOUT: !118 = !{!116} +// CHECK:STDOUT: !119 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.2fbae80a61a11ec7:core.Destroy.Core", scope: null, file: !84, line: 15, type: !29, spFlags: DISPFlagDefinition, unit: !85, retainedNodes: !122) +// CHECK:STDOUT: !120 = !DILocalVariable(arg: 1, scope: !119, type: !21) +// CHECK:STDOUT: !121 = !DILocation(line: 15, column: 3, scope: !119) +// CHECK:STDOUT: !122 = !{!120} +// CHECK:STDOUT: !123 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.2fbae80a61a11ec7:core.Destroy.Core", scope: null, file: !84, line: 15, type: !29, spFlags: DISPFlagDefinition, unit: !85, retainedNodes: !126) +// CHECK:STDOUT: !124 = !DILocalVariable(arg: 1, scope: !123, type: !21) +// CHECK:STDOUT: !125 = !DILocation(line: 15, column: 3, scope: !123) +// CHECK:STDOUT: !126 = !{!124} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'implicit_init_with_nonempty_nonconst.carbon' @@ -252,50 +358,97 @@ fn Run() { // CHECK:STDOUT: @Other.val.loc17_40.5 = internal constant { i32 } { i32 42 } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @main() #0 !dbg !89 { +// CHECK:STDOUT: define i32 @main() #0 !dbg !129 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %o.var = alloca { i32 }, align 4, !dbg !90 -// CHECK:STDOUT: %_.var = alloca <{ ptr, { i32 } }>, align 8, !dbg !92 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %o.var), !dbg !90 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !92 -// CHECK:STDOUT: %.loc17_40.2.a = getelementptr inbounds nuw <{ ptr, { i32 } }>, ptr %_.var, i32 0, i32 0, !dbg !95 -// CHECK:STDOUT: store ptr %o.var, ptr %.loc17_40.2.a, align 8, !dbg !95 -// CHECK:STDOUT: %.loc17_40.4.b = getelementptr inbounds nuw <{ ptr, { i32 } }>, ptr %_.var, i32 0, i32 1, !dbg !95 -// CHECK:STDOUT: %.loc17_39.3.v = getelementptr inbounds nuw { i32 }, ptr %.loc17_40.4.b, i32 0, i32 0, !dbg !96 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %.loc17_40.4.b, ptr align 4 @Other.val.loc17_40.5, i64 4, i1 false), !dbg !95 -// CHECK:STDOUT: call void @"_COp.2fbae80a61a11ec7:core.Destroy.Core"(ptr %_.var), !dbg !92 -// CHECK:STDOUT: call void @"_COp.6a519b95f6f059eb:core.Destroy.Core"(ptr %o.var), !dbg !90 -// CHECK:STDOUT: ret i32 0, !dbg !98 +// CHECK:STDOUT: %o.var = alloca { i32 }, align 4, !dbg !130 +// CHECK:STDOUT: %_.var = alloca <{ ptr, { i32 } }>, align 8, !dbg !132 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %o.var), !dbg !130 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !132 +// CHECK:STDOUT: %.loc17_40.2.a = getelementptr inbounds nuw <{ ptr, { i32 } }>, ptr %_.var, i32 0, i32 0, !dbg !135 +// CHECK:STDOUT: store ptr %o.var, ptr %.loc17_40.2.a, align 8, !dbg !135 +// CHECK:STDOUT: %.loc17_40.4.b = getelementptr inbounds nuw <{ ptr, { i32 } }>, ptr %_.var, i32 0, i32 1, !dbg !135 +// CHECK:STDOUT: %.loc17_39.3.v = getelementptr inbounds nuw { i32 }, ptr %.loc17_40.4.b, i32 0, i32 0, !dbg !136 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %.loc17_40.4.b, ptr align 4 @Other.val.loc17_40.5, i64 4, i1 false), !dbg !135 +// CHECK:STDOUT: call void @"_CSelfDestruct.2fbae80a61a11ec7:core.Destroy.Core"(ptr %_.var), !dbg !132 +// CHECK:STDOUT: call void @"_CSelfDestruct.6a519b95f6f059eb:core.Destroy.Core"(ptr %o.var), !dbg !130 +// CHECK:STDOUT: ret i32 0, !dbg !138 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !99 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.d7c3fbe4c84d0842:core.Destroy.Core"(ptr %self) #0 !dbg !139 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !101 +// CHECK:STDOUT: ret void, !dbg !141 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.92afc3a45a31c789:core.Destroy.Core"(ptr %self) #0 !dbg !103 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !143 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !105 +// CHECK:STDOUT: ret void, !dbg !145 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.6a519b95f6f059eb:core.Destroy.Core"(ptr %self) #0 !dbg !107 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !147 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !109 +// CHECK:STDOUT: ret void, !dbg !149 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.fa5d2a8a45149476:core.Destroy.Core"(ptr %self) #0 !dbg !111 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !151 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !113 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !153 +// CHECK:STDOUT: ret void, !dbg !153 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.2fbae80a61a11ec7:core.Destroy.Core"(ptr %self) #0 !dbg !115 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.92afc3a45a31c789:core.Destroy.Core"(ptr %self) #0 !dbg !155 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !117 +// CHECK:STDOUT: ret void, !dbg !157 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.92afc3a45a31c789:core.Destroy.Core"(ptr %self) #0 !dbg !159 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.92afc3a45a31c789:core.Destroy.Core"(ptr %self), !dbg !161 +// CHECK:STDOUT: ret void, !dbg !161 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.6a519b95f6f059eb:core.Destroy.Core"(ptr %self) #0 !dbg !163 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !165 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6a519b95f6f059eb:core.Destroy.Core"(ptr %self) #0 !dbg !167 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.6a519b95f6f059eb:core.Destroy.Core"(ptr %self), !dbg !169 +// CHECK:STDOUT: ret void, !dbg !169 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.fa5d2a8a45149476:core.Destroy.Core"(ptr %self) #0 !dbg !171 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !173 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.fa5d2a8a45149476:core.Destroy.Core"(ptr %self) #0 !dbg !175 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.fa5d2a8a45149476:core.Destroy.Core"(ptr %self), !dbg !177 +// CHECK:STDOUT: ret void, !dbg !177 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.2fbae80a61a11ec7:core.Destroy.Core"(ptr %self) #0 !dbg !179 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !181 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.2fbae80a61a11ec7:core.Destroy.Core"(ptr %self) #0 !dbg !183 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.2fbae80a61a11ec7:core.Destroy.Core"(ptr %self), !dbg !185 +// CHECK:STDOUT: ret void, !dbg !185 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -310,7 +463,7 @@ fn Run() { // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!88} +// CHECK:STDOUT: !llvm.dbg.cu = !{!128} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} @@ -323,32 +476,60 @@ fn Run() { // CHECK:STDOUT: !27 = !DISubroutineType(types: !26) // CHECK:STDOUT: !28 = !{null, !21} // CHECK:STDOUT: !29 = !DISubroutineType(types: !28) -// CHECK:STDOUT: !87 = !DIFile(filename: "implicit_init_with_nonempty_nonconst.carbon", directory: "") -// CHECK:STDOUT: !88 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !87, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !89 = distinct !DISubprogram(name: "Run", linkageName: "main", scope: null, file: !87, line: 13, type: !25, spFlags: DISPFlagDefinition, unit: !88) -// CHECK:STDOUT: !90 = !DILocation(line: 14, column: 3, scope: !89) -// CHECK:STDOUT: !92 = !DILocation(line: 17, column: 3, scope: !89) -// CHECK:STDOUT: !95 = !DILocation(line: 17, column: 16, scope: !89) -// CHECK:STDOUT: !96 = !DILocation(line: 17, column: 31, scope: !89) -// CHECK:STDOUT: !98 = !DILocation(line: 13, column: 1, scope: !89) -// CHECK:STDOUT: !99 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !87, line: 17, type: !27, spFlags: DISPFlagDefinition, unit: !88, retainedNodes: !102) -// CHECK:STDOUT: !100 = !DILocalVariable(arg: 1, scope: !99, type: !20) -// CHECK:STDOUT: !101 = !DILocation(line: 17, column: 3, scope: !99) -// CHECK:STDOUT: !102 = !{!100} -// CHECK:STDOUT: !103 = distinct !DISubprogram(name: "Op", linkageName: "_COp.92afc3a45a31c789:core.Destroy.Core", scope: null, file: !87, line: 17, type: !29, spFlags: DISPFlagDefinition, unit: !88, retainedNodes: !106) -// CHECK:STDOUT: !104 = !DILocalVariable(arg: 1, scope: !103, type: !21) -// CHECK:STDOUT: !105 = !DILocation(line: 17, column: 3, scope: !103) -// CHECK:STDOUT: !106 = !{!104} -// CHECK:STDOUT: !107 = distinct !DISubprogram(name: "Op", linkageName: "_COp.6a519b95f6f059eb:core.Destroy.Core", scope: null, file: !87, line: 17, type: !29, spFlags: DISPFlagDefinition, unit: !88, retainedNodes: !110) -// CHECK:STDOUT: !108 = !DILocalVariable(arg: 1, scope: !107, type: !21) -// CHECK:STDOUT: !109 = !DILocation(line: 17, column: 3, scope: !107) -// CHECK:STDOUT: !110 = !{!108} -// CHECK:STDOUT: !111 = distinct !DISubprogram(name: "Op", linkageName: "_COp.fa5d2a8a45149476:core.Destroy.Core", scope: null, file: !87, line: 17, type: !29, spFlags: DISPFlagDefinition, unit: !88, retainedNodes: !114) -// CHECK:STDOUT: !112 = !DILocalVariable(arg: 1, scope: !111, type: !21) -// CHECK:STDOUT: !113 = !DILocation(line: 17, column: 3, scope: !111) -// CHECK:STDOUT: !114 = !{!112} -// CHECK:STDOUT: !115 = distinct !DISubprogram(name: "Op", linkageName: "_COp.2fbae80a61a11ec7:core.Destroy.Core", scope: null, file: !87, line: 17, type: !29, spFlags: DISPFlagDefinition, unit: !88, retainedNodes: !118) -// CHECK:STDOUT: !116 = !DILocalVariable(arg: 1, scope: !115, type: !21) -// CHECK:STDOUT: !117 = !DILocation(line: 17, column: 3, scope: !115) -// CHECK:STDOUT: !118 = !{!116} +// CHECK:STDOUT: !127 = !DIFile(filename: "implicit_init_with_nonempty_nonconst.carbon", directory: "") +// CHECK:STDOUT: !128 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !127, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !129 = distinct !DISubprogram(name: "Run", linkageName: "main", scope: null, file: !127, line: 13, type: !25, spFlags: DISPFlagDefinition, unit: !128) +// CHECK:STDOUT: !130 = !DILocation(line: 14, column: 3, scope: !129) +// CHECK:STDOUT: !132 = !DILocation(line: 17, column: 3, scope: !129) +// CHECK:STDOUT: !135 = !DILocation(line: 17, column: 16, scope: !129) +// CHECK:STDOUT: !136 = !DILocation(line: 17, column: 31, scope: !129) +// CHECK:STDOUT: !138 = !DILocation(line: 13, column: 1, scope: !129) +// CHECK:STDOUT: !139 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.d7c3fbe4c84d0842:core.Destroy.Core", scope: null, file: !127, line: 17, type: !29, spFlags: DISPFlagDefinition, unit: !128, retainedNodes: !142) +// CHECK:STDOUT: !140 = !DILocalVariable(arg: 1, scope: !139, type: !21) +// CHECK:STDOUT: !141 = !DILocation(line: 17, column: 3, scope: !139) +// CHECK:STDOUT: !142 = !{!140} +// CHECK:STDOUT: !143 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !127, line: 17, type: !27, spFlags: DISPFlagDefinition, unit: !128, retainedNodes: !146) +// CHECK:STDOUT: !144 = !DILocalVariable(arg: 1, scope: !143, type: !20) +// CHECK:STDOUT: !145 = !DILocation(line: 17, column: 3, scope: !143) +// CHECK:STDOUT: !146 = !{!144} +// CHECK:STDOUT: !147 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !127, line: 17, type: !27, spFlags: DISPFlagDefinition, unit: !128, retainedNodes: !150) +// CHECK:STDOUT: !148 = !DILocalVariable(arg: 1, scope: !147, type: !20) +// CHECK:STDOUT: !149 = !DILocation(line: 17, column: 3, scope: !147) +// CHECK:STDOUT: !150 = !{!148} +// CHECK:STDOUT: !151 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !127, line: 17, type: !27, spFlags: DISPFlagDefinition, unit: !128, retainedNodes: !154) +// CHECK:STDOUT: !152 = !DILocalVariable(arg: 1, scope: !151, type: !20) +// CHECK:STDOUT: !153 = !DILocation(line: 17, column: 3, scope: !151) +// CHECK:STDOUT: !154 = !{!152} +// CHECK:STDOUT: !155 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.92afc3a45a31c789:core.Destroy.Core", scope: null, file: !127, line: 17, type: !29, spFlags: DISPFlagDefinition, unit: !128, retainedNodes: !158) +// CHECK:STDOUT: !156 = !DILocalVariable(arg: 1, scope: !155, type: !21) +// CHECK:STDOUT: !157 = !DILocation(line: 17, column: 3, scope: !155) +// CHECK:STDOUT: !158 = !{!156} +// CHECK:STDOUT: !159 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.92afc3a45a31c789:core.Destroy.Core", scope: null, file: !127, line: 17, type: !29, spFlags: DISPFlagDefinition, unit: !128, retainedNodes: !162) +// CHECK:STDOUT: !160 = !DILocalVariable(arg: 1, scope: !159, type: !21) +// CHECK:STDOUT: !161 = !DILocation(line: 17, column: 3, scope: !159) +// CHECK:STDOUT: !162 = !{!160} +// CHECK:STDOUT: !163 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.6a519b95f6f059eb:core.Destroy.Core", scope: null, file: !127, line: 17, type: !29, spFlags: DISPFlagDefinition, unit: !128, retainedNodes: !166) +// CHECK:STDOUT: !164 = !DILocalVariable(arg: 1, scope: !163, type: !21) +// CHECK:STDOUT: !165 = !DILocation(line: 17, column: 3, scope: !163) +// CHECK:STDOUT: !166 = !{!164} +// CHECK:STDOUT: !167 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6a519b95f6f059eb:core.Destroy.Core", scope: null, file: !127, line: 17, type: !29, spFlags: DISPFlagDefinition, unit: !128, retainedNodes: !170) +// CHECK:STDOUT: !168 = !DILocalVariable(arg: 1, scope: !167, type: !21) +// CHECK:STDOUT: !169 = !DILocation(line: 17, column: 3, scope: !167) +// CHECK:STDOUT: !170 = !{!168} +// CHECK:STDOUT: !171 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.fa5d2a8a45149476:core.Destroy.Core", scope: null, file: !127, line: 17, type: !29, spFlags: DISPFlagDefinition, unit: !128, retainedNodes: !174) +// CHECK:STDOUT: !172 = !DILocalVariable(arg: 1, scope: !171, type: !21) +// CHECK:STDOUT: !173 = !DILocation(line: 17, column: 3, scope: !171) +// CHECK:STDOUT: !174 = !{!172} +// CHECK:STDOUT: !175 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.fa5d2a8a45149476:core.Destroy.Core", scope: null, file: !127, line: 17, type: !29, spFlags: DISPFlagDefinition, unit: !128, retainedNodes: !178) +// CHECK:STDOUT: !176 = !DILocalVariable(arg: 1, scope: !175, type: !21) +// CHECK:STDOUT: !177 = !DILocation(line: 17, column: 3, scope: !175) +// CHECK:STDOUT: !178 = !{!176} +// CHECK:STDOUT: !179 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.2fbae80a61a11ec7:core.Destroy.Core", scope: null, file: !127, line: 17, type: !29, spFlags: DISPFlagDefinition, unit: !128, retainedNodes: !182) +// CHECK:STDOUT: !180 = !DILocalVariable(arg: 1, scope: !179, type: !21) +// CHECK:STDOUT: !181 = !DILocation(line: 17, column: 3, scope: !179) +// CHECK:STDOUT: !182 = !{!180} +// CHECK:STDOUT: !183 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.2fbae80a61a11ec7:core.Destroy.Core", scope: null, file: !127, line: 17, type: !29, spFlags: DISPFlagDefinition, unit: !128, retainedNodes: !186) +// CHECK:STDOUT: !184 = !DILocalVariable(arg: 1, scope: !183, type: !21) +// CHECK:STDOUT: !185 = !DILocation(line: 17, column: 3, scope: !183) +// CHECK:STDOUT: !186 = !{!184} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/class/generic.carbon b/toolchain/lower/testdata/class/generic.carbon index c353583b2df1..a6afb436cb53 100644 --- a/toolchain/lower/testdata/class/generic.carbon +++ b/toolchain/lower/testdata/class/generic.carbon @@ -303,98 +303,172 @@ fn AccessTuple() -> (i32, i32, i32) { // CHECK:STDOUT: %.loc16_37.5.w = getelementptr inbounds nuw { i1, i32 }, ptr %c.var, i32 0, i32 1, !dbg !135 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %c.var, ptr align 4 @C.val.29b.loc16_3, i64 8, i1 false), !dbg !134 // CHECK:STDOUT: %C.GetBool.call = call i1 @_CGetBool.C.Main.4d6ceefeb7f772f4(ptr %c.var), !dbg !137 -// CHECK:STDOUT: call void @"_COp.d012f76a41f764ee:core.Destroy.Core"(ptr %c.var), !dbg !134 +// CHECK:STDOUT: call void @"_CSelfDestruct.d012f76a41f764ee:core.Destroy.Core"(ptr %c.var), !dbg !134 // CHECK:STDOUT: ret i1 %C.GetBool.call, !dbg !138 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !139 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.48e0adf639fe7af4:core.Destroy.Core"(ptr %self) #0 !dbg !139 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !141 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.861652b2c489f7cc:core.Destroy.Core"(ptr %self) #0 !dbg !143 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !143 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !145 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.d012f76a41f764ee:core.Destroy.Core"(ptr %self) #0 !dbg !147 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !147 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !149 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CAccessInt.Main() #0 !dbg !151 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !151 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %c.var = alloca { i1, i32 }, align 4, !dbg !154 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !154 -// CHECK:STDOUT: %.loc21_37.2.v = getelementptr inbounds nuw { i1, i32 }, ptr %c.var, i32 0, i32 0, !dbg !155 -// CHECK:STDOUT: %.loc21_37.5.w = getelementptr inbounds nuw { i1, i32 }, ptr %c.var, i32 0, i32 1, !dbg !155 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %c.var, ptr align 4 @C.val.29b.loc16_3, i64 8, i1 false), !dbg !154 -// CHECK:STDOUT: %C.GetT.call = call i32 @_CGetT.C.Main.4d6ceefeb7f772f4(ptr %c.var), !dbg !157 -// CHECK:STDOUT: call void @"_COp.d012f76a41f764ee:core.Destroy.Core"(ptr %c.var), !dbg !154 -// CHECK:STDOUT: ret i32 %C.GetT.call, !dbg !160 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !153 +// CHECK:STDOUT: ret void, !dbg !153 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CAccessEmpty.Main() #0 !dbg !161 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.861652b2c489f7cc:core.Destroy.Core"(ptr %self) #0 !dbg !155 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %c.var = alloca { i1, {} }, align 1, !dbg !164 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !164 -// CHECK:STDOUT: %.loc26_37.2.v = getelementptr inbounds nuw { i1, {} }, ptr %c.var, i32 0, i32 0, !dbg !165 -// CHECK:STDOUT: %.loc26_37.4.w = getelementptr inbounds nuw { i1, {} }, ptr %c.var, i32 0, i32 1, !dbg !165 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %c.var, ptr align 1 @C.val.0ea.loc26_3, i64 1, i1 false), !dbg !164 -// CHECK:STDOUT: call void @_CGetT.C.Main.22bf4b2f6c4322a2(ptr %c.var), !dbg !167 -// CHECK:STDOUT: call void @"_COp.0477b985a5aa27cc:core.Destroy.Core"(ptr %c.var), !dbg !164 -// CHECK:STDOUT: ret void, !dbg !168 +// CHECK:STDOUT: ret void, !dbg !157 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.82468d70c8d12e86:core.Destroy.Core"(ptr %self) #0 !dbg !169 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.861652b2c489f7cc:core.Destroy.Core"(ptr %self) #0 !dbg !159 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !171 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.861652b2c489f7cc:core.Destroy.Core"(ptr %self), !dbg !161 +// CHECK:STDOUT: ret void, !dbg !161 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.0477b985a5aa27cc:core.Destroy.Core"(ptr %self) #0 !dbg !173 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.d012f76a41f764ee:core.Destroy.Core"(ptr %self) #0 !dbg !163 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !175 +// CHECK:STDOUT: ret void, !dbg !165 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CAccessTuple.Main(ptr sret({ i32, i32, i32 }) %return) #0 !dbg !177 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.d012f76a41f764ee:core.Destroy.Core"(ptr %self) #0 !dbg !167 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %c.var = alloca { i1, { i32, i32, i32 } }, align 4, !dbg !180 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !180 -// CHECK:STDOUT: %.loc31_57.2.v = getelementptr inbounds nuw { i1, { i32, i32, i32 } }, ptr %c.var, i32 0, i32 0, !dbg !181 -// CHECK:STDOUT: %.loc31_57.4.w = getelementptr inbounds nuw { i1, { i32, i32, i32 } }, ptr %c.var, i32 0, i32 1, !dbg !181 -// CHECK:STDOUT: %tuple.elem0.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %.loc31_57.4.w, i32 0, i32 0, !dbg !182 -// CHECK:STDOUT: %tuple.elem1.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %.loc31_57.4.w, i32 0, i32 1, !dbg !182 -// CHECK:STDOUT: %tuple.elem2.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %.loc31_57.4.w, i32 0, i32 2, !dbg !182 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %c.var, ptr align 4 @C.val.727.loc31_3, i64 16, i1 false), !dbg !180 -// CHECK:STDOUT: call void @_CGetT.C.Main.03220e6718a91584(ptr %return, ptr %c.var), !dbg !184 -// CHECK:STDOUT: call void @"_COp.3cffcf67f1271f67:core.Destroy.Core"(ptr %c.var), !dbg !180 -// CHECK:STDOUT: ret void, !dbg !185 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.d012f76a41f764ee:core.Destroy.Core"(ptr %self), !dbg !169 +// CHECK:STDOUT: ret void, !dbg !169 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.555b1314256372b8:core.Destroy.Core"(ptr %self) #0 !dbg !186 { +// CHECK:STDOUT: define i32 @_CAccessInt.Main() #0 !dbg !171 { // CHECK:STDOUT: entry: +// CHECK:STDOUT: %c.var = alloca { i1, i32 }, align 4, !dbg !174 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !174 +// CHECK:STDOUT: %.loc21_37.2.v = getelementptr inbounds nuw { i1, i32 }, ptr %c.var, i32 0, i32 0, !dbg !175 +// CHECK:STDOUT: %.loc21_37.5.w = getelementptr inbounds nuw { i1, i32 }, ptr %c.var, i32 0, i32 1, !dbg !175 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %c.var, ptr align 4 @C.val.29b.loc16_3, i64 8, i1 false), !dbg !174 +// CHECK:STDOUT: %C.GetT.call = call i32 @_CGetT.C.Main.4d6ceefeb7f772f4(ptr %c.var), !dbg !177 +// CHECK:STDOUT: call void @"_CSelfDestruct.d012f76a41f764ee:core.Destroy.Core"(ptr %c.var), !dbg !174 +// CHECK:STDOUT: ret i32 %C.GetT.call, !dbg !180 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CAccessEmpty.Main() #0 !dbg !181 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %c.var = alloca { i1, {} }, align 1, !dbg !184 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !184 +// CHECK:STDOUT: %.loc26_37.2.v = getelementptr inbounds nuw { i1, {} }, ptr %c.var, i32 0, i32 0, !dbg !185 +// CHECK:STDOUT: %.loc26_37.4.w = getelementptr inbounds nuw { i1, {} }, ptr %c.var, i32 0, i32 1, !dbg !185 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %c.var, ptr align 1 @C.val.0ea.loc26_3, i64 1, i1 false), !dbg !184 +// CHECK:STDOUT: call void @_CGetT.C.Main.22bf4b2f6c4322a2(ptr %c.var), !dbg !187 +// CHECK:STDOUT: call void @"_CSelfDestruct.0477b985a5aa27cc:core.Destroy.Core"(ptr %c.var), !dbg !184 // CHECK:STDOUT: ret void, !dbg !188 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.1ada7ed46fb16378:core.Destroy.Core"(ptr %self) #0 !dbg !190 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.61ea2aba74ab3bf1:core.Destroy.Core"(ptr %self) #0 !dbg !189 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !192 +// CHECK:STDOUT: ret void, !dbg !191 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.3cffcf67f1271f67:core.Destroy.Core"(ptr %self) #0 !dbg !194 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.82468d70c8d12e86:core.Destroy.Core"(ptr %self) #0 !dbg !193 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !196 +// CHECK:STDOUT: ret void, !dbg !195 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.82468d70c8d12e86:core.Destroy.Core"(ptr %self) #0 !dbg !197 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.82468d70c8d12e86:core.Destroy.Core"(ptr %self), !dbg !199 +// CHECK:STDOUT: ret void, !dbg !199 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.0477b985a5aa27cc:core.Destroy.Core"(ptr %self) #0 !dbg !201 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !203 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.0477b985a5aa27cc:core.Destroy.Core"(ptr %self) #0 !dbg !205 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.0477b985a5aa27cc:core.Destroy.Core"(ptr %self), !dbg !207 +// CHECK:STDOUT: ret void, !dbg !207 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CAccessTuple.Main(ptr sret({ i32, i32, i32 }) %return) #0 !dbg !209 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %c.var = alloca { i1, { i32, i32, i32 } }, align 4, !dbg !212 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !212 +// CHECK:STDOUT: %.loc31_57.2.v = getelementptr inbounds nuw { i1, { i32, i32, i32 } }, ptr %c.var, i32 0, i32 0, !dbg !213 +// CHECK:STDOUT: %.loc31_57.4.w = getelementptr inbounds nuw { i1, { i32, i32, i32 } }, ptr %c.var, i32 0, i32 1, !dbg !213 +// CHECK:STDOUT: %tuple.elem0.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %.loc31_57.4.w, i32 0, i32 0, !dbg !214 +// CHECK:STDOUT: %tuple.elem1.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %.loc31_57.4.w, i32 0, i32 1, !dbg !214 +// CHECK:STDOUT: %tuple.elem2.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %.loc31_57.4.w, i32 0, i32 2, !dbg !214 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %c.var, ptr align 4 @C.val.727.loc31_3, i64 16, i1 false), !dbg !212 +// CHECK:STDOUT: call void @_CGetT.C.Main.03220e6718a91584(ptr %return, ptr %c.var), !dbg !216 +// CHECK:STDOUT: call void @"_CSelfDestruct.3cffcf67f1271f67:core.Destroy.Core"(ptr %c.var), !dbg !212 +// CHECK:STDOUT: ret void, !dbg !217 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.555b1314256372b8:core.Destroy.Core"(ptr %self) #0 !dbg !218 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !220 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.555b1314256372b8:core.Destroy.Core"(ptr %self) #0 !dbg !222 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.555b1314256372b8:core.Destroy.Core"(ptr %self), !dbg !224 +// CHECK:STDOUT: ret void, !dbg !224 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.1ada7ed46fb16378:core.Destroy.Core"(ptr %self) #0 !dbg !226 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !228 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.1ada7ed46fb16378:core.Destroy.Core"(ptr %self) #0 !dbg !230 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.1ada7ed46fb16378:core.Destroy.Core"(ptr %self), !dbg !232 +// CHECK:STDOUT: ret void, !dbg !232 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.3cffcf67f1271f67:core.Destroy.Core"(ptr %self) #0 !dbg !234 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !236 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.3cffcf67f1271f67:core.Destroy.Core"(ptr %self) #0 !dbg !238 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.3cffcf67f1271f67:core.Destroy.Core"(ptr %self), !dbg !240 +// CHECK:STDOUT: ret void, !dbg !240 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -404,52 +478,52 @@ fn AccessTuple() -> (i32, i32, i32) { // 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 i1 @_CGetBool.C.Main.4d6ceefeb7f772f4(ptr %self) #0 !dbg !198 { +// CHECK:STDOUT: define linkonce_odr i1 @_CGetBool.C.Main.4d6ceefeb7f772f4(ptr %self) #0 !dbg !242 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc6_16.1.v = getelementptr inbounds nuw { i1, i32 }, ptr %self, i32 0, i32 0, !dbg !203 -// CHECK:STDOUT: %.loc6_16.2 = load i8, ptr %.loc6_16.1.v, align 1, !dbg !203 -// CHECK:STDOUT: %.loc6_16.21 = trunc i8 %.loc6_16.2 to i1, !dbg !203 -// CHECK:STDOUT: ret i1 %.loc6_16.21, !dbg !204 +// CHECK:STDOUT: %.loc6_16.1.v = getelementptr inbounds nuw { i1, i32 }, ptr %self, i32 0, i32 0, !dbg !247 +// CHECK:STDOUT: %.loc6_16.2 = load i8, ptr %.loc6_16.1.v, align 1, !dbg !247 +// CHECK:STDOUT: %.loc6_16.21 = trunc i8 %.loc6_16.2 to i1, !dbg !247 +// CHECK:STDOUT: ret i1 %.loc6_16.21, !dbg !248 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CGetT.C.Main.4d6ceefeb7f772f4(ptr %self) #0 !dbg !206 { +// CHECK:STDOUT: define linkonce_odr i32 @_CGetT.C.Main.4d6ceefeb7f772f4(ptr %self) #0 !dbg !250 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc9_16.1.w = getelementptr inbounds nuw { i1, i32 }, ptr %self, i32 0, i32 1, !dbg !211 -// CHECK:STDOUT: %.loc9_16.2 = load i32, ptr %.loc9_16.1.w, align 4, !dbg !211 -// CHECK:STDOUT: ret i32 %.loc9_16.2, !dbg !212 +// CHECK:STDOUT: %.loc9_16.1.w = getelementptr inbounds nuw { i1, i32 }, ptr %self, i32 0, i32 1, !dbg !255 +// CHECK:STDOUT: %.loc9_16.2 = load i32, ptr %.loc9_16.1.w, align 4, !dbg !255 +// CHECK:STDOUT: ret i32 %.loc9_16.2, !dbg !256 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CGetT.C.Main.22bf4b2f6c4322a2(ptr %self) #0 !dbg !214 { +// CHECK:STDOUT: define linkonce_odr void @_CGetT.C.Main.22bf4b2f6c4322a2(ptr %self) #0 !dbg !258 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc9_16.1.w = getelementptr inbounds nuw { i1, {} }, ptr %self, i32 0, i32 1, !dbg !219 -// CHECK:STDOUT: ret void, !dbg !220 +// CHECK:STDOUT: %.loc9_16.1.w = getelementptr inbounds nuw { i1, {} }, ptr %self, i32 0, i32 1, !dbg !263 +// CHECK:STDOUT: ret void, !dbg !264 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CGetT.C.Main.03220e6718a91584(ptr sret({ i32, i32, i32 }) %return, ptr %self) #0 !dbg !222 { +// CHECK:STDOUT: define linkonce_odr void @_CGetT.C.Main.03220e6718a91584(ptr sret({ i32, i32, i32 }) %return, ptr %self) #0 !dbg !266 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc9_16.1.w = getelementptr inbounds nuw { i1, { i32, i32, i32 } }, ptr %self, i32 0, i32 1, !dbg !227 -// CHECK:STDOUT: call void @"_COp.6753b13effab4291:Copy.Core.c9f31a0e20c75302"(ptr %return, ptr %.loc9_16.1.w), !dbg !227 -// CHECK:STDOUT: ret void, !dbg !228 +// CHECK:STDOUT: %.loc9_16.1.w = getelementptr inbounds nuw { i1, { i32, i32, i32 } }, ptr %self, i32 0, i32 1, !dbg !271 +// CHECK:STDOUT: call void @"_COp.6753b13effab4291:Copy.Core.c9f31a0e20c75302"(ptr %return, ptr %.loc9_16.1.w), !dbg !271 +// CHECK:STDOUT: ret void, !dbg !272 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_COp.6753b13effab4291:Copy.Core.c9f31a0e20c75302"(ptr sret({ i32, i32, i32 }) %return, ptr %self) #0 !dbg !230 { -// CHECK:STDOUT: %tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %self, i32 0, i32 0, !dbg !235 -// CHECK:STDOUT: %tuple.elem.load = load i32, ptr %tuple.elem, align 4, !dbg !235 -// CHECK:STDOUT: %tuple.elem1 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %return, i32 0, i32 0, !dbg !236 -// CHECK:STDOUT: %tuple.elem2 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %self, i32 0, i32 1, !dbg !237 -// CHECK:STDOUT: %tuple.elem.load3 = load i32, ptr %tuple.elem2, align 4, !dbg !237 -// CHECK:STDOUT: %tuple.elem4 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %return, i32 0, i32 1, !dbg !236 -// CHECK:STDOUT: %tuple.elem5 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %self, i32 0, i32 2, !dbg !238 -// CHECK:STDOUT: %tuple.elem.load6 = load i32, ptr %tuple.elem5, align 4, !dbg !238 -// CHECK:STDOUT: %tuple.elem7 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %return, i32 0, i32 2, !dbg !236 -// CHECK:STDOUT: store i32 %tuple.elem.load, ptr %tuple.elem1, align 4, !dbg !236 -// CHECK:STDOUT: store i32 %tuple.elem.load3, ptr %tuple.elem4, align 4, !dbg !236 -// CHECK:STDOUT: store i32 %tuple.elem.load6, ptr %tuple.elem7, align 4, !dbg !236 -// CHECK:STDOUT: ret void, !dbg !239 +// CHECK:STDOUT: define linkonce_odr void @"_COp.6753b13effab4291:Copy.Core.c9f31a0e20c75302"(ptr sret({ i32, i32, i32 }) %return, ptr %self) #0 !dbg !274 { +// CHECK:STDOUT: %tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %self, i32 0, i32 0, !dbg !279 +// CHECK:STDOUT: %tuple.elem.load = load i32, ptr %tuple.elem, align 4, !dbg !279 +// CHECK:STDOUT: %tuple.elem1 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %return, i32 0, i32 0, !dbg !280 +// CHECK:STDOUT: %tuple.elem2 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %self, i32 0, i32 1, !dbg !281 +// CHECK:STDOUT: %tuple.elem.load3 = load i32, ptr %tuple.elem2, align 4, !dbg !281 +// CHECK:STDOUT: %tuple.elem4 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %return, i32 0, i32 1, !dbg !280 +// CHECK:STDOUT: %tuple.elem5 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %self, i32 0, i32 2, !dbg !282 +// CHECK:STDOUT: %tuple.elem.load6 = load i32, ptr %tuple.elem5, align 4, !dbg !282 +// CHECK:STDOUT: %tuple.elem7 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %return, i32 0, i32 2, !dbg !280 +// CHECK:STDOUT: store i32 %tuple.elem.load, ptr %tuple.elem1, align 4, !dbg !280 +// CHECK:STDOUT: store i32 %tuple.elem.load3, ptr %tuple.elem4, align 4, !dbg !280 +// CHECK:STDOUT: store i32 %tuple.elem.load6, ptr %tuple.elem7, align 4, !dbg !280 +// CHECK:STDOUT: ret void, !dbg !283 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -473,9 +547,9 @@ fn AccessTuple() -> (i32, i32, i32) { // CHECK:STDOUT: !108 = !DISubroutineType(types: !107) // CHECK:STDOUT: !121 = !DIFile(filename: "access.carbon", directory: "") // CHECK:STDOUT: !122 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !121, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !123 = !{null, !36} +// CHECK:STDOUT: !123 = !{null, !37} // CHECK:STDOUT: !124 = !DISubroutineType(types: !123) -// CHECK:STDOUT: !125 = !{null, !37} +// CHECK:STDOUT: !125 = !{null, !36} // CHECK:STDOUT: !126 = !DISubroutineType(types: !125) // CHECK:STDOUT: !127 = !{!36} // CHECK:STDOUT: !128 = !DISubroutineType(types: !127) @@ -486,82 +560,126 @@ fn AccessTuple() -> (i32, i32, i32) { // CHECK:STDOUT: !135 = !DILocation(line: 16, column: 19, scope: !131) // CHECK:STDOUT: !137 = !DILocation(line: 17, column: 10, scope: !131) // CHECK:STDOUT: !138 = !DILocation(line: 17, column: 3, scope: !131) -// CHECK:STDOUT: !139 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !121, line: 16, type: !124, spFlags: DISPFlagDefinition, unit: !122, retainedNodes: !142) -// CHECK:STDOUT: !140 = !DILocalVariable(arg: 1, scope: !139, type: !36) +// CHECK:STDOUT: !139 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.48e0adf639fe7af4:core.Destroy.Core", scope: null, file: !121, line: 16, type: !124, spFlags: DISPFlagDefinition, unit: !122, retainedNodes: !142) +// CHECK:STDOUT: !140 = !DILocalVariable(arg: 1, scope: !139, type: !37) // CHECK:STDOUT: !141 = !DILocation(line: 16, column: 3, scope: !139) // CHECK:STDOUT: !142 = !{!140} -// CHECK:STDOUT: !143 = distinct !DISubprogram(name: "Op", linkageName: "_COp.861652b2c489f7cc:core.Destroy.Core", scope: null, file: !121, line: 16, type: !126, spFlags: DISPFlagDefinition, unit: !122, retainedNodes: !146) -// CHECK:STDOUT: !144 = !DILocalVariable(arg: 1, scope: !143, type: !37) +// CHECK:STDOUT: !143 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !121, line: 16, type: !126, spFlags: DISPFlagDefinition, unit: !122, retainedNodes: !146) +// CHECK:STDOUT: !144 = !DILocalVariable(arg: 1, scope: !143, type: !36) // CHECK:STDOUT: !145 = !DILocation(line: 16, column: 3, scope: !143) // CHECK:STDOUT: !146 = !{!144} -// CHECK:STDOUT: !147 = distinct !DISubprogram(name: "Op", linkageName: "_COp.d012f76a41f764ee:core.Destroy.Core", scope: null, file: !121, line: 16, type: !126, spFlags: DISPFlagDefinition, unit: !122, retainedNodes: !150) -// CHECK:STDOUT: !148 = !DILocalVariable(arg: 1, scope: !147, type: !37) +// CHECK:STDOUT: !147 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !121, line: 16, type: !126, spFlags: DISPFlagDefinition, unit: !122, retainedNodes: !150) +// CHECK:STDOUT: !148 = !DILocalVariable(arg: 1, scope: !147, type: !36) // CHECK:STDOUT: !149 = !DILocation(line: 16, column: 3, scope: !147) // CHECK:STDOUT: !150 = !{!148} -// CHECK:STDOUT: !151 = distinct !DISubprogram(name: "AccessInt", linkageName: "_CAccessInt.Main", scope: null, file: !121, line: 20, type: !128, spFlags: DISPFlagDefinition, unit: !122) -// CHECK:STDOUT: !154 = !DILocation(line: 21, column: 3, scope: !151) -// CHECK:STDOUT: !155 = !DILocation(line: 21, column: 19, scope: !151) -// CHECK:STDOUT: !157 = !DILocation(line: 22, column: 10, scope: !151) -// CHECK:STDOUT: !158 = !{!36, !37} -// CHECK:STDOUT: !159 = !DISubroutineType(types: !158) -// CHECK:STDOUT: !160 = !DILocation(line: 22, column: 3, scope: !151) -// CHECK:STDOUT: !161 = distinct !DISubprogram(name: "AccessEmpty", linkageName: "_CAccessEmpty.Main", scope: null, file: !121, line: 25, type: !130, spFlags: DISPFlagDefinition, unit: !122) -// CHECK:STDOUT: !164 = !DILocation(line: 26, column: 3, scope: !161) -// CHECK:STDOUT: !165 = !DILocation(line: 26, column: 18, scope: !161) -// CHECK:STDOUT: !167 = !DILocation(line: 27, column: 10, scope: !161) -// CHECK:STDOUT: !168 = !DILocation(line: 27, column: 3, scope: !161) -// CHECK:STDOUT: !169 = distinct !DISubprogram(name: "Op", linkageName: "_COp.82468d70c8d12e86:core.Destroy.Core", scope: null, file: !121, line: 26, type: !126, spFlags: DISPFlagDefinition, unit: !122, retainedNodes: !172) -// CHECK:STDOUT: !170 = !DILocalVariable(arg: 1, scope: !169, type: !37) -// CHECK:STDOUT: !171 = !DILocation(line: 26, column: 3, scope: !169) -// CHECK:STDOUT: !172 = !{!170} -// CHECK:STDOUT: !173 = distinct !DISubprogram(name: "Op", linkageName: "_COp.0477b985a5aa27cc:core.Destroy.Core", scope: null, file: !121, line: 26, type: !126, spFlags: DISPFlagDefinition, unit: !122, retainedNodes: !176) -// CHECK:STDOUT: !174 = !DILocalVariable(arg: 1, scope: !173, type: !37) -// CHECK:STDOUT: !175 = !DILocation(line: 26, column: 3, scope: !173) -// CHECK:STDOUT: !176 = !{!174} -// CHECK:STDOUT: !177 = distinct !DISubprogram(name: "AccessTuple", linkageName: "_CAccessTuple.Main", scope: null, file: !121, line: 30, type: !39, spFlags: DISPFlagDefinition, unit: !122) -// CHECK:STDOUT: !180 = !DILocation(line: 31, column: 3, scope: !177) -// CHECK:STDOUT: !181 = !DILocation(line: 31, column: 31, scope: !177) -// CHECK:STDOUT: !182 = !DILocation(line: 31, column: 48, scope: !177) -// CHECK:STDOUT: !184 = !DILocation(line: 32, column: 10, scope: !177) -// CHECK:STDOUT: !185 = !DILocation(line: 32, column: 3, scope: !177) -// CHECK:STDOUT: !186 = distinct !DISubprogram(name: "Op", linkageName: "_COp.555b1314256372b8:core.Destroy.Core", scope: null, file: !121, line: 31, type: !126, spFlags: DISPFlagDefinition, unit: !122, retainedNodes: !189) -// CHECK:STDOUT: !187 = !DILocalVariable(arg: 1, scope: !186, type: !37) -// CHECK:STDOUT: !188 = !DILocation(line: 31, column: 3, scope: !186) -// CHECK:STDOUT: !189 = !{!187} -// CHECK:STDOUT: !190 = distinct !DISubprogram(name: "Op", linkageName: "_COp.1ada7ed46fb16378:core.Destroy.Core", scope: null, file: !121, line: 31, type: !126, spFlags: DISPFlagDefinition, unit: !122, retainedNodes: !193) -// CHECK:STDOUT: !191 = !DILocalVariable(arg: 1, scope: !190, type: !37) -// CHECK:STDOUT: !192 = !DILocation(line: 31, column: 3, scope: !190) -// CHECK:STDOUT: !193 = !{!191} -// CHECK:STDOUT: !194 = distinct !DISubprogram(name: "Op", linkageName: "_COp.3cffcf67f1271f67:core.Destroy.Core", scope: null, file: !121, line: 31, type: !126, spFlags: DISPFlagDefinition, unit: !122, retainedNodes: !197) -// CHECK:STDOUT: !195 = !DILocalVariable(arg: 1, scope: !194, type: !37) -// CHECK:STDOUT: !196 = !DILocation(line: 31, column: 3, scope: !194) -// CHECK:STDOUT: !197 = !{!195} -// CHECK:STDOUT: !198 = distinct !DISubprogram(name: "GetBool", linkageName: "_CGetBool.C.Main.4d6ceefeb7f772f4", scope: null, file: !121, line: 5, type: !108, spFlags: DISPFlagDefinition, unit: !122, retainedNodes: !205) -// CHECK:STDOUT: !199 = !DILocalVariable(arg: 1, scope: !198, type: !37) -// CHECK:STDOUT: !203 = !DILocation(line: 6, column: 12, scope: !198) -// CHECK:STDOUT: !204 = !DILocation(line: 6, column: 5, scope: !198) -// CHECK:STDOUT: !205 = !{!199} -// CHECK:STDOUT: !206 = distinct !DISubprogram(name: "GetT", linkageName: "_CGetT.C.Main.4d6ceefeb7f772f4", scope: null, file: !121, line: 8, type: !159, spFlags: DISPFlagDefinition, unit: !122, retainedNodes: !213) -// CHECK:STDOUT: !207 = !DILocalVariable(arg: 1, scope: !206, type: !37) -// CHECK:STDOUT: !211 = !DILocation(line: 9, column: 12, scope: !206) -// CHECK:STDOUT: !212 = !DILocation(line: 9, column: 5, scope: !206) -// CHECK:STDOUT: !213 = !{!207} -// CHECK:STDOUT: !214 = distinct !DISubprogram(name: "GetT", linkageName: "_CGetT.C.Main.22bf4b2f6c4322a2", scope: null, file: !121, line: 8, type: !126, spFlags: DISPFlagDefinition, unit: !122, retainedNodes: !221) -// CHECK:STDOUT: !215 = !DILocalVariable(arg: 1, scope: !214, type: !37) -// CHECK:STDOUT: !219 = !DILocation(line: 9, column: 12, scope: !214) -// CHECK:STDOUT: !220 = !DILocation(line: 9, column: 5, scope: !214) -// CHECK:STDOUT: !221 = !{!215} -// CHECK:STDOUT: !222 = distinct !DISubprogram(name: "GetT", linkageName: "_CGetT.C.Main.03220e6718a91584", scope: null, file: !121, line: 8, type: !108, spFlags: DISPFlagDefinition, unit: !122, retainedNodes: !229) +// CHECK:STDOUT: !151 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !121, line: 16, type: !126, spFlags: DISPFlagDefinition, unit: !122, retainedNodes: !154) +// CHECK:STDOUT: !152 = !DILocalVariable(arg: 1, scope: !151, type: !36) +// CHECK:STDOUT: !153 = !DILocation(line: 16, column: 3, scope: !151) +// CHECK:STDOUT: !154 = !{!152} +// CHECK:STDOUT: !155 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.861652b2c489f7cc:core.Destroy.Core", scope: null, file: !121, line: 16, type: !124, spFlags: DISPFlagDefinition, unit: !122, retainedNodes: !158) +// CHECK:STDOUT: !156 = !DILocalVariable(arg: 1, scope: !155, type: !37) +// CHECK:STDOUT: !157 = !DILocation(line: 16, column: 3, scope: !155) +// CHECK:STDOUT: !158 = !{!156} +// CHECK:STDOUT: !159 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.861652b2c489f7cc:core.Destroy.Core", scope: null, file: !121, line: 16, type: !124, spFlags: DISPFlagDefinition, unit: !122, retainedNodes: !162) +// CHECK:STDOUT: !160 = !DILocalVariable(arg: 1, scope: !159, type: !37) +// CHECK:STDOUT: !161 = !DILocation(line: 16, column: 3, scope: !159) +// CHECK:STDOUT: !162 = !{!160} +// CHECK:STDOUT: !163 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.d012f76a41f764ee:core.Destroy.Core", scope: null, file: !121, line: 16, type: !124, spFlags: DISPFlagDefinition, unit: !122, retainedNodes: !166) +// CHECK:STDOUT: !164 = !DILocalVariable(arg: 1, scope: !163, type: !37) +// CHECK:STDOUT: !165 = !DILocation(line: 16, column: 3, scope: !163) +// CHECK:STDOUT: !166 = !{!164} +// CHECK:STDOUT: !167 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.d012f76a41f764ee:core.Destroy.Core", scope: null, file: !121, line: 16, type: !124, spFlags: DISPFlagDefinition, unit: !122, retainedNodes: !170) +// CHECK:STDOUT: !168 = !DILocalVariable(arg: 1, scope: !167, type: !37) +// CHECK:STDOUT: !169 = !DILocation(line: 16, column: 3, scope: !167) +// CHECK:STDOUT: !170 = !{!168} +// CHECK:STDOUT: !171 = distinct !DISubprogram(name: "AccessInt", linkageName: "_CAccessInt.Main", scope: null, file: !121, line: 20, type: !128, spFlags: DISPFlagDefinition, unit: !122) +// CHECK:STDOUT: !174 = !DILocation(line: 21, column: 3, scope: !171) +// CHECK:STDOUT: !175 = !DILocation(line: 21, column: 19, scope: !171) +// CHECK:STDOUT: !177 = !DILocation(line: 22, column: 10, scope: !171) +// CHECK:STDOUT: !178 = !{!36, !37} +// CHECK:STDOUT: !179 = !DISubroutineType(types: !178) +// CHECK:STDOUT: !180 = !DILocation(line: 22, column: 3, scope: !171) +// CHECK:STDOUT: !181 = distinct !DISubprogram(name: "AccessEmpty", linkageName: "_CAccessEmpty.Main", scope: null, file: !121, line: 25, type: !130, spFlags: DISPFlagDefinition, unit: !122) +// CHECK:STDOUT: !184 = !DILocation(line: 26, column: 3, scope: !181) +// CHECK:STDOUT: !185 = !DILocation(line: 26, column: 18, scope: !181) +// CHECK:STDOUT: !187 = !DILocation(line: 27, column: 10, scope: !181) +// CHECK:STDOUT: !188 = !DILocation(line: 27, column: 3, scope: !181) +// CHECK:STDOUT: !189 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.61ea2aba74ab3bf1:core.Destroy.Core", scope: null, file: !121, line: 26, type: !124, spFlags: DISPFlagDefinition, unit: !122, retainedNodes: !192) +// CHECK:STDOUT: !190 = !DILocalVariable(arg: 1, scope: !189, type: !37) +// CHECK:STDOUT: !191 = !DILocation(line: 26, column: 3, scope: !189) +// CHECK:STDOUT: !192 = !{!190} +// CHECK:STDOUT: !193 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.82468d70c8d12e86:core.Destroy.Core", scope: null, file: !121, line: 26, type: !124, spFlags: DISPFlagDefinition, unit: !122, retainedNodes: !196) +// CHECK:STDOUT: !194 = !DILocalVariable(arg: 1, scope: !193, type: !37) +// CHECK:STDOUT: !195 = !DILocation(line: 26, column: 3, scope: !193) +// CHECK:STDOUT: !196 = !{!194} +// CHECK:STDOUT: !197 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.82468d70c8d12e86:core.Destroy.Core", scope: null, file: !121, line: 26, type: !124, spFlags: DISPFlagDefinition, unit: !122, retainedNodes: !200) +// CHECK:STDOUT: !198 = !DILocalVariable(arg: 1, scope: !197, type: !37) +// CHECK:STDOUT: !199 = !DILocation(line: 26, column: 3, scope: !197) +// CHECK:STDOUT: !200 = !{!198} +// CHECK:STDOUT: !201 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.0477b985a5aa27cc:core.Destroy.Core", scope: null, file: !121, line: 26, type: !124, spFlags: DISPFlagDefinition, unit: !122, retainedNodes: !204) +// CHECK:STDOUT: !202 = !DILocalVariable(arg: 1, scope: !201, type: !37) +// CHECK:STDOUT: !203 = !DILocation(line: 26, column: 3, scope: !201) +// CHECK:STDOUT: !204 = !{!202} +// CHECK:STDOUT: !205 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.0477b985a5aa27cc:core.Destroy.Core", scope: null, file: !121, line: 26, type: !124, spFlags: DISPFlagDefinition, unit: !122, retainedNodes: !208) +// CHECK:STDOUT: !206 = !DILocalVariable(arg: 1, scope: !205, type: !37) +// CHECK:STDOUT: !207 = !DILocation(line: 26, column: 3, scope: !205) +// CHECK:STDOUT: !208 = !{!206} +// CHECK:STDOUT: !209 = distinct !DISubprogram(name: "AccessTuple", linkageName: "_CAccessTuple.Main", scope: null, file: !121, line: 30, type: !39, spFlags: DISPFlagDefinition, unit: !122) +// CHECK:STDOUT: !212 = !DILocation(line: 31, column: 3, scope: !209) +// CHECK:STDOUT: !213 = !DILocation(line: 31, column: 31, scope: !209) +// CHECK:STDOUT: !214 = !DILocation(line: 31, column: 48, scope: !209) +// CHECK:STDOUT: !216 = !DILocation(line: 32, column: 10, scope: !209) +// CHECK:STDOUT: !217 = !DILocation(line: 32, column: 3, scope: !209) +// CHECK:STDOUT: !218 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.555b1314256372b8:core.Destroy.Core", scope: null, file: !121, line: 31, type: !124, spFlags: DISPFlagDefinition, unit: !122, retainedNodes: !221) +// CHECK:STDOUT: !219 = !DILocalVariable(arg: 1, scope: !218, type: !37) +// CHECK:STDOUT: !220 = !DILocation(line: 31, column: 3, scope: !218) +// CHECK:STDOUT: !221 = !{!219} +// CHECK:STDOUT: !222 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.555b1314256372b8:core.Destroy.Core", scope: null, file: !121, line: 31, type: !124, spFlags: DISPFlagDefinition, unit: !122, retainedNodes: !225) // CHECK:STDOUT: !223 = !DILocalVariable(arg: 1, scope: !222, type: !37) -// CHECK:STDOUT: !227 = !DILocation(line: 9, column: 12, scope: !222) -// CHECK:STDOUT: !228 = !DILocation(line: 9, column: 5, scope: !222) -// CHECK:STDOUT: !229 = !{!223} -// CHECK:STDOUT: !230 = distinct !DISubprogram(name: "Op", linkageName: "_COp.6753b13effab4291:Copy.Core.c9f31a0e20c75302", scope: null, file: !9, line: 58, type: !108, spFlags: DISPFlagDefinition, unit: !122, retainedNodes: !240) +// CHECK:STDOUT: !224 = !DILocation(line: 31, column: 3, scope: !222) +// CHECK:STDOUT: !225 = !{!223} +// CHECK:STDOUT: !226 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.1ada7ed46fb16378:core.Destroy.Core", scope: null, file: !121, line: 31, type: !124, spFlags: DISPFlagDefinition, unit: !122, retainedNodes: !229) +// CHECK:STDOUT: !227 = !DILocalVariable(arg: 1, scope: !226, type: !37) +// CHECK:STDOUT: !228 = !DILocation(line: 31, column: 3, scope: !226) +// CHECK:STDOUT: !229 = !{!227} +// CHECK:STDOUT: !230 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.1ada7ed46fb16378:core.Destroy.Core", scope: null, file: !121, line: 31, type: !124, spFlags: DISPFlagDefinition, unit: !122, retainedNodes: !233) // CHECK:STDOUT: !231 = !DILocalVariable(arg: 1, scope: !230, type: !37) -// CHECK:STDOUT: !235 = !DILocation(line: 59, column: 13, scope: !230) -// CHECK:STDOUT: !236 = !DILocation(line: 59, column: 12, scope: !230) -// CHECK:STDOUT: !237 = !DILocation(line: 59, column: 26, scope: !230) -// CHECK:STDOUT: !238 = !DILocation(line: 59, column: 39, scope: !230) -// CHECK:STDOUT: !239 = !DILocation(line: 59, column: 5, scope: !230) -// CHECK:STDOUT: !240 = !{!231} +// CHECK:STDOUT: !232 = !DILocation(line: 31, column: 3, scope: !230) +// CHECK:STDOUT: !233 = !{!231} +// CHECK:STDOUT: !234 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.3cffcf67f1271f67:core.Destroy.Core", scope: null, file: !121, line: 31, type: !124, spFlags: DISPFlagDefinition, unit: !122, retainedNodes: !237) +// CHECK:STDOUT: !235 = !DILocalVariable(arg: 1, scope: !234, type: !37) +// CHECK:STDOUT: !236 = !DILocation(line: 31, column: 3, scope: !234) +// CHECK:STDOUT: !237 = !{!235} +// CHECK:STDOUT: !238 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.3cffcf67f1271f67:core.Destroy.Core", scope: null, file: !121, line: 31, type: !124, spFlags: DISPFlagDefinition, unit: !122, retainedNodes: !241) +// CHECK:STDOUT: !239 = !DILocalVariable(arg: 1, scope: !238, type: !37) +// CHECK:STDOUT: !240 = !DILocation(line: 31, column: 3, scope: !238) +// CHECK:STDOUT: !241 = !{!239} +// CHECK:STDOUT: !242 = distinct !DISubprogram(name: "GetBool", linkageName: "_CGetBool.C.Main.4d6ceefeb7f772f4", scope: null, file: !121, line: 5, type: !108, spFlags: DISPFlagDefinition, unit: !122, retainedNodes: !249) +// CHECK:STDOUT: !243 = !DILocalVariable(arg: 1, scope: !242, type: !37) +// CHECK:STDOUT: !247 = !DILocation(line: 6, column: 12, scope: !242) +// CHECK:STDOUT: !248 = !DILocation(line: 6, column: 5, scope: !242) +// CHECK:STDOUT: !249 = !{!243} +// CHECK:STDOUT: !250 = distinct !DISubprogram(name: "GetT", linkageName: "_CGetT.C.Main.4d6ceefeb7f772f4", scope: null, file: !121, line: 8, type: !179, spFlags: DISPFlagDefinition, unit: !122, retainedNodes: !257) +// CHECK:STDOUT: !251 = !DILocalVariable(arg: 1, scope: !250, type: !37) +// CHECK:STDOUT: !255 = !DILocation(line: 9, column: 12, scope: !250) +// CHECK:STDOUT: !256 = !DILocation(line: 9, column: 5, scope: !250) +// CHECK:STDOUT: !257 = !{!251} +// CHECK:STDOUT: !258 = distinct !DISubprogram(name: "GetT", linkageName: "_CGetT.C.Main.22bf4b2f6c4322a2", scope: null, file: !121, line: 8, type: !124, spFlags: DISPFlagDefinition, unit: !122, retainedNodes: !265) +// CHECK:STDOUT: !259 = !DILocalVariable(arg: 1, scope: !258, type: !37) +// CHECK:STDOUT: !263 = !DILocation(line: 9, column: 12, scope: !258) +// CHECK:STDOUT: !264 = !DILocation(line: 9, column: 5, scope: !258) +// CHECK:STDOUT: !265 = !{!259} +// CHECK:STDOUT: !266 = distinct !DISubprogram(name: "GetT", linkageName: "_CGetT.C.Main.03220e6718a91584", scope: null, file: !121, line: 8, type: !108, spFlags: DISPFlagDefinition, unit: !122, retainedNodes: !273) +// CHECK:STDOUT: !267 = !DILocalVariable(arg: 1, scope: !266, type: !37) +// CHECK:STDOUT: !271 = !DILocation(line: 9, column: 12, scope: !266) +// CHECK:STDOUT: !272 = !DILocation(line: 9, column: 5, scope: !266) +// CHECK:STDOUT: !273 = !{!267} +// CHECK:STDOUT: !274 = distinct !DISubprogram(name: "Op", linkageName: "_COp.6753b13effab4291:Copy.Core.c9f31a0e20c75302", scope: null, file: !9, line: 58, type: !108, spFlags: DISPFlagDefinition, unit: !122, retainedNodes: !284) +// CHECK:STDOUT: !275 = !DILocalVariable(arg: 1, scope: !274, type: !37) +// CHECK:STDOUT: !279 = !DILocation(line: 59, column: 13, scope: !274) +// CHECK:STDOUT: !280 = !DILocation(line: 59, column: 12, scope: !274) +// CHECK:STDOUT: !281 = !DILocation(line: 59, column: 26, scope: !274) +// CHECK:STDOUT: !282 = !DILocation(line: 59, column: 39, scope: !274) +// CHECK:STDOUT: !283 = !DILocation(line: 59, column: 5, scope: !274) +// CHECK:STDOUT: !284 = !{!275} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/class/static.carbon b/toolchain/lower/testdata/class/static.carbon index d8d7fb8f2fdf..10fbe93badc9 100644 --- a/toolchain/lower/testdata/class/static.carbon +++ b/toolchain/lower/testdata/class/static.carbon @@ -104,28 +104,41 @@ fn Run() -> i32 { // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind // CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.C.Main"(ptr %self) #1 !dbg !43 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @"_COp.08d9e38b928ba575:core.Destroy.Core"(ptr %self), !dbg !45 +// CHECK:STDOUT: call void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr %self), !dbg !45 // CHECK:STDOUT: ret void, !dbg !45 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #2 !dbg !47 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %self) #2 !dbg !47 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !49 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @main() #2 !dbg !51 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #2 !dbg !51 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %F.call = call i32 @_Z1Fv(), !dbg !54 -// CHECK:STDOUT: ret i32 %F.call, !dbg !55 +// CHECK:STDOUT: ret void, !dbg !53 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define internal void @_C__global_init.Main() #2 !dbg !56 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #2 !dbg !55 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: store i32 123, ptr @_Cx.C.Main, align 4, !dbg !57 -// CHECK:STDOUT: ret void, !dbg !58 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core"(ptr %self), !dbg !57 +// CHECK:STDOUT: ret void, !dbg !57 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define i32 @main() #2 !dbg !59 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %F.call = call i32 @_Z1Fv(), !dbg !62 +// CHECK:STDOUT: ret i32 %F.call, !dbg !63 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define internal void @_C__global_init.Main() #2 !dbg !64 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: store i32 123, ptr @_Cx.C.Main, align 4, !dbg !65 +// CHECK:STDOUT: ret void, !dbg !66 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } @@ -133,8 +146,8 @@ fn Run() -> i32 { // CHECK:STDOUT: attributes #2 = { nounwind } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!37} -// CHECK:STDOUT: !llvm.module.flags = !{!59, !60, !61, !6, !7} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!63} +// CHECK:STDOUT: !llvm.module.flags = !{!67, !68, !69, !6, !7} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!71} // CHECK:STDOUT: // CHECK:STDOUT: !0 = !{!"Simple C++ TBAA"} // CHECK:STDOUT: !1 = !{!"omnipotent char", !0, i64 0} @@ -156,19 +169,27 @@ fn Run() -> i32 { // CHECK:STDOUT: !44 = !DILocalVariable(arg: 1, scope: !43, type: !38) // CHECK:STDOUT: !45 = !DILocation(line: 4, column: 1, scope: !43) // CHECK:STDOUT: !46 = !{!44} -// CHECK:STDOUT: !47 = distinct !DISubprogram(name: "Op", linkageName: "_COp.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !36, line: 4, type: !40, spFlags: DISPFlagDefinition, unit: !37, retainedNodes: !50) +// CHECK:STDOUT: !47 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !36, line: 4, type: !40, spFlags: DISPFlagDefinition, unit: !37, retainedNodes: !50) // CHECK:STDOUT: !48 = !DILocalVariable(arg: 1, scope: !47, type: !38) // CHECK:STDOUT: !49 = !DILocation(line: 4, column: 1, scope: !47) // CHECK:STDOUT: !50 = !{!48} -// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "Run", linkageName: "main", scope: null, file: !36, line: 14, type: !42, spFlags: DISPFlagDefinition, unit: !37) -// CHECK:STDOUT: !54 = !DILocation(line: 15, column: 10, scope: !51) -// CHECK:STDOUT: !55 = !DILocation(line: 15, column: 3, scope: !51) -// CHECK:STDOUT: !56 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !36, type: !26, spFlags: DISPFlagDefinition, unit: !37) -// CHECK:STDOUT: !57 = !DILocation(line: 5, column: 10, scope: !56) -// CHECK:STDOUT: !58 = !DILocation(line: 0, scope: !56) -// CHECK:STDOUT: !59 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !60 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !61 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !62 = !{!"__libc_errno", !2, i64 0} -// CHECK:STDOUT: !63 = !{!62, !2, i64 0} +// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !36, line: 4, type: !40, spFlags: DISPFlagDefinition, unit: !37, retainedNodes: !54) +// CHECK:STDOUT: !52 = !DILocalVariable(arg: 1, scope: !51, type: !38) +// CHECK:STDOUT: !53 = !DILocation(line: 4, column: 1, scope: !51) +// CHECK:STDOUT: !54 = !{!52} +// CHECK:STDOUT: !55 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !36, line: 4, type: !40, spFlags: DISPFlagDefinition, unit: !37, retainedNodes: !58) +// CHECK:STDOUT: !56 = !DILocalVariable(arg: 1, scope: !55, type: !38) +// CHECK:STDOUT: !57 = !DILocation(line: 4, column: 1, scope: !55) +// CHECK:STDOUT: !58 = !{!56} +// CHECK:STDOUT: !59 = distinct !DISubprogram(name: "Run", linkageName: "main", scope: null, file: !36, line: 14, type: !42, spFlags: DISPFlagDefinition, unit: !37) +// CHECK:STDOUT: !62 = !DILocation(line: 15, column: 10, scope: !59) +// CHECK:STDOUT: !63 = !DILocation(line: 15, column: 3, scope: !59) +// CHECK:STDOUT: !64 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !36, type: !26, spFlags: DISPFlagDefinition, unit: !37) +// CHECK:STDOUT: !65 = !DILocation(line: 5, column: 10, scope: !64) +// CHECK:STDOUT: !66 = !DILocation(line: 0, scope: !64) +// CHECK:STDOUT: !67 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !68 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !69 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !70 = !{!"__libc_errno", !2, i64 0} +// CHECK:STDOUT: !71 = !{!70, !2, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/class/virtual.carbon b/toolchain/lower/testdata/class/virtual.carbon index d63345b55091..5748abfac347 100644 --- a/toolchain/lower/testdata/class/virtual.carbon +++ b/toolchain/lower/testdata/class/virtual.carbon @@ -296,10 +296,10 @@ fn Use() { // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %_.var.loc9, ptr align 8 @Derived.val.loc9_49.5, i64 8, i1 false), !dbg !49 // CHECK:STDOUT: store ptr @"_CDerived.Classes.$vtable", ptr %.loc9_49.7.vptr, align 8, !dbg !49 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc12), !dbg !52 -// CHECK:STDOUT: call void @"_COp.43ed5d0e08fc7556:core.Destroy.Core"(ptr %_.var.loc12), !dbg !52 -// CHECK:STDOUT: call void @"_COp.43ed5d0e08fc7556:core.Destroy.Core"(ptr %_.var.loc9), !dbg !48 -// CHECK:STDOUT: call void @"_COp.4487e305711510e9:core.Destroy.Core"(ptr %_.var.loc8), !dbg !45 -// CHECK:STDOUT: call void @"_COp.bf085e1f873e33df:core.Destroy.Core"(ptr %_.var.loc7), !dbg !43 +// CHECK:STDOUT: call void @"_CSelfDestruct.43ed5d0e08fc7556:core.Destroy.Core"(ptr %_.var.loc12), !dbg !52 +// CHECK:STDOUT: call void @"_CSelfDestruct.43ed5d0e08fc7556:core.Destroy.Core"(ptr %_.var.loc9), !dbg !48 +// CHECK:STDOUT: call void @"_CSelfDestruct.4487e305711510e9:core.Destroy.Core"(ptr %_.var.loc8), !dbg !45 +// CHECK:STDOUT: call void @"_CSelfDestruct.bf085e1f873e33df:core.Destroy.Core"(ptr %_.var.loc7), !dbg !43 // CHECK:STDOUT: ret void, !dbg !54 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -308,42 +308,89 @@ fn Use() { // CHECK:STDOUT: declare void @"_CFn:thunk:Intermediate.Classes:Derived.Classes"(ptr) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.bf085e1f873e33df:core.Destroy.Core"(ptr %self) #0 !dbg !55 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.454fecbcedcd86e1:core.Destroy.Core"(ptr %self) #0 !dbg !55 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !57 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f7b08e0f33b30342:core.Destroy.Core"(ptr %self) #0 !dbg !59 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %self) #0 !dbg !59 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !61 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.4487e305711510e9:core.Destroy.Core"(ptr %self) #0 !dbg !63 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.bf085e1f873e33df:core.Destroy.Core"(ptr %self) #0 !dbg !63 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !65 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.3c3534e993db7939:core.Destroy.Core"(ptr %self) #0 !dbg !67 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.bf085e1f873e33df:core.Destroy.Core"(ptr %self) #0 !dbg !67 { // CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.bf085e1f873e33df:core.Destroy.Core"(ptr %self), !dbg !69 // CHECK:STDOUT: ret void, !dbg !69 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.43ed5d0e08fc7556:core.Destroy.Core"(ptr %self) #0 !dbg !71 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f7b08e0f33b30342:core.Destroy.Core"(ptr %self) #0 !dbg !71 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !73 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CUse.Create(ptr %v) #0 !dbg !75 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f7b08e0f33b30342:core.Destroy.Core"(ptr %self) #0 !dbg !75 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Intermediate.Fn.call.vtable = load ptr, ptr %v, align 8, !dbg !78 -// CHECK:STDOUT: %Intermediate.Fn.call = call ptr @llvm.load.relative.i32(ptr %Intermediate.Fn.call.vtable, i32 0), !dbg !78 -// CHECK:STDOUT: call void %Intermediate.Fn.call(ptr %v), !dbg !78 -// CHECK:STDOUT: ret void, !dbg !79 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f7b08e0f33b30342:core.Destroy.Core"(ptr %self), !dbg !77 +// CHECK:STDOUT: ret void, !dbg !77 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.4487e305711510e9:core.Destroy.Core"(ptr %self) #0 !dbg !79 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !81 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.4487e305711510e9:core.Destroy.Core"(ptr %self) #0 !dbg !83 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.4487e305711510e9:core.Destroy.Core"(ptr %self), !dbg !85 +// CHECK:STDOUT: ret void, !dbg !85 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.3c3534e993db7939:core.Destroy.Core"(ptr %self) #0 !dbg !87 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !89 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.3c3534e993db7939:core.Destroy.Core"(ptr %self) #0 !dbg !91 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.3c3534e993db7939:core.Destroy.Core"(ptr %self), !dbg !93 +// CHECK:STDOUT: ret void, !dbg !93 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.43ed5d0e08fc7556:core.Destroy.Core"(ptr %self) #0 !dbg !95 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !97 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.43ed5d0e08fc7556:core.Destroy.Core"(ptr %self) #0 !dbg !99 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.43ed5d0e08fc7556:core.Destroy.Core"(ptr %self), !dbg !101 +// CHECK:STDOUT: ret void, !dbg !101 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CUse.Create(ptr %v) #0 !dbg !103 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %Intermediate.Fn.call.vtable = load ptr, ptr %v, align 8, !dbg !106 +// CHECK:STDOUT: %Intermediate.Fn.call = call ptr @llvm.load.relative.i32(ptr %Intermediate.Fn.call.vtable, i32 0), !dbg !106 +// CHECK:STDOUT: call void %Intermediate.Fn.call(ptr %v), !dbg !106 +// CHECK:STDOUT: ret void, !dbg !107 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -356,7 +403,7 @@ fn Use() { // CHECK:STDOUT: declare ptr @llvm.load.relative.i32(ptr, i32) #2 // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives -// CHECK:STDOUT: uselistorder ptr @"_COp.43ed5d0e08fc7556:core.Destroy.Core", { 1, 0 } +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.43ed5d0e08fc7556:core.Destroy.Core", { 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 3, 2, 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.memcpy.p0.p0.i64, { 2, 1, 0 } // CHECK:STDOUT: @@ -385,31 +432,59 @@ fn Use() { // CHECK:STDOUT: !50 = !DILocation(line: 9, column: 37, scope: !42) // CHECK:STDOUT: !52 = !DILocation(line: 12, column: 3, scope: !42) // CHECK:STDOUT: !54 = !DILocation(line: 6, column: 1, scope: !42) -// CHECK:STDOUT: !55 = distinct !DISubprogram(name: "Op", linkageName: "_COp.bf085e1f873e33df:core.Destroy.Core", scope: null, file: !38, line: 12, type: !22, spFlags: DISPFlagDefinition, unit: !39, retainedNodes: !58) +// CHECK:STDOUT: !55 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.454fecbcedcd86e1:core.Destroy.Core", scope: null, file: !38, line: 12, type: !22, spFlags: DISPFlagDefinition, unit: !39, retainedNodes: !58) // CHECK:STDOUT: !56 = !DILocalVariable(arg: 1, scope: !55, type: !20) // CHECK:STDOUT: !57 = !DILocation(line: 12, column: 3, scope: !55) // CHECK:STDOUT: !58 = !{!56} -// CHECK:STDOUT: !59 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f7b08e0f33b30342:core.Destroy.Core", scope: null, file: !38, line: 12, type: !22, spFlags: DISPFlagDefinition, unit: !39, retainedNodes: !62) +// CHECK:STDOUT: !59 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !38, line: 12, type: !22, spFlags: DISPFlagDefinition, unit: !39, retainedNodes: !62) // CHECK:STDOUT: !60 = !DILocalVariable(arg: 1, scope: !59, type: !20) // CHECK:STDOUT: !61 = !DILocation(line: 12, column: 3, scope: !59) // CHECK:STDOUT: !62 = !{!60} -// CHECK:STDOUT: !63 = distinct !DISubprogram(name: "Op", linkageName: "_COp.4487e305711510e9:core.Destroy.Core", scope: null, file: !38, line: 12, type: !22, spFlags: DISPFlagDefinition, unit: !39, retainedNodes: !66) +// CHECK:STDOUT: !63 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.bf085e1f873e33df:core.Destroy.Core", scope: null, file: !38, line: 12, type: !22, spFlags: DISPFlagDefinition, unit: !39, retainedNodes: !66) // CHECK:STDOUT: !64 = !DILocalVariable(arg: 1, scope: !63, type: !20) // CHECK:STDOUT: !65 = !DILocation(line: 12, column: 3, scope: !63) // CHECK:STDOUT: !66 = !{!64} -// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "Op", linkageName: "_COp.3c3534e993db7939:core.Destroy.Core", scope: null, file: !38, line: 12, type: !22, spFlags: DISPFlagDefinition, unit: !39, retainedNodes: !70) +// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.bf085e1f873e33df:core.Destroy.Core", scope: null, file: !38, line: 12, type: !22, spFlags: DISPFlagDefinition, unit: !39, retainedNodes: !70) // CHECK:STDOUT: !68 = !DILocalVariable(arg: 1, scope: !67, type: !20) // CHECK:STDOUT: !69 = !DILocation(line: 12, column: 3, scope: !67) // CHECK:STDOUT: !70 = !{!68} -// CHECK:STDOUT: !71 = distinct !DISubprogram(name: "Op", linkageName: "_COp.43ed5d0e08fc7556:core.Destroy.Core", scope: null, file: !38, line: 12, type: !22, spFlags: DISPFlagDefinition, unit: !39, retainedNodes: !74) +// CHECK:STDOUT: !71 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f7b08e0f33b30342:core.Destroy.Core", scope: null, file: !38, line: 12, type: !22, spFlags: DISPFlagDefinition, unit: !39, retainedNodes: !74) // CHECK:STDOUT: !72 = !DILocalVariable(arg: 1, scope: !71, type: !20) // CHECK:STDOUT: !73 = !DILocation(line: 12, column: 3, scope: !71) // CHECK:STDOUT: !74 = !{!72} -// CHECK:STDOUT: !75 = distinct !DISubprogram(name: "Use", linkageName: "_CUse.Create", scope: null, file: !38, line: 15, type: !22, spFlags: DISPFlagDefinition, unit: !39, retainedNodes: !80) +// CHECK:STDOUT: !75 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f7b08e0f33b30342:core.Destroy.Core", scope: null, file: !38, line: 12, type: !22, spFlags: DISPFlagDefinition, unit: !39, retainedNodes: !78) // CHECK:STDOUT: !76 = !DILocalVariable(arg: 1, scope: !75, type: !20) -// CHECK:STDOUT: !78 = !DILocation(line: 16, column: 3, scope: !75) -// CHECK:STDOUT: !79 = !DILocation(line: 15, column: 1, scope: !75) -// CHECK:STDOUT: !80 = !{!76} +// CHECK:STDOUT: !77 = !DILocation(line: 12, column: 3, scope: !75) +// CHECK:STDOUT: !78 = !{!76} +// CHECK:STDOUT: !79 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.4487e305711510e9:core.Destroy.Core", scope: null, file: !38, line: 12, type: !22, spFlags: DISPFlagDefinition, unit: !39, retainedNodes: !82) +// CHECK:STDOUT: !80 = !DILocalVariable(arg: 1, scope: !79, type: !20) +// CHECK:STDOUT: !81 = !DILocation(line: 12, column: 3, scope: !79) +// CHECK:STDOUT: !82 = !{!80} +// CHECK:STDOUT: !83 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.4487e305711510e9:core.Destroy.Core", scope: null, file: !38, line: 12, type: !22, spFlags: DISPFlagDefinition, unit: !39, retainedNodes: !86) +// CHECK:STDOUT: !84 = !DILocalVariable(arg: 1, scope: !83, type: !20) +// CHECK:STDOUT: !85 = !DILocation(line: 12, column: 3, scope: !83) +// CHECK:STDOUT: !86 = !{!84} +// CHECK:STDOUT: !87 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.3c3534e993db7939:core.Destroy.Core", scope: null, file: !38, line: 12, type: !22, spFlags: DISPFlagDefinition, unit: !39, retainedNodes: !90) +// CHECK:STDOUT: !88 = !DILocalVariable(arg: 1, scope: !87, type: !20) +// CHECK:STDOUT: !89 = !DILocation(line: 12, column: 3, scope: !87) +// CHECK:STDOUT: !90 = !{!88} +// CHECK:STDOUT: !91 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.3c3534e993db7939:core.Destroy.Core", scope: null, file: !38, line: 12, type: !22, spFlags: DISPFlagDefinition, unit: !39, retainedNodes: !94) +// CHECK:STDOUT: !92 = !DILocalVariable(arg: 1, scope: !91, type: !20) +// CHECK:STDOUT: !93 = !DILocation(line: 12, column: 3, scope: !91) +// CHECK:STDOUT: !94 = !{!92} +// CHECK:STDOUT: !95 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.43ed5d0e08fc7556:core.Destroy.Core", scope: null, file: !38, line: 12, type: !22, spFlags: DISPFlagDefinition, unit: !39, retainedNodes: !98) +// CHECK:STDOUT: !96 = !DILocalVariable(arg: 1, scope: !95, type: !20) +// CHECK:STDOUT: !97 = !DILocation(line: 12, column: 3, scope: !95) +// CHECK:STDOUT: !98 = !{!96} +// CHECK:STDOUT: !99 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.43ed5d0e08fc7556:core.Destroy.Core", scope: null, file: !38, line: 12, type: !22, spFlags: DISPFlagDefinition, unit: !39, retainedNodes: !102) +// CHECK:STDOUT: !100 = !DILocalVariable(arg: 1, scope: !99, type: !20) +// CHECK:STDOUT: !101 = !DILocation(line: 12, column: 3, scope: !99) +// CHECK:STDOUT: !102 = !{!100} +// CHECK:STDOUT: !103 = distinct !DISubprogram(name: "Use", linkageName: "_CUse.Create", scope: null, file: !38, line: 15, type: !22, spFlags: DISPFlagDefinition, unit: !39, retainedNodes: !108) +// CHECK:STDOUT: !104 = !DILocalVariable(arg: 1, scope: !103, type: !20) +// CHECK:STDOUT: !106 = !DILocation(line: 16, column: 3, scope: !103) +// CHECK:STDOUT: !107 = !DILocation(line: 15, column: 1, scope: !103) +// CHECK:STDOUT: !108 = !{!104} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'create_named_ctor.carbon' @@ -420,62 +495,62 @@ fn Use() { // CHECK:STDOUT: @empty_struct.ac8.loc7_12 = internal constant {} zeroinitializer // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CMakePartialBase.Main(ptr sret({}) %return) #0 !dbg !85 { +// CHECK:STDOUT: define void @_CMakePartialBase.Main(ptr sret({}) %return) #0 !dbg !113 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %return, ptr align 1 @empty_struct.ac8.loc7_12, i64 0, i1 false), !dbg !88 -// CHECK:STDOUT: ret void, !dbg !88 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %return, ptr align 1 @empty_struct.ac8.loc7_12, i64 0, i1 false), !dbg !116 +// CHECK:STDOUT: ret void, !dbg !116 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CMakePartialIntermediate.Main(ptr sret({ ptr, {} }) %return) #0 !dbg !89 { +// CHECK:STDOUT: define void @_CMakePartialIntermediate.Main(ptr sret({ ptr, {} }) %return) #0 !dbg !117 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc11_36.1.base = getelementptr inbounds nuw { ptr, {} }, ptr %return, i32 0, i32 1, !dbg !92 -// CHECK:STDOUT: call void @_CMakePartialBase.Main(ptr %.loc11_36.1.base), !dbg !93 -// CHECK:STDOUT: %.loc11_36.3.vptr = getelementptr inbounds nuw { ptr, {} }, ptr %return, i32 0, i32 0, !dbg !92 -// CHECK:STDOUT: store ptr poison, ptr %.loc11_36.3.vptr, align 8, !dbg !92 -// CHECK:STDOUT: ret void, !dbg !94 +// CHECK:STDOUT: %.loc11_36.1.base = getelementptr inbounds nuw { ptr, {} }, ptr %return, i32 0, i32 1, !dbg !120 +// CHECK:STDOUT: call void @_CMakePartialBase.Main(ptr %.loc11_36.1.base), !dbg !121 +// CHECK:STDOUT: %.loc11_36.3.vptr = getelementptr inbounds nuw { ptr, {} }, ptr %return, i32 0, i32 0, !dbg !120 +// CHECK:STDOUT: store ptr poison, ptr %.loc11_36.3.vptr, align 8, !dbg !120 +// CHECK:STDOUT: ret void, !dbg !122 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CMakeBase.Main(ptr sret({}) %return) #0 !dbg !95 { +// CHECK:STDOUT: define void @_CMakeBase.Main(ptr sret({}) %return) #0 !dbg !123 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CMakePartialBase.Main(ptr %return), !dbg !98 -// CHECK:STDOUT: ret void, !dbg !99 +// CHECK:STDOUT: call void @_CMakePartialBase.Main(ptr %return), !dbg !126 +// CHECK:STDOUT: ret void, !dbg !127 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CMakeIntermediate.Main(ptr sret({ ptr, {} }) %return) #0 !dbg !100 { +// CHECK:STDOUT: define void @_CMakeIntermediate.Main(ptr sret({ ptr, {} }) %return) #0 !dbg !128 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CMakePartialIntermediate.Main(ptr %return), !dbg !103 -// CHECK:STDOUT: %.loc19_34.1.vptr = getelementptr inbounds nuw { ptr, {} }, ptr %return, i32 0, i32 0, !dbg !103 -// CHECK:STDOUT: store ptr @"_CIntermediate.Classes.$vtable", ptr %.loc19_34.1.vptr, align 8, !dbg !103 -// CHECK:STDOUT: ret void, !dbg !104 +// CHECK:STDOUT: call void @_CMakePartialIntermediate.Main(ptr %return), !dbg !131 +// CHECK:STDOUT: %.loc19_34.1.vptr = getelementptr inbounds nuw { ptr, {} }, ptr %return, i32 0, i32 0, !dbg !131 +// CHECK:STDOUT: store ptr @"_CIntermediate.Classes.$vtable", ptr %.loc19_34.1.vptr, align 8, !dbg !131 +// CHECK:STDOUT: ret void, !dbg !132 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_CFn.Intermediate.Classes(ptr) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CMakeDerivedFromPartial.Main(ptr sret({ { ptr, {} } }) %return) #0 !dbg !105 { +// CHECK:STDOUT: define void @_CMakeDerivedFromPartial.Main(ptr sret({ { ptr, {} } }) %return) #0 !dbg !133 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc23_44.1.base = getelementptr inbounds nuw { { ptr, {} } }, ptr %return, i32 0, i32 0, !dbg !108 -// CHECK:STDOUT: call void @_CMakePartialIntermediate.Main(ptr %.loc23_44.1.base), !dbg !109 -// CHECK:STDOUT: %.loc23_44.5.base = getelementptr inbounds nuw { { ptr, {} } }, ptr %return, i32 0, i32 0, !dbg !108 -// CHECK:STDOUT: %.loc23_44.6.vptr = getelementptr inbounds nuw { ptr, {} }, ptr %.loc23_44.5.base, i32 0, i32 0, !dbg !108 -// CHECK:STDOUT: store ptr @"_CDerived.Classes.$vtable", ptr %.loc23_44.6.vptr, align 8, !dbg !108 -// CHECK:STDOUT: ret void, !dbg !110 +// CHECK:STDOUT: %.loc23_44.1.base = getelementptr inbounds nuw { { ptr, {} } }, ptr %return, i32 0, i32 0, !dbg !136 +// CHECK:STDOUT: call void @_CMakePartialIntermediate.Main(ptr %.loc23_44.1.base), !dbg !137 +// CHECK:STDOUT: %.loc23_44.5.base = getelementptr inbounds nuw { { ptr, {} } }, ptr %return, i32 0, i32 0, !dbg !136 +// CHECK:STDOUT: %.loc23_44.6.vptr = getelementptr inbounds nuw { ptr, {} }, ptr %.loc23_44.5.base, i32 0, i32 0, !dbg !136 +// CHECK:STDOUT: store ptr @"_CDerived.Classes.$vtable", ptr %.loc23_44.6.vptr, align 8, !dbg !136 +// CHECK:STDOUT: ret void, !dbg !138 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @"_CFn:thunk:Intermediate.Classes:Derived.Classes"(ptr) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CMakeDerivedFromNonPartial.Main(ptr sret({ { ptr, {} } }) %return) #0 !dbg !111 { +// CHECK:STDOUT: define void @_CMakeDerivedFromNonPartial.Main(ptr sret({ { ptr, {} } }) %return) #0 !dbg !139 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc27_37.1.base = getelementptr inbounds nuw { { ptr, {} } }, ptr %return, i32 0, i32 0, !dbg !114 -// CHECK:STDOUT: call void @_CMakeIntermediate.Main(ptr %.loc27_37.1.base), !dbg !115 -// CHECK:STDOUT: %.loc27_37.7.base = getelementptr inbounds nuw { { ptr, {} } }, ptr %return, i32 0, i32 0, !dbg !114 -// CHECK:STDOUT: %.loc27_37.8.vptr = getelementptr inbounds nuw { ptr, {} }, ptr %.loc27_37.7.base, i32 0, i32 0, !dbg !114 -// CHECK:STDOUT: store ptr @"_CDerived.Classes.$vtable", ptr %.loc27_37.8.vptr, align 8, !dbg !114 -// CHECK:STDOUT: ret void, !dbg !116 +// CHECK:STDOUT: %.loc27_37.1.base = getelementptr inbounds nuw { { ptr, {} } }, ptr %return, i32 0, i32 0, !dbg !142 +// CHECK:STDOUT: call void @_CMakeIntermediate.Main(ptr %.loc27_37.1.base), !dbg !143 +// CHECK:STDOUT: %.loc27_37.7.base = getelementptr inbounds nuw { { ptr, {} } }, ptr %return, i32 0, i32 0, !dbg !142 +// CHECK:STDOUT: %.loc27_37.8.vptr = getelementptr inbounds nuw { ptr, {} }, ptr %.loc27_37.7.base, i32 0, i32 0, !dbg !142 +// CHECK:STDOUT: store ptr @"_CDerived.Classes.$vtable", ptr %.loc27_37.8.vptr, align 8, !dbg !142 +// CHECK:STDOUT: ret void, !dbg !144 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -484,36 +559,36 @@ fn Use() { // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!82} +// CHECK:STDOUT: !llvm.dbg.cu = !{!110} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !20 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !81 = !DIFile(filename: "create_named_ctor.carbon", directory: "") -// CHECK:STDOUT: !82 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !81, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !83 = !{!20} -// CHECK:STDOUT: !84 = !DISubroutineType(types: !83) -// CHECK:STDOUT: !85 = distinct !DISubprogram(name: "MakePartialBase", linkageName: "_CMakePartialBase.Main", scope: null, file: !81, line: 6, type: !84, spFlags: DISPFlagDefinition, unit: !82) -// CHECK:STDOUT: !88 = !DILocation(line: 7, column: 3, scope: !85) -// CHECK:STDOUT: !89 = distinct !DISubprogram(name: "MakePartialIntermediate", linkageName: "_CMakePartialIntermediate.Main", scope: null, file: !81, line: 10, type: !84, spFlags: DISPFlagDefinition, unit: !82) -// CHECK:STDOUT: !92 = !DILocation(line: 11, column: 10, scope: !89) -// CHECK:STDOUT: !93 = !DILocation(line: 11, column: 19, scope: !89) -// CHECK:STDOUT: !94 = !DILocation(line: 11, column: 3, scope: !89) -// CHECK:STDOUT: !95 = distinct !DISubprogram(name: "MakeBase", linkageName: "_CMakeBase.Main", scope: null, file: !81, line: 14, type: !84, spFlags: DISPFlagDefinition, unit: !82) -// CHECK:STDOUT: !98 = !DILocation(line: 15, column: 10, scope: !95) -// CHECK:STDOUT: !99 = !DILocation(line: 15, column: 3, scope: !95) -// CHECK:STDOUT: !100 = distinct !DISubprogram(name: "MakeIntermediate", linkageName: "_CMakeIntermediate.Main", scope: null, file: !81, line: 18, type: !84, spFlags: DISPFlagDefinition, unit: !82) -// CHECK:STDOUT: !103 = !DILocation(line: 19, column: 10, scope: !100) -// CHECK:STDOUT: !104 = !DILocation(line: 19, column: 3, scope: !100) -// CHECK:STDOUT: !105 = distinct !DISubprogram(name: "MakeDerivedFromPartial", linkageName: "_CMakeDerivedFromPartial.Main", scope: null, file: !81, line: 22, type: !84, spFlags: DISPFlagDefinition, unit: !82) -// CHECK:STDOUT: !108 = !DILocation(line: 23, column: 10, scope: !105) -// CHECK:STDOUT: !109 = !DILocation(line: 23, column: 19, scope: !105) -// CHECK:STDOUT: !110 = !DILocation(line: 23, column: 3, scope: !105) -// CHECK:STDOUT: !111 = distinct !DISubprogram(name: "MakeDerivedFromNonPartial", linkageName: "_CMakeDerivedFromNonPartial.Main", scope: null, file: !81, line: 26, type: !84, spFlags: DISPFlagDefinition, unit: !82) -// CHECK:STDOUT: !114 = !DILocation(line: 27, column: 10, scope: !111) -// CHECK:STDOUT: !115 = !DILocation(line: 27, column: 19, scope: !111) -// CHECK:STDOUT: !116 = !DILocation(line: 27, column: 3, scope: !111) +// CHECK:STDOUT: !109 = !DIFile(filename: "create_named_ctor.carbon", directory: "") +// CHECK:STDOUT: !110 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !109, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !111 = !{!20} +// CHECK:STDOUT: !112 = !DISubroutineType(types: !111) +// CHECK:STDOUT: !113 = distinct !DISubprogram(name: "MakePartialBase", linkageName: "_CMakePartialBase.Main", scope: null, file: !109, line: 6, type: !112, spFlags: DISPFlagDefinition, unit: !110) +// CHECK:STDOUT: !116 = !DILocation(line: 7, column: 3, scope: !113) +// CHECK:STDOUT: !117 = distinct !DISubprogram(name: "MakePartialIntermediate", linkageName: "_CMakePartialIntermediate.Main", scope: null, file: !109, line: 10, type: !112, spFlags: DISPFlagDefinition, unit: !110) +// CHECK:STDOUT: !120 = !DILocation(line: 11, column: 10, scope: !117) +// CHECK:STDOUT: !121 = !DILocation(line: 11, column: 19, scope: !117) +// CHECK:STDOUT: !122 = !DILocation(line: 11, column: 3, scope: !117) +// CHECK:STDOUT: !123 = distinct !DISubprogram(name: "MakeBase", linkageName: "_CMakeBase.Main", scope: null, file: !109, line: 14, type: !112, spFlags: DISPFlagDefinition, unit: !110) +// CHECK:STDOUT: !126 = !DILocation(line: 15, column: 10, scope: !123) +// CHECK:STDOUT: !127 = !DILocation(line: 15, column: 3, scope: !123) +// CHECK:STDOUT: !128 = distinct !DISubprogram(name: "MakeIntermediate", linkageName: "_CMakeIntermediate.Main", scope: null, file: !109, line: 18, type: !112, spFlags: DISPFlagDefinition, unit: !110) +// CHECK:STDOUT: !131 = !DILocation(line: 19, column: 10, scope: !128) +// CHECK:STDOUT: !132 = !DILocation(line: 19, column: 3, scope: !128) +// CHECK:STDOUT: !133 = distinct !DISubprogram(name: "MakeDerivedFromPartial", linkageName: "_CMakeDerivedFromPartial.Main", scope: null, file: !109, line: 22, type: !112, spFlags: DISPFlagDefinition, unit: !110) +// CHECK:STDOUT: !136 = !DILocation(line: 23, column: 10, scope: !133) +// CHECK:STDOUT: !137 = !DILocation(line: 23, column: 19, scope: !133) +// CHECK:STDOUT: !138 = !DILocation(line: 23, column: 3, scope: !133) +// CHECK:STDOUT: !139 = distinct !DISubprogram(name: "MakeDerivedFromNonPartial", linkageName: "_CMakeDerivedFromNonPartial.Main", scope: null, file: !109, line: 26, type: !112, spFlags: DISPFlagDefinition, unit: !110) +// CHECK:STDOUT: !142 = !DILocation(line: 27, column: 10, scope: !139) +// CHECK:STDOUT: !143 = !DILocation(line: 27, column: 19, scope: !139) +// CHECK:STDOUT: !144 = !DILocation(line: 27, column: 3, scope: !139) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'member_init.carbon' @@ -523,53 +598,86 @@ fn Use() { // CHECK:STDOUT: @Base.val.loc13_3 = internal constant <{ ptr, i32 }> <{ ptr @"_CBase.MemberInit.$vtable", i32 3 }> // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CFn.Base.MemberInit(ptr %self) #0 !dbg !122 { +// CHECK:STDOUT: define void @_CFn.Base.MemberInit(ptr %self) #0 !dbg !150 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !125 +// CHECK:STDOUT: ret void, !dbg !153 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CFn.MemberInit() #0 !dbg !127 { +// CHECK:STDOUT: define void @_CFn.MemberInit() #0 !dbg !155 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %i.var = alloca i32, align 4, !dbg !128 -// CHECK:STDOUT: %v.var = alloca <{ ptr, i32 }>, align 8, !dbg !130 -// CHECK:STDOUT: %_.var = alloca <{ ptr, i32 }>, align 8, !dbg !135 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %i.var), !dbg !128 -// CHECK:STDOUT: store i32 3, ptr %i.var, align 4, !dbg !128 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %v.var), !dbg !130 -// CHECK:STDOUT: %.loc11_24.2.vptr = getelementptr inbounds nuw <{ ptr, i32 }>, ptr %v.var, i32 0, i32 0, !dbg !132 -// CHECK:STDOUT: %.loc11_23 = load i32, ptr %i.var, align 4, !dbg !131 -// CHECK:STDOUT: %.loc11_24.4.m = getelementptr inbounds nuw <{ ptr, i32 }>, ptr %v.var, i32 0, i32 1, !dbg !132 -// CHECK:STDOUT: store i32 %.loc11_23, ptr %.loc11_24.4.m, align 4, !dbg !132 -// CHECK:STDOUT: store ptr @"_CBase.MemberInit.$vtable", ptr %.loc11_24.2.vptr, align 8, !dbg !132 -// CHECK:STDOUT: %.loc12_4.m = getelementptr inbounds nuw <{ ptr, i32 }>, ptr %v.var, i32 0, i32 1, !dbg !134 -// CHECK:STDOUT: store i32 5, ptr %.loc12_4.m, align 4, !dbg !134 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !135 -// CHECK:STDOUT: %.loc13_24.2.vptr = getelementptr inbounds nuw <{ ptr, i32 }>, ptr %_.var, i32 0, i32 0, !dbg !136 -// CHECK:STDOUT: %.loc13_24.5.m = getelementptr inbounds nuw <{ ptr, i32 }>, ptr %_.var, i32 0, i32 1, !dbg !136 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %_.var, ptr align 8 @Base.val.loc13_3, i64 12, i1 false), !dbg !135 -// CHECK:STDOUT: call void @"_COp.c6dbe0017b4c8d16:core.Destroy.Core"(ptr %_.var), !dbg !135 -// CHECK:STDOUT: call void @"_COp.c6dbe0017b4c8d16:core.Destroy.Core"(ptr %v.var), !dbg !130 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %i.var), !dbg !128 -// CHECK:STDOUT: ret void, !dbg !138 +// CHECK:STDOUT: %i.var = alloca i32, align 4, !dbg !156 +// CHECK:STDOUT: %v.var = alloca <{ ptr, i32 }>, align 8, !dbg !158 +// CHECK:STDOUT: %_.var = alloca <{ ptr, i32 }>, align 8, !dbg !163 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %i.var), !dbg !156 +// CHECK:STDOUT: store i32 3, ptr %i.var, align 4, !dbg !156 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %v.var), !dbg !158 +// CHECK:STDOUT: %.loc11_24.2.vptr = getelementptr inbounds nuw <{ ptr, i32 }>, ptr %v.var, i32 0, i32 0, !dbg !160 +// CHECK:STDOUT: %.loc11_23 = load i32, ptr %i.var, align 4, !dbg !159 +// CHECK:STDOUT: %.loc11_24.4.m = getelementptr inbounds nuw <{ ptr, i32 }>, ptr %v.var, i32 0, i32 1, !dbg !160 +// CHECK:STDOUT: store i32 %.loc11_23, ptr %.loc11_24.4.m, align 4, !dbg !160 +// CHECK:STDOUT: store ptr @"_CBase.MemberInit.$vtable", ptr %.loc11_24.2.vptr, align 8, !dbg !160 +// CHECK:STDOUT: %.loc12_4.m = getelementptr inbounds nuw <{ ptr, i32 }>, ptr %v.var, i32 0, i32 1, !dbg !162 +// CHECK:STDOUT: store i32 5, ptr %.loc12_4.m, align 4, !dbg !162 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !163 +// CHECK:STDOUT: %.loc13_24.2.vptr = getelementptr inbounds nuw <{ ptr, i32 }>, ptr %_.var, i32 0, i32 0, !dbg !164 +// CHECK:STDOUT: %.loc13_24.5.m = getelementptr inbounds nuw <{ ptr, i32 }>, ptr %_.var, i32 0, i32 1, !dbg !164 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %_.var, ptr align 8 @Base.val.loc13_3, i64 12, i1 false), !dbg !163 +// CHECK:STDOUT: call void @"_CSelfDestruct.c6dbe0017b4c8d16:core.Destroy.Core"(ptr %_.var), !dbg !163 +// CHECK:STDOUT: call void @"_CSelfDestruct.c6dbe0017b4c8d16:core.Destroy.Core"(ptr %v.var), !dbg !158 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %i.var), !dbg !156 +// CHECK:STDOUT: ret void, !dbg !166 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !139 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.454fecbcedcd86e1:core.Destroy.Core"(ptr %self) #0 !dbg !167 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !141 +// CHECK:STDOUT: ret void, !dbg !169 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.fd9d4a98e93fc879:core.Destroy.Core"(ptr %self) #0 !dbg !143 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !171 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !145 +// CHECK:STDOUT: ret void, !dbg !173 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.c6dbe0017b4c8d16:core.Destroy.Core"(ptr %self) #0 !dbg !147 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !175 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !149 +// CHECK:STDOUT: ret void, !dbg !177 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !179 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !181 +// CHECK:STDOUT: ret void, !dbg !181 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.fd9d4a98e93fc879:core.Destroy.Core"(ptr %self) #0 !dbg !183 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !185 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.fd9d4a98e93fc879:core.Destroy.Core"(ptr %self) #0 !dbg !187 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.fd9d4a98e93fc879:core.Destroy.Core"(ptr %self), !dbg !189 +// CHECK:STDOUT: ret void, !dbg !189 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.c6dbe0017b4c8d16:core.Destroy.Core"(ptr %self) #0 !dbg !191 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !193 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.c6dbe0017b4c8d16:core.Destroy.Core"(ptr %self) #0 !dbg !195 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.c6dbe0017b4c8d16:core.Destroy.Core"(ptr %self), !dbg !197 +// CHECK:STDOUT: ret void, !dbg !197 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -579,13 +687,13 @@ fn Use() { // 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: ; uselistorder directives -// CHECK:STDOUT: uselistorder ptr @"_COp.c6dbe0017b4c8d16:core.Destroy.Core", { 1, 0 } +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.c6dbe0017b4c8d16:core.Destroy.Core", { 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 2, 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!118} +// CHECK:STDOUT: !llvm.dbg.cu = !{!146} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} @@ -595,36 +703,56 @@ fn Use() { // CHECK:STDOUT: !22 = !DISubroutineType(types: !21) // CHECK:STDOUT: !40 = !{null} // CHECK:STDOUT: !41 = !DISubroutineType(types: !40) -// CHECK:STDOUT: !117 = !DIFile(filename: "member_init.carbon", directory: "") -// CHECK:STDOUT: !118 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !117, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !119 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !120 = !{null, !119} -// CHECK:STDOUT: !121 = !DISubroutineType(types: !120) -// CHECK:STDOUT: !122 = distinct !DISubprogram(name: "Fn", linkageName: "_CFn.Base.MemberInit", scope: null, file: !117, line: 6, type: !22, spFlags: DISPFlagDefinition, unit: !118, retainedNodes: !126) -// CHECK:STDOUT: !123 = !DILocalVariable(arg: 1, scope: !122, type: !20) -// CHECK:STDOUT: !125 = !DILocation(line: 6, column: 3, scope: !122) -// CHECK:STDOUT: !126 = !{!123} -// CHECK:STDOUT: !127 = distinct !DISubprogram(name: "Fn", linkageName: "_CFn.MemberInit", scope: null, file: !117, line: 9, type: !41, spFlags: DISPFlagDefinition, unit: !118) -// CHECK:STDOUT: !128 = !DILocation(line: 10, column: 3, scope: !127) -// CHECK:STDOUT: !130 = !DILocation(line: 11, column: 3, scope: !127) -// CHECK:STDOUT: !131 = !DILocation(line: 11, column: 23, scope: !127) -// CHECK:STDOUT: !132 = !DILocation(line: 11, column: 17, scope: !127) -// CHECK:STDOUT: !134 = !DILocation(line: 12, column: 3, scope: !127) -// CHECK:STDOUT: !135 = !DILocation(line: 13, column: 3, scope: !127) -// CHECK:STDOUT: !136 = !DILocation(line: 13, column: 17, scope: !127) -// CHECK:STDOUT: !138 = !DILocation(line: 9, column: 1, scope: !127) -// CHECK:STDOUT: !139 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !117, line: 13, type: !121, spFlags: DISPFlagDefinition, unit: !118, retainedNodes: !142) -// CHECK:STDOUT: !140 = !DILocalVariable(arg: 1, scope: !139, type: !119) -// CHECK:STDOUT: !141 = !DILocation(line: 13, column: 3, scope: !139) -// CHECK:STDOUT: !142 = !{!140} -// CHECK:STDOUT: !143 = distinct !DISubprogram(name: "Op", linkageName: "_COp.fd9d4a98e93fc879:core.Destroy.Core", scope: null, file: !117, line: 13, type: !22, spFlags: DISPFlagDefinition, unit: !118, retainedNodes: !146) -// CHECK:STDOUT: !144 = !DILocalVariable(arg: 1, scope: !143, type: !20) -// CHECK:STDOUT: !145 = !DILocation(line: 13, column: 3, scope: !143) -// CHECK:STDOUT: !146 = !{!144} -// CHECK:STDOUT: !147 = distinct !DISubprogram(name: "Op", linkageName: "_COp.c6dbe0017b4c8d16:core.Destroy.Core", scope: null, file: !117, line: 13, type: !22, spFlags: DISPFlagDefinition, unit: !118, retainedNodes: !150) -// CHECK:STDOUT: !148 = !DILocalVariable(arg: 1, scope: !147, type: !20) -// CHECK:STDOUT: !149 = !DILocation(line: 13, column: 3, scope: !147) -// CHECK:STDOUT: !150 = !{!148} +// CHECK:STDOUT: !145 = !DIFile(filename: "member_init.carbon", directory: "") +// CHECK:STDOUT: !146 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !145, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !147 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !148 = !{null, !147} +// CHECK:STDOUT: !149 = !DISubroutineType(types: !148) +// CHECK:STDOUT: !150 = distinct !DISubprogram(name: "Fn", linkageName: "_CFn.Base.MemberInit", scope: null, file: !145, line: 6, type: !22, spFlags: DISPFlagDefinition, unit: !146, retainedNodes: !154) +// CHECK:STDOUT: !151 = !DILocalVariable(arg: 1, scope: !150, type: !20) +// CHECK:STDOUT: !153 = !DILocation(line: 6, column: 3, scope: !150) +// CHECK:STDOUT: !154 = !{!151} +// CHECK:STDOUT: !155 = distinct !DISubprogram(name: "Fn", linkageName: "_CFn.MemberInit", scope: null, file: !145, line: 9, type: !41, spFlags: DISPFlagDefinition, unit: !146) +// CHECK:STDOUT: !156 = !DILocation(line: 10, column: 3, scope: !155) +// CHECK:STDOUT: !158 = !DILocation(line: 11, column: 3, scope: !155) +// CHECK:STDOUT: !159 = !DILocation(line: 11, column: 23, scope: !155) +// CHECK:STDOUT: !160 = !DILocation(line: 11, column: 17, scope: !155) +// CHECK:STDOUT: !162 = !DILocation(line: 12, column: 3, scope: !155) +// CHECK:STDOUT: !163 = !DILocation(line: 13, column: 3, scope: !155) +// CHECK:STDOUT: !164 = !DILocation(line: 13, column: 17, scope: !155) +// CHECK:STDOUT: !166 = !DILocation(line: 9, column: 1, scope: !155) +// CHECK:STDOUT: !167 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.454fecbcedcd86e1:core.Destroy.Core", scope: null, file: !145, line: 13, type: !22, spFlags: DISPFlagDefinition, unit: !146, retainedNodes: !170) +// CHECK:STDOUT: !168 = !DILocalVariable(arg: 1, scope: !167, type: !20) +// CHECK:STDOUT: !169 = !DILocation(line: 13, column: 3, scope: !167) +// CHECK:STDOUT: !170 = !{!168} +// CHECK:STDOUT: !171 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !145, line: 13, type: !149, spFlags: DISPFlagDefinition, unit: !146, retainedNodes: !174) +// CHECK:STDOUT: !172 = !DILocalVariable(arg: 1, scope: !171, type: !147) +// CHECK:STDOUT: !173 = !DILocation(line: 13, column: 3, scope: !171) +// CHECK:STDOUT: !174 = !{!172} +// CHECK:STDOUT: !175 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !145, line: 13, type: !149, spFlags: DISPFlagDefinition, unit: !146, retainedNodes: !178) +// CHECK:STDOUT: !176 = !DILocalVariable(arg: 1, scope: !175, type: !147) +// CHECK:STDOUT: !177 = !DILocation(line: 13, column: 3, scope: !175) +// CHECK:STDOUT: !178 = !{!176} +// CHECK:STDOUT: !179 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !145, line: 13, type: !149, spFlags: DISPFlagDefinition, unit: !146, retainedNodes: !182) +// CHECK:STDOUT: !180 = !DILocalVariable(arg: 1, scope: !179, type: !147) +// CHECK:STDOUT: !181 = !DILocation(line: 13, column: 3, scope: !179) +// CHECK:STDOUT: !182 = !{!180} +// CHECK:STDOUT: !183 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.fd9d4a98e93fc879:core.Destroy.Core", scope: null, file: !145, line: 13, type: !22, spFlags: DISPFlagDefinition, unit: !146, retainedNodes: !186) +// CHECK:STDOUT: !184 = !DILocalVariable(arg: 1, scope: !183, type: !20) +// CHECK:STDOUT: !185 = !DILocation(line: 13, column: 3, scope: !183) +// CHECK:STDOUT: !186 = !{!184} +// CHECK:STDOUT: !187 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.fd9d4a98e93fc879:core.Destroy.Core", scope: null, file: !145, line: 13, type: !22, spFlags: DISPFlagDefinition, unit: !146, retainedNodes: !190) +// CHECK:STDOUT: !188 = !DILocalVariable(arg: 1, scope: !187, type: !20) +// CHECK:STDOUT: !189 = !DILocation(line: 13, column: 3, scope: !187) +// CHECK:STDOUT: !190 = !{!188} +// CHECK:STDOUT: !191 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.c6dbe0017b4c8d16:core.Destroy.Core", scope: null, file: !145, line: 13, type: !22, spFlags: DISPFlagDefinition, unit: !146, retainedNodes: !194) +// CHECK:STDOUT: !192 = !DILocalVariable(arg: 1, scope: !191, type: !20) +// CHECK:STDOUT: !193 = !DILocation(line: 13, column: 3, scope: !191) +// CHECK:STDOUT: !194 = !{!192} +// CHECK:STDOUT: !195 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.c6dbe0017b4c8d16:core.Destroy.Core", scope: null, file: !145, line: 13, type: !22, spFlags: DISPFlagDefinition, unit: !146, retainedNodes: !198) +// CHECK:STDOUT: !196 = !DILocalVariable(arg: 1, scope: !195, type: !20) +// CHECK:STDOUT: !197 = !DILocation(line: 13, column: 3, scope: !195) +// CHECK:STDOUT: !198 = !{!196} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'member_brace_init.carbon' @@ -637,42 +765,76 @@ fn Use() { // CHECK:STDOUT: declare void @_CF.Base.Main(ptr) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CUse.Main() #0 !dbg !153 { +// CHECK:STDOUT: define void @_CUse.Main() #0 !dbg !201 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca { { ptr } }, align 8, !dbg !154 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !154 -// CHECK:STDOUT: %.loc13_32.2.base = getelementptr inbounds nuw { { ptr } }, ptr %_.var, i32 0, i32 0, !dbg !155 -// CHECK:STDOUT: %.loc13_31.2.vptr = getelementptr inbounds nuw { ptr }, ptr %.loc13_32.2.base, i32 0, i32 0, !dbg !156 -// CHECK:STDOUT: %.loc13_32.6.base = getelementptr inbounds nuw { { ptr } }, ptr %_.var, i32 0, i32 0, !dbg !155 -// CHECK:STDOUT: %.loc13_32.7.vptr = getelementptr inbounds nuw { ptr }, ptr %.loc13_32.6.base, i32 0, i32 0, !dbg !155 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %_.var, ptr align 8 @Derived.val.loc13_32.5, i64 8, i1 false), !dbg !155 -// CHECK:STDOUT: store ptr @"_CDerived.Main.$vtable", ptr %.loc13_32.7.vptr, align 8, !dbg !155 -// CHECK:STDOUT: call void @"_COp.b25525d21a9bd472:core.Destroy.Core"(ptr %_.var), !dbg !154 -// CHECK:STDOUT: ret void, !dbg !158 +// CHECK:STDOUT: %_.var = alloca { { ptr } }, align 8, !dbg !202 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !202 +// CHECK:STDOUT: %.loc13_32.2.base = getelementptr inbounds nuw { { ptr } }, ptr %_.var, i32 0, i32 0, !dbg !203 +// CHECK:STDOUT: %.loc13_31.2.vptr = getelementptr inbounds nuw { ptr }, ptr %.loc13_32.2.base, i32 0, i32 0, !dbg !204 +// CHECK:STDOUT: %.loc13_32.6.base = getelementptr inbounds nuw { { ptr } }, ptr %_.var, i32 0, i32 0, !dbg !203 +// CHECK:STDOUT: %.loc13_32.7.vptr = getelementptr inbounds nuw { ptr }, ptr %.loc13_32.6.base, i32 0, i32 0, !dbg !203 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %_.var, ptr align 8 @Derived.val.loc13_32.5, i64 8, i1 false), !dbg !203 +// CHECK:STDOUT: store ptr @"_CDerived.Main.$vtable", ptr %.loc13_32.7.vptr, align 8, !dbg !203 +// CHECK:STDOUT: call void @"_CSelfDestruct.b25525d21a9bd472:core.Destroy.Core"(ptr %_.var), !dbg !202 +// CHECK:STDOUT: ret void, !dbg !206 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.95528a86e1127e2d:core.Destroy.Core"(ptr %self) #0 !dbg !159 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.454fecbcedcd86e1:core.Destroy.Core"(ptr %self) #0 !dbg !207 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !161 +// CHECK:STDOUT: ret void, !dbg !209 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.294df737cd074d60:core.Destroy.Core"(ptr %self) #0 !dbg !163 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.95528a86e1127e2d:core.Destroy.Core"(ptr %self) #0 !dbg !211 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !165 +// CHECK:STDOUT: ret void, !dbg !213 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.caed8a96bf328d09:core.Destroy.Core"(ptr %self) #0 !dbg !167 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.95528a86e1127e2d:core.Destroy.Core"(ptr %self) #0 !dbg !215 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !169 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.95528a86e1127e2d:core.Destroy.Core"(ptr %self), !dbg !217 +// CHECK:STDOUT: ret void, !dbg !217 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.b25525d21a9bd472:core.Destroy.Core"(ptr %self) #0 !dbg !171 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.294df737cd074d60:core.Destroy.Core"(ptr %self) #0 !dbg !219 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !173 +// CHECK:STDOUT: ret void, !dbg !221 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.294df737cd074d60:core.Destroy.Core"(ptr %self) #0 !dbg !223 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.294df737cd074d60:core.Destroy.Core"(ptr %self), !dbg !225 +// CHECK:STDOUT: ret void, !dbg !225 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.caed8a96bf328d09:core.Destroy.Core"(ptr %self) #0 !dbg !227 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !229 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.caed8a96bf328d09:core.Destroy.Core"(ptr %self) #0 !dbg !231 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.caed8a96bf328d09:core.Destroy.Core"(ptr %self), !dbg !233 +// CHECK:STDOUT: ret void, !dbg !233 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.b25525d21a9bd472:core.Destroy.Core"(ptr %self) #0 !dbg !235 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !237 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.b25525d21a9bd472:core.Destroy.Core"(ptr %self) #0 !dbg !239 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.b25525d21a9bd472:core.Destroy.Core"(ptr %self), !dbg !241 +// CHECK:STDOUT: ret void, !dbg !241 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -684,7 +846,7 @@ fn Use() { // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!152} +// CHECK:STDOUT: !llvm.dbg.cu = !{!200} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} @@ -694,29 +856,49 @@ fn Use() { // CHECK:STDOUT: !22 = !DISubroutineType(types: !21) // CHECK:STDOUT: !40 = !{null} // CHECK:STDOUT: !41 = !DISubroutineType(types: !40) -// CHECK:STDOUT: !151 = !DIFile(filename: "member_brace_init.carbon", directory: "") -// CHECK:STDOUT: !152 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !151, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !153 = distinct !DISubprogram(name: "Use", linkageName: "_CUse.Main", scope: null, file: !151, line: 12, type: !41, spFlags: DISPFlagDefinition, unit: !152) -// CHECK:STDOUT: !154 = !DILocation(line: 13, column: 3, scope: !153) -// CHECK:STDOUT: !155 = !DILocation(line: 13, column: 21, scope: !153) -// CHECK:STDOUT: !156 = !DILocation(line: 13, column: 30, scope: !153) -// CHECK:STDOUT: !158 = !DILocation(line: 12, column: 1, scope: !153) -// CHECK:STDOUT: !159 = distinct !DISubprogram(name: "Op", linkageName: "_COp.95528a86e1127e2d:core.Destroy.Core", scope: null, file: !151, line: 13, type: !22, spFlags: DISPFlagDefinition, unit: !152, retainedNodes: !162) -// CHECK:STDOUT: !160 = !DILocalVariable(arg: 1, scope: !159, type: !20) -// CHECK:STDOUT: !161 = !DILocation(line: 13, column: 3, scope: !159) -// CHECK:STDOUT: !162 = !{!160} -// CHECK:STDOUT: !163 = distinct !DISubprogram(name: "Op", linkageName: "_COp.294df737cd074d60:core.Destroy.Core", scope: null, file: !151, line: 13, type: !22, spFlags: DISPFlagDefinition, unit: !152, retainedNodes: !166) -// CHECK:STDOUT: !164 = !DILocalVariable(arg: 1, scope: !163, type: !20) -// CHECK:STDOUT: !165 = !DILocation(line: 13, column: 3, scope: !163) -// CHECK:STDOUT: !166 = !{!164} -// CHECK:STDOUT: !167 = distinct !DISubprogram(name: "Op", linkageName: "_COp.caed8a96bf328d09:core.Destroy.Core", scope: null, file: !151, line: 13, type: !22, spFlags: DISPFlagDefinition, unit: !152, retainedNodes: !170) -// CHECK:STDOUT: !168 = !DILocalVariable(arg: 1, scope: !167, type: !20) -// CHECK:STDOUT: !169 = !DILocation(line: 13, column: 3, scope: !167) -// CHECK:STDOUT: !170 = !{!168} -// CHECK:STDOUT: !171 = distinct !DISubprogram(name: "Op", linkageName: "_COp.b25525d21a9bd472:core.Destroy.Core", scope: null, file: !151, line: 13, type: !22, spFlags: DISPFlagDefinition, unit: !152, retainedNodes: !174) -// CHECK:STDOUT: !172 = !DILocalVariable(arg: 1, scope: !171, type: !20) -// CHECK:STDOUT: !173 = !DILocation(line: 13, column: 3, scope: !171) -// CHECK:STDOUT: !174 = !{!172} +// CHECK:STDOUT: !199 = !DIFile(filename: "member_brace_init.carbon", directory: "") +// CHECK:STDOUT: !200 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !199, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !201 = distinct !DISubprogram(name: "Use", linkageName: "_CUse.Main", scope: null, file: !199, line: 12, type: !41, spFlags: DISPFlagDefinition, unit: !200) +// CHECK:STDOUT: !202 = !DILocation(line: 13, column: 3, scope: !201) +// CHECK:STDOUT: !203 = !DILocation(line: 13, column: 21, scope: !201) +// CHECK:STDOUT: !204 = !DILocation(line: 13, column: 30, scope: !201) +// CHECK:STDOUT: !206 = !DILocation(line: 12, column: 1, scope: !201) +// CHECK:STDOUT: !207 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.454fecbcedcd86e1:core.Destroy.Core", scope: null, file: !199, line: 13, type: !22, spFlags: DISPFlagDefinition, unit: !200, retainedNodes: !210) +// CHECK:STDOUT: !208 = !DILocalVariable(arg: 1, scope: !207, type: !20) +// CHECK:STDOUT: !209 = !DILocation(line: 13, column: 3, scope: !207) +// CHECK:STDOUT: !210 = !{!208} +// CHECK:STDOUT: !211 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.95528a86e1127e2d:core.Destroy.Core", scope: null, file: !199, line: 13, type: !22, spFlags: DISPFlagDefinition, unit: !200, retainedNodes: !214) +// CHECK:STDOUT: !212 = !DILocalVariable(arg: 1, scope: !211, type: !20) +// CHECK:STDOUT: !213 = !DILocation(line: 13, column: 3, scope: !211) +// CHECK:STDOUT: !214 = !{!212} +// CHECK:STDOUT: !215 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.95528a86e1127e2d:core.Destroy.Core", scope: null, file: !199, line: 13, type: !22, spFlags: DISPFlagDefinition, unit: !200, retainedNodes: !218) +// CHECK:STDOUT: !216 = !DILocalVariable(arg: 1, scope: !215, type: !20) +// CHECK:STDOUT: !217 = !DILocation(line: 13, column: 3, scope: !215) +// CHECK:STDOUT: !218 = !{!216} +// CHECK:STDOUT: !219 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.294df737cd074d60:core.Destroy.Core", scope: null, file: !199, line: 13, type: !22, spFlags: DISPFlagDefinition, unit: !200, retainedNodes: !222) +// CHECK:STDOUT: !220 = !DILocalVariable(arg: 1, scope: !219, type: !20) +// CHECK:STDOUT: !221 = !DILocation(line: 13, column: 3, scope: !219) +// CHECK:STDOUT: !222 = !{!220} +// CHECK:STDOUT: !223 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.294df737cd074d60:core.Destroy.Core", scope: null, file: !199, line: 13, type: !22, spFlags: DISPFlagDefinition, unit: !200, retainedNodes: !226) +// CHECK:STDOUT: !224 = !DILocalVariable(arg: 1, scope: !223, type: !20) +// CHECK:STDOUT: !225 = !DILocation(line: 13, column: 3, scope: !223) +// CHECK:STDOUT: !226 = !{!224} +// CHECK:STDOUT: !227 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.caed8a96bf328d09:core.Destroy.Core", scope: null, file: !199, line: 13, type: !22, spFlags: DISPFlagDefinition, unit: !200, retainedNodes: !230) +// CHECK:STDOUT: !228 = !DILocalVariable(arg: 1, scope: !227, type: !20) +// CHECK:STDOUT: !229 = !DILocation(line: 13, column: 3, scope: !227) +// CHECK:STDOUT: !230 = !{!228} +// CHECK:STDOUT: !231 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.caed8a96bf328d09:core.Destroy.Core", scope: null, file: !199, line: 13, type: !22, spFlags: DISPFlagDefinition, unit: !200, retainedNodes: !234) +// CHECK:STDOUT: !232 = !DILocalVariable(arg: 1, scope: !231, type: !20) +// CHECK:STDOUT: !233 = !DILocation(line: 13, column: 3, scope: !231) +// CHECK:STDOUT: !234 = !{!232} +// CHECK:STDOUT: !235 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.b25525d21a9bd472:core.Destroy.Core", scope: null, file: !199, line: 13, type: !22, spFlags: DISPFlagDefinition, unit: !200, retainedNodes: !238) +// CHECK:STDOUT: !236 = !DILocalVariable(arg: 1, scope: !235, type: !20) +// CHECK:STDOUT: !237 = !DILocation(line: 13, column: 3, scope: !235) +// CHECK:STDOUT: !238 = !{!236} +// CHECK:STDOUT: !239 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.b25525d21a9bd472:core.Destroy.Core", scope: null, file: !199, line: 13, type: !22, spFlags: DISPFlagDefinition, unit: !200, retainedNodes: !242) +// CHECK:STDOUT: !240 = !DILocalVariable(arg: 1, scope: !239, type: !20) +// CHECK:STDOUT: !241 = !DILocation(line: 13, column: 3, scope: !239) +// CHECK:STDOUT: !242 = !{!240} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'call.carbon' @@ -727,12 +909,12 @@ fn Use() { // CHECK:STDOUT: declare void @_CF.Base.Main(ptr) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CUse.Main(ptr %b) #0 !dbg !177 { +// CHECK:STDOUT: define void @_CUse.Main(ptr %b) #0 !dbg !245 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Base.F.call.vtable = load ptr, ptr %b, align 8, !dbg !180 -// CHECK:STDOUT: %Base.F.call = call ptr @llvm.load.relative.i32(ptr %Base.F.call.vtable, i32 0), !dbg !180 -// CHECK:STDOUT: call void %Base.F.call(ptr %b), !dbg !180 -// CHECK:STDOUT: ret void, !dbg !181 +// CHECK:STDOUT: %Base.F.call.vtable = load ptr, ptr %b, align 8, !dbg !248 +// CHECK:STDOUT: %Base.F.call = call ptr @llvm.load.relative.i32(ptr %Base.F.call.vtable, i32 0), !dbg !248 +// CHECK:STDOUT: call void %Base.F.call(ptr %b), !dbg !248 +// CHECK:STDOUT: ret void, !dbg !249 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: read) @@ -741,7 +923,7 @@ fn Use() { // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: read) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!176} +// CHECK:STDOUT: !llvm.dbg.cu = !{!244} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} @@ -749,13 +931,13 @@ fn Use() { // CHECK:STDOUT: !20 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) // CHECK:STDOUT: !21 = !{null, !20} // CHECK:STDOUT: !22 = !DISubroutineType(types: !21) -// CHECK:STDOUT: !175 = !DIFile(filename: "call.carbon", directory: "") -// CHECK:STDOUT: !176 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !175, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !177 = distinct !DISubprogram(name: "Use", linkageName: "_CUse.Main", scope: null, file: !175, line: 8, type: !22, spFlags: DISPFlagDefinition, unit: !176, retainedNodes: !182) -// CHECK:STDOUT: !178 = !DILocalVariable(arg: 1, scope: !177, type: !20) -// CHECK:STDOUT: !180 = !DILocation(line: 9, column: 3, scope: !177) -// CHECK:STDOUT: !181 = !DILocation(line: 8, column: 1, scope: !177) -// CHECK:STDOUT: !182 = !{!178} +// CHECK:STDOUT: !243 = !DIFile(filename: "call.carbon", directory: "") +// CHECK:STDOUT: !244 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !243, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !245 = distinct !DISubprogram(name: "Use", linkageName: "_CUse.Main", scope: null, file: !243, line: 8, type: !22, spFlags: DISPFlagDefinition, unit: !244, retainedNodes: !250) +// CHECK:STDOUT: !246 = !DILocalVariable(arg: 1, scope: !245, type: !20) +// CHECK:STDOUT: !248 = !DILocation(line: 9, column: 3, scope: !245) +// CHECK:STDOUT: !249 = !DILocation(line: 8, column: 1, scope: !245) +// CHECK:STDOUT: !250 = !{!246} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'call_impl.carbon' @@ -770,53 +952,87 @@ fn Use() { // CHECK:STDOUT: declare void @_CF.Derived.Main(ptr) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr void @"_CF:thunk:Base.Main:Derived.Main"(ptr %self) #0 !dbg !185 { +// CHECK:STDOUT: define weak_odr void @"_CF:thunk:Base.Main:Derived.Main"(ptr %self) #0 !dbg !253 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CF.Derived.Main(ptr %self), !dbg !188 -// CHECK:STDOUT: ret void, !dbg !188 +// CHECK:STDOUT: call void @_CF.Derived.Main(ptr %self), !dbg !256 +// CHECK:STDOUT: ret void, !dbg !256 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CUse.Main() #1 !dbg !190 { +// CHECK:STDOUT: define void @_CUse.Main() #1 !dbg !258 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %v.var = alloca { { ptr } }, align 8, !dbg !191 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %v.var), !dbg !191 -// CHECK:STDOUT: %.loc14_32.2.base = getelementptr inbounds nuw { { ptr } }, ptr %v.var, i32 0, i32 0, !dbg !192 -// CHECK:STDOUT: %.loc14_31.2.vptr = getelementptr inbounds nuw { ptr }, ptr %.loc14_32.2.base, i32 0, i32 0, !dbg !193 -// CHECK:STDOUT: %.loc14_32.6.base = getelementptr inbounds nuw { { ptr } }, ptr %v.var, i32 0, i32 0, !dbg !192 -// CHECK:STDOUT: %.loc14_32.7.vptr = getelementptr inbounds nuw { ptr }, ptr %.loc14_32.6.base, i32 0, i32 0, !dbg !192 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %v.var, ptr align 8 @Derived.val.loc14_32.5, i64 8, i1 false), !dbg !192 -// CHECK:STDOUT: store ptr @"_CDerived.Main.$vtable", ptr %.loc14_32.7.vptr, align 8, !dbg !192 -// CHECK:STDOUT: %.loc15_3.1.base = getelementptr inbounds nuw { { ptr } }, ptr %v.var, i32 0, i32 0, !dbg !195 -// CHECK:STDOUT: %Base.F.call.vtable = load ptr, ptr %.loc15_3.1.base, align 8, !dbg !195 -// CHECK:STDOUT: %Base.F.call = call ptr @llvm.load.relative.i32(ptr %Base.F.call.vtable, i32 0), !dbg !195 -// CHECK:STDOUT: call void %Base.F.call(ptr %.loc15_3.1.base), !dbg !195 -// CHECK:STDOUT: call void @"_COp.b25525d21a9bd472:core.Destroy.Core"(ptr %v.var), !dbg !191 -// CHECK:STDOUT: ret void, !dbg !196 +// CHECK:STDOUT: %v.var = alloca { { ptr } }, align 8, !dbg !259 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %v.var), !dbg !259 +// CHECK:STDOUT: %.loc14_32.2.base = getelementptr inbounds nuw { { ptr } }, ptr %v.var, i32 0, i32 0, !dbg !260 +// CHECK:STDOUT: %.loc14_31.2.vptr = getelementptr inbounds nuw { ptr }, ptr %.loc14_32.2.base, i32 0, i32 0, !dbg !261 +// CHECK:STDOUT: %.loc14_32.6.base = getelementptr inbounds nuw { { ptr } }, ptr %v.var, i32 0, i32 0, !dbg !260 +// CHECK:STDOUT: %.loc14_32.7.vptr = getelementptr inbounds nuw { ptr }, ptr %.loc14_32.6.base, i32 0, i32 0, !dbg !260 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %v.var, ptr align 8 @Derived.val.loc14_32.5, i64 8, i1 false), !dbg !260 +// CHECK:STDOUT: store ptr @"_CDerived.Main.$vtable", ptr %.loc14_32.7.vptr, align 8, !dbg !260 +// CHECK:STDOUT: %.loc15_3.1.base = getelementptr inbounds nuw { { ptr } }, ptr %v.var, i32 0, i32 0, !dbg !263 +// CHECK:STDOUT: %Base.F.call.vtable = load ptr, ptr %.loc15_3.1.base, align 8, !dbg !263 +// CHECK:STDOUT: %Base.F.call = call ptr @llvm.load.relative.i32(ptr %Base.F.call.vtable, i32 0), !dbg !263 +// CHECK:STDOUT: call void %Base.F.call(ptr %.loc15_3.1.base), !dbg !263 +// CHECK:STDOUT: call void @"_CSelfDestruct.b25525d21a9bd472:core.Destroy.Core"(ptr %v.var), !dbg !259 +// CHECK:STDOUT: ret void, !dbg !264 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.95528a86e1127e2d:core.Destroy.Core"(ptr %self) #1 !dbg !197 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.454fecbcedcd86e1:core.Destroy.Core"(ptr %self) #1 !dbg !265 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !199 +// CHECK:STDOUT: ret void, !dbg !267 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.294df737cd074d60:core.Destroy.Core"(ptr %self) #1 !dbg !201 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.95528a86e1127e2d:core.Destroy.Core"(ptr %self) #1 !dbg !269 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !203 +// CHECK:STDOUT: ret void, !dbg !271 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.caed8a96bf328d09:core.Destroy.Core"(ptr %self) #1 !dbg !205 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.95528a86e1127e2d:core.Destroy.Core"(ptr %self) #1 !dbg !273 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !207 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.95528a86e1127e2d:core.Destroy.Core"(ptr %self), !dbg !275 +// CHECK:STDOUT: ret void, !dbg !275 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.b25525d21a9bd472:core.Destroy.Core"(ptr %self) #1 !dbg !209 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.294df737cd074d60:core.Destroy.Core"(ptr %self) #1 !dbg !277 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !211 +// CHECK:STDOUT: ret void, !dbg !279 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.294df737cd074d60:core.Destroy.Core"(ptr %self) #1 !dbg !281 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.294df737cd074d60:core.Destroy.Core"(ptr %self), !dbg !283 +// CHECK:STDOUT: ret void, !dbg !283 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.caed8a96bf328d09:core.Destroy.Core"(ptr %self) #1 !dbg !285 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !287 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.caed8a96bf328d09:core.Destroy.Core"(ptr %self) #1 !dbg !289 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.caed8a96bf328d09:core.Destroy.Core"(ptr %self), !dbg !291 +// CHECK:STDOUT: ret void, !dbg !291 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.b25525d21a9bd472:core.Destroy.Core"(ptr %self) #1 !dbg !293 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !295 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.b25525d21a9bd472:core.Destroy.Core"(ptr %self) #1 !dbg !297 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.b25525d21a9bd472:core.Destroy.Core"(ptr %self), !dbg !299 +// CHECK:STDOUT: ret void, !dbg !299 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -833,7 +1049,7 @@ fn Use() { // CHECK:STDOUT: attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: read) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!184} +// CHECK:STDOUT: !llvm.dbg.cu = !{!252} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} @@ -843,124 +1059,198 @@ fn Use() { // CHECK:STDOUT: !22 = !DISubroutineType(types: !21) // CHECK:STDOUT: !40 = !{null} // CHECK:STDOUT: !41 = !DISubroutineType(types: !40) -// CHECK:STDOUT: !183 = !DIFile(filename: "call_impl.carbon", directory: "") -// CHECK:STDOUT: !184 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !183, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !185 = distinct !DISubprogram(name: "F", linkageName: "_CF:thunk:Base.Main:Derived.Main", scope: null, file: !183, line: 10, type: !22, spFlags: DISPFlagDefinition, unit: !184, retainedNodes: !189) -// CHECK:STDOUT: !186 = !DILocalVariable(arg: 1, scope: !185, type: !20) -// CHECK:STDOUT: !188 = !DILocation(line: 10, column: 3, scope: !185) -// CHECK:STDOUT: !189 = !{!186} -// CHECK:STDOUT: !190 = distinct !DISubprogram(name: "Use", linkageName: "_CUse.Main", scope: null, file: !183, line: 13, type: !41, spFlags: DISPFlagDefinition, unit: !184) -// CHECK:STDOUT: !191 = !DILocation(line: 14, column: 3, scope: !190) -// CHECK:STDOUT: !192 = !DILocation(line: 14, column: 21, scope: !190) -// CHECK:STDOUT: !193 = !DILocation(line: 14, column: 30, scope: !190) -// CHECK:STDOUT: !195 = !DILocation(line: 15, column: 3, scope: !190) -// CHECK:STDOUT: !196 = !DILocation(line: 13, column: 1, scope: !190) -// CHECK:STDOUT: !197 = distinct !DISubprogram(name: "Op", linkageName: "_COp.95528a86e1127e2d:core.Destroy.Core", scope: null, file: !183, line: 14, type: !22, spFlags: DISPFlagDefinition, unit: !184, retainedNodes: !200) -// CHECK:STDOUT: !198 = !DILocalVariable(arg: 1, scope: !197, type: !20) -// CHECK:STDOUT: !199 = !DILocation(line: 14, column: 3, scope: !197) -// CHECK:STDOUT: !200 = !{!198} -// CHECK:STDOUT: !201 = distinct !DISubprogram(name: "Op", linkageName: "_COp.294df737cd074d60:core.Destroy.Core", scope: null, file: !183, line: 14, type: !22, spFlags: DISPFlagDefinition, unit: !184, retainedNodes: !204) -// CHECK:STDOUT: !202 = !DILocalVariable(arg: 1, scope: !201, type: !20) -// CHECK:STDOUT: !203 = !DILocation(line: 14, column: 3, scope: !201) -// CHECK:STDOUT: !204 = !{!202} -// CHECK:STDOUT: !205 = distinct !DISubprogram(name: "Op", linkageName: "_COp.caed8a96bf328d09:core.Destroy.Core", scope: null, file: !183, line: 14, type: !22, spFlags: DISPFlagDefinition, unit: !184, retainedNodes: !208) -// CHECK:STDOUT: !206 = !DILocalVariable(arg: 1, scope: !205, type: !20) -// CHECK:STDOUT: !207 = !DILocation(line: 14, column: 3, scope: !205) -// CHECK:STDOUT: !208 = !{!206} -// CHECK:STDOUT: !209 = distinct !DISubprogram(name: "Op", linkageName: "_COp.b25525d21a9bd472:core.Destroy.Core", scope: null, file: !183, line: 14, type: !22, spFlags: DISPFlagDefinition, unit: !184, retainedNodes: !212) -// CHECK:STDOUT: !210 = !DILocalVariable(arg: 1, scope: !209, type: !20) -// CHECK:STDOUT: !211 = !DILocation(line: 14, column: 3, scope: !209) -// CHECK:STDOUT: !212 = !{!210} +// CHECK:STDOUT: !251 = !DIFile(filename: "call_impl.carbon", directory: "") +// CHECK:STDOUT: !252 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !251, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !253 = distinct !DISubprogram(name: "F", linkageName: "_CF:thunk:Base.Main:Derived.Main", scope: null, file: !251, line: 10, type: !22, spFlags: DISPFlagDefinition, unit: !252, retainedNodes: !257) +// CHECK:STDOUT: !254 = !DILocalVariable(arg: 1, scope: !253, type: !20) +// CHECK:STDOUT: !256 = !DILocation(line: 10, column: 3, scope: !253) +// CHECK:STDOUT: !257 = !{!254} +// CHECK:STDOUT: !258 = distinct !DISubprogram(name: "Use", linkageName: "_CUse.Main", scope: null, file: !251, line: 13, type: !41, spFlags: DISPFlagDefinition, unit: !252) +// CHECK:STDOUT: !259 = !DILocation(line: 14, column: 3, scope: !258) +// CHECK:STDOUT: !260 = !DILocation(line: 14, column: 21, scope: !258) +// CHECK:STDOUT: !261 = !DILocation(line: 14, column: 30, scope: !258) +// CHECK:STDOUT: !263 = !DILocation(line: 15, column: 3, scope: !258) +// CHECK:STDOUT: !264 = !DILocation(line: 13, column: 1, scope: !258) +// CHECK:STDOUT: !265 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.454fecbcedcd86e1:core.Destroy.Core", scope: null, file: !251, line: 14, type: !22, spFlags: DISPFlagDefinition, unit: !252, retainedNodes: !268) +// CHECK:STDOUT: !266 = !DILocalVariable(arg: 1, scope: !265, type: !20) +// CHECK:STDOUT: !267 = !DILocation(line: 14, column: 3, scope: !265) +// CHECK:STDOUT: !268 = !{!266} +// CHECK:STDOUT: !269 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.95528a86e1127e2d:core.Destroy.Core", scope: null, file: !251, line: 14, type: !22, spFlags: DISPFlagDefinition, unit: !252, retainedNodes: !272) +// CHECK:STDOUT: !270 = !DILocalVariable(arg: 1, scope: !269, type: !20) +// CHECK:STDOUT: !271 = !DILocation(line: 14, column: 3, scope: !269) +// CHECK:STDOUT: !272 = !{!270} +// CHECK:STDOUT: !273 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.95528a86e1127e2d:core.Destroy.Core", scope: null, file: !251, line: 14, type: !22, spFlags: DISPFlagDefinition, unit: !252, retainedNodes: !276) +// CHECK:STDOUT: !274 = !DILocalVariable(arg: 1, scope: !273, type: !20) +// CHECK:STDOUT: !275 = !DILocation(line: 14, column: 3, scope: !273) +// CHECK:STDOUT: !276 = !{!274} +// CHECK:STDOUT: !277 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.294df737cd074d60:core.Destroy.Core", scope: null, file: !251, line: 14, type: !22, spFlags: DISPFlagDefinition, unit: !252, retainedNodes: !280) +// CHECK:STDOUT: !278 = !DILocalVariable(arg: 1, scope: !277, type: !20) +// CHECK:STDOUT: !279 = !DILocation(line: 14, column: 3, scope: !277) +// CHECK:STDOUT: !280 = !{!278} +// CHECK:STDOUT: !281 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.294df737cd074d60:core.Destroy.Core", scope: null, file: !251, line: 14, type: !22, spFlags: DISPFlagDefinition, unit: !252, retainedNodes: !284) +// CHECK:STDOUT: !282 = !DILocalVariable(arg: 1, scope: !281, type: !20) +// CHECK:STDOUT: !283 = !DILocation(line: 14, column: 3, scope: !281) +// CHECK:STDOUT: !284 = !{!282} +// CHECK:STDOUT: !285 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.caed8a96bf328d09:core.Destroy.Core", scope: null, file: !251, line: 14, type: !22, spFlags: DISPFlagDefinition, unit: !252, retainedNodes: !288) +// CHECK:STDOUT: !286 = !DILocalVariable(arg: 1, scope: !285, type: !20) +// CHECK:STDOUT: !287 = !DILocation(line: 14, column: 3, scope: !285) +// CHECK:STDOUT: !288 = !{!286} +// CHECK:STDOUT: !289 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.caed8a96bf328d09:core.Destroy.Core", scope: null, file: !251, line: 14, type: !22, spFlags: DISPFlagDefinition, unit: !252, retainedNodes: !292) +// CHECK:STDOUT: !290 = !DILocalVariable(arg: 1, scope: !289, type: !20) +// CHECK:STDOUT: !291 = !DILocation(line: 14, column: 3, scope: !289) +// CHECK:STDOUT: !292 = !{!290} +// CHECK:STDOUT: !293 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.b25525d21a9bd472:core.Destroy.Core", scope: null, file: !251, line: 14, type: !22, spFlags: DISPFlagDefinition, unit: !252, retainedNodes: !296) +// CHECK:STDOUT: !294 = !DILocalVariable(arg: 1, scope: !293, type: !20) +// CHECK:STDOUT: !295 = !DILocation(line: 14, column: 3, scope: !293) +// CHECK:STDOUT: !296 = !{!294} +// CHECK:STDOUT: !297 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.b25525d21a9bd472:core.Destroy.Core", scope: null, file: !251, line: 14, type: !22, spFlags: DISPFlagDefinition, unit: !252, retainedNodes: !300) +// CHECK:STDOUT: !298 = !DILocalVariable(arg: 1, scope: !297, type: !20) +// CHECK:STDOUT: !299 = !DILocation(line: 14, column: 3, scope: !297) +// CHECK:STDOUT: !300 = !{!298} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'generic_noop.carbon' // CHECK:STDOUT: source_filename = "generic_noop.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!214} +// CHECK:STDOUT: !llvm.dbg.cu = !{!302} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !213 = !DIFile(filename: "generic_noop.carbon", directory: "") -// CHECK:STDOUT: !214 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !213, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !301 = !DIFile(filename: "generic_noop.carbon", directory: "") +// CHECK:STDOUT: !302 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !301, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'generic_use.carbon' // CHECK:STDOUT: source_filename = "generic_use.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: @"_CBase.Main.$vtable.73dc16096a14ffe3" = unnamed_addr constant [1 x i32] [i32 trunc (i64 sub (i64 ptrtoint (ptr @_CF.Base.Main.73dc16096a14ffe3 to i64), i64 ptrtoint (ptr @"_CBase.Main.$vtable.73dc16096a14ffe3" to i64)) to i32)] -// CHECK:STDOUT: @"_CBase.Main.$vtable.8c5d6b80f4488d91" = unnamed_addr constant [1 x i32] [i32 trunc (i64 sub (i64 ptrtoint (ptr @_CF.Base.Main.8c5d6b80f4488d91 to i64), i64 ptrtoint (ptr @"_CBase.Main.$vtable.8c5d6b80f4488d91" to i64)) to i32)] -// CHECK:STDOUT: @Base.val.16c.loc16_3 = internal constant { ptr } { ptr @"_CBase.Main.$vtable.73dc16096a14ffe3" } -// CHECK:STDOUT: @Base.val.d0c.loc17_3 = internal constant { ptr } { ptr @"_CBase.Main.$vtable.8c5d6b80f4488d91" } +// CHECK:STDOUT: @"_CBase.Main.$vtable.2f8a0042309f394e" = unnamed_addr constant [1 x i32] [i32 trunc (i64 sub (i64 ptrtoint (ptr @_CF.Base.Main.2f8a0042309f394e to i64), i64 ptrtoint (ptr @"_CBase.Main.$vtable.2f8a0042309f394e" to i64)) to i32)] +// CHECK:STDOUT: @"_CBase.Main.$vtable.d7d44a05ee79f1b8" = unnamed_addr constant [1 x i32] [i32 trunc (i64 sub (i64 ptrtoint (ptr @_CF.Base.Main.d7d44a05ee79f1b8 to i64), i64 ptrtoint (ptr @"_CBase.Main.$vtable.d7d44a05ee79f1b8" to i64)) to i32)] +// CHECK:STDOUT: @Base.val.a7b.loc16_3 = internal constant { ptr } { ptr @"_CBase.Main.$vtable.2f8a0042309f394e" } +// CHECK:STDOUT: @Base.val.3f1.loc17_3 = internal constant { ptr } { ptr @"_CBase.Main.$vtable.d7d44a05ee79f1b8" } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !217 { +// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !305 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var.loc16 = alloca { ptr }, align 8, !dbg !218 -// CHECK:STDOUT: %_.var.loc17 = alloca { ptr }, align 8, !dbg !221 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc16), !dbg !218 -// CHECK:STDOUT: %.loc16_22.2.vptr = getelementptr inbounds nuw { ptr }, ptr %_.var.loc16, i32 0, i32 0, !dbg !219 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %_.var.loc16, ptr align 8 @Base.val.16c.loc16_3, i64 8, i1 false), !dbg !218 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc17), !dbg !221 -// CHECK:STDOUT: %.loc17_22.2.vptr = getelementptr inbounds nuw { ptr }, ptr %_.var.loc17, i32 0, i32 0, !dbg !222 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %_.var.loc17, ptr align 8 @Base.val.d0c.loc17_3, i64 8, i1 false), !dbg !221 -// CHECK:STDOUT: call void @"_COp.29f553c9039a992c:core.Destroy.Core"(ptr %_.var.loc17), !dbg !221 -// CHECK:STDOUT: call void @"_COp.7c9ece1036397869:core.Destroy.Core"(ptr %_.var.loc16), !dbg !218 -// CHECK:STDOUT: ret void, !dbg !224 +// CHECK:STDOUT: %_.var.loc16 = alloca { ptr }, align 8, !dbg !306 +// CHECK:STDOUT: %_.var.loc17 = alloca { ptr }, align 8, !dbg !309 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc16), !dbg !306 +// CHECK:STDOUT: %.loc16_22.2.vptr = getelementptr inbounds nuw { ptr }, ptr %_.var.loc16, i32 0, i32 0, !dbg !307 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %_.var.loc16, ptr align 8 @Base.val.a7b.loc16_3, i64 8, i1 false), !dbg !306 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc17), !dbg !309 +// CHECK:STDOUT: %.loc17_22.2.vptr = getelementptr inbounds nuw { ptr }, ptr %_.var.loc17, i32 0, i32 0, !dbg !310 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %_.var.loc17, ptr align 8 @Base.val.3f1.loc17_3, i64 8, i1 false), !dbg !309 +// CHECK:STDOUT: call void @"_CSelfDestruct.c3ce2497e05f4476:core.Destroy.Core"(ptr %_.var.loc17), !dbg !309 +// CHECK:STDOUT: call void @"_CSelfDestruct.b64fd0f098bf5c8e:core.Destroy.Core"(ptr %_.var.loc16), !dbg !306 +// CHECK:STDOUT: ret void, !dbg !312 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.13f86630f401913f:core.Destroy.Core"(ptr %self) #0 !dbg !225 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %self) #0 !dbg !313 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !227 +// CHECK:STDOUT: ret void, !dbg !315 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f2f12ab22a0a6b87:core.Destroy.Core"(ptr %self) #0 !dbg !229 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.13f86630f401913f:core.Destroy.Core"(ptr %self) #0 !dbg !317 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !231 +// CHECK:STDOUT: ret void, !dbg !319 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.8578661a61c8bbbf:core.Destroy.Core"(ptr %self) #0 !dbg !233 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.13f86630f401913f:core.Destroy.Core"(ptr %self) #0 !dbg !321 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !235 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.13f86630f401913f:core.Destroy.Core"(ptr %self), !dbg !323 +// CHECK:STDOUT: ret void, !dbg !323 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.95528a86e1127e2d:core.Destroy.Core"(ptr %self) #0 !dbg !237 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f2f12ab22a0a6b87:core.Destroy.Core"(ptr %self) #0 !dbg !325 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !239 +// CHECK:STDOUT: ret void, !dbg !327 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.29f553c9039a992c:core.Destroy.Core"(ptr %self) #0 !dbg !241 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f2f12ab22a0a6b87:core.Destroy.Core"(ptr %self) #0 !dbg !329 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !243 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f2f12ab22a0a6b87:core.Destroy.Core"(ptr %self), !dbg !331 +// CHECK:STDOUT: ret void, !dbg !331 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.7c9ece1036397869:core.Destroy.Core"(ptr %self) #0 !dbg !245 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.8578661a61c8bbbf:core.Destroy.Core"(ptr %self) #0 !dbg !333 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !247 +// CHECK:STDOUT: ret void, !dbg !335 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CF.Base.Main.73dc16096a14ffe3(ptr %self) #0 !dbg !249 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.8578661a61c8bbbf:core.Destroy.Core"(ptr %self) #0 !dbg !337 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca {}, align 1, !dbg !252 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !252 -// CHECK:STDOUT: call void @"_COp.13f86630f401913f:core.Destroy.Core"(ptr %_.var), !dbg !252 -// CHECK:STDOUT: ret void, !dbg !254 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.8578661a61c8bbbf:core.Destroy.Core"(ptr %self), !dbg !339 +// CHECK:STDOUT: ret void, !dbg !339 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CF.Base.Main.8c5d6b80f4488d91(ptr %self) #0 !dbg !256 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.454fecbcedcd86e1:core.Destroy.Core"(ptr %self) #0 !dbg !341 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca { {} }, align 1, !dbg !259 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !259 -// CHECK:STDOUT: call void @"_COp.8578661a61c8bbbf:core.Destroy.Core"(ptr %_.var), !dbg !259 -// CHECK:STDOUT: ret void, !dbg !261 +// CHECK:STDOUT: ret void, !dbg !343 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.95528a86e1127e2d:core.Destroy.Core"(ptr %self) #0 !dbg !345 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !347 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.95528a86e1127e2d:core.Destroy.Core"(ptr %self) #0 !dbg !349 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.95528a86e1127e2d:core.Destroy.Core"(ptr %self), !dbg !351 +// CHECK:STDOUT: ret void, !dbg !351 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.c3ce2497e05f4476:core.Destroy.Core"(ptr %self) #0 !dbg !353 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !355 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.c3ce2497e05f4476:core.Destroy.Core"(ptr %self) #0 !dbg !357 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.c3ce2497e05f4476:core.Destroy.Core"(ptr %self), !dbg !359 +// CHECK:STDOUT: ret void, !dbg !359 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.b64fd0f098bf5c8e:core.Destroy.Core"(ptr %self) #0 !dbg !361 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !363 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.b64fd0f098bf5c8e:core.Destroy.Core"(ptr %self) #0 !dbg !365 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.b64fd0f098bf5c8e:core.Destroy.Core"(ptr %self), !dbg !367 +// CHECK:STDOUT: ret void, !dbg !367 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @_CF.Base.Main.2f8a0042309f394e(ptr %self) #0 !dbg !369 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %_.var = alloca {}, align 1, !dbg !372 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !372 +// CHECK:STDOUT: call void @"_CSelfDestruct.13f86630f401913f:core.Destroy.Core"(ptr %_.var), !dbg !372 +// CHECK:STDOUT: ret void, !dbg !374 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @_CF.Base.Main.d7d44a05ee79f1b8(ptr %self) #0 !dbg !376 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %_.var = alloca { {} }, align 1, !dbg !379 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !379 +// CHECK:STDOUT: call void @"_CSelfDestruct.8578661a61c8bbbf:core.Destroy.Core"(ptr %_.var), !dbg !379 +// CHECK:STDOUT: ret void, !dbg !381 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -976,7 +1266,7 @@ fn Use() { // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!216} +// CHECK:STDOUT: !llvm.dbg.cu = !{!304} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} @@ -986,48 +1276,80 @@ fn Use() { // CHECK:STDOUT: !22 = !DISubroutineType(types: !21) // CHECK:STDOUT: !40 = !{null} // CHECK:STDOUT: !41 = !DISubroutineType(types: !40) -// CHECK:STDOUT: !215 = !DIFile(filename: "generic_use.carbon", directory: "") -// CHECK:STDOUT: !216 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !215, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !217 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !215, line: 15, type: !41, spFlags: DISPFlagDefinition, unit: !216) -// CHECK:STDOUT: !218 = !DILocation(line: 16, column: 3, scope: !217) -// CHECK:STDOUT: !219 = !DILocation(line: 16, column: 21, scope: !217) -// CHECK:STDOUT: !221 = !DILocation(line: 17, column: 3, scope: !217) -// CHECK:STDOUT: !222 = !DILocation(line: 17, column: 21, scope: !217) -// CHECK:STDOUT: !224 = !DILocation(line: 15, column: 1, scope: !217) -// CHECK:STDOUT: !225 = distinct !DISubprogram(name: "Op", linkageName: "_COp.13f86630f401913f:core.Destroy.Core", scope: null, file: !215, line: 16, type: !22, spFlags: DISPFlagDefinition, unit: !216, retainedNodes: !228) -// CHECK:STDOUT: !226 = !DILocalVariable(arg: 1, scope: !225, type: !20) -// CHECK:STDOUT: !227 = !DILocation(line: 16, column: 10, scope: !225) -// CHECK:STDOUT: !228 = !{!226} -// CHECK:STDOUT: !229 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f2f12ab22a0a6b87:core.Destroy.Core", scope: null, file: !215, line: 17, type: !22, spFlags: DISPFlagDefinition, unit: !216, retainedNodes: !232) -// CHECK:STDOUT: !230 = !DILocalVariable(arg: 1, scope: !229, type: !20) -// CHECK:STDOUT: !231 = !DILocation(line: 17, column: 10, scope: !229) -// CHECK:STDOUT: !232 = !{!230} -// CHECK:STDOUT: !233 = distinct !DISubprogram(name: "Op", linkageName: "_COp.8578661a61c8bbbf:core.Destroy.Core", scope: null, file: !215, line: 17, type: !22, spFlags: DISPFlagDefinition, unit: !216, retainedNodes: !236) -// CHECK:STDOUT: !234 = !DILocalVariable(arg: 1, scope: !233, type: !20) -// CHECK:STDOUT: !235 = !DILocation(line: 17, column: 10, scope: !233) -// CHECK:STDOUT: !236 = !{!234} -// CHECK:STDOUT: !237 = distinct !DISubprogram(name: "Op", linkageName: "_COp.95528a86e1127e2d:core.Destroy.Core", scope: null, file: !215, line: 17, type: !22, spFlags: DISPFlagDefinition, unit: !216, retainedNodes: !240) -// CHECK:STDOUT: !238 = !DILocalVariable(arg: 1, scope: !237, type: !20) -// CHECK:STDOUT: !239 = !DILocation(line: 17, column: 3, scope: !237) -// CHECK:STDOUT: !240 = !{!238} -// CHECK:STDOUT: !241 = distinct !DISubprogram(name: "Op", linkageName: "_COp.29f553c9039a992c:core.Destroy.Core", scope: null, file: !215, line: 17, type: !22, spFlags: DISPFlagDefinition, unit: !216, retainedNodes: !244) -// CHECK:STDOUT: !242 = !DILocalVariable(arg: 1, scope: !241, type: !20) -// CHECK:STDOUT: !243 = !DILocation(line: 17, column: 3, scope: !241) -// CHECK:STDOUT: !244 = !{!242} -// CHECK:STDOUT: !245 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7c9ece1036397869:core.Destroy.Core", scope: null, file: !215, line: 16, type: !22, spFlags: DISPFlagDefinition, unit: !216, retainedNodes: !248) -// CHECK:STDOUT: !246 = !DILocalVariable(arg: 1, scope: !245, type: !20) -// CHECK:STDOUT: !247 = !DILocation(line: 16, column: 3, scope: !245) -// CHECK:STDOUT: !248 = !{!246} -// CHECK:STDOUT: !249 = distinct !DISubprogram(name: "F", linkageName: "_CF.Base.Main.73dc16096a14ffe3", scope: null, file: !215, line: 5, type: !22, spFlags: DISPFlagDefinition, unit: !216, retainedNodes: !255) -// CHECK:STDOUT: !250 = !DILocalVariable(arg: 1, scope: !249, type: !20) -// CHECK:STDOUT: !252 = !DILocation(line: 6, column: 5, scope: !249) -// CHECK:STDOUT: !254 = !DILocation(line: 5, column: 3, scope: !249) -// CHECK:STDOUT: !255 = !{!250} -// CHECK:STDOUT: !256 = distinct !DISubprogram(name: "F", linkageName: "_CF.Base.Main.8c5d6b80f4488d91", scope: null, file: !215, line: 5, type: !22, spFlags: DISPFlagDefinition, unit: !216, retainedNodes: !262) -// CHECK:STDOUT: !257 = !DILocalVariable(arg: 1, scope: !256, type: !20) -// CHECK:STDOUT: !259 = !DILocation(line: 6, column: 5, scope: !256) -// CHECK:STDOUT: !261 = !DILocation(line: 5, column: 3, scope: !256) -// CHECK:STDOUT: !262 = !{!257} +// CHECK:STDOUT: !303 = !DIFile(filename: "generic_use.carbon", directory: "") +// CHECK:STDOUT: !304 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !303, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !305 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !303, line: 15, type: !41, spFlags: DISPFlagDefinition, unit: !304) +// CHECK:STDOUT: !306 = !DILocation(line: 16, column: 3, scope: !305) +// CHECK:STDOUT: !307 = !DILocation(line: 16, column: 21, scope: !305) +// CHECK:STDOUT: !309 = !DILocation(line: 17, column: 3, scope: !305) +// CHECK:STDOUT: !310 = !DILocation(line: 17, column: 21, scope: !305) +// CHECK:STDOUT: !312 = !DILocation(line: 15, column: 1, scope: !305) +// CHECK:STDOUT: !313 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !303, line: 16, type: !22, spFlags: DISPFlagDefinition, unit: !304, retainedNodes: !316) +// CHECK:STDOUT: !314 = !DILocalVariable(arg: 1, scope: !313, type: !20) +// CHECK:STDOUT: !315 = !DILocation(line: 16, column: 10, scope: !313) +// CHECK:STDOUT: !316 = !{!314} +// CHECK:STDOUT: !317 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.13f86630f401913f:core.Destroy.Core", scope: null, file: !303, line: 16, type: !22, spFlags: DISPFlagDefinition, unit: !304, retainedNodes: !320) +// CHECK:STDOUT: !318 = !DILocalVariable(arg: 1, scope: !317, type: !20) +// CHECK:STDOUT: !319 = !DILocation(line: 16, column: 10, scope: !317) +// CHECK:STDOUT: !320 = !{!318} +// CHECK:STDOUT: !321 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.13f86630f401913f:core.Destroy.Core", scope: null, file: !303, line: 16, type: !22, spFlags: DISPFlagDefinition, unit: !304, retainedNodes: !324) +// CHECK:STDOUT: !322 = !DILocalVariable(arg: 1, scope: !321, type: !20) +// CHECK:STDOUT: !323 = !DILocation(line: 16, column: 10, scope: !321) +// CHECK:STDOUT: !324 = !{!322} +// CHECK:STDOUT: !325 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f2f12ab22a0a6b87:core.Destroy.Core", scope: null, file: !303, line: 17, type: !22, spFlags: DISPFlagDefinition, unit: !304, retainedNodes: !328) +// CHECK:STDOUT: !326 = !DILocalVariable(arg: 1, scope: !325, type: !20) +// CHECK:STDOUT: !327 = !DILocation(line: 17, column: 10, scope: !325) +// CHECK:STDOUT: !328 = !{!326} +// CHECK:STDOUT: !329 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f2f12ab22a0a6b87:core.Destroy.Core", scope: null, file: !303, line: 17, type: !22, spFlags: DISPFlagDefinition, unit: !304, retainedNodes: !332) +// CHECK:STDOUT: !330 = !DILocalVariable(arg: 1, scope: !329, type: !20) +// CHECK:STDOUT: !331 = !DILocation(line: 17, column: 10, scope: !329) +// CHECK:STDOUT: !332 = !{!330} +// CHECK:STDOUT: !333 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.8578661a61c8bbbf:core.Destroy.Core", scope: null, file: !303, line: 17, type: !22, spFlags: DISPFlagDefinition, unit: !304, retainedNodes: !336) +// CHECK:STDOUT: !334 = !DILocalVariable(arg: 1, scope: !333, type: !20) +// CHECK:STDOUT: !335 = !DILocation(line: 17, column: 10, scope: !333) +// CHECK:STDOUT: !336 = !{!334} +// CHECK:STDOUT: !337 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.8578661a61c8bbbf:core.Destroy.Core", scope: null, file: !303, line: 17, type: !22, spFlags: DISPFlagDefinition, unit: !304, retainedNodes: !340) +// CHECK:STDOUT: !338 = !DILocalVariable(arg: 1, scope: !337, type: !20) +// CHECK:STDOUT: !339 = !DILocation(line: 17, column: 10, scope: !337) +// CHECK:STDOUT: !340 = !{!338} +// CHECK:STDOUT: !341 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.454fecbcedcd86e1:core.Destroy.Core", scope: null, file: !303, line: 17, type: !22, spFlags: DISPFlagDefinition, unit: !304, retainedNodes: !344) +// CHECK:STDOUT: !342 = !DILocalVariable(arg: 1, scope: !341, type: !20) +// CHECK:STDOUT: !343 = !DILocation(line: 17, column: 3, scope: !341) +// CHECK:STDOUT: !344 = !{!342} +// CHECK:STDOUT: !345 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.95528a86e1127e2d:core.Destroy.Core", scope: null, file: !303, line: 17, type: !22, spFlags: DISPFlagDefinition, unit: !304, retainedNodes: !348) +// CHECK:STDOUT: !346 = !DILocalVariable(arg: 1, scope: !345, type: !20) +// CHECK:STDOUT: !347 = !DILocation(line: 17, column: 3, scope: !345) +// CHECK:STDOUT: !348 = !{!346} +// CHECK:STDOUT: !349 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.95528a86e1127e2d:core.Destroy.Core", scope: null, file: !303, line: 17, type: !22, spFlags: DISPFlagDefinition, unit: !304, retainedNodes: !352) +// CHECK:STDOUT: !350 = !DILocalVariable(arg: 1, scope: !349, type: !20) +// CHECK:STDOUT: !351 = !DILocation(line: 17, column: 3, scope: !349) +// CHECK:STDOUT: !352 = !{!350} +// CHECK:STDOUT: !353 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.c3ce2497e05f4476:core.Destroy.Core", scope: null, file: !303, line: 17, type: !22, spFlags: DISPFlagDefinition, unit: !304, retainedNodes: !356) +// CHECK:STDOUT: !354 = !DILocalVariable(arg: 1, scope: !353, type: !20) +// CHECK:STDOUT: !355 = !DILocation(line: 17, column: 3, scope: !353) +// CHECK:STDOUT: !356 = !{!354} +// CHECK:STDOUT: !357 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.c3ce2497e05f4476:core.Destroy.Core", scope: null, file: !303, line: 17, type: !22, spFlags: DISPFlagDefinition, unit: !304, retainedNodes: !360) +// CHECK:STDOUT: !358 = !DILocalVariable(arg: 1, scope: !357, type: !20) +// CHECK:STDOUT: !359 = !DILocation(line: 17, column: 3, scope: !357) +// CHECK:STDOUT: !360 = !{!358} +// CHECK:STDOUT: !361 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.b64fd0f098bf5c8e:core.Destroy.Core", scope: null, file: !303, line: 16, type: !22, spFlags: DISPFlagDefinition, unit: !304, retainedNodes: !364) +// CHECK:STDOUT: !362 = !DILocalVariable(arg: 1, scope: !361, type: !20) +// CHECK:STDOUT: !363 = !DILocation(line: 16, column: 3, scope: !361) +// CHECK:STDOUT: !364 = !{!362} +// CHECK:STDOUT: !365 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.b64fd0f098bf5c8e:core.Destroy.Core", scope: null, file: !303, line: 16, type: !22, spFlags: DISPFlagDefinition, unit: !304, retainedNodes: !368) +// CHECK:STDOUT: !366 = !DILocalVariable(arg: 1, scope: !365, type: !20) +// CHECK:STDOUT: !367 = !DILocation(line: 16, column: 3, scope: !365) +// CHECK:STDOUT: !368 = !{!366} +// CHECK:STDOUT: !369 = distinct !DISubprogram(name: "F", linkageName: "_CF.Base.Main.2f8a0042309f394e", scope: null, file: !303, line: 5, type: !22, spFlags: DISPFlagDefinition, unit: !304, retainedNodes: !375) +// CHECK:STDOUT: !370 = !DILocalVariable(arg: 1, scope: !369, type: !20) +// CHECK:STDOUT: !372 = !DILocation(line: 6, column: 5, scope: !369) +// CHECK:STDOUT: !374 = !DILocation(line: 5, column: 3, scope: !369) +// CHECK:STDOUT: !375 = !{!370} +// CHECK:STDOUT: !376 = distinct !DISubprogram(name: "F", linkageName: "_CF.Base.Main.d7d44a05ee79f1b8", scope: null, file: !303, line: 5, type: !22, spFlags: DISPFlagDefinition, unit: !304, retainedNodes: !382) +// CHECK:STDOUT: !377 = !DILocalVariable(arg: 1, scope: !376, type: !20) +// CHECK:STDOUT: !379 = !DILocation(line: 6, column: 5, scope: !376) +// CHECK:STDOUT: !381 = !DILocation(line: 5, column: 3, scope: !376) +// CHECK:STDOUT: !382 = !{!377} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'generic_base.carbon' @@ -1036,42 +1358,76 @@ fn Use() { // CHECK:STDOUT: @"_CDerived.Main.$vtable" = unnamed_addr constant [1 x i32] [i32 trunc (i64 sub (i64 ptrtoint (ptr @_CF.Base.Main.6d6a4a2512463e59 to i64), i64 ptrtoint (ptr @"_CDerived.Main.$vtable" to i64)) to i32)] // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CMake.Main() #0 !dbg !265 { +// CHECK:STDOUT: define void @_CMake.Main() #0 !dbg !385 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca { { ptr } }, align 8, !dbg !266 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !266 -// CHECK:STDOUT: call void @"_COp.b25525d21a9bd472:core.Destroy.Core"(ptr %_.var), !dbg !266 -// CHECK:STDOUT: ret void, !dbg !268 +// CHECK:STDOUT: %_.var = alloca { { ptr } }, align 8, !dbg !386 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !386 +// CHECK:STDOUT: call void @"_CSelfDestruct.b25525d21a9bd472:core.Destroy.Core"(ptr %_.var), !dbg !386 +// CHECK:STDOUT: ret void, !dbg !388 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.95528a86e1127e2d:core.Destroy.Core"(ptr %self) #0 !dbg !269 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.454fecbcedcd86e1:core.Destroy.Core"(ptr %self) #0 !dbg !389 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !271 +// CHECK:STDOUT: ret void, !dbg !391 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.5b23b4f14feb87e1:core.Destroy.Core"(ptr %self) #0 !dbg !273 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.95528a86e1127e2d:core.Destroy.Core"(ptr %self) #0 !dbg !393 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !275 +// CHECK:STDOUT: ret void, !dbg !395 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.2f190654c863951f:core.Destroy.Core"(ptr %self) #0 !dbg !277 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.95528a86e1127e2d:core.Destroy.Core"(ptr %self) #0 !dbg !397 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !279 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.95528a86e1127e2d:core.Destroy.Core"(ptr %self), !dbg !399 +// CHECK:STDOUT: ret void, !dbg !399 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.b25525d21a9bd472:core.Destroy.Core"(ptr %self) #0 !dbg !281 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.5b23b4f14feb87e1:core.Destroy.Core"(ptr %self) #0 !dbg !401 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !283 +// CHECK:STDOUT: ret void, !dbg !403 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CF.Base.Main.6d6a4a2512463e59(ptr %self) #0 !dbg !285 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.5b23b4f14feb87e1:core.Destroy.Core"(ptr %self) #0 !dbg !405 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !288 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.5b23b4f14feb87e1:core.Destroy.Core"(ptr %self), !dbg !407 +// CHECK:STDOUT: ret void, !dbg !407 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.2f190654c863951f:core.Destroy.Core"(ptr %self) #0 !dbg !409 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !411 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.2f190654c863951f:core.Destroy.Core"(ptr %self) #0 !dbg !413 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.2f190654c863951f:core.Destroy.Core"(ptr %self), !dbg !415 +// CHECK:STDOUT: ret void, !dbg !415 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.b25525d21a9bd472:core.Destroy.Core"(ptr %self) #0 !dbg !417 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !419 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.b25525d21a9bd472:core.Destroy.Core"(ptr %self) #0 !dbg !421 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.b25525d21a9bd472:core.Destroy.Core"(ptr %self), !dbg !423 +// CHECK:STDOUT: ret void, !dbg !423 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @_CF.Base.Main.6d6a4a2512463e59(ptr %self) #0 !dbg !425 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !428 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -1080,7 +1436,7 @@ fn Use() { // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!264} +// CHECK:STDOUT: !llvm.dbg.cu = !{!384} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} @@ -1090,31 +1446,51 @@ fn Use() { // CHECK:STDOUT: !22 = !DISubroutineType(types: !21) // CHECK:STDOUT: !40 = !{null} // CHECK:STDOUT: !41 = !DISubroutineType(types: !40) -// CHECK:STDOUT: !263 = !DIFile(filename: "generic_base.carbon", directory: "") -// CHECK:STDOUT: !264 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !263, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !265 = distinct !DISubprogram(name: "Make", linkageName: "_CMake.Main", scope: null, file: !263, line: 14, type: !41, spFlags: DISPFlagDefinition, unit: !264) -// CHECK:STDOUT: !266 = !DILocation(line: 15, column: 3, scope: !265) -// CHECK:STDOUT: !268 = !DILocation(line: 14, column: 1, scope: !265) -// CHECK:STDOUT: !269 = distinct !DISubprogram(name: "Op", linkageName: "_COp.95528a86e1127e2d:core.Destroy.Core", scope: null, file: !263, line: 15, type: !22, spFlags: DISPFlagDefinition, unit: !264, retainedNodes: !272) -// CHECK:STDOUT: !270 = !DILocalVariable(arg: 1, scope: !269, type: !20) -// CHECK:STDOUT: !271 = !DILocation(line: 15, column: 3, scope: !269) -// CHECK:STDOUT: !272 = !{!270} -// CHECK:STDOUT: !273 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5b23b4f14feb87e1:core.Destroy.Core", scope: null, file: !263, line: 15, type: !22, spFlags: DISPFlagDefinition, unit: !264, retainedNodes: !276) -// CHECK:STDOUT: !274 = !DILocalVariable(arg: 1, scope: !273, type: !20) -// CHECK:STDOUT: !275 = !DILocation(line: 15, column: 3, scope: !273) -// CHECK:STDOUT: !276 = !{!274} -// CHECK:STDOUT: !277 = distinct !DISubprogram(name: "Op", linkageName: "_COp.2f190654c863951f:core.Destroy.Core", scope: null, file: !263, line: 15, type: !22, spFlags: DISPFlagDefinition, unit: !264, retainedNodes: !280) -// CHECK:STDOUT: !278 = !DILocalVariable(arg: 1, scope: !277, type: !20) -// CHECK:STDOUT: !279 = !DILocation(line: 15, column: 3, scope: !277) -// CHECK:STDOUT: !280 = !{!278} -// CHECK:STDOUT: !281 = distinct !DISubprogram(name: "Op", linkageName: "_COp.b25525d21a9bd472:core.Destroy.Core", scope: null, file: !263, line: 15, type: !22, spFlags: DISPFlagDefinition, unit: !264, retainedNodes: !284) -// CHECK:STDOUT: !282 = !DILocalVariable(arg: 1, scope: !281, type: !20) -// CHECK:STDOUT: !283 = !DILocation(line: 15, column: 3, scope: !281) -// CHECK:STDOUT: !284 = !{!282} -// CHECK:STDOUT: !285 = distinct !DISubprogram(name: "F", linkageName: "_CF.Base.Main.6d6a4a2512463e59", scope: null, file: !263, line: 5, type: !22, spFlags: DISPFlagDefinition, unit: !264, retainedNodes: !289) -// CHECK:STDOUT: !286 = !DILocalVariable(arg: 1, scope: !285, type: !20) -// CHECK:STDOUT: !288 = !DILocation(line: 5, column: 3, scope: !285) -// CHECK:STDOUT: !289 = !{!286} +// CHECK:STDOUT: !383 = !DIFile(filename: "generic_base.carbon", directory: "") +// CHECK:STDOUT: !384 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !383, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !385 = distinct !DISubprogram(name: "Make", linkageName: "_CMake.Main", scope: null, file: !383, line: 14, type: !41, spFlags: DISPFlagDefinition, unit: !384) +// CHECK:STDOUT: !386 = !DILocation(line: 15, column: 3, scope: !385) +// CHECK:STDOUT: !388 = !DILocation(line: 14, column: 1, scope: !385) +// CHECK:STDOUT: !389 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.454fecbcedcd86e1:core.Destroy.Core", scope: null, file: !383, line: 15, type: !22, spFlags: DISPFlagDefinition, unit: !384, retainedNodes: !392) +// CHECK:STDOUT: !390 = !DILocalVariable(arg: 1, scope: !389, type: !20) +// CHECK:STDOUT: !391 = !DILocation(line: 15, column: 3, scope: !389) +// CHECK:STDOUT: !392 = !{!390} +// CHECK:STDOUT: !393 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.95528a86e1127e2d:core.Destroy.Core", scope: null, file: !383, line: 15, type: !22, spFlags: DISPFlagDefinition, unit: !384, retainedNodes: !396) +// CHECK:STDOUT: !394 = !DILocalVariable(arg: 1, scope: !393, type: !20) +// CHECK:STDOUT: !395 = !DILocation(line: 15, column: 3, scope: !393) +// CHECK:STDOUT: !396 = !{!394} +// CHECK:STDOUT: !397 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.95528a86e1127e2d:core.Destroy.Core", scope: null, file: !383, line: 15, type: !22, spFlags: DISPFlagDefinition, unit: !384, retainedNodes: !400) +// CHECK:STDOUT: !398 = !DILocalVariable(arg: 1, scope: !397, type: !20) +// CHECK:STDOUT: !399 = !DILocation(line: 15, column: 3, scope: !397) +// CHECK:STDOUT: !400 = !{!398} +// CHECK:STDOUT: !401 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.5b23b4f14feb87e1:core.Destroy.Core", scope: null, file: !383, line: 15, type: !22, spFlags: DISPFlagDefinition, unit: !384, retainedNodes: !404) +// CHECK:STDOUT: !402 = !DILocalVariable(arg: 1, scope: !401, type: !20) +// CHECK:STDOUT: !403 = !DILocation(line: 15, column: 3, scope: !401) +// CHECK:STDOUT: !404 = !{!402} +// CHECK:STDOUT: !405 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.5b23b4f14feb87e1:core.Destroy.Core", scope: null, file: !383, line: 15, type: !22, spFlags: DISPFlagDefinition, unit: !384, retainedNodes: !408) +// CHECK:STDOUT: !406 = !DILocalVariable(arg: 1, scope: !405, type: !20) +// CHECK:STDOUT: !407 = !DILocation(line: 15, column: 3, scope: !405) +// CHECK:STDOUT: !408 = !{!406} +// CHECK:STDOUT: !409 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.2f190654c863951f:core.Destroy.Core", scope: null, file: !383, line: 15, type: !22, spFlags: DISPFlagDefinition, unit: !384, retainedNodes: !412) +// CHECK:STDOUT: !410 = !DILocalVariable(arg: 1, scope: !409, type: !20) +// CHECK:STDOUT: !411 = !DILocation(line: 15, column: 3, scope: !409) +// CHECK:STDOUT: !412 = !{!410} +// CHECK:STDOUT: !413 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.2f190654c863951f:core.Destroy.Core", scope: null, file: !383, line: 15, type: !22, spFlags: DISPFlagDefinition, unit: !384, retainedNodes: !416) +// CHECK:STDOUT: !414 = !DILocalVariable(arg: 1, scope: !413, type: !20) +// CHECK:STDOUT: !415 = !DILocation(line: 15, column: 3, scope: !413) +// CHECK:STDOUT: !416 = !{!414} +// CHECK:STDOUT: !417 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.b25525d21a9bd472:core.Destroy.Core", scope: null, file: !383, line: 15, type: !22, spFlags: DISPFlagDefinition, unit: !384, retainedNodes: !420) +// CHECK:STDOUT: !418 = !DILocalVariable(arg: 1, scope: !417, type: !20) +// CHECK:STDOUT: !419 = !DILocation(line: 15, column: 3, scope: !417) +// CHECK:STDOUT: !420 = !{!418} +// CHECK:STDOUT: !421 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.b25525d21a9bd472:core.Destroy.Core", scope: null, file: !383, line: 15, type: !22, spFlags: DISPFlagDefinition, unit: !384, retainedNodes: !424) +// CHECK:STDOUT: !422 = !DILocalVariable(arg: 1, scope: !421, type: !20) +// CHECK:STDOUT: !423 = !DILocation(line: 15, column: 3, scope: !421) +// CHECK:STDOUT: !424 = !{!422} +// CHECK:STDOUT: !425 = distinct !DISubprogram(name: "F", linkageName: "_CF.Base.Main.6d6a4a2512463e59", scope: null, file: !383, line: 5, type: !22, spFlags: DISPFlagDefinition, unit: !384, retainedNodes: !429) +// CHECK:STDOUT: !426 = !DILocalVariable(arg: 1, scope: !425, type: !20) +// CHECK:STDOUT: !428 = !DILocation(line: 5, column: 3, scope: !425) +// CHECK:STDOUT: !429 = !{!426} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'thunk.carbon' @@ -1131,86 +1507,140 @@ fn Use() { // CHECK:STDOUT: declare void @_CF.Base.Main(ptr sret({}), ptr, ptr) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF.Derived.Main(ptr sret({}) %return, ptr %self, ptr %n) #0 !dbg !296 { +// CHECK:STDOUT: define void @_CF.Derived.Main(ptr sret({}) %return, ptr %self, ptr %n) #0 !dbg !436 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %return, ptr align 1 @From.val.loc18_14, i64 0, i1 false), !dbg !303 -// CHECK:STDOUT: ret void, !dbg !303 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %return, ptr align 1 @From.val.loc18_14, i64 0, i1 false), !dbg !443 +// CHECK:STDOUT: ret void, !dbg !443 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr void @"_CF:thunk:Base.Main:Derived.Main"(ptr sret({}) %return, ptr %self, ptr %n) #1 !dbg !305 { +// CHECK:STDOUT: define weak_odr void @"_CF:thunk:Base.Main:Derived.Main"(ptr sret({}) %return, ptr %self, ptr %n) #1 !dbg !445 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc17_52.2.temp = alloca {}, align 1, !dbg !309 -// CHECK:STDOUT: %.5.temp = alloca {}, align 1, !dbg !308 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc17_52.2.temp), !dbg !309 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.5.temp), !dbg !308 -// CHECK:STDOUT: call void @"_CConvert.From.Main:ImplicitAs.a3bb440f6426a7d6.Core"(ptr %.5.temp, ptr %n), !dbg !308 -// CHECK:STDOUT: call void @_CF.Derived.Main(ptr %.loc17_52.2.temp, ptr %self, ptr %.5.temp), !dbg !309 -// CHECK:STDOUT: call void @"_CConvert.From.Main:ImplicitAs.a3bb440f6426a7d6.Core"(ptr %return, ptr %.loc17_52.2.temp), !dbg !309 -// CHECK:STDOUT: call void @"_COp.c2a743abd057cb33:core.Destroy.Core"(ptr %.loc17_52.2.temp), !dbg !309 -// CHECK:STDOUT: call void @"_COp.7ef2e8c2f12d163a:core.Destroy.Core"(ptr %.5.temp), !dbg !308 -// CHECK:STDOUT: ret void, !dbg !309 +// CHECK:STDOUT: %.loc17_52.2.temp = alloca {}, align 1, !dbg !449 +// CHECK:STDOUT: %.5.temp = alloca {}, align 1, !dbg !448 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc17_52.2.temp), !dbg !449 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.5.temp), !dbg !448 +// CHECK:STDOUT: call void @"_CConvert.From.Main:ImplicitAs.a3bb440f6426a7d6.Core"(ptr %.5.temp, ptr %n), !dbg !448 +// CHECK:STDOUT: call void @_CF.Derived.Main(ptr %.loc17_52.2.temp, ptr %self, ptr %.5.temp), !dbg !449 +// CHECK:STDOUT: call void @"_CConvert.From.Main:ImplicitAs.a3bb440f6426a7d6.Core"(ptr %return, ptr %.loc17_52.2.temp), !dbg !449 +// CHECK:STDOUT: call void @"_CSelfDestruct.c2a743abd057cb33:core.Destroy.Core"(ptr %.loc17_52.2.temp), !dbg !449 +// CHECK:STDOUT: call void @"_CSelfDestruct.7ef2e8c2f12d163a:core.Destroy.Core"(ptr %.5.temp), !dbg !448 +// CHECK:STDOUT: ret void, !dbg !449 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.c2a743abd057cb33:core.Destroy.Core"(ptr %self) #0 !dbg !311 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %self) #0 !dbg !451 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !313 +// CHECK:STDOUT: ret void, !dbg !453 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.7ef2e8c2f12d163a:core.Destroy.Core"(ptr %self) #0 !dbg !315 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.c2a743abd057cb33:core.Destroy.Core"(ptr %self) #0 !dbg !455 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !317 +// CHECK:STDOUT: ret void, !dbg !457 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CUse.Main() #0 !dbg !319 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.c2a743abd057cb33:core.Destroy.Core"(ptr %self) #0 !dbg !459 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %d.var = alloca { { ptr } }, align 8, !dbg !320 -// CHECK:STDOUT: %.loc25_10.1.temp = alloca {}, align 1, !dbg !328 -// CHECK:STDOUT: %.loc25_9.2.temp = alloca {}, align 1, !dbg !329 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %d.var), !dbg !320 -// CHECK:STDOUT: %.loc23_31.2.base = getelementptr inbounds nuw { { ptr } }, ptr %d.var, i32 0, i32 0, !dbg !321 -// CHECK:STDOUT: %.loc23_30.2.vptr = getelementptr inbounds nuw { ptr }, ptr %.loc23_31.2.base, i32 0, i32 0, !dbg !322 -// CHECK:STDOUT: %.loc23_31.6.base = getelementptr inbounds nuw { { ptr } }, ptr %d.var, i32 0, i32 0, !dbg !321 -// CHECK:STDOUT: %.loc23_31.7.vptr = getelementptr inbounds nuw { ptr }, ptr %.loc23_31.6.base, i32 0, i32 0, !dbg !321 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %d.var, ptr align 8 @Derived.val.loc23_31.5, i64 8, i1 false), !dbg !321 -// CHECK:STDOUT: store ptr @"_CDerived.Main.$vtable", ptr %.loc23_31.7.vptr, align 8, !dbg !321 -// CHECK:STDOUT: %.loc24_18.2.base = getelementptr inbounds nuw { { ptr } }, ptr %d.var, i32 0, i32 0, !dbg !325 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc25_10.1.temp), !dbg !328 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc25_9.2.temp), !dbg !329 -// CHECK:STDOUT: %Base.F.call.vtable = load ptr, ptr %.loc25_10.1.temp, align 8, !dbg !328 -// CHECK:STDOUT: %Base.F.call = call ptr @llvm.load.relative.i32(ptr %Base.F.call.vtable, i32 0), !dbg !328 -// CHECK:STDOUT: call void %Base.F.call(ptr %.loc25_10.1.temp, ptr %.loc24_18.2.base, ptr @From.val.loc18_14), !dbg !328 -// CHECK:STDOUT: call void @"_COp.7ef2e8c2f12d163a:core.Destroy.Core"(ptr %.loc25_10.1.temp), !dbg !328 -// CHECK:STDOUT: call void @"_COp.c2a743abd057cb33:core.Destroy.Core"(ptr @From.val), !dbg !329 -// CHECK:STDOUT: call void @"_COp.b25525d21a9bd472:core.Destroy.Core"(ptr %d.var), !dbg !320 -// CHECK:STDOUT: ret void, !dbg !330 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.c2a743abd057cb33:core.Destroy.Core"(ptr %self), !dbg !461 +// CHECK:STDOUT: ret void, !dbg !461 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.95528a86e1127e2d:core.Destroy.Core"(ptr %self) #0 !dbg !331 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.7ef2e8c2f12d163a:core.Destroy.Core"(ptr %self) #0 !dbg !463 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !333 +// CHECK:STDOUT: ret void, !dbg !465 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.294df737cd074d60:core.Destroy.Core"(ptr %self) #0 !dbg !335 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.7ef2e8c2f12d163a:core.Destroy.Core"(ptr %self) #0 !dbg !467 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !337 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.7ef2e8c2f12d163a:core.Destroy.Core"(ptr %self), !dbg !469 +// CHECK:STDOUT: ret void, !dbg !469 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.caed8a96bf328d09:core.Destroy.Core"(ptr %self) #0 !dbg !339 { +// CHECK:STDOUT: define void @_CUse.Main() #0 !dbg !471 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !341 +// CHECK:STDOUT: %d.var = alloca { { ptr } }, align 8, !dbg !472 +// CHECK:STDOUT: %.loc25_10.1.temp = alloca {}, align 1, !dbg !480 +// CHECK:STDOUT: %.loc25_9.2.temp = alloca {}, align 1, !dbg !481 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %d.var), !dbg !472 +// CHECK:STDOUT: %.loc23_31.2.base = getelementptr inbounds nuw { { ptr } }, ptr %d.var, i32 0, i32 0, !dbg !473 +// CHECK:STDOUT: %.loc23_30.2.vptr = getelementptr inbounds nuw { ptr }, ptr %.loc23_31.2.base, i32 0, i32 0, !dbg !474 +// CHECK:STDOUT: %.loc23_31.6.base = getelementptr inbounds nuw { { ptr } }, ptr %d.var, i32 0, i32 0, !dbg !473 +// CHECK:STDOUT: %.loc23_31.7.vptr = getelementptr inbounds nuw { ptr }, ptr %.loc23_31.6.base, i32 0, i32 0, !dbg !473 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %d.var, ptr align 8 @Derived.val.loc23_31.5, i64 8, i1 false), !dbg !473 +// CHECK:STDOUT: store ptr @"_CDerived.Main.$vtable", ptr %.loc23_31.7.vptr, align 8, !dbg !473 +// CHECK:STDOUT: %.loc24_18.2.base = getelementptr inbounds nuw { { ptr } }, ptr %d.var, i32 0, i32 0, !dbg !477 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc25_10.1.temp), !dbg !480 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc25_9.2.temp), !dbg !481 +// CHECK:STDOUT: %Base.F.call.vtable = load ptr, ptr %.loc25_10.1.temp, align 8, !dbg !480 +// CHECK:STDOUT: %Base.F.call = call ptr @llvm.load.relative.i32(ptr %Base.F.call.vtable, i32 0), !dbg !480 +// CHECK:STDOUT: call void %Base.F.call(ptr %.loc25_10.1.temp, ptr %.loc24_18.2.base, ptr @From.val.loc18_14), !dbg !480 +// CHECK:STDOUT: call void @"_CSelfDestruct.7ef2e8c2f12d163a:core.Destroy.Core"(ptr %.loc25_10.1.temp), !dbg !480 +// CHECK:STDOUT: call void @"_CSelfDestruct.c2a743abd057cb33:core.Destroy.Core"(ptr @From.val), !dbg !481 +// CHECK:STDOUT: call void @"_CSelfDestruct.b25525d21a9bd472:core.Destroy.Core"(ptr %d.var), !dbg !472 +// CHECK:STDOUT: ret void, !dbg !482 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.b25525d21a9bd472:core.Destroy.Core"(ptr %self) #0 !dbg !343 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.454fecbcedcd86e1:core.Destroy.Core"(ptr %self) #0 !dbg !483 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !345 +// CHECK:STDOUT: ret void, !dbg !485 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.95528a86e1127e2d:core.Destroy.Core"(ptr %self) #0 !dbg !487 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !489 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.95528a86e1127e2d:core.Destroy.Core"(ptr %self) #0 !dbg !491 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.95528a86e1127e2d:core.Destroy.Core"(ptr %self), !dbg !493 +// CHECK:STDOUT: ret void, !dbg !493 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.294df737cd074d60:core.Destroy.Core"(ptr %self) #0 !dbg !495 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !497 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.294df737cd074d60:core.Destroy.Core"(ptr %self) #0 !dbg !499 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.294df737cd074d60:core.Destroy.Core"(ptr %self), !dbg !501 +// CHECK:STDOUT: ret void, !dbg !501 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.caed8a96bf328d09:core.Destroy.Core"(ptr %self) #0 !dbg !503 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !505 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.caed8a96bf328d09:core.Destroy.Core"(ptr %self) #0 !dbg !507 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.caed8a96bf328d09:core.Destroy.Core"(ptr %self), !dbg !509 +// CHECK:STDOUT: ret void, !dbg !509 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.b25525d21a9bd472:core.Destroy.Core"(ptr %self) #0 !dbg !511 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !513 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.b25525d21a9bd472:core.Destroy.Core"(ptr %self) #0 !dbg !515 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.b25525d21a9bd472:core.Destroy.Core"(ptr %self), !dbg !517 +// CHECK:STDOUT: ret void, !dbg !517 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -1231,7 +1661,7 @@ fn Use() { // CHECK:STDOUT: attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: read) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!291} +// CHECK:STDOUT: !llvm.dbg.cu = !{!431} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} @@ -1241,51 +1671,83 @@ fn Use() { // CHECK:STDOUT: !22 = !DISubroutineType(types: !21) // CHECK:STDOUT: !40 = !{null} // CHECK:STDOUT: !41 = !DISubroutineType(types: !40) -// CHECK:STDOUT: !290 = !DIFile(filename: "thunk.carbon", directory: "") -// CHECK:STDOUT: !291 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !290, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !294 = !{!20, !20, !20} -// CHECK:STDOUT: !295 = !DISubroutineType(types: !294) -// CHECK:STDOUT: !296 = distinct !DISubprogram(name: "F", linkageName: "_CF.Derived.Main", scope: null, file: !290, line: 17, type: !295, spFlags: DISPFlagDefinition, unit: !291, retainedNodes: !304) -// CHECK:STDOUT: !297 = !DILocalVariable(arg: 1, scope: !296, type: !20) -// CHECK:STDOUT: !298 = !DILocalVariable(arg: 2, scope: !296, type: !20) -// CHECK:STDOUT: !303 = !DILocation(line: 18, column: 5, scope: !296) -// CHECK:STDOUT: !304 = !{!297, !298} -// CHECK:STDOUT: !305 = distinct !DISubprogram(name: "F", linkageName: "_CF:thunk:Base.Main:Derived.Main", scope: null, file: !290, line: 17, type: !295, spFlags: DISPFlagDefinition, unit: !291, retainedNodes: !310) -// CHECK:STDOUT: !306 = !DILocalVariable(arg: 1, scope: !305, type: !20) -// CHECK:STDOUT: !307 = !DILocalVariable(arg: 2, scope: !305, type: !20) -// CHECK:STDOUT: !308 = !DILocation(line: 0, scope: !305) -// CHECK:STDOUT: !309 = !DILocation(line: 17, column: 3, scope: !305) -// CHECK:STDOUT: !310 = !{!306, !307} -// CHECK:STDOUT: !311 = distinct !DISubprogram(name: "Op", linkageName: "_COp.c2a743abd057cb33:core.Destroy.Core", scope: null, file: !290, line: 17, type: !22, spFlags: DISPFlagDefinition, unit: !291, retainedNodes: !314) -// CHECK:STDOUT: !312 = !DILocalVariable(arg: 1, scope: !311, type: !20) -// CHECK:STDOUT: !313 = !DILocation(line: 17, column: 3, scope: !311) -// CHECK:STDOUT: !314 = !{!312} -// CHECK:STDOUT: !315 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7ef2e8c2f12d163a:core.Destroy.Core", scope: null, file: !290, type: !22, spFlags: DISPFlagDefinition, unit: !291, retainedNodes: !318) -// CHECK:STDOUT: !316 = !DILocalVariable(arg: 1, scope: !315, type: !20) -// CHECK:STDOUT: !317 = !DILocation(line: 0, scope: !315) -// CHECK:STDOUT: !318 = !{!316} -// CHECK:STDOUT: !319 = distinct !DISubprogram(name: "Use", linkageName: "_CUse.Main", scope: null, file: !290, line: 22, type: !41, spFlags: DISPFlagDefinition, unit: !291) -// CHECK:STDOUT: !320 = !DILocation(line: 23, column: 3, scope: !319) -// CHECK:STDOUT: !321 = !DILocation(line: 23, column: 20, scope: !319) -// CHECK:STDOUT: !322 = !DILocation(line: 23, column: 29, scope: !319) -// CHECK:STDOUT: !325 = !DILocation(line: 24, column: 18, scope: !319) -// CHECK:STDOUT: !328 = !DILocation(line: 25, column: 3, scope: !319) -// CHECK:STDOUT: !329 = !DILocation(line: 25, column: 8, scope: !319) -// CHECK:STDOUT: !330 = !DILocation(line: 22, column: 1, scope: !319) -// CHECK:STDOUT: !331 = distinct !DISubprogram(name: "Op", linkageName: "_COp.95528a86e1127e2d:core.Destroy.Core", scope: null, file: !290, line: 23, type: !22, spFlags: DISPFlagDefinition, unit: !291, retainedNodes: !334) -// CHECK:STDOUT: !332 = !DILocalVariable(arg: 1, scope: !331, type: !20) -// CHECK:STDOUT: !333 = !DILocation(line: 23, column: 3, scope: !331) -// CHECK:STDOUT: !334 = !{!332} -// CHECK:STDOUT: !335 = distinct !DISubprogram(name: "Op", linkageName: "_COp.294df737cd074d60:core.Destroy.Core", scope: null, file: !290, line: 23, type: !22, spFlags: DISPFlagDefinition, unit: !291, retainedNodes: !338) -// CHECK:STDOUT: !336 = !DILocalVariable(arg: 1, scope: !335, type: !20) -// CHECK:STDOUT: !337 = !DILocation(line: 23, column: 3, scope: !335) -// CHECK:STDOUT: !338 = !{!336} -// CHECK:STDOUT: !339 = distinct !DISubprogram(name: "Op", linkageName: "_COp.caed8a96bf328d09:core.Destroy.Core", scope: null, file: !290, line: 23, type: !22, spFlags: DISPFlagDefinition, unit: !291, retainedNodes: !342) -// CHECK:STDOUT: !340 = !DILocalVariable(arg: 1, scope: !339, type: !20) -// CHECK:STDOUT: !341 = !DILocation(line: 23, column: 3, scope: !339) -// CHECK:STDOUT: !342 = !{!340} -// CHECK:STDOUT: !343 = distinct !DISubprogram(name: "Op", linkageName: "_COp.b25525d21a9bd472:core.Destroy.Core", scope: null, file: !290, line: 23, type: !22, spFlags: DISPFlagDefinition, unit: !291, retainedNodes: !346) -// CHECK:STDOUT: !344 = !DILocalVariable(arg: 1, scope: !343, type: !20) -// CHECK:STDOUT: !345 = !DILocation(line: 23, column: 3, scope: !343) -// CHECK:STDOUT: !346 = !{!344} +// CHECK:STDOUT: !430 = !DIFile(filename: "thunk.carbon", directory: "") +// CHECK:STDOUT: !431 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !430, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !434 = !{!20, !20, !20} +// CHECK:STDOUT: !435 = !DISubroutineType(types: !434) +// CHECK:STDOUT: !436 = distinct !DISubprogram(name: "F", linkageName: "_CF.Derived.Main", scope: null, file: !430, line: 17, type: !435, spFlags: DISPFlagDefinition, unit: !431, retainedNodes: !444) +// CHECK:STDOUT: !437 = !DILocalVariable(arg: 1, scope: !436, type: !20) +// CHECK:STDOUT: !438 = !DILocalVariable(arg: 2, scope: !436, type: !20) +// CHECK:STDOUT: !443 = !DILocation(line: 18, column: 5, scope: !436) +// CHECK:STDOUT: !444 = !{!437, !438} +// CHECK:STDOUT: !445 = distinct !DISubprogram(name: "F", linkageName: "_CF:thunk:Base.Main:Derived.Main", scope: null, file: !430, line: 17, type: !435, spFlags: DISPFlagDefinition, unit: !431, retainedNodes: !450) +// CHECK:STDOUT: !446 = !DILocalVariable(arg: 1, scope: !445, type: !20) +// CHECK:STDOUT: !447 = !DILocalVariable(arg: 2, scope: !445, type: !20) +// CHECK:STDOUT: !448 = !DILocation(line: 0, scope: !445) +// CHECK:STDOUT: !449 = !DILocation(line: 17, column: 3, scope: !445) +// CHECK:STDOUT: !450 = !{!446, !447} +// CHECK:STDOUT: !451 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !430, line: 17, type: !22, spFlags: DISPFlagDefinition, unit: !431, retainedNodes: !454) +// CHECK:STDOUT: !452 = !DILocalVariable(arg: 1, scope: !451, type: !20) +// CHECK:STDOUT: !453 = !DILocation(line: 17, column: 3, scope: !451) +// CHECK:STDOUT: !454 = !{!452} +// CHECK:STDOUT: !455 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.c2a743abd057cb33:core.Destroy.Core", scope: null, file: !430, line: 17, type: !22, spFlags: DISPFlagDefinition, unit: !431, retainedNodes: !458) +// CHECK:STDOUT: !456 = !DILocalVariable(arg: 1, scope: !455, type: !20) +// CHECK:STDOUT: !457 = !DILocation(line: 17, column: 3, scope: !455) +// CHECK:STDOUT: !458 = !{!456} +// CHECK:STDOUT: !459 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.c2a743abd057cb33:core.Destroy.Core", scope: null, file: !430, line: 17, type: !22, spFlags: DISPFlagDefinition, unit: !431, retainedNodes: !462) +// CHECK:STDOUT: !460 = !DILocalVariable(arg: 1, scope: !459, type: !20) +// CHECK:STDOUT: !461 = !DILocation(line: 17, column: 3, scope: !459) +// CHECK:STDOUT: !462 = !{!460} +// CHECK:STDOUT: !463 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.7ef2e8c2f12d163a:core.Destroy.Core", scope: null, file: !430, type: !22, spFlags: DISPFlagDefinition, unit: !431, retainedNodes: !466) +// CHECK:STDOUT: !464 = !DILocalVariable(arg: 1, scope: !463, type: !20) +// CHECK:STDOUT: !465 = !DILocation(line: 0, scope: !463) +// CHECK:STDOUT: !466 = !{!464} +// CHECK:STDOUT: !467 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.7ef2e8c2f12d163a:core.Destroy.Core", scope: null, file: !430, type: !22, spFlags: DISPFlagDefinition, unit: !431, retainedNodes: !470) +// CHECK:STDOUT: !468 = !DILocalVariable(arg: 1, scope: !467, type: !20) +// CHECK:STDOUT: !469 = !DILocation(line: 0, scope: !467) +// CHECK:STDOUT: !470 = !{!468} +// CHECK:STDOUT: !471 = distinct !DISubprogram(name: "Use", linkageName: "_CUse.Main", scope: null, file: !430, line: 22, type: !41, spFlags: DISPFlagDefinition, unit: !431) +// CHECK:STDOUT: !472 = !DILocation(line: 23, column: 3, scope: !471) +// CHECK:STDOUT: !473 = !DILocation(line: 23, column: 20, scope: !471) +// CHECK:STDOUT: !474 = !DILocation(line: 23, column: 29, scope: !471) +// CHECK:STDOUT: !477 = !DILocation(line: 24, column: 18, scope: !471) +// CHECK:STDOUT: !480 = !DILocation(line: 25, column: 3, scope: !471) +// CHECK:STDOUT: !481 = !DILocation(line: 25, column: 8, scope: !471) +// CHECK:STDOUT: !482 = !DILocation(line: 22, column: 1, scope: !471) +// CHECK:STDOUT: !483 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.454fecbcedcd86e1:core.Destroy.Core", scope: null, file: !430, line: 23, type: !22, spFlags: DISPFlagDefinition, unit: !431, retainedNodes: !486) +// CHECK:STDOUT: !484 = !DILocalVariable(arg: 1, scope: !483, type: !20) +// CHECK:STDOUT: !485 = !DILocation(line: 23, column: 3, scope: !483) +// CHECK:STDOUT: !486 = !{!484} +// CHECK:STDOUT: !487 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.95528a86e1127e2d:core.Destroy.Core", scope: null, file: !430, line: 23, type: !22, spFlags: DISPFlagDefinition, unit: !431, retainedNodes: !490) +// CHECK:STDOUT: !488 = !DILocalVariable(arg: 1, scope: !487, type: !20) +// CHECK:STDOUT: !489 = !DILocation(line: 23, column: 3, scope: !487) +// CHECK:STDOUT: !490 = !{!488} +// CHECK:STDOUT: !491 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.95528a86e1127e2d:core.Destroy.Core", scope: null, file: !430, line: 23, type: !22, spFlags: DISPFlagDefinition, unit: !431, retainedNodes: !494) +// CHECK:STDOUT: !492 = !DILocalVariable(arg: 1, scope: !491, type: !20) +// CHECK:STDOUT: !493 = !DILocation(line: 23, column: 3, scope: !491) +// CHECK:STDOUT: !494 = !{!492} +// CHECK:STDOUT: !495 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.294df737cd074d60:core.Destroy.Core", scope: null, file: !430, line: 23, type: !22, spFlags: DISPFlagDefinition, unit: !431, retainedNodes: !498) +// CHECK:STDOUT: !496 = !DILocalVariable(arg: 1, scope: !495, type: !20) +// CHECK:STDOUT: !497 = !DILocation(line: 23, column: 3, scope: !495) +// CHECK:STDOUT: !498 = !{!496} +// CHECK:STDOUT: !499 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.294df737cd074d60:core.Destroy.Core", scope: null, file: !430, line: 23, type: !22, spFlags: DISPFlagDefinition, unit: !431, retainedNodes: !502) +// CHECK:STDOUT: !500 = !DILocalVariable(arg: 1, scope: !499, type: !20) +// CHECK:STDOUT: !501 = !DILocation(line: 23, column: 3, scope: !499) +// CHECK:STDOUT: !502 = !{!500} +// CHECK:STDOUT: !503 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.caed8a96bf328d09:core.Destroy.Core", scope: null, file: !430, line: 23, type: !22, spFlags: DISPFlagDefinition, unit: !431, retainedNodes: !506) +// CHECK:STDOUT: !504 = !DILocalVariable(arg: 1, scope: !503, type: !20) +// CHECK:STDOUT: !505 = !DILocation(line: 23, column: 3, scope: !503) +// CHECK:STDOUT: !506 = !{!504} +// CHECK:STDOUT: !507 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.caed8a96bf328d09:core.Destroy.Core", scope: null, file: !430, line: 23, type: !22, spFlags: DISPFlagDefinition, unit: !431, retainedNodes: !510) +// CHECK:STDOUT: !508 = !DILocalVariable(arg: 1, scope: !507, type: !20) +// CHECK:STDOUT: !509 = !DILocation(line: 23, column: 3, scope: !507) +// CHECK:STDOUT: !510 = !{!508} +// CHECK:STDOUT: !511 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.b25525d21a9bd472:core.Destroy.Core", scope: null, file: !430, line: 23, type: !22, spFlags: DISPFlagDefinition, unit: !431, retainedNodes: !514) +// CHECK:STDOUT: !512 = !DILocalVariable(arg: 1, scope: !511, type: !20) +// CHECK:STDOUT: !513 = !DILocation(line: 23, column: 3, scope: !511) +// CHECK:STDOUT: !514 = !{!512} +// CHECK:STDOUT: !515 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.b25525d21a9bd472:core.Destroy.Core", scope: null, file: !430, line: 23, type: !22, spFlags: DISPFlagDefinition, unit: !431, retainedNodes: !518) +// CHECK:STDOUT: !516 = !DILocalVariable(arg: 1, scope: !515, type: !20) +// CHECK:STDOUT: !517 = !DILocation(line: 23, column: 3, scope: !515) +// CHECK:STDOUT: !518 = !{!516} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/for/bindings.carbon b/toolchain/lower/testdata/for/bindings.carbon index 6e35cdd900a3..15f9164562d3 100644 --- a/toolchain/lower/testdata/for/bindings.carbon +++ b/toolchain/lower/testdata/for/bindings.carbon @@ -37,98 +37,173 @@ fn For() { // CHECK:STDOUT: // CHECK:STDOUT: @EmptyRange.val.loc27_3 = internal constant {} zeroinitializer // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %self) #0 !dbg !16 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !18 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: declare void @_CF.Main(i32, ptr) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CFor.Main() #0 !dbg !16 { +// CHECK:STDOUT: define void @_CFor.Main() #0 !dbg !20 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %r.var = alloca {}, align 1, !dbg !17 -// CHECK:STDOUT: %n.var = alloca i32, align 4, !dbg !19 -// CHECK:STDOUT: %var = alloca {}, align 1, !dbg !22 -// CHECK:STDOUT: %.loc29_33.1.temp = alloca <{ { i32, i32 }, i1 }>, align 4, !dbg !22 -// CHECK:STDOUT: %.loc29_33.8.temp = alloca { i32, i32 }, align 4, !dbg !22 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %r.var), !dbg !17 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %r.var, ptr align 1 @EmptyRange.val.loc27_3, i64 0, i1 false), !dbg !17 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %n.var), !dbg !19 -// CHECK:STDOUT: call void @"_CNewCursor.EmptyRange.a081b942542726db.Main:Iterate.Core.77b9b98c21cda092"(ptr %r.var), !dbg !22 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %var), !dbg !22 -// CHECK:STDOUT: br label %for.next, !dbg !22 +// CHECK:STDOUT: %r.var = alloca {}, align 1, !dbg !21 +// CHECK:STDOUT: %n.var = alloca i32, align 4, !dbg !23 +// CHECK:STDOUT: %var = alloca {}, align 1, !dbg !26 +// CHECK:STDOUT: %.loc29_33.1.temp = alloca <{ { i32, i32 }, i1 }>, align 4, !dbg !26 +// CHECK:STDOUT: %.loc29_33.8.temp = alloca { i32, i32 }, align 4, !dbg !26 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %r.var), !dbg !21 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %r.var, ptr align 1 @EmptyRange.val.loc27_3, i64 0, i1 false), !dbg !21 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %n.var), !dbg !23 +// CHECK:STDOUT: call void @"_CNewCursor.EmptyRange.a081b942542726db.Main:Iterate.Core.2e30d2d7a87a6cd3"(ptr %r.var), !dbg !26 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %var), !dbg !26 +// CHECK:STDOUT: br label %for.next, !dbg !26 // CHECK:STDOUT: // CHECK:STDOUT: for.next: ; preds = %for.body, %entry -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc29_33.1.temp), !dbg !22 -// CHECK:STDOUT: call void @"_CNext.EmptyRange.a081b942542726db.Main:Iterate.Core.77b9b98c21cda092"(ptr %.loc29_33.1.temp, ptr %r.var, ptr %var), !dbg !22 -// CHECK:STDOUT: %Optional.HasValue.call = call i1 @_CHasValue.Optional.Core.6dc9cf042919088c(ptr %.loc29_33.1.temp), !dbg !22 -// CHECK:STDOUT: br i1 %Optional.HasValue.call, label %for.body, label %for.done, !dbg !22 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc29_33.1.temp), !dbg !26 +// CHECK:STDOUT: call void @"_CNext.EmptyRange.a081b942542726db.Main:Iterate.Core.2e30d2d7a87a6cd3"(ptr %.loc29_33.1.temp, ptr %r.var, ptr %var), !dbg !26 +// CHECK:STDOUT: %Optional.HasValue.call = call i1 @_CHasValue.Optional.Core.b20cf0d1c9daa8c2(ptr %.loc29_33.1.temp), !dbg !26 +// CHECK:STDOUT: br i1 %Optional.HasValue.call, label %for.body, label %for.done, !dbg !26 // CHECK:STDOUT: // CHECK:STDOUT: for.body: ; preds = %for.next -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc29_33.8.temp), !dbg !22 -// CHECK:STDOUT: call void @_CGet.Optional.Core.6dc9cf042919088c(ptr %.loc29_33.8.temp, ptr %.loc29_33.1.temp), !dbg !22 -// CHECK:STDOUT: %tuple.elem0.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %.loc29_33.8.temp, i32 0, i32 0, !dbg !22 -// CHECK:STDOUT: %tuple.elem1.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %.loc29_33.8.temp, i32 0, i32 1, !dbg !22 -// CHECK:STDOUT: %.loc29_33.11 = load i32, ptr %tuple.elem0.tuple.elem, align 4, !dbg !22 -// CHECK:STDOUT: %.loc29_33.12 = load i32, ptr %tuple.elem1.tuple.elem, align 4, !dbg !22 -// CHECK:STDOUT: store i32 %.loc29_33.12, ptr %n.var, align 4, !dbg !19 -// CHECK:STDOUT: call void @_CF.Main(i32 %.loc29_33.11, ptr %n.var), !dbg !32 -// CHECK:STDOUT: call void @"_COp.e554695bf635d9c1:core.Destroy.Core"(ptr %.loc29_33.8.temp), !dbg !22 -// CHECK:STDOUT: call void @"_COp.e6ede56fadd95c85:core.Destroy.Core"(ptr %.loc29_33.1.temp), !dbg !22 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %n.var), !dbg !19 -// CHECK:STDOUT: br label %for.next, !dbg !33 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc29_33.8.temp), !dbg !26 +// CHECK:STDOUT: call void @_CGet.Optional.Core.b20cf0d1c9daa8c2(ptr %.loc29_33.8.temp, ptr %.loc29_33.1.temp), !dbg !26 +// CHECK:STDOUT: %tuple.elem0.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %.loc29_33.8.temp, i32 0, i32 0, !dbg !26 +// CHECK:STDOUT: %tuple.elem1.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %.loc29_33.8.temp, i32 0, i32 1, !dbg !26 +// CHECK:STDOUT: %.loc29_33.11 = load i32, ptr %tuple.elem0.tuple.elem, align 4, !dbg !26 +// CHECK:STDOUT: %.loc29_33.12 = load i32, ptr %tuple.elem1.tuple.elem, align 4, !dbg !26 +// CHECK:STDOUT: store i32 %.loc29_33.12, ptr %n.var, align 4, !dbg !23 +// CHECK:STDOUT: call void @_CF.Main(i32 %.loc29_33.11, ptr %n.var), !dbg !36 +// CHECK:STDOUT: call void @"_CSelfDestruct.e554695bf635d9c1:core.Destroy.Core"(ptr %.loc29_33.8.temp), !dbg !26 +// CHECK:STDOUT: call void @"_CSelfDestruct.e1dbefa6145042b5:core.Destroy.Core"(ptr %.loc29_33.1.temp), !dbg !26 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %n.var), !dbg !23 +// CHECK:STDOUT: br label %for.next, !dbg !37 // CHECK:STDOUT: // CHECK:STDOUT: for.done: ; preds = %for.next -// CHECK:STDOUT: call void @"_COp.e6ede56fadd95c85:core.Destroy.Core"(ptr %.loc29_33.1.temp), !dbg !22 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %n.var), !dbg !19 -// CHECK:STDOUT: call void @"_COp.5c0f85cf677fdc52:core.Destroy.Core"(ptr %r.var), !dbg !17 -// CHECK:STDOUT: ret void, !dbg !34 +// CHECK:STDOUT: call void @"_CSelfDestruct.e1dbefa6145042b5:core.Destroy.Core"(ptr %.loc29_33.1.temp), !dbg !26 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %n.var), !dbg !23 +// CHECK:STDOUT: call void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %var), !dbg !26 +// CHECK:STDOUT: call void @"_CSelfDestruct.454683f3b8639b20:core.Destroy.Core"(ptr %r.var), !dbg !21 +// CHECK:STDOUT: ret void, !dbg !38 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !35 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !37 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.e554695bf635d9c1:core.Destroy.Core"(ptr %self) #0 !dbg !39 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !39 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !41 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.6b9c90d9dd82cebb:core.Destroy.Core"(ptr %self) #0 !dbg !43 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !43 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !45 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.29c785c8e8489e66:core.Destroy.Core"(ptr %self) #0 !dbg !47 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !47 { // CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !49 // CHECK:STDOUT: ret void, !dbg !49 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.db896a6e77a760db:core.Destroy.Core"(ptr %self) #0 !dbg !51 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.e554695bf635d9c1:core.Destroy.Core"(ptr %self) #0 !dbg !51 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !53 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.a968564cf435c13f:core.Destroy.Core"(ptr %self) #0 !dbg !55 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.e554695bf635d9c1:core.Destroy.Core"(ptr %self) #0 !dbg !55 { // CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.e554695bf635d9c1:core.Destroy.Core"(ptr %self), !dbg !57 // CHECK:STDOUT: ret void, !dbg !57 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.e6ede56fadd95c85:core.Destroy.Core"(ptr %self) #0 !dbg !59 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.6b9c90d9dd82cebb:core.Destroy.Core"(ptr %self) #0 !dbg !59 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !61 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.5c0f85cf677fdc52:core.Destroy.Core"(ptr %self) #0 !dbg !63 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6b9c90d9dd82cebb:core.Destroy.Core"(ptr %self) #0 !dbg !63 { // CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.6b9c90d9dd82cebb:core.Destroy.Core"(ptr %self), !dbg !65 // CHECK:STDOUT: ret void, !dbg !65 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.a69fcb7116d040b0:core.Destroy.Core"(ptr %self) #0 !dbg !67 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !69 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.a69fcb7116d040b0:core.Destroy.Core"(ptr %self) #0 !dbg !71 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.a69fcb7116d040b0:core.Destroy.Core"(ptr %self), !dbg !73 +// CHECK:STDOUT: ret void, !dbg !73 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.48e0adf639fe7af4:core.Destroy.Core"(ptr %self) #0 !dbg !75 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !77 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.47c342be31d1679f:core.Destroy.Core"(ptr %self) #0 !dbg !79 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !81 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.47c342be31d1679f:core.Destroy.Core"(ptr %self) #0 !dbg !83 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.47c342be31d1679f:core.Destroy.Core"(ptr %self), !dbg !85 +// CHECK:STDOUT: ret void, !dbg !85 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.b61f4dca88958e98:core.Destroy.Core"(ptr %self) #0 !dbg !87 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !89 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.b61f4dca88958e98:core.Destroy.Core"(ptr %self) #0 !dbg !91 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.b61f4dca88958e98:core.Destroy.Core"(ptr %self), !dbg !93 +// CHECK:STDOUT: ret void, !dbg !93 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.e1dbefa6145042b5:core.Destroy.Core"(ptr %self) #0 !dbg !95 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !97 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.e1dbefa6145042b5:core.Destroy.Core"(ptr %self) #0 !dbg !99 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.e1dbefa6145042b5:core.Destroy.Core"(ptr %self), !dbg !101 +// CHECK:STDOUT: ret void, !dbg !101 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.454683f3b8639b20:core.Destroy.Core"(ptr %self) #0 !dbg !103 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !105 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.454683f3b8639b20:core.Destroy.Core"(ptr %self) #0 !dbg !107 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.454683f3b8639b20:core.Destroy.Core"(ptr %self), !dbg !109 +// CHECK:STDOUT: ret void, !dbg !109 +// 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: @@ -136,74 +211,74 @@ fn For() { // 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 @"_CNewCursor.EmptyRange.a081b942542726db.Main:Iterate.Core.77b9b98c21cda092"(ptr %self) #0 !dbg !67 { +// CHECK:STDOUT: define linkonce_odr void @"_CNewCursor.EmptyRange.a081b942542726db.Main:Iterate.Core.2e30d2d7a87a6cd3"(ptr %self) #0 !dbg !111 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !72 +// CHECK:STDOUT: ret void, !dbg !116 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CNext.EmptyRange.a081b942542726db.Main:Iterate.Core.77b9b98c21cda092"(ptr sret(<{ { i32, i32 }, i1 }>) %return, ptr %self, ptr %_) #0 !dbg !74 { +// CHECK:STDOUT: define linkonce_odr void @"_CNext.EmptyRange.a081b942542726db.Main:Iterate.Core.2e30d2d7a87a6cd3"(ptr sret(<{ { i32, i32 }, i1 }>) %return, ptr %self, ptr %_) #0 !dbg !118 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CNone.Optional.Core.6dc9cf042919088c(ptr %return), !dbg !81 -// CHECK:STDOUT: ret void, !dbg !84 +// CHECK:STDOUT: call void @_CNone.Optional.Core.b20cf0d1c9daa8c2(ptr %return), !dbg !125 +// CHECK:STDOUT: ret void, !dbg !128 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.6dc9cf042919088c(ptr %self) #0 !dbg !87 { -// CHECK:STDOUT: %1 = call i1 @"_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.77b9b98c21cda092"(ptr %self), !dbg !93 -// CHECK:STDOUT: ret i1 %1, !dbg !94 +// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.b20cf0d1c9daa8c2(ptr %self) #0 !dbg !131 { +// CHECK:STDOUT: %1 = call i1 @"_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.2e30d2d7a87a6cd3"(ptr %self), !dbg !137 +// CHECK:STDOUT: ret i1 %1, !dbg !138 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CGet.Optional.Core.6dc9cf042919088c(ptr sret({ i32, i32 }) %return, ptr %self) #0 !dbg !96 { -// CHECK:STDOUT: call void @"_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.77b9b98c21cda092"(ptr %return, ptr %self), !dbg !102 -// CHECK:STDOUT: ret void, !dbg !103 +// CHECK:STDOUT: define linkonce_odr void @_CGet.Optional.Core.b20cf0d1c9daa8c2(ptr sret({ i32, i32 }) %return, ptr %self) #0 !dbg !140 { +// CHECK:STDOUT: call void @"_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.2e30d2d7a87a6cd3"(ptr %return, ptr %self), !dbg !146 +// CHECK:STDOUT: ret void, !dbg !147 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CNone.Optional.Core.6dc9cf042919088c(ptr sret(<{ { i32, i32 }, i1 }>) %return) #0 !dbg !105 { -// CHECK:STDOUT: call void @"_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.77b9b98c21cda092"(ptr %return), !dbg !108 -// CHECK:STDOUT: ret void, !dbg !109 +// CHECK:STDOUT: define linkonce_odr void @_CNone.Optional.Core.b20cf0d1c9daa8c2(ptr sret(<{ { i32, i32 }, i1 }>) %return) #0 !dbg !149 { +// CHECK:STDOUT: call void @"_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.2e30d2d7a87a6cd3"(ptr %return), !dbg !152 +// CHECK:STDOUT: ret void, !dbg !153 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @"_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.77b9b98c21cda092"(ptr %value) #0 !dbg !110 { -// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ { i32, i32 }, i1 }>, ptr %value, i32 0, i32 1, !dbg !115 -// CHECK:STDOUT: %1 = load i8, ptr %has_value, align 1, !dbg !115 -// CHECK:STDOUT: %2 = trunc i8 %1 to i1, !dbg !115 -// CHECK:STDOUT: ret i1 %2, !dbg !116 +// CHECK:STDOUT: define linkonce_odr i1 @"_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.2e30d2d7a87a6cd3"(ptr %value) #0 !dbg !154 { +// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ { i32, i32 }, i1 }>, ptr %value, i32 0, i32 1, !dbg !159 +// CHECK:STDOUT: %1 = load i8, ptr %has_value, align 1, !dbg !159 +// CHECK:STDOUT: %2 = trunc i8 %1 to i1, !dbg !159 +// CHECK:STDOUT: ret i1 %2, !dbg !160 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.77b9b98c21cda092"(ptr sret({ i32, i32 }) %return, ptr %value) #0 !dbg !118 { -// CHECK:STDOUT: %value1 = getelementptr inbounds nuw <{ { i32, i32 }, i1 }>, ptr %value, i32 0, i32 0, !dbg !123 -// CHECK:STDOUT: call void @"_COp.4e4edddc7580c79b:Copy.Core.8608f3c6f62d80cb"(ptr %return, ptr %value1), !dbg !123 -// CHECK:STDOUT: ret void, !dbg !124 +// CHECK:STDOUT: define linkonce_odr void @"_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.2e30d2d7a87a6cd3"(ptr sret({ i32, i32 }) %return, ptr %value) #0 !dbg !162 { +// CHECK:STDOUT: %value1 = getelementptr inbounds nuw <{ { i32, i32 }, i1 }>, ptr %value, i32 0, i32 0, !dbg !167 +// CHECK:STDOUT: call void @"_COp.4e4edddc7580c79b:Copy.Core.8608f3c6f62d80cb"(ptr %return, ptr %value1), !dbg !167 +// CHECK:STDOUT: ret void, !dbg !168 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.77b9b98c21cda092"(ptr sret(<{ { i32, i32 }, i1 }>) %return) #0 !dbg !126 { -// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ { i32, i32 }, i1 }>, ptr %return, i32 0, i32 1, !dbg !133 -// CHECK:STDOUT: store i8 0, ptr %has_value, align 1, !dbg !133 -// CHECK:STDOUT: ret void, !dbg !134 +// CHECK:STDOUT: define linkonce_odr void @"_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.2e30d2d7a87a6cd3"(ptr sret(<{ { i32, i32 }, i1 }>) %return) #0 !dbg !170 { +// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ { i32, i32 }, i1 }>, ptr %return, i32 0, i32 1, !dbg !177 +// CHECK:STDOUT: store i8 0, ptr %has_value, align 1, !dbg !177 +// CHECK:STDOUT: ret void, !dbg !178 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_COp.4e4edddc7580c79b:Copy.Core.8608f3c6f62d80cb"(ptr sret({ i32, i32 }) %return, ptr %self) #0 !dbg !136 { -// CHECK:STDOUT: %tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 0, !dbg !141 -// CHECK:STDOUT: %tuple.elem.load = load i32, ptr %tuple.elem, align 4, !dbg !141 -// CHECK:STDOUT: %tuple.elem1 = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 0, !dbg !142 -// CHECK:STDOUT: %tuple.elem2 = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 1, !dbg !143 -// CHECK:STDOUT: %tuple.elem.load3 = load i32, ptr %tuple.elem2, align 4, !dbg !143 -// CHECK:STDOUT: %tuple.elem4 = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 1, !dbg !142 -// CHECK:STDOUT: store i32 %tuple.elem.load, ptr %tuple.elem1, align 4, !dbg !142 -// CHECK:STDOUT: store i32 %tuple.elem.load3, ptr %tuple.elem4, align 4, !dbg !142 -// CHECK:STDOUT: ret void, !dbg !144 +// CHECK:STDOUT: define linkonce_odr void @"_COp.4e4edddc7580c79b:Copy.Core.8608f3c6f62d80cb"(ptr sret({ i32, i32 }) %return, ptr %self) #0 !dbg !180 { +// CHECK:STDOUT: %tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 0, !dbg !185 +// CHECK:STDOUT: %tuple.elem.load = load i32, ptr %tuple.elem, align 4, !dbg !185 +// CHECK:STDOUT: %tuple.elem1 = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 0, !dbg !186 +// CHECK:STDOUT: %tuple.elem2 = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 1, !dbg !187 +// CHECK:STDOUT: %tuple.elem.load3 = load i32, ptr %tuple.elem2, align 4, !dbg !187 +// CHECK:STDOUT: %tuple.elem4 = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 1, !dbg !186 +// CHECK:STDOUT: store i32 %tuple.elem.load, ptr %tuple.elem1, align 4, !dbg !186 +// CHECK:STDOUT: store i32 %tuple.elem.load3, ptr %tuple.elem4, align 4, !dbg !186 +// CHECK:STDOUT: ret void, !dbg !188 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives -// CHECK:STDOUT: uselistorder ptr @"_COp.f58524831c37807e:core.Destroy.Core", { 1, 0 } -// CHECK:STDOUT: uselistorder ptr @"_COp.e6ede56fadd95c85:core.Destroy.Core", { 1, 0 } +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core", { 1, 0 } +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.e1dbefa6145042b5:core.Destroy.Core", { 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 4, 3, 2, 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -218,100 +293,144 @@ fn For() { // CHECK:STDOUT: !5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !4, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) // CHECK:STDOUT: !6 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) // CHECK:STDOUT: !7 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !10 = !{null} -// CHECK:STDOUT: !11 = !DISubroutineType(types: !10) -// CHECK:STDOUT: !12 = !{null, !6} +// CHECK:STDOUT: !8 = !{null, !7} +// CHECK:STDOUT: !9 = !DISubroutineType(types: !8) +// CHECK:STDOUT: !12 = !{null} // CHECK:STDOUT: !13 = !DISubroutineType(types: !12) -// CHECK:STDOUT: !14 = !{null, !7} +// CHECK:STDOUT: !14 = !{null, !6} // CHECK:STDOUT: !15 = !DISubroutineType(types: !14) -// CHECK:STDOUT: !16 = distinct !DISubprogram(name: "For", linkageName: "_CFor.Main", scope: null, file: !4, line: 26, type: !11, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !17 = !DILocation(line: 27, column: 3, scope: !16) -// CHECK:STDOUT: !19 = !DILocation(line: 29, column: 17, scope: !16) -// CHECK:STDOUT: !22 = !DILocation(line: 29, column: 7, scope: !16) -// CHECK:STDOUT: !23 = !{!7, !7, !7} -// CHECK:STDOUT: !24 = !DISubroutineType(types: !23) -// CHECK:STDOUT: !25 = !{!7, !7} -// CHECK:STDOUT: !26 = !DISubroutineType(types: !25) -// CHECK:STDOUT: !32 = !DILocation(line: 30, column: 5, scope: !16) -// CHECK:STDOUT: !33 = !DILocation(line: 29, column: 3, scope: !16) -// CHECK:STDOUT: !34 = !DILocation(line: 26, column: 1, scope: !16) -// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 27, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !38) -// CHECK:STDOUT: !36 = !DILocalVariable(arg: 1, scope: !35, type: !6) -// CHECK:STDOUT: !37 = !DILocation(line: 27, column: 10, scope: !35) -// CHECK:STDOUT: !38 = !{!36} -// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "Op", linkageName: "_COp.e554695bf635d9c1:core.Destroy.Core", scope: null, file: !4, line: 27, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !42) -// CHECK:STDOUT: !40 = !DILocalVariable(arg: 1, scope: !39, type: !7) +// CHECK:STDOUT: !16 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !4, line: 14, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !19) +// CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !16, type: !7) +// CHECK:STDOUT: !18 = !DILocation(line: 14, column: 44, scope: !16) +// CHECK:STDOUT: !19 = !{!17} +// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "For", linkageName: "_CFor.Main", scope: null, file: !4, line: 26, type: !13, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !21 = !DILocation(line: 27, column: 3, scope: !20) +// CHECK:STDOUT: !23 = !DILocation(line: 29, column: 17, scope: !20) +// CHECK:STDOUT: !26 = !DILocation(line: 29, column: 7, scope: !20) +// CHECK:STDOUT: !27 = !{!7, !7, !7} +// CHECK:STDOUT: !28 = !DISubroutineType(types: !27) +// CHECK:STDOUT: !29 = !{!7, !7} +// CHECK:STDOUT: !30 = !DISubroutineType(types: !29) +// CHECK:STDOUT: !36 = !DILocation(line: 30, column: 5, scope: !20) +// CHECK:STDOUT: !37 = !DILocation(line: 29, column: 3, scope: !20) +// CHECK:STDOUT: !38 = !DILocation(line: 26, column: 1, scope: !20) +// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !4, line: 27, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !42) +// CHECK:STDOUT: !40 = !DILocalVariable(arg: 1, scope: !39, type: !6) // CHECK:STDOUT: !41 = !DILocation(line: 27, column: 10, scope: !39) // CHECK:STDOUT: !42 = !{!40} -// CHECK:STDOUT: !43 = distinct !DISubprogram(name: "Op", linkageName: "_COp.6b9c90d9dd82cebb:core.Destroy.Core", scope: null, file: !4, line: 29, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !46) -// CHECK:STDOUT: !44 = !DILocalVariable(arg: 1, scope: !43, type: !7) -// CHECK:STDOUT: !45 = !DILocation(line: 29, column: 7, scope: !43) +// CHECK:STDOUT: !43 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 27, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !46) +// CHECK:STDOUT: !44 = !DILocalVariable(arg: 1, scope: !43, type: !6) +// CHECK:STDOUT: !45 = !DILocation(line: 27, column: 10, scope: !43) // CHECK:STDOUT: !46 = !{!44} -// CHECK:STDOUT: !47 = distinct !DISubprogram(name: "Op", linkageName: "_COp.29c785c8e8489e66:core.Destroy.Core", scope: null, file: !4, line: 29, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !50) -// CHECK:STDOUT: !48 = !DILocalVariable(arg: 1, scope: !47, type: !7) -// CHECK:STDOUT: !49 = !DILocation(line: 29, column: 7, scope: !47) +// CHECK:STDOUT: !47 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 27, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !50) +// CHECK:STDOUT: !48 = !DILocalVariable(arg: 1, scope: !47, type: !6) +// CHECK:STDOUT: !49 = !DILocation(line: 27, column: 10, scope: !47) // CHECK:STDOUT: !50 = !{!48} -// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "Op", linkageName: "_COp.db896a6e77a760db:core.Destroy.Core", scope: null, file: !4, line: 29, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !54) +// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.e554695bf635d9c1:core.Destroy.Core", scope: null, file: !4, line: 27, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !54) // CHECK:STDOUT: !52 = !DILocalVariable(arg: 1, scope: !51, type: !7) -// CHECK:STDOUT: !53 = !DILocation(line: 29, column: 7, scope: !51) +// CHECK:STDOUT: !53 = !DILocation(line: 27, column: 10, scope: !51) // CHECK:STDOUT: !54 = !{!52} -// CHECK:STDOUT: !55 = distinct !DISubprogram(name: "Op", linkageName: "_COp.a968564cf435c13f:core.Destroy.Core", scope: null, file: !4, line: 29, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !58) +// CHECK:STDOUT: !55 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.e554695bf635d9c1:core.Destroy.Core", scope: null, file: !4, line: 27, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !58) // CHECK:STDOUT: !56 = !DILocalVariable(arg: 1, scope: !55, type: !7) -// CHECK:STDOUT: !57 = !DILocation(line: 29, column: 7, scope: !55) +// CHECK:STDOUT: !57 = !DILocation(line: 27, column: 10, scope: !55) // CHECK:STDOUT: !58 = !{!56} -// CHECK:STDOUT: !59 = distinct !DISubprogram(name: "Op", linkageName: "_COp.e6ede56fadd95c85:core.Destroy.Core", scope: null, file: !4, line: 29, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !62) +// CHECK:STDOUT: !59 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.6b9c90d9dd82cebb:core.Destroy.Core", scope: null, file: !4, line: 29, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !62) // CHECK:STDOUT: !60 = !DILocalVariable(arg: 1, scope: !59, type: !7) // CHECK:STDOUT: !61 = !DILocation(line: 29, column: 7, scope: !59) // CHECK:STDOUT: !62 = !{!60} -// CHECK:STDOUT: !63 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5c0f85cf677fdc52:core.Destroy.Core", scope: null, file: !4, line: 27, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !66) +// CHECK:STDOUT: !63 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6b9c90d9dd82cebb:core.Destroy.Core", scope: null, file: !4, line: 29, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !66) // CHECK:STDOUT: !64 = !DILocalVariable(arg: 1, scope: !63, type: !7) -// CHECK:STDOUT: !65 = !DILocation(line: 27, column: 3, scope: !63) +// CHECK:STDOUT: !65 = !DILocation(line: 29, column: 7, scope: !63) // CHECK:STDOUT: !66 = !{!64} -// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "NewCursor", linkageName: "_CNewCursor.EmptyRange.a081b942542726db.Main:Iterate.Core.77b9b98c21cda092", scope: null, file: !4, line: 15, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !73) +// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.a69fcb7116d040b0:core.Destroy.Core", scope: null, file: !4, line: 29, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !70) // CHECK:STDOUT: !68 = !DILocalVariable(arg: 1, scope: !67, type: !7) -// CHECK:STDOUT: !72 = !DILocation(line: 16, column: 7, scope: !67) -// CHECK:STDOUT: !73 = !{!68} -// CHECK:STDOUT: !74 = distinct !DISubprogram(name: "Next", linkageName: "_CNext.EmptyRange.a081b942542726db.Main:Iterate.Core.77b9b98c21cda092", scope: null, file: !4, line: 18, type: !24, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !85) -// CHECK:STDOUT: !75 = !DILocalVariable(arg: 1, scope: !74, type: !7) -// CHECK:STDOUT: !76 = !DILocalVariable(arg: 2, scope: !74, type: !7) -// CHECK:STDOUT: !81 = !DILocation(line: 19, column: 14, scope: !74) -// CHECK:STDOUT: !82 = !{!7} -// CHECK:STDOUT: !83 = !DISubroutineType(types: !82) -// CHECK:STDOUT: !84 = !DILocation(line: 19, column: 7, scope: !74) -// CHECK:STDOUT: !85 = !{!75, !76} -// CHECK:STDOUT: !86 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") -// CHECK:STDOUT: !87 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.6dc9cf042919088c", scope: null, file: !86, line: 36, type: !26, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !95) +// CHECK:STDOUT: !69 = !DILocation(line: 29, column: 7, scope: !67) +// CHECK:STDOUT: !70 = !{!68} +// CHECK:STDOUT: !71 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.a69fcb7116d040b0:core.Destroy.Core", scope: null, file: !4, line: 29, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !74) +// CHECK:STDOUT: !72 = !DILocalVariable(arg: 1, scope: !71, type: !7) +// CHECK:STDOUT: !73 = !DILocation(line: 29, column: 7, scope: !71) +// CHECK:STDOUT: !74 = !{!72} +// CHECK:STDOUT: !75 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.48e0adf639fe7af4:core.Destroy.Core", scope: null, file: !4, line: 29, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !78) +// CHECK:STDOUT: !76 = !DILocalVariable(arg: 1, scope: !75, type: !7) +// CHECK:STDOUT: !77 = !DILocation(line: 29, column: 7, scope: !75) +// CHECK:STDOUT: !78 = !{!76} +// CHECK:STDOUT: !79 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.47c342be31d1679f:core.Destroy.Core", scope: null, file: !4, line: 29, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !82) +// CHECK:STDOUT: !80 = !DILocalVariable(arg: 1, scope: !79, type: !7) +// CHECK:STDOUT: !81 = !DILocation(line: 29, column: 7, scope: !79) +// CHECK:STDOUT: !82 = !{!80} +// CHECK:STDOUT: !83 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.47c342be31d1679f:core.Destroy.Core", scope: null, file: !4, line: 29, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !86) +// CHECK:STDOUT: !84 = !DILocalVariable(arg: 1, scope: !83, type: !7) +// CHECK:STDOUT: !85 = !DILocation(line: 29, column: 7, scope: !83) +// CHECK:STDOUT: !86 = !{!84} +// CHECK:STDOUT: !87 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.b61f4dca88958e98:core.Destroy.Core", scope: null, file: !4, line: 29, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !90) // CHECK:STDOUT: !88 = !DILocalVariable(arg: 1, scope: !87, type: !7) -// CHECK:STDOUT: !93 = !DILocation(line: 37, column: 12, scope: !87) -// CHECK:STDOUT: !94 = !DILocation(line: 37, column: 5, scope: !87) -// CHECK:STDOUT: !95 = !{!88} -// CHECK:STDOUT: !96 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.6dc9cf042919088c", scope: null, file: !86, line: 39, type: !26, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !104) -// CHECK:STDOUT: !97 = !DILocalVariable(arg: 1, scope: !96, type: !7) -// CHECK:STDOUT: !102 = !DILocation(line: 40, column: 12, scope: !96) -// CHECK:STDOUT: !103 = !DILocation(line: 40, column: 5, scope: !96) -// CHECK:STDOUT: !104 = !{!97} -// CHECK:STDOUT: !105 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.6dc9cf042919088c", scope: null, file: !86, line: 30, type: !83, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !108 = !DILocation(line: 31, column: 12, scope: !105) -// CHECK:STDOUT: !109 = !DILocation(line: 31, column: 5, scope: !105) -// CHECK:STDOUT: !110 = distinct !DISubprogram(name: "Has", linkageName: "_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.77b9b98c21cda092", scope: null, file: !86, line: 141, type: !26, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !117) -// CHECK:STDOUT: !111 = !DILocalVariable(arg: 1, scope: !110, type: !7) -// CHECK:STDOUT: !115 = !DILocation(line: 142, column: 12, scope: !110) -// CHECK:STDOUT: !116 = !DILocation(line: 142, column: 5, scope: !110) -// CHECK:STDOUT: !117 = !{!111} -// CHECK:STDOUT: !118 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.77b9b98c21cda092", scope: null, file: !86, line: 144, type: !26, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !125) +// CHECK:STDOUT: !89 = !DILocation(line: 29, column: 7, scope: !87) +// CHECK:STDOUT: !90 = !{!88} +// CHECK:STDOUT: !91 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.b61f4dca88958e98:core.Destroy.Core", scope: null, file: !4, line: 29, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !94) +// CHECK:STDOUT: !92 = !DILocalVariable(arg: 1, scope: !91, type: !7) +// CHECK:STDOUT: !93 = !DILocation(line: 29, column: 7, scope: !91) +// CHECK:STDOUT: !94 = !{!92} +// CHECK:STDOUT: !95 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.e1dbefa6145042b5:core.Destroy.Core", scope: null, file: !4, line: 29, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !98) +// CHECK:STDOUT: !96 = !DILocalVariable(arg: 1, scope: !95, type: !7) +// CHECK:STDOUT: !97 = !DILocation(line: 29, column: 7, scope: !95) +// CHECK:STDOUT: !98 = !{!96} +// CHECK:STDOUT: !99 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.e1dbefa6145042b5:core.Destroy.Core", scope: null, file: !4, line: 29, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !102) +// CHECK:STDOUT: !100 = !DILocalVariable(arg: 1, scope: !99, type: !7) +// CHECK:STDOUT: !101 = !DILocation(line: 29, column: 7, scope: !99) +// CHECK:STDOUT: !102 = !{!100} +// CHECK:STDOUT: !103 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.454683f3b8639b20:core.Destroy.Core", scope: null, file: !4, line: 27, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !106) +// CHECK:STDOUT: !104 = !DILocalVariable(arg: 1, scope: !103, type: !7) +// CHECK:STDOUT: !105 = !DILocation(line: 27, column: 3, scope: !103) +// CHECK:STDOUT: !106 = !{!104} +// CHECK:STDOUT: !107 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.454683f3b8639b20:core.Destroy.Core", scope: null, file: !4, line: 27, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !110) +// CHECK:STDOUT: !108 = !DILocalVariable(arg: 1, scope: !107, type: !7) +// CHECK:STDOUT: !109 = !DILocation(line: 27, column: 3, scope: !107) +// CHECK:STDOUT: !110 = !{!108} +// CHECK:STDOUT: !111 = distinct !DISubprogram(name: "NewCursor", linkageName: "_CNewCursor.EmptyRange.a081b942542726db.Main:Iterate.Core.2e30d2d7a87a6cd3", scope: null, file: !4, line: 15, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !117) +// CHECK:STDOUT: !112 = !DILocalVariable(arg: 1, scope: !111, type: !7) +// CHECK:STDOUT: !116 = !DILocation(line: 16, column: 7, scope: !111) +// CHECK:STDOUT: !117 = !{!112} +// CHECK:STDOUT: !118 = distinct !DISubprogram(name: "Next", linkageName: "_CNext.EmptyRange.a081b942542726db.Main:Iterate.Core.2e30d2d7a87a6cd3", scope: null, file: !4, line: 18, type: !28, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !129) // CHECK:STDOUT: !119 = !DILocalVariable(arg: 1, scope: !118, type: !7) -// CHECK:STDOUT: !123 = !DILocation(line: 145, column: 12, scope: !118) -// CHECK:STDOUT: !124 = !DILocation(line: 145, column: 5, scope: !118) -// CHECK:STDOUT: !125 = !{!119} -// CHECK:STDOUT: !126 = distinct !DISubprogram(name: "None", linkageName: "_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.77b9b98c21cda092", scope: null, file: !86, line: 125, type: !83, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !133 = !DILocation(line: 128, column: 5, scope: !126) -// CHECK:STDOUT: !134 = !DILocation(line: 129, column: 5, scope: !126) -// CHECK:STDOUT: !135 = !DIFile(filename: "{{.*}}/prelude/copy.carbon", directory: "") -// CHECK:STDOUT: !136 = distinct !DISubprogram(name: "Op", linkageName: "_COp.4e4edddc7580c79b:Copy.Core.8608f3c6f62d80cb", scope: null, file: !135, line: 62, type: !26, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !145) -// CHECK:STDOUT: !137 = !DILocalVariable(arg: 1, scope: !136, type: !7) -// CHECK:STDOUT: !141 = !DILocation(line: 63, column: 13, scope: !136) -// CHECK:STDOUT: !142 = !DILocation(line: 63, column: 12, scope: !136) -// CHECK:STDOUT: !143 = !DILocation(line: 63, column: 26, scope: !136) -// CHECK:STDOUT: !144 = !DILocation(line: 63, column: 5, scope: !136) -// CHECK:STDOUT: !145 = !{!137} +// CHECK:STDOUT: !120 = !DILocalVariable(arg: 2, scope: !118, type: !7) +// CHECK:STDOUT: !125 = !DILocation(line: 19, column: 14, scope: !118) +// CHECK:STDOUT: !126 = !{!7} +// CHECK:STDOUT: !127 = !DISubroutineType(types: !126) +// CHECK:STDOUT: !128 = !DILocation(line: 19, column: 7, scope: !118) +// CHECK:STDOUT: !129 = !{!119, !120} +// CHECK:STDOUT: !130 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") +// CHECK:STDOUT: !131 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.b20cf0d1c9daa8c2", scope: null, file: !130, line: 36, type: !30, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !139) +// CHECK:STDOUT: !132 = !DILocalVariable(arg: 1, scope: !131, type: !7) +// CHECK:STDOUT: !137 = !DILocation(line: 37, column: 12, scope: !131) +// CHECK:STDOUT: !138 = !DILocation(line: 37, column: 5, scope: !131) +// CHECK:STDOUT: !139 = !{!132} +// CHECK:STDOUT: !140 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.b20cf0d1c9daa8c2", scope: null, file: !130, line: 39, type: !30, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !148) +// CHECK:STDOUT: !141 = !DILocalVariable(arg: 1, scope: !140, type: !7) +// CHECK:STDOUT: !146 = !DILocation(line: 40, column: 12, scope: !140) +// CHECK:STDOUT: !147 = !DILocation(line: 40, column: 5, scope: !140) +// CHECK:STDOUT: !148 = !{!141} +// CHECK:STDOUT: !149 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.b20cf0d1c9daa8c2", scope: null, file: !130, line: 30, type: !127, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !152 = !DILocation(line: 31, column: 12, scope: !149) +// CHECK:STDOUT: !153 = !DILocation(line: 31, column: 5, scope: !149) +// CHECK:STDOUT: !154 = distinct !DISubprogram(name: "Has", linkageName: "_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.2e30d2d7a87a6cd3", scope: null, file: !130, line: 141, type: !30, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !161) +// CHECK:STDOUT: !155 = !DILocalVariable(arg: 1, scope: !154, type: !7) +// CHECK:STDOUT: !159 = !DILocation(line: 142, column: 12, scope: !154) +// CHECK:STDOUT: !160 = !DILocation(line: 142, column: 5, scope: !154) +// CHECK:STDOUT: !161 = !{!155} +// CHECK:STDOUT: !162 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.2e30d2d7a87a6cd3", scope: null, file: !130, line: 144, type: !30, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !169) +// CHECK:STDOUT: !163 = !DILocalVariable(arg: 1, scope: !162, type: !7) +// CHECK:STDOUT: !167 = !DILocation(line: 145, column: 12, scope: !162) +// CHECK:STDOUT: !168 = !DILocation(line: 145, column: 5, scope: !162) +// CHECK:STDOUT: !169 = !{!163} +// CHECK:STDOUT: !170 = distinct !DISubprogram(name: "None", linkageName: "_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.2e30d2d7a87a6cd3", scope: null, file: !130, line: 125, type: !127, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !177 = !DILocation(line: 128, column: 5, scope: !170) +// CHECK:STDOUT: !178 = !DILocation(line: 129, column: 5, scope: !170) +// CHECK:STDOUT: !179 = !DIFile(filename: "{{.*}}/prelude/copy.carbon", directory: "") +// CHECK:STDOUT: !180 = distinct !DISubprogram(name: "Op", linkageName: "_COp.4e4edddc7580c79b:Copy.Core.8608f3c6f62d80cb", scope: null, file: !179, line: 62, type: !30, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !189) +// CHECK:STDOUT: !181 = !DILocalVariable(arg: 1, scope: !180, type: !7) +// CHECK:STDOUT: !185 = !DILocation(line: 63, column: 13, scope: !180) +// CHECK:STDOUT: !186 = !DILocation(line: 63, column: 12, scope: !180) +// CHECK:STDOUT: !187 = !DILocation(line: 63, column: 26, scope: !180) +// CHECK:STDOUT: !188 = !DILocation(line: 63, column: 5, scope: !180) +// CHECK:STDOUT: !189 = !{!181} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/for/break_continue.carbon b/toolchain/lower/testdata/for/break_continue.carbon index e1c934e40649..8dd7fb58da76 100644 --- a/toolchain/lower/testdata/for/break_continue.carbon +++ b/toolchain/lower/testdata/for/break_continue.carbon @@ -48,11 +48,11 @@ fn For() { // CHECK:STDOUT: for.next: ; preds = %if.else.loc20, %if.then.loc20, %entry // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_33.1.temp), !dbg !21 // CHECK:STDOUT: call void @"_CNext.IntRange.9452f4c51951679b.Core:Iterate.Core.be1e879c1ad406d8"(ptr %.loc18_33.1.temp, ptr %.loc18_32.1.temp, ptr %var), !dbg !21 -// CHECK:STDOUT: %Optional.HasValue.call = call i1 @_CHasValue.Optional.Core.63bc0bf740b17859(ptr %.loc18_33.1.temp), !dbg !21 +// CHECK:STDOUT: %Optional.HasValue.call = call i1 @_CHasValue.Optional.Core.fc4496a6c25d418b(ptr %.loc18_33.1.temp), !dbg !21 // CHECK:STDOUT: br i1 %Optional.HasValue.call, label %for.body, label %for.done, !dbg !21 // CHECK:STDOUT: // CHECK:STDOUT: for.body: ; preds = %for.next -// CHECK:STDOUT: %Optional.Get.call = call i32 @_CGet.Optional.Core.63bc0bf740b17859(ptr %.loc18_33.1.temp), !dbg !21 +// CHECK:STDOUT: %Optional.Get.call = call i32 @_CGet.Optional.Core.fc4496a6c25d418b(ptr %.loc18_33.1.temp), !dbg !21 // CHECK:STDOUT: %F.call = call i1 @_CF.Main(), !dbg !28 // CHECK:STDOUT: br i1 %F.call, label %if.then.loc19, label %if.else.loc19, !dbg !29 // CHECK:STDOUT: @@ -64,187 +64,250 @@ fn For() { // CHECK:STDOUT: br i1 %G.call, label %if.then.loc20, label %if.else.loc20, !dbg !32 // CHECK:STDOUT: // CHECK:STDOUT: if.then.loc20: ; preds = %if.else.loc19 -// CHECK:STDOUT: call void @"_COp.1423d794a4867d77:core.Destroy.Core"(ptr %.loc18_33.1.temp), !dbg !21 +// CHECK:STDOUT: call void @"_CSelfDestruct.a8a4e50b707d8bfe:core.Destroy.Core"(ptr %.loc18_33.1.temp), !dbg !21 // CHECK:STDOUT: br label %for.next, !dbg !33 // CHECK:STDOUT: // CHECK:STDOUT: if.else.loc20: ; preds = %if.else.loc19 // CHECK:STDOUT: call void @_CH.Main(), !dbg !34 -// CHECK:STDOUT: call void @"_COp.1423d794a4867d77:core.Destroy.Core"(ptr %.loc18_33.1.temp), !dbg !21 +// CHECK:STDOUT: call void @"_CSelfDestruct.a8a4e50b707d8bfe:core.Destroy.Core"(ptr %.loc18_33.1.temp), !dbg !21 // CHECK:STDOUT: br label %for.next, !dbg !35 // CHECK:STDOUT: // CHECK:STDOUT: for.done: ; preds = %if.then.loc19, %for.next -// CHECK:STDOUT: call void @"_COp.1423d794a4867d77:core.Destroy.Core"(ptr %.loc18_33.1.temp), !dbg !21 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %var), !dbg !21 -// CHECK:STDOUT: call void @"_COp.c9184c281ed4335d:core.Destroy.Core"(ptr %.loc18_32.1.temp), !dbg !20 +// CHECK:STDOUT: call void @"_CSelfDestruct.a8a4e50b707d8bfe:core.Destroy.Core"(ptr %.loc18_33.1.temp), !dbg !21 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %var), !dbg !21 +// CHECK:STDOUT: call void @"_CSelfDestruct.c9184c281ed4335d:core.Destroy.Core"(ptr %.loc18_32.1.temp), !dbg !20 // CHECK:STDOUT: ret void, !dbg !36 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_CRange.Core(ptr sret({ i32, i32 }), i32) // CHECK:STDOUT: -// CHECK:STDOUT: declare void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr) +// CHECK:STDOUT: declare void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr) +// CHECK:STDOUT: +// CHECK:STDOUT: declare void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.1d6a7672bf2f14c6:core.Destroy.Core"(ptr %self) #0 !dbg !37 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !38 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !39 +// CHECK:STDOUT: ret void, !dbg !40 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.c1dffdf44e31057b:core.Destroy.Core"(ptr %self) #0 !dbg !41 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.1d6a7672bf2f14c6:core.Destroy.Core"(ptr %self) #0 !dbg !42 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !43 +// CHECK:STDOUT: ret void, !dbg !44 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.271d79a4f33942b3:core.Destroy.Core"(ptr %self) #0 !dbg !45 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.1d6a7672bf2f14c6:core.Destroy.Core"(ptr %self) #0 !dbg !46 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !47 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.1d6a7672bf2f14c6:core.Destroy.Core"(ptr %self), !dbg !48 +// CHECK:STDOUT: ret void, !dbg !48 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.aef98596d3a9e1eb:core.Destroy.Core"(ptr %self) #0 !dbg !49 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.51569357b34b54dc:core.Destroy.Core"(ptr %self) #0 !dbg !50 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !51 +// CHECK:STDOUT: ret void, !dbg !52 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.1423d794a4867d77:core.Destroy.Core"(ptr %self) #0 !dbg !53 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.51569357b34b54dc:core.Destroy.Core"(ptr %self) #0 !dbg !54 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !55 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.51569357b34b54dc:core.Destroy.Core"(ptr %self), !dbg !56 +// CHECK:STDOUT: ret void, !dbg !56 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.e933d5ff8212e171:core.Destroy.Core"(ptr %self) #0 !dbg !57 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.48e0adf639fe7af4:core.Destroy.Core"(ptr %self) #0 !dbg !58 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !59 +// CHECK:STDOUT: ret void, !dbg !60 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.c9184c281ed4335d:core.Destroy.Core"(ptr %self) #0 !dbg !61 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f6a63055ea5a1824:core.Destroy.Core"(ptr %self) #0 !dbg !62 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !63 +// CHECK:STDOUT: ret void, !dbg !64 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f6a63055ea5a1824:core.Destroy.Core"(ptr %self) #0 !dbg !66 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f6a63055ea5a1824:core.Destroy.Core"(ptr %self), !dbg !68 +// CHECK:STDOUT: ret void, !dbg !68 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.b7a533f3082ff11b:core.Destroy.Core"(ptr %self) #0 !dbg !70 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !72 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.b7a533f3082ff11b:core.Destroy.Core"(ptr %self) #0 !dbg !74 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.b7a533f3082ff11b:core.Destroy.Core"(ptr %self), !dbg !76 +// CHECK:STDOUT: ret void, !dbg !76 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.a8a4e50b707d8bfe:core.Destroy.Core"(ptr %self) #0 !dbg !78 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !80 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.a8a4e50b707d8bfe:core.Destroy.Core"(ptr %self) #0 !dbg !82 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.a8a4e50b707d8bfe:core.Destroy.Core"(ptr %self), !dbg !84 +// CHECK:STDOUT: ret void, !dbg !84 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.e933d5ff8212e171:core.Destroy.Core"(ptr %self) #0 !dbg !86 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !88 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.e933d5ff8212e171:core.Destroy.Core"(ptr %self) #0 !dbg !90 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.e933d5ff8212e171:core.Destroy.Core"(ptr %self), !dbg !92 +// CHECK:STDOUT: ret void, !dbg !92 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.c9184c281ed4335d:core.Destroy.Core"(ptr %self) #0 !dbg !94 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !96 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.c9184c281ed4335d:core.Destroy.Core"(ptr %self) #0 !dbg !98 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.c9184c281ed4335d:core.Destroy.Core"(ptr %self), !dbg !100 +// CHECK:STDOUT: ret void, !dbg !100 // 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 i32 @"_CNewCursor.IntRange.9452f4c51951679b.Core:Iterate.Core.be1e879c1ad406d8"(ptr %self) #0 !dbg !68 { -// CHECK:STDOUT: %start = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 0, !dbg !73 -// CHECK:STDOUT: %1 = load i32, ptr %start, align 4, !dbg !73 -// CHECK:STDOUT: ret i32 %1, !dbg !74 +// CHECK:STDOUT: define linkonce_odr i32 @"_CNewCursor.IntRange.9452f4c51951679b.Core:Iterate.Core.be1e879c1ad406d8"(ptr %self) #0 !dbg !104 { +// CHECK:STDOUT: %start = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 0, !dbg !109 +// CHECK:STDOUT: %1 = load i32, ptr %start, align 4, !dbg !109 +// CHECK:STDOUT: ret i32 %1, !dbg !110 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CNext.IntRange.9452f4c51951679b.Core:Iterate.Core.be1e879c1ad406d8"(ptr sret(<{ i32, i1 }>) %return, ptr %self, ptr %cursor) #0 !dbg !76 { -// CHECK:STDOUT: %1 = alloca i32, align 4, !dbg !83 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !83 -// CHECK:STDOUT: %2 = load i32, ptr %cursor, align 4, !dbg !85 -// CHECK:STDOUT: store i32 %2, ptr %1, align 4, !dbg !83 -// CHECK:STDOUT: %end = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 1, !dbg !88 -// CHECK:STDOUT: %3 = load i32, ptr %end, align 4, !dbg !88 -// CHECK:STDOUT: %4 = load i32, ptr %1, align 4, !dbg !87 -// CHECK:STDOUT: %5 = icmp slt i32 %4, %3, !dbg !87 -// CHECK:STDOUT: br i1 %5, label %6, label %8, !dbg !89 +// CHECK:STDOUT: define linkonce_odr void @"_CNext.IntRange.9452f4c51951679b.Core:Iterate.Core.be1e879c1ad406d8"(ptr sret(<{ i32, i1 }>) %return, ptr %self, ptr %cursor) #0 !dbg !112 { +// CHECK:STDOUT: %1 = alloca i32, align 4, !dbg !119 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !119 +// CHECK:STDOUT: %2 = load i32, ptr %cursor, align 4, !dbg !121 +// CHECK:STDOUT: store i32 %2, ptr %1, align 4, !dbg !119 +// CHECK:STDOUT: %end = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 1, !dbg !124 +// CHECK:STDOUT: %3 = load i32, ptr %end, align 4, !dbg !124 +// CHECK:STDOUT: %4 = load i32, ptr %1, align 4, !dbg !123 +// CHECK:STDOUT: %5 = icmp slt i32 %4, %3, !dbg !123 +// CHECK:STDOUT: br i1 %5, label %6, label %8, !dbg !125 // CHECK:STDOUT: // CHECK:STDOUT: 6: ; preds = %0 -// CHECK:STDOUT: call void @"_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8"(ptr %cursor), !dbg !92 -// CHECK:STDOUT: %7 = load i32, ptr %1, align 4, !dbg !93 -// CHECK:STDOUT: call void @_CSome.Optional.Core.63bc0bf740b17859(ptr %return, i32 %7), !dbg !94 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %1), !dbg !83 -// CHECK:STDOUT: ret void, !dbg !95 +// CHECK:STDOUT: call void @"_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8"(ptr %cursor), !dbg !128 +// CHECK:STDOUT: %7 = load i32, ptr %1, align 4, !dbg !129 +// CHECK:STDOUT: call void @_CSome.Optional.Core.fc4496a6c25d418b(ptr %return, i32 %7), !dbg !130 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %1), !dbg !119 +// CHECK:STDOUT: ret void, !dbg !131 // CHECK:STDOUT: // CHECK:STDOUT: 8: ; preds = %0 -// CHECK:STDOUT: call void @_CNone.Optional.Core.63bc0bf740b17859(ptr %return), !dbg !96 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %1), !dbg !83 -// CHECK:STDOUT: ret void, !dbg !97 +// CHECK:STDOUT: call void @_CNone.Optional.Core.fc4496a6c25d418b(ptr %return), !dbg !132 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %1), !dbg !119 +// CHECK:STDOUT: ret void, !dbg !133 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.63bc0bf740b17859(ptr %self) #0 !dbg !100 { -// CHECK:STDOUT: %1 = call i1 @"_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.89a3e87df6fdafe1"(ptr %self), !dbg !106 -// CHECK:STDOUT: ret i1 %1, !dbg !107 +// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.fc4496a6c25d418b(ptr %self) #0 !dbg !136 { +// CHECK:STDOUT: %1 = call i1 @"_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %self), !dbg !142 +// CHECK:STDOUT: ret i1 %1, !dbg !143 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CGet.Optional.Core.63bc0bf740b17859(ptr %self) #0 !dbg !109 { -// CHECK:STDOUT: %1 = call i32 @"_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.89a3e87df6fdafe1"(ptr %self), !dbg !115 -// CHECK:STDOUT: ret i32 %1, !dbg !116 +// CHECK:STDOUT: define linkonce_odr i32 @_CGet.Optional.Core.fc4496a6c25d418b(ptr %self) #0 !dbg !145 { +// CHECK:STDOUT: %1 = call i32 @"_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %self), !dbg !151 +// CHECK:STDOUT: ret i32 %1, !dbg !152 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_CInclusiveRange.Core(ptr sret({ i32, i32 }), i32, i32) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8"(ptr %self) #0 !dbg !119 { -// CHECK:STDOUT: call void @"_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895"(ptr %self, i32 1), !dbg !122 -// CHECK:STDOUT: ret void, !dbg !125 +// CHECK:STDOUT: define linkonce_odr void @"_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8"(ptr %self) #0 !dbg !155 { +// CHECK:STDOUT: call void @"_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895"(ptr %self, i32 1), !dbg !158 +// CHECK:STDOUT: ret void, !dbg !161 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSome.Optional.Core.63bc0bf740b17859(ptr sret(<{ i32, i1 }>) %return, i32 %value) #0 !dbg !127 { -// CHECK:STDOUT: call void @"_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.89a3e87df6fdafe1"(ptr %return, i32 %value), !dbg !132 -// CHECK:STDOUT: ret void, !dbg !133 +// CHECK:STDOUT: define linkonce_odr void @_CSome.Optional.Core.fc4496a6c25d418b(ptr sret(<{ i32, i1 }>) %return, i32 %value) #0 !dbg !163 { +// CHECK:STDOUT: call void @"_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %return, i32 %value), !dbg !168 +// CHECK:STDOUT: ret void, !dbg !169 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CNone.Optional.Core.63bc0bf740b17859(ptr sret(<{ i32, i1 }>) %return) #0 !dbg !135 { -// CHECK:STDOUT: call void @"_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.89a3e87df6fdafe1"(ptr %return), !dbg !138 -// CHECK:STDOUT: ret void, !dbg !139 +// CHECK:STDOUT: define linkonce_odr void @_CNone.Optional.Core.fc4496a6c25d418b(ptr sret(<{ i32, i1 }>) %return) #0 !dbg !171 { +// CHECK:STDOUT: call void @"_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %return), !dbg !174 +// CHECK:STDOUT: ret void, !dbg !175 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @"_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.89a3e87df6fdafe1"(ptr %value) #0 !dbg !140 { -// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %value, i32 0, i32 1, !dbg !145 -// CHECK:STDOUT: %1 = load i8, ptr %has_value, align 1, !dbg !145 -// CHECK:STDOUT: %2 = trunc i8 %1 to i1, !dbg !145 -// CHECK:STDOUT: ret i1 %2, !dbg !146 +// CHECK:STDOUT: define linkonce_odr i1 @"_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %value) #0 !dbg !176 { +// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %value, i32 0, i32 1, !dbg !181 +// CHECK:STDOUT: %1 = load i8, ptr %has_value, align 1, !dbg !181 +// CHECK:STDOUT: %2 = trunc i8 %1 to i1, !dbg !181 +// CHECK:STDOUT: ret i1 %2, !dbg !182 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @"_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.89a3e87df6fdafe1"(ptr %value) #0 !dbg !148 { -// CHECK:STDOUT: %value1 = getelementptr inbounds nuw <{ i32, i1 }>, ptr %value, i32 0, i32 0, !dbg !153 -// CHECK:STDOUT: %1 = load i32, ptr %value1, align 4, !dbg !153 -// CHECK:STDOUT: ret i32 %1, !dbg !154 +// CHECK:STDOUT: define linkonce_odr i32 @"_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %value) #0 !dbg !184 { +// CHECK:STDOUT: %value1 = getelementptr inbounds nuw <{ i32, i1 }>, ptr %value, i32 0, i32 0, !dbg !189 +// CHECK:STDOUT: %1 = load i32, ptr %value1, align 4, !dbg !189 +// CHECK:STDOUT: ret i32 %1, !dbg !190 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define linkonce_odr void @"_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895"(ptr %self, i32 %other) #2 !dbg !156 { -// CHECK:STDOUT: %1 = call i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044"(i32 %other), !dbg !159 -// CHECK:STDOUT: %2 = load i32, ptr %self, align 4, !dbg !160 -// CHECK:STDOUT: %3 = add i32 %2, %1, !dbg !160 -// CHECK:STDOUT: store i32 %3, ptr %self, align 4, !dbg !160 -// CHECK:STDOUT: ret void, !dbg !160 +// CHECK:STDOUT: define linkonce_odr void @"_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895"(ptr %self, i32 %other) #2 !dbg !192 { +// CHECK:STDOUT: %1 = call i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044"(i32 %other), !dbg !195 +// CHECK:STDOUT: %2 = load i32, ptr %self, align 4, !dbg !196 +// CHECK:STDOUT: %3 = add i32 %2, %1, !dbg !196 +// CHECK:STDOUT: store i32 %3, ptr %self, align 4, !dbg !196 +// CHECK:STDOUT: ret void, !dbg !196 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.89a3e87df6fdafe1"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !164 { -// CHECK:STDOUT: %value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 0, !dbg !173 -// CHECK:STDOUT: store i32 %self, ptr %value, align 4, !dbg !173 -// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 1, !dbg !175 -// CHECK:STDOUT: store i8 1, ptr %has_value, align 1, !dbg !175 -// CHECK:STDOUT: ret void, !dbg !176 +// CHECK:STDOUT: define linkonce_odr void @"_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !200 { +// CHECK:STDOUT: %value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 0, !dbg !209 +// CHECK:STDOUT: store i32 %self, ptr %value, align 4, !dbg !209 +// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 1, !dbg !211 +// CHECK:STDOUT: store i8 1, ptr %has_value, align 1, !dbg !211 +// CHECK:STDOUT: ret void, !dbg !212 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.89a3e87df6fdafe1"(ptr sret(<{ i32, i1 }>) %return) #0 !dbg !178 { -// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 1, !dbg !185 -// CHECK:STDOUT: store i8 0, ptr %has_value, align 1, !dbg !185 -// CHECK:STDOUT: ret void, !dbg !186 +// CHECK:STDOUT: define linkonce_odr void @"_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr sret(<{ i32, i1 }>) %return) #0 !dbg !214 { +// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 1, !dbg !221 +// CHECK:STDOUT: store i8 0, ptr %has_value, align 1, !dbg !221 +// CHECK:STDOUT: ret void, !dbg !222 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044"(i32 %self) #0 !dbg !187 { -// CHECK:STDOUT: %1 = call i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self), !dbg !192 -// CHECK:STDOUT: ret i32 %1, !dbg !194 +// CHECK:STDOUT: define linkonce_odr i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044"(i32 %self) #0 !dbg !223 { +// CHECK:STDOUT: %1 = call i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self), !dbg !228 +// CHECK:STDOUT: ret i32 %1, !dbg !230 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self) #0 !dbg !196 { -// CHECK:STDOUT: ret i32 %self, !dbg !202 +// CHECK:STDOUT: define linkonce_odr i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self) #0 !dbg !232 { +// CHECK:STDOUT: ret i32 %self, !dbg !238 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives -// CHECK:STDOUT: uselistorder ptr @"_COp.1423d794a4867d77:core.Destroy.Core", { 2, 1, 0 } +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.a8a4e50b707d8bfe:core.Destroy.Core", { 2, 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 0, 3, 2, 1 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -288,116 +351,152 @@ fn For() { // CHECK:STDOUT: !34 = !DILocation(line: 21, column: 5, scope: !18) // CHECK:STDOUT: !35 = !DILocation(line: 18, column: 3, scope: !18) // CHECK:STDOUT: !36 = !DILocation(line: 17, column: 1, scope: !18) -// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "Op", linkageName: "_COp.1d6a7672bf2f14c6:core.Destroy.Core", scope: null, file: !4, line: 18, type: !17, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !40) -// CHECK:STDOUT: !38 = !DILocalVariable(arg: 1, scope: !37, type: !7) -// CHECK:STDOUT: !39 = !DILocation(line: 18, column: 7, scope: !37) -// CHECK:STDOUT: !40 = !{!38} -// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "Op", linkageName: "_COp.c1dffdf44e31057b:core.Destroy.Core", scope: null, file: !4, line: 18, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !44) -// CHECK:STDOUT: !42 = !DILocalVariable(arg: 1, scope: !41, type: !6) -// CHECK:STDOUT: !43 = !DILocation(line: 18, column: 7, scope: !41) -// CHECK:STDOUT: !44 = !{!42} -// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "Op", linkageName: "_COp.271d79a4f33942b3:core.Destroy.Core", scope: null, file: !4, line: 18, type: !17, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !48) -// CHECK:STDOUT: !46 = !DILocalVariable(arg: 1, scope: !45, type: !7) -// CHECK:STDOUT: !47 = !DILocation(line: 18, column: 7, scope: !45) -// CHECK:STDOUT: !48 = !{!46} -// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "Op", linkageName: "_COp.aef98596d3a9e1eb:core.Destroy.Core", scope: null, file: !4, line: 18, type: !17, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !52) -// CHECK:STDOUT: !50 = !DILocalVariable(arg: 1, scope: !49, type: !7) -// CHECK:STDOUT: !51 = !DILocation(line: 18, column: 7, scope: !49) -// CHECK:STDOUT: !52 = !{!50} -// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "Op", linkageName: "_COp.1423d794a4867d77:core.Destroy.Core", scope: null, file: !4, line: 18, type: !17, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !56) -// CHECK:STDOUT: !54 = !DILocalVariable(arg: 1, scope: !53, type: !7) -// CHECK:STDOUT: !55 = !DILocation(line: 18, column: 7, scope: !53) -// CHECK:STDOUT: !56 = !{!54} -// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "Op", linkageName: "_COp.e933d5ff8212e171:core.Destroy.Core", scope: null, file: !4, line: 18, type: !17, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !60) -// CHECK:STDOUT: !58 = !DILocalVariable(arg: 1, scope: !57, type: !7) -// CHECK:STDOUT: !59 = !DILocation(line: 18, column: 18, scope: !57) -// CHECK:STDOUT: !60 = !{!58} -// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "Op", linkageName: "_COp.c9184c281ed4335d:core.Destroy.Core", scope: null, file: !4, line: 18, type: !17, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !64) -// CHECK:STDOUT: !62 = !DILocalVariable(arg: 1, scope: !61, type: !7) -// CHECK:STDOUT: !63 = !DILocation(line: 18, column: 18, scope: !61) -// CHECK:STDOUT: !64 = !{!62} -// CHECK:STDOUT: !67 = !DIFile(filename: "{{.*}}/prelude/range.carbon", directory: "") -// CHECK:STDOUT: !68 = distinct !DISubprogram(name: "NewCursor", linkageName: "_CNewCursor.IntRange.9452f4c51951679b.Core:Iterate.Core.be1e879c1ad406d8", scope: null, file: !67, line: 19, type: !23, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !75) -// CHECK:STDOUT: !69 = !DILocalVariable(arg: 1, scope: !68, type: !7) -// CHECK:STDOUT: !73 = !DILocation(line: 19, column: 43, scope: !68) -// CHECK:STDOUT: !74 = !DILocation(line: 19, column: 36, scope: !68) -// CHECK:STDOUT: !75 = !{!69} -// CHECK:STDOUT: !76 = distinct !DISubprogram(name: "Next", linkageName: "_CNext.IntRange.9452f4c51951679b.Core:Iterate.Core.be1e879c1ad406d8", scope: null, file: !67, line: 20, type: !25, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !98) -// CHECK:STDOUT: !77 = !DILocalVariable(arg: 1, scope: !76, type: !7) -// CHECK:STDOUT: !78 = !DILocalVariable(arg: 2, scope: !76, type: !7) -// CHECK:STDOUT: !83 = !DILocation(line: 21, column: 7, scope: !76) -// CHECK:STDOUT: !85 = !DILocation(line: 21, column: 27, scope: !76) -// CHECK:STDOUT: !87 = !DILocation(line: 22, column: 11, scope: !76) -// CHECK:STDOUT: !88 = !DILocation(line: 22, column: 19, scope: !76) -// CHECK:STDOUT: !89 = !DILocation(line: 22, column: 10, scope: !76) -// CHECK:STDOUT: !92 = !DILocation(line: 23, column: 9, scope: !76) -// CHECK:STDOUT: !93 = !DILocation(line: 24, column: 38, scope: !76) -// CHECK:STDOUT: !94 = !DILocation(line: 24, column: 16, scope: !76) -// CHECK:STDOUT: !95 = !DILocation(line: 24, column: 9, scope: !76) -// CHECK:STDOUT: !96 = !DILocation(line: 26, column: 16, scope: !76) -// CHECK:STDOUT: !97 = !DILocation(line: 26, column: 9, scope: !76) -// CHECK:STDOUT: !98 = !{!77, !78} -// CHECK:STDOUT: !99 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") -// CHECK:STDOUT: !100 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.63bc0bf740b17859", scope: null, file: !99, line: 36, type: !27, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !108) -// CHECK:STDOUT: !101 = !DILocalVariable(arg: 1, scope: !100, type: !7) -// CHECK:STDOUT: !106 = !DILocation(line: 37, column: 12, scope: !100) -// CHECK:STDOUT: !107 = !DILocation(line: 37, column: 5, scope: !100) -// CHECK:STDOUT: !108 = !{!101} -// CHECK:STDOUT: !109 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.63bc0bf740b17859", scope: null, file: !99, line: 39, type: !23, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !117) -// CHECK:STDOUT: !110 = !DILocalVariable(arg: 1, scope: !109, type: !7) -// CHECK:STDOUT: !115 = !DILocation(line: 40, column: 12, scope: !109) -// CHECK:STDOUT: !116 = !DILocation(line: 40, column: 5, scope: !109) -// CHECK:STDOUT: !117 = !{!110} -// CHECK:STDOUT: !118 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "") -// CHECK:STDOUT: !119 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !118, line: 396, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !126) -// CHECK:STDOUT: !120 = !DILocalVariable(arg: 1, scope: !119, type: !6) -// CHECK:STDOUT: !122 = !DILocation(line: 398, column: 5, scope: !119) -// CHECK:STDOUT: !123 = !{null, !6, !6} -// CHECK:STDOUT: !124 = !DISubroutineType(types: !123) -// CHECK:STDOUT: !125 = !DILocation(line: 396, column: 3, scope: !119) -// CHECK:STDOUT: !126 = !{!120} -// CHECK:STDOUT: !127 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.63bc0bf740b17859", scope: null, file: !99, line: 33, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !134) -// CHECK:STDOUT: !128 = !DILocalVariable(arg: 1, scope: !127, type: !6) -// CHECK:STDOUT: !132 = !DILocation(line: 34, column: 12, scope: !127) -// CHECK:STDOUT: !133 = !DILocation(line: 34, column: 5, scope: !127) -// CHECK:STDOUT: !134 = !{!128} -// CHECK:STDOUT: !135 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.63bc0bf740b17859", scope: null, file: !99, line: 30, type: !9, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !138 = !DILocation(line: 31, column: 12, scope: !135) -// CHECK:STDOUT: !139 = !DILocation(line: 31, column: 5, scope: !135) -// CHECK:STDOUT: !140 = distinct !DISubprogram(name: "Has", linkageName: "_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.89a3e87df6fdafe1", scope: null, file: !99, line: 141, type: !27, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !147) -// CHECK:STDOUT: !141 = !DILocalVariable(arg: 1, scope: !140, type: !7) -// CHECK:STDOUT: !145 = !DILocation(line: 142, column: 12, scope: !140) -// CHECK:STDOUT: !146 = !DILocation(line: 142, column: 5, scope: !140) -// CHECK:STDOUT: !147 = !{!141} -// CHECK:STDOUT: !148 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.89a3e87df6fdafe1", scope: null, file: !99, line: 144, type: !23, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !155) -// CHECK:STDOUT: !149 = !DILocalVariable(arg: 1, scope: !148, type: !7) -// CHECK:STDOUT: !153 = !DILocation(line: 145, column: 12, scope: !148) -// CHECK:STDOUT: !154 = !DILocation(line: 145, column: 5, scope: !148) -// CHECK:STDOUT: !155 = !{!149} -// CHECK:STDOUT: !156 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895", scope: null, file: !118, line: 331, type: !124, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !163) -// CHECK:STDOUT: !157 = !DILocalVariable(arg: 1, scope: !156, type: !6) -// CHECK:STDOUT: !158 = !DILocalVariable(arg: 2, scope: !156, type: !6) -// CHECK:STDOUT: !159 = !DILocation(line: 0, scope: !156) -// CHECK:STDOUT: !160 = !DILocation(line: 331, column: 3, scope: !156) -// CHECK:STDOUT: !161 = !{!6, !6} -// CHECK:STDOUT: !162 = !DISubroutineType(types: !161) -// CHECK:STDOUT: !163 = !{!157, !158} -// CHECK:STDOUT: !164 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.89a3e87df6fdafe1", scope: null, file: !99, line: 131, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !177) -// CHECK:STDOUT: !165 = !DILocalVariable(arg: 1, scope: !164, type: !6) -// CHECK:STDOUT: !173 = !DILocation(line: 137, column: 5, scope: !164) -// CHECK:STDOUT: !175 = !DILocation(line: 138, column: 5, scope: !164) -// CHECK:STDOUT: !176 = !DILocation(line: 139, column: 5, scope: !164) -// CHECK:STDOUT: !177 = !{!165} -// CHECK:STDOUT: !178 = distinct !DISubprogram(name: "None", linkageName: "_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.89a3e87df6fdafe1", scope: null, file: !99, line: 125, type: !9, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !185 = !DILocation(line: 128, column: 5, scope: !178) -// CHECK:STDOUT: !186 = !DILocation(line: 129, column: 5, scope: !178) -// CHECK:STDOUT: !187 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044", scope: null, file: !118, line: 64, type: !162, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !195) -// CHECK:STDOUT: !188 = !DILocalVariable(arg: 1, scope: !187, type: !6) -// CHECK:STDOUT: !192 = !DILocation(line: 66, column: 17, scope: !187) -// CHECK:STDOUT: !194 = !DILocation(line: 66, column: 5, scope: !187) -// CHECK:STDOUT: !195 = !{!188} -// CHECK:STDOUT: !196 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !118, line: 59, type: !162, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !203) -// CHECK:STDOUT: !197 = !DILocalVariable(arg: 1, scope: !196, type: !6) -// CHECK:STDOUT: !202 = !DILocation(line: 59, column: 28, scope: !196) -// CHECK:STDOUT: !203 = !{!197} +// CHECK:STDOUT: !37 = !DIFile(filename: "{{.*}}/prelude/range.carbon", directory: "") +// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !37, line: 18, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !41) +// CHECK:STDOUT: !39 = !DILocalVariable(arg: 1, scope: !38, type: !6) +// CHECK:STDOUT: !40 = !DILocation(line: 18, column: 39, scope: !38) +// CHECK:STDOUT: !41 = !{!39} +// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.1d6a7672bf2f14c6:core.Destroy.Core", scope: null, file: !4, line: 18, type: !17, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !45) +// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !42, type: !7) +// CHECK:STDOUT: !44 = !DILocation(line: 18, column: 7, scope: !42) +// CHECK:STDOUT: !45 = !{!43} +// CHECK:STDOUT: !46 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.1d6a7672bf2f14c6:core.Destroy.Core", scope: null, file: !4, line: 18, type: !17, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !49) +// CHECK:STDOUT: !47 = !DILocalVariable(arg: 1, scope: !46, type: !7) +// CHECK:STDOUT: !48 = !DILocation(line: 18, column: 7, scope: !46) +// CHECK:STDOUT: !49 = !{!47} +// CHECK:STDOUT: !50 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.51569357b34b54dc:core.Destroy.Core", scope: null, file: !4, line: 18, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !53) +// CHECK:STDOUT: !51 = !DILocalVariable(arg: 1, scope: !50, type: !6) +// CHECK:STDOUT: !52 = !DILocation(line: 18, column: 7, scope: !50) +// CHECK:STDOUT: !53 = !{!51} +// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.51569357b34b54dc:core.Destroy.Core", scope: null, file: !4, line: 18, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !57) +// CHECK:STDOUT: !55 = !DILocalVariable(arg: 1, scope: !54, type: !6) +// CHECK:STDOUT: !56 = !DILocation(line: 18, column: 7, scope: !54) +// CHECK:STDOUT: !57 = !{!55} +// CHECK:STDOUT: !58 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.48e0adf639fe7af4:core.Destroy.Core", scope: null, file: !4, line: 18, type: !17, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !61) +// CHECK:STDOUT: !59 = !DILocalVariable(arg: 1, scope: !58, type: !7) +// CHECK:STDOUT: !60 = !DILocation(line: 18, column: 7, scope: !58) +// CHECK:STDOUT: !61 = !{!59} +// CHECK:STDOUT: !62 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f6a63055ea5a1824:core.Destroy.Core", scope: null, file: !4, line: 18, type: !17, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !65) +// CHECK:STDOUT: !63 = !DILocalVariable(arg: 1, scope: !62, type: !7) +// CHECK:STDOUT: !64 = !DILocation(line: 18, column: 7, scope: !62) +// CHECK:STDOUT: !65 = !{!63} +// CHECK:STDOUT: !66 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f6a63055ea5a1824:core.Destroy.Core", scope: null, file: !4, line: 18, type: !17, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !69) +// CHECK:STDOUT: !67 = !DILocalVariable(arg: 1, scope: !66, type: !7) +// CHECK:STDOUT: !68 = !DILocation(line: 18, column: 7, scope: !66) +// CHECK:STDOUT: !69 = !{!67} +// CHECK:STDOUT: !70 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.b7a533f3082ff11b:core.Destroy.Core", scope: null, file: !4, line: 18, type: !17, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !73) +// CHECK:STDOUT: !71 = !DILocalVariable(arg: 1, scope: !70, type: !7) +// CHECK:STDOUT: !72 = !DILocation(line: 18, column: 7, scope: !70) +// CHECK:STDOUT: !73 = !{!71} +// CHECK:STDOUT: !74 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.b7a533f3082ff11b:core.Destroy.Core", scope: null, file: !4, line: 18, type: !17, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !77) +// CHECK:STDOUT: !75 = !DILocalVariable(arg: 1, scope: !74, type: !7) +// CHECK:STDOUT: !76 = !DILocation(line: 18, column: 7, scope: !74) +// CHECK:STDOUT: !77 = !{!75} +// CHECK:STDOUT: !78 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.a8a4e50b707d8bfe:core.Destroy.Core", scope: null, file: !4, line: 18, type: !17, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !81) +// CHECK:STDOUT: !79 = !DILocalVariable(arg: 1, scope: !78, type: !7) +// CHECK:STDOUT: !80 = !DILocation(line: 18, column: 7, scope: !78) +// CHECK:STDOUT: !81 = !{!79} +// CHECK:STDOUT: !82 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.a8a4e50b707d8bfe:core.Destroy.Core", scope: null, file: !4, line: 18, type: !17, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !85) +// CHECK:STDOUT: !83 = !DILocalVariable(arg: 1, scope: !82, type: !7) +// CHECK:STDOUT: !84 = !DILocation(line: 18, column: 7, scope: !82) +// CHECK:STDOUT: !85 = !{!83} +// CHECK:STDOUT: !86 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.e933d5ff8212e171:core.Destroy.Core", scope: null, file: !4, line: 18, type: !17, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !89) +// CHECK:STDOUT: !87 = !DILocalVariable(arg: 1, scope: !86, type: !7) +// CHECK:STDOUT: !88 = !DILocation(line: 18, column: 18, scope: !86) +// CHECK:STDOUT: !89 = !{!87} +// CHECK:STDOUT: !90 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.e933d5ff8212e171:core.Destroy.Core", scope: null, file: !4, line: 18, type: !17, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !93) +// CHECK:STDOUT: !91 = !DILocalVariable(arg: 1, scope: !90, type: !7) +// CHECK:STDOUT: !92 = !DILocation(line: 18, column: 18, scope: !90) +// CHECK:STDOUT: !93 = !{!91} +// CHECK:STDOUT: !94 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.c9184c281ed4335d:core.Destroy.Core", scope: null, file: !4, line: 18, type: !17, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !97) +// CHECK:STDOUT: !95 = !DILocalVariable(arg: 1, scope: !94, type: !7) +// CHECK:STDOUT: !96 = !DILocation(line: 18, column: 18, scope: !94) +// CHECK:STDOUT: !97 = !{!95} +// CHECK:STDOUT: !98 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.c9184c281ed4335d:core.Destroy.Core", scope: null, file: !4, line: 18, type: !17, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !101) +// CHECK:STDOUT: !99 = !DILocalVariable(arg: 1, scope: !98, type: !7) +// CHECK:STDOUT: !100 = !DILocation(line: 18, column: 18, scope: !98) +// CHECK:STDOUT: !101 = !{!99} +// CHECK:STDOUT: !104 = distinct !DISubprogram(name: "NewCursor", linkageName: "_CNewCursor.IntRange.9452f4c51951679b.Core:Iterate.Core.be1e879c1ad406d8", scope: null, file: !37, line: 19, type: !23, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !111) +// CHECK:STDOUT: !105 = !DILocalVariable(arg: 1, scope: !104, type: !7) +// CHECK:STDOUT: !109 = !DILocation(line: 19, column: 43, scope: !104) +// CHECK:STDOUT: !110 = !DILocation(line: 19, column: 36, scope: !104) +// CHECK:STDOUT: !111 = !{!105} +// CHECK:STDOUT: !112 = distinct !DISubprogram(name: "Next", linkageName: "_CNext.IntRange.9452f4c51951679b.Core:Iterate.Core.be1e879c1ad406d8", scope: null, file: !37, line: 20, type: !25, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !134) +// CHECK:STDOUT: !113 = !DILocalVariable(arg: 1, scope: !112, type: !7) +// CHECK:STDOUT: !114 = !DILocalVariable(arg: 2, scope: !112, type: !7) +// CHECK:STDOUT: !119 = !DILocation(line: 21, column: 7, scope: !112) +// CHECK:STDOUT: !121 = !DILocation(line: 21, column: 27, scope: !112) +// CHECK:STDOUT: !123 = !DILocation(line: 22, column: 11, scope: !112) +// CHECK:STDOUT: !124 = !DILocation(line: 22, column: 19, scope: !112) +// CHECK:STDOUT: !125 = !DILocation(line: 22, column: 10, scope: !112) +// CHECK:STDOUT: !128 = !DILocation(line: 23, column: 9, scope: !112) +// CHECK:STDOUT: !129 = !DILocation(line: 24, column: 38, scope: !112) +// CHECK:STDOUT: !130 = !DILocation(line: 24, column: 16, scope: !112) +// CHECK:STDOUT: !131 = !DILocation(line: 24, column: 9, scope: !112) +// CHECK:STDOUT: !132 = !DILocation(line: 26, column: 16, scope: !112) +// CHECK:STDOUT: !133 = !DILocation(line: 26, column: 9, scope: !112) +// CHECK:STDOUT: !134 = !{!113, !114} +// CHECK:STDOUT: !135 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") +// CHECK:STDOUT: !136 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.fc4496a6c25d418b", scope: null, file: !135, line: 36, type: !27, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !144) +// CHECK:STDOUT: !137 = !DILocalVariable(arg: 1, scope: !136, type: !7) +// CHECK:STDOUT: !142 = !DILocation(line: 37, column: 12, scope: !136) +// CHECK:STDOUT: !143 = !DILocation(line: 37, column: 5, scope: !136) +// CHECK:STDOUT: !144 = !{!137} +// CHECK:STDOUT: !145 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.fc4496a6c25d418b", scope: null, file: !135, line: 39, type: !23, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !153) +// CHECK:STDOUT: !146 = !DILocalVariable(arg: 1, scope: !145, type: !7) +// CHECK:STDOUT: !151 = !DILocation(line: 40, column: 12, scope: !145) +// CHECK:STDOUT: !152 = !DILocation(line: 40, column: 5, scope: !145) +// CHECK:STDOUT: !153 = !{!146} +// CHECK:STDOUT: !154 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "") +// CHECK:STDOUT: !155 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !154, line: 396, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !162) +// CHECK:STDOUT: !156 = !DILocalVariable(arg: 1, scope: !155, type: !6) +// CHECK:STDOUT: !158 = !DILocation(line: 398, column: 5, scope: !155) +// CHECK:STDOUT: !159 = !{null, !6, !6} +// CHECK:STDOUT: !160 = !DISubroutineType(types: !159) +// CHECK:STDOUT: !161 = !DILocation(line: 396, column: 3, scope: !155) +// CHECK:STDOUT: !162 = !{!156} +// CHECK:STDOUT: !163 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.fc4496a6c25d418b", scope: null, file: !135, line: 33, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !170) +// CHECK:STDOUT: !164 = !DILocalVariable(arg: 1, scope: !163, type: !6) +// CHECK:STDOUT: !168 = !DILocation(line: 34, column: 12, scope: !163) +// CHECK:STDOUT: !169 = !DILocation(line: 34, column: 5, scope: !163) +// CHECK:STDOUT: !170 = !{!164} +// CHECK:STDOUT: !171 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.fc4496a6c25d418b", scope: null, file: !135, line: 30, type: !9, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !174 = !DILocation(line: 31, column: 12, scope: !171) +// CHECK:STDOUT: !175 = !DILocation(line: 31, column: 5, scope: !171) +// CHECK:STDOUT: !176 = distinct !DISubprogram(name: "Has", linkageName: "_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f", scope: null, file: !135, line: 141, type: !27, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !183) +// CHECK:STDOUT: !177 = !DILocalVariable(arg: 1, scope: !176, type: !7) +// CHECK:STDOUT: !181 = !DILocation(line: 142, column: 12, scope: !176) +// CHECK:STDOUT: !182 = !DILocation(line: 142, column: 5, scope: !176) +// CHECK:STDOUT: !183 = !{!177} +// CHECK:STDOUT: !184 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f", scope: null, file: !135, line: 144, type: !23, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !191) +// CHECK:STDOUT: !185 = !DILocalVariable(arg: 1, scope: !184, type: !7) +// CHECK:STDOUT: !189 = !DILocation(line: 145, column: 12, scope: !184) +// CHECK:STDOUT: !190 = !DILocation(line: 145, column: 5, scope: !184) +// CHECK:STDOUT: !191 = !{!185} +// CHECK:STDOUT: !192 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895", scope: null, file: !154, line: 331, type: !160, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !199) +// CHECK:STDOUT: !193 = !DILocalVariable(arg: 1, scope: !192, type: !6) +// CHECK:STDOUT: !194 = !DILocalVariable(arg: 2, scope: !192, type: !6) +// CHECK:STDOUT: !195 = !DILocation(line: 0, scope: !192) +// CHECK:STDOUT: !196 = !DILocation(line: 331, column: 3, scope: !192) +// CHECK:STDOUT: !197 = !{!6, !6} +// CHECK:STDOUT: !198 = !DISubroutineType(types: !197) +// CHECK:STDOUT: !199 = !{!193, !194} +// CHECK:STDOUT: !200 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f", scope: null, file: !135, line: 131, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !213) +// CHECK:STDOUT: !201 = !DILocalVariable(arg: 1, scope: !200, type: !6) +// CHECK:STDOUT: !209 = !DILocation(line: 137, column: 5, scope: !200) +// CHECK:STDOUT: !211 = !DILocation(line: 138, column: 5, scope: !200) +// CHECK:STDOUT: !212 = !DILocation(line: 139, column: 5, scope: !200) +// CHECK:STDOUT: !213 = !{!201} +// CHECK:STDOUT: !214 = distinct !DISubprogram(name: "None", linkageName: "_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f", scope: null, file: !135, line: 125, type: !9, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !221 = !DILocation(line: 128, column: 5, scope: !214) +// CHECK:STDOUT: !222 = !DILocation(line: 129, column: 5, scope: !214) +// CHECK:STDOUT: !223 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044", scope: null, file: !154, line: 64, type: !198, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !231) +// CHECK:STDOUT: !224 = !DILocalVariable(arg: 1, scope: !223, type: !6) +// CHECK:STDOUT: !228 = !DILocation(line: 66, column: 17, scope: !223) +// CHECK:STDOUT: !230 = !DILocation(line: 66, column: 5, scope: !223) +// CHECK:STDOUT: !231 = !{!224} +// CHECK:STDOUT: !232 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !154, line: 59, type: !198, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !239) +// CHECK:STDOUT: !233 = !DILocalVariable(arg: 1, scope: !232, type: !6) +// CHECK:STDOUT: !238 = !DILocation(line: 59, column: 28, scope: !232) +// CHECK:STDOUT: !239 = !{!233} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/for/for.carbon b/toolchain/lower/testdata/for/for.carbon index 63b0ca27cdae..d35e82dc4f3f 100644 --- a/toolchain/lower/testdata/for/for.carbon +++ b/toolchain/lower/testdata/for/for.carbon @@ -49,189 +49,252 @@ fn For() { // CHECK:STDOUT: for.next: ; preds = %for.body, %entry // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc19_33.1.temp), !dbg !20 // CHECK:STDOUT: call void @"_CNext.IntRange.9452f4c51951679b.Core:Iterate.Core.be1e879c1ad406d8"(ptr %.loc19_33.1.temp, ptr %.loc19_32.1.temp, ptr %var), !dbg !20 -// CHECK:STDOUT: %Optional.HasValue.call = call i1 @_CHasValue.Optional.Core.63bc0bf740b17859(ptr %.loc19_33.1.temp), !dbg !20 +// CHECK:STDOUT: %Optional.HasValue.call = call i1 @_CHasValue.Optional.Core.fc4496a6c25d418b(ptr %.loc19_33.1.temp), !dbg !20 // CHECK:STDOUT: br i1 %Optional.HasValue.call, label %for.body, label %for.done, !dbg !20 // CHECK:STDOUT: // CHECK:STDOUT: for.body: ; preds = %for.next -// CHECK:STDOUT: %Optional.Get.call = call i32 @_CGet.Optional.Core.63bc0bf740b17859(ptr %.loc19_33.1.temp), !dbg !20 +// CHECK:STDOUT: %Optional.Get.call = call i32 @_CGet.Optional.Core.fc4496a6c25d418b(ptr %.loc19_33.1.temp), !dbg !20 // CHECK:STDOUT: call void @_CG.Main(), !dbg !27 -// CHECK:STDOUT: call void @"_COp.1423d794a4867d77:core.Destroy.Core"(ptr %.loc19_33.1.temp), !dbg !20 +// CHECK:STDOUT: call void @"_CSelfDestruct.a8a4e50b707d8bfe:core.Destroy.Core"(ptr %.loc19_33.1.temp), !dbg !20 // CHECK:STDOUT: br label %for.next, !dbg !28 // CHECK:STDOUT: // CHECK:STDOUT: for.done: ; preds = %for.next -// CHECK:STDOUT: call void @"_COp.1423d794a4867d77:core.Destroy.Core"(ptr %.loc19_33.1.temp), !dbg !20 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %var), !dbg !20 -// CHECK:STDOUT: call void @"_COp.c9184c281ed4335d:core.Destroy.Core"(ptr %.loc19_32.1.temp), !dbg !19 +// CHECK:STDOUT: call void @"_CSelfDestruct.a8a4e50b707d8bfe:core.Destroy.Core"(ptr %.loc19_33.1.temp), !dbg !20 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %var), !dbg !20 +// CHECK:STDOUT: call void @"_CSelfDestruct.c9184c281ed4335d:core.Destroy.Core"(ptr %.loc19_32.1.temp), !dbg !19 // CHECK:STDOUT: call void @_CH.Main(), !dbg !29 // CHECK:STDOUT: ret void, !dbg !30 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_CRange.Core(ptr sret({ i32, i32 }), i32) // CHECK:STDOUT: -// CHECK:STDOUT: declare void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr) +// CHECK:STDOUT: declare void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr) +// CHECK:STDOUT: +// CHECK:STDOUT: declare void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.1d6a7672bf2f14c6:core.Destroy.Core"(ptr %self) #0 !dbg !31 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !32 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !33 +// CHECK:STDOUT: ret void, !dbg !34 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.c1dffdf44e31057b:core.Destroy.Core"(ptr %self) #0 !dbg !35 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.1d6a7672bf2f14c6:core.Destroy.Core"(ptr %self) #0 !dbg !36 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !37 +// CHECK:STDOUT: ret void, !dbg !38 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.271d79a4f33942b3:core.Destroy.Core"(ptr %self) #0 !dbg !39 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.1d6a7672bf2f14c6:core.Destroy.Core"(ptr %self) #0 !dbg !40 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !41 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.1d6a7672bf2f14c6:core.Destroy.Core"(ptr %self), !dbg !42 +// CHECK:STDOUT: ret void, !dbg !42 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.aef98596d3a9e1eb:core.Destroy.Core"(ptr %self) #0 !dbg !43 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.51569357b34b54dc:core.Destroy.Core"(ptr %self) #0 !dbg !44 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !45 +// CHECK:STDOUT: ret void, !dbg !46 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.1423d794a4867d77:core.Destroy.Core"(ptr %self) #0 !dbg !47 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.51569357b34b54dc:core.Destroy.Core"(ptr %self) #0 !dbg !48 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !49 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.51569357b34b54dc:core.Destroy.Core"(ptr %self), !dbg !50 +// CHECK:STDOUT: ret void, !dbg !50 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.e933d5ff8212e171:core.Destroy.Core"(ptr %self) #0 !dbg !51 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.48e0adf639fe7af4:core.Destroy.Core"(ptr %self) #0 !dbg !52 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !53 +// CHECK:STDOUT: ret void, !dbg !54 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.c9184c281ed4335d:core.Destroy.Core"(ptr %self) #0 !dbg !55 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f6a63055ea5a1824:core.Destroy.Core"(ptr %self) #0 !dbg !56 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !57 +// CHECK:STDOUT: ret void, !dbg !58 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f6a63055ea5a1824:core.Destroy.Core"(ptr %self) #0 !dbg !60 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f6a63055ea5a1824:core.Destroy.Core"(ptr %self), !dbg !62 +// CHECK:STDOUT: ret void, !dbg !62 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.b7a533f3082ff11b:core.Destroy.Core"(ptr %self) #0 !dbg !64 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !66 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.b7a533f3082ff11b:core.Destroy.Core"(ptr %self) #0 !dbg !68 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.b7a533f3082ff11b:core.Destroy.Core"(ptr %self), !dbg !70 +// CHECK:STDOUT: ret void, !dbg !70 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.a8a4e50b707d8bfe:core.Destroy.Core"(ptr %self) #0 !dbg !72 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !74 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.a8a4e50b707d8bfe:core.Destroy.Core"(ptr %self) #0 !dbg !76 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.a8a4e50b707d8bfe:core.Destroy.Core"(ptr %self), !dbg !78 +// CHECK:STDOUT: ret void, !dbg !78 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.e933d5ff8212e171:core.Destroy.Core"(ptr %self) #0 !dbg !80 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !82 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.e933d5ff8212e171:core.Destroy.Core"(ptr %self) #0 !dbg !84 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.e933d5ff8212e171:core.Destroy.Core"(ptr %self), !dbg !86 +// CHECK:STDOUT: ret void, !dbg !86 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.c9184c281ed4335d:core.Destroy.Core"(ptr %self) #0 !dbg !88 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !90 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.c9184c281ed4335d:core.Destroy.Core"(ptr %self) #0 !dbg !92 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.c9184c281ed4335d:core.Destroy.Core"(ptr %self), !dbg !94 +// CHECK:STDOUT: ret void, !dbg !94 // 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 i32 @"_CNewCursor.IntRange.9452f4c51951679b.Core:Iterate.Core.be1e879c1ad406d8"(ptr %self) #0 !dbg !62 { -// CHECK:STDOUT: %start = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 0, !dbg !67 -// CHECK:STDOUT: %1 = load i32, ptr %start, align 4, !dbg !67 -// CHECK:STDOUT: ret i32 %1, !dbg !68 +// CHECK:STDOUT: define linkonce_odr i32 @"_CNewCursor.IntRange.9452f4c51951679b.Core:Iterate.Core.be1e879c1ad406d8"(ptr %self) #0 !dbg !98 { +// CHECK:STDOUT: %start = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 0, !dbg !103 +// CHECK:STDOUT: %1 = load i32, ptr %start, align 4, !dbg !103 +// CHECK:STDOUT: ret i32 %1, !dbg !104 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CNext.IntRange.9452f4c51951679b.Core:Iterate.Core.be1e879c1ad406d8"(ptr sret(<{ i32, i1 }>) %return, ptr %self, ptr %cursor) #0 !dbg !70 { -// CHECK:STDOUT: %1 = alloca i32, align 4, !dbg !77 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !77 -// CHECK:STDOUT: %2 = load i32, ptr %cursor, align 4, !dbg !79 -// CHECK:STDOUT: store i32 %2, ptr %1, align 4, !dbg !77 -// CHECK:STDOUT: %end = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 1, !dbg !82 -// CHECK:STDOUT: %3 = load i32, ptr %end, align 4, !dbg !82 -// CHECK:STDOUT: %4 = load i32, ptr %1, align 4, !dbg !81 -// CHECK:STDOUT: %5 = icmp slt i32 %4, %3, !dbg !81 -// CHECK:STDOUT: br i1 %5, label %6, label %8, !dbg !83 +// CHECK:STDOUT: define linkonce_odr void @"_CNext.IntRange.9452f4c51951679b.Core:Iterate.Core.be1e879c1ad406d8"(ptr sret(<{ i32, i1 }>) %return, ptr %self, ptr %cursor) #0 !dbg !106 { +// CHECK:STDOUT: %1 = alloca i32, align 4, !dbg !113 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !113 +// CHECK:STDOUT: %2 = load i32, ptr %cursor, align 4, !dbg !115 +// CHECK:STDOUT: store i32 %2, ptr %1, align 4, !dbg !113 +// CHECK:STDOUT: %end = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 1, !dbg !118 +// CHECK:STDOUT: %3 = load i32, ptr %end, align 4, !dbg !118 +// CHECK:STDOUT: %4 = load i32, ptr %1, align 4, !dbg !117 +// CHECK:STDOUT: %5 = icmp slt i32 %4, %3, !dbg !117 +// CHECK:STDOUT: br i1 %5, label %6, label %8, !dbg !119 // CHECK:STDOUT: // CHECK:STDOUT: 6: ; preds = %0 -// CHECK:STDOUT: call void @"_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8"(ptr %cursor), !dbg !86 -// CHECK:STDOUT: %7 = load i32, ptr %1, align 4, !dbg !87 -// CHECK:STDOUT: call void @_CSome.Optional.Core.63bc0bf740b17859(ptr %return, i32 %7), !dbg !88 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %1), !dbg !77 -// CHECK:STDOUT: ret void, !dbg !89 +// CHECK:STDOUT: call void @"_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8"(ptr %cursor), !dbg !122 +// CHECK:STDOUT: %7 = load i32, ptr %1, align 4, !dbg !123 +// CHECK:STDOUT: call void @_CSome.Optional.Core.fc4496a6c25d418b(ptr %return, i32 %7), !dbg !124 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %1), !dbg !113 +// CHECK:STDOUT: ret void, !dbg !125 // CHECK:STDOUT: // CHECK:STDOUT: 8: ; preds = %0 -// CHECK:STDOUT: call void @_CNone.Optional.Core.63bc0bf740b17859(ptr %return), !dbg !90 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %1), !dbg !77 -// CHECK:STDOUT: ret void, !dbg !93 +// CHECK:STDOUT: call void @_CNone.Optional.Core.fc4496a6c25d418b(ptr %return), !dbg !126 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %1), !dbg !113 +// CHECK:STDOUT: ret void, !dbg !129 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.63bc0bf740b17859(ptr %self) #0 !dbg !96 { -// CHECK:STDOUT: %1 = call i1 @"_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.89a3e87df6fdafe1"(ptr %self), !dbg !102 -// CHECK:STDOUT: ret i1 %1, !dbg !103 +// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.fc4496a6c25d418b(ptr %self) #0 !dbg !132 { +// CHECK:STDOUT: %1 = call i1 @"_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %self), !dbg !138 +// CHECK:STDOUT: ret i1 %1, !dbg !139 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CGet.Optional.Core.63bc0bf740b17859(ptr %self) #0 !dbg !105 { -// CHECK:STDOUT: %1 = call i32 @"_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.89a3e87df6fdafe1"(ptr %self), !dbg !111 -// CHECK:STDOUT: ret i32 %1, !dbg !112 +// CHECK:STDOUT: define linkonce_odr i32 @_CGet.Optional.Core.fc4496a6c25d418b(ptr %self) #0 !dbg !141 { +// CHECK:STDOUT: %1 = call i32 @"_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %self), !dbg !147 +// CHECK:STDOUT: ret i32 %1, !dbg !148 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_CInclusiveRange.Core(ptr sret({ i32, i32 }), i32, i32) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8"(ptr %self) #0 !dbg !115 { -// CHECK:STDOUT: call void @"_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895"(ptr %self, i32 1), !dbg !118 -// CHECK:STDOUT: ret void, !dbg !121 +// CHECK:STDOUT: define linkonce_odr void @"_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8"(ptr %self) #0 !dbg !151 { +// CHECK:STDOUT: call void @"_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895"(ptr %self, i32 1), !dbg !154 +// CHECK:STDOUT: ret void, !dbg !157 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSome.Optional.Core.63bc0bf740b17859(ptr sret(<{ i32, i1 }>) %return, i32 %value) #0 !dbg !123 { -// CHECK:STDOUT: call void @"_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.89a3e87df6fdafe1"(ptr %return, i32 %value), !dbg !128 -// CHECK:STDOUT: ret void, !dbg !129 +// CHECK:STDOUT: define linkonce_odr void @_CSome.Optional.Core.fc4496a6c25d418b(ptr sret(<{ i32, i1 }>) %return, i32 %value) #0 !dbg !159 { +// CHECK:STDOUT: call void @"_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %return, i32 %value), !dbg !164 +// CHECK:STDOUT: ret void, !dbg !165 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CNone.Optional.Core.63bc0bf740b17859(ptr sret(<{ i32, i1 }>) %return) #0 !dbg !131 { -// CHECK:STDOUT: call void @"_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.89a3e87df6fdafe1"(ptr %return), !dbg !134 -// CHECK:STDOUT: ret void, !dbg !135 +// CHECK:STDOUT: define linkonce_odr void @_CNone.Optional.Core.fc4496a6c25d418b(ptr sret(<{ i32, i1 }>) %return) #0 !dbg !167 { +// CHECK:STDOUT: call void @"_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %return), !dbg !170 +// CHECK:STDOUT: ret void, !dbg !171 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @"_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.89a3e87df6fdafe1"(ptr %value) #0 !dbg !136 { -// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %value, i32 0, i32 1, !dbg !141 -// CHECK:STDOUT: %1 = load i8, ptr %has_value, align 1, !dbg !141 -// CHECK:STDOUT: %2 = trunc i8 %1 to i1, !dbg !141 -// CHECK:STDOUT: ret i1 %2, !dbg !142 +// CHECK:STDOUT: define linkonce_odr i1 @"_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %value) #0 !dbg !172 { +// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %value, i32 0, i32 1, !dbg !177 +// CHECK:STDOUT: %1 = load i8, ptr %has_value, align 1, !dbg !177 +// CHECK:STDOUT: %2 = trunc i8 %1 to i1, !dbg !177 +// CHECK:STDOUT: ret i1 %2, !dbg !178 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @"_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.89a3e87df6fdafe1"(ptr %value) #0 !dbg !144 { -// CHECK:STDOUT: %value1 = getelementptr inbounds nuw <{ i32, i1 }>, ptr %value, i32 0, i32 0, !dbg !149 -// CHECK:STDOUT: %1 = load i32, ptr %value1, align 4, !dbg !149 -// CHECK:STDOUT: ret i32 %1, !dbg !150 +// CHECK:STDOUT: define linkonce_odr i32 @"_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr %value) #0 !dbg !180 { +// CHECK:STDOUT: %value1 = getelementptr inbounds nuw <{ i32, i1 }>, ptr %value, i32 0, i32 0, !dbg !185 +// CHECK:STDOUT: %1 = load i32, ptr %value1, align 4, !dbg !185 +// CHECK:STDOUT: ret i32 %1, !dbg !186 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define linkonce_odr void @"_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895"(ptr %self, i32 %other) #2 !dbg !152 { -// CHECK:STDOUT: %1 = call i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044"(i32 %other), !dbg !155 -// CHECK:STDOUT: %2 = load i32, ptr %self, align 4, !dbg !156 -// CHECK:STDOUT: %3 = add i32 %2, %1, !dbg !156 -// CHECK:STDOUT: store i32 %3, ptr %self, align 4, !dbg !156 -// CHECK:STDOUT: ret void, !dbg !156 +// CHECK:STDOUT: define linkonce_odr void @"_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895"(ptr %self, i32 %other) #2 !dbg !188 { +// CHECK:STDOUT: %1 = call i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044"(i32 %other), !dbg !191 +// CHECK:STDOUT: %2 = load i32, ptr %self, align 4, !dbg !192 +// CHECK:STDOUT: %3 = add i32 %2, %1, !dbg !192 +// CHECK:STDOUT: store i32 %3, ptr %self, align 4, !dbg !192 +// CHECK:STDOUT: ret void, !dbg !192 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.89a3e87df6fdafe1"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !160 { -// CHECK:STDOUT: %value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 0, !dbg !169 -// CHECK:STDOUT: store i32 %self, ptr %value, align 4, !dbg !169 -// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 1, !dbg !171 -// CHECK:STDOUT: store i8 1, ptr %has_value, align 1, !dbg !171 -// CHECK:STDOUT: ret void, !dbg !172 +// CHECK:STDOUT: define linkonce_odr void @"_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !196 { +// CHECK:STDOUT: %value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 0, !dbg !205 +// CHECK:STDOUT: store i32 %self, ptr %value, align 4, !dbg !205 +// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 1, !dbg !207 +// CHECK:STDOUT: store i8 1, ptr %has_value, align 1, !dbg !207 +// CHECK:STDOUT: ret void, !dbg !208 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.89a3e87df6fdafe1"(ptr sret(<{ i32, i1 }>) %return) #0 !dbg !174 { -// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 1, !dbg !181 -// CHECK:STDOUT: store i8 0, ptr %has_value, align 1, !dbg !181 -// CHECK:STDOUT: ret void, !dbg !182 +// CHECK:STDOUT: define linkonce_odr void @"_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f"(ptr sret(<{ i32, i1 }>) %return) #0 !dbg !210 { +// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 1, !dbg !217 +// CHECK:STDOUT: store i8 0, ptr %has_value, align 1, !dbg !217 +// CHECK:STDOUT: ret void, !dbg !218 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044"(i32 %self) #0 !dbg !183 { -// CHECK:STDOUT: %1 = call i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self), !dbg !188 -// CHECK:STDOUT: ret i32 %1, !dbg !190 +// CHECK:STDOUT: define linkonce_odr i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044"(i32 %self) #0 !dbg !219 { +// CHECK:STDOUT: %1 = call i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self), !dbg !224 +// CHECK:STDOUT: ret i32 %1, !dbg !226 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self) #0 !dbg !192 { -// CHECK:STDOUT: ret i32 %self, !dbg !198 +// CHECK:STDOUT: define linkonce_odr i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self) #0 !dbg !228 { +// CHECK:STDOUT: ret i32 %self, !dbg !234 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives -// CHECK:STDOUT: uselistorder ptr @"_COp.1423d794a4867d77:core.Destroy.Core", { 1, 0 } +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.a8a4e50b707d8bfe:core.Destroy.Core", { 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 0, 3, 2, 1 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -269,118 +332,154 @@ fn For() { // CHECK:STDOUT: !28 = !DILocation(line: 19, column: 3, scope: !16) // CHECK:STDOUT: !29 = !DILocation(line: 22, column: 3, scope: !16) // CHECK:STDOUT: !30 = !DILocation(line: 17, column: 1, scope: !16) -// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "Op", linkageName: "_COp.1d6a7672bf2f14c6:core.Destroy.Core", scope: null, file: !4, line: 19, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !34) -// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !31, type: !9) -// CHECK:STDOUT: !33 = !DILocation(line: 19, column: 7, scope: !31) -// CHECK:STDOUT: !34 = !{!32} -// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "Op", linkageName: "_COp.c1dffdf44e31057b:core.Destroy.Core", scope: null, file: !4, line: 19, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !38) -// CHECK:STDOUT: !36 = !DILocalVariable(arg: 1, scope: !35, type: !6) -// CHECK:STDOUT: !37 = !DILocation(line: 19, column: 7, scope: !35) -// CHECK:STDOUT: !38 = !{!36} -// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "Op", linkageName: "_COp.271d79a4f33942b3:core.Destroy.Core", scope: null, file: !4, line: 19, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !42) -// CHECK:STDOUT: !40 = !DILocalVariable(arg: 1, scope: !39, type: !9) -// CHECK:STDOUT: !41 = !DILocation(line: 19, column: 7, scope: !39) -// CHECK:STDOUT: !42 = !{!40} -// CHECK:STDOUT: !43 = distinct !DISubprogram(name: "Op", linkageName: "_COp.aef98596d3a9e1eb:core.Destroy.Core", scope: null, file: !4, line: 19, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !46) -// CHECK:STDOUT: !44 = !DILocalVariable(arg: 1, scope: !43, type: !9) -// CHECK:STDOUT: !45 = !DILocation(line: 19, column: 7, scope: !43) -// CHECK:STDOUT: !46 = !{!44} -// CHECK:STDOUT: !47 = distinct !DISubprogram(name: "Op", linkageName: "_COp.1423d794a4867d77:core.Destroy.Core", scope: null, file: !4, line: 19, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !50) -// CHECK:STDOUT: !48 = !DILocalVariable(arg: 1, scope: !47, type: !9) -// CHECK:STDOUT: !49 = !DILocation(line: 19, column: 7, scope: !47) -// CHECK:STDOUT: !50 = !{!48} -// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "Op", linkageName: "_COp.e933d5ff8212e171:core.Destroy.Core", scope: null, file: !4, line: 19, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !54) -// CHECK:STDOUT: !52 = !DILocalVariable(arg: 1, scope: !51, type: !9) -// CHECK:STDOUT: !53 = !DILocation(line: 19, column: 18, scope: !51) -// CHECK:STDOUT: !54 = !{!52} -// CHECK:STDOUT: !55 = distinct !DISubprogram(name: "Op", linkageName: "_COp.c9184c281ed4335d:core.Destroy.Core", scope: null, file: !4, line: 19, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !58) -// CHECK:STDOUT: !56 = !DILocalVariable(arg: 1, scope: !55, type: !9) -// CHECK:STDOUT: !57 = !DILocation(line: 19, column: 18, scope: !55) -// CHECK:STDOUT: !58 = !{!56} -// CHECK:STDOUT: !61 = !DIFile(filename: "{{.*}}/prelude/range.carbon", directory: "") -// CHECK:STDOUT: !62 = distinct !DISubprogram(name: "NewCursor", linkageName: "_CNewCursor.IntRange.9452f4c51951679b.Core:Iterate.Core.be1e879c1ad406d8", scope: null, file: !61, line: 19, type: !22, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !69) -// CHECK:STDOUT: !63 = !DILocalVariable(arg: 1, scope: !62, type: !9) -// CHECK:STDOUT: !67 = !DILocation(line: 19, column: 43, scope: !62) -// CHECK:STDOUT: !68 = !DILocation(line: 19, column: 36, scope: !62) -// CHECK:STDOUT: !69 = !{!63} -// CHECK:STDOUT: !70 = distinct !DISubprogram(name: "Next", linkageName: "_CNext.IntRange.9452f4c51951679b.Core:Iterate.Core.be1e879c1ad406d8", scope: null, file: !61, line: 20, type: !24, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !94) -// CHECK:STDOUT: !71 = !DILocalVariable(arg: 1, scope: !70, type: !9) -// CHECK:STDOUT: !72 = !DILocalVariable(arg: 2, scope: !70, type: !9) -// CHECK:STDOUT: !77 = !DILocation(line: 21, column: 7, scope: !70) -// CHECK:STDOUT: !79 = !DILocation(line: 21, column: 27, scope: !70) -// CHECK:STDOUT: !81 = !DILocation(line: 22, column: 11, scope: !70) -// CHECK:STDOUT: !82 = !DILocation(line: 22, column: 19, scope: !70) -// CHECK:STDOUT: !83 = !DILocation(line: 22, column: 10, scope: !70) -// CHECK:STDOUT: !86 = !DILocation(line: 23, column: 9, scope: !70) -// CHECK:STDOUT: !87 = !DILocation(line: 24, column: 38, scope: !70) -// CHECK:STDOUT: !88 = !DILocation(line: 24, column: 16, scope: !70) -// CHECK:STDOUT: !89 = !DILocation(line: 24, column: 9, scope: !70) -// CHECK:STDOUT: !90 = !DILocation(line: 26, column: 16, scope: !70) -// CHECK:STDOUT: !91 = !{!9} -// CHECK:STDOUT: !92 = !DISubroutineType(types: !91) -// CHECK:STDOUT: !93 = !DILocation(line: 26, column: 9, scope: !70) -// CHECK:STDOUT: !94 = !{!71, !72} -// CHECK:STDOUT: !95 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") -// CHECK:STDOUT: !96 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.63bc0bf740b17859", scope: null, file: !95, line: 36, type: !26, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !104) -// CHECK:STDOUT: !97 = !DILocalVariable(arg: 1, scope: !96, type: !9) -// CHECK:STDOUT: !102 = !DILocation(line: 37, column: 12, scope: !96) -// CHECK:STDOUT: !103 = !DILocation(line: 37, column: 5, scope: !96) -// CHECK:STDOUT: !104 = !{!97} -// CHECK:STDOUT: !105 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.63bc0bf740b17859", scope: null, file: !95, line: 39, type: !22, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !113) -// CHECK:STDOUT: !106 = !DILocalVariable(arg: 1, scope: !105, type: !9) -// CHECK:STDOUT: !111 = !DILocation(line: 40, column: 12, scope: !105) -// CHECK:STDOUT: !112 = !DILocation(line: 40, column: 5, scope: !105) -// CHECK:STDOUT: !113 = !{!106} -// CHECK:STDOUT: !114 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "") -// CHECK:STDOUT: !115 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !114, line: 396, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !122) -// CHECK:STDOUT: !116 = !DILocalVariable(arg: 1, scope: !115, type: !6) -// CHECK:STDOUT: !118 = !DILocation(line: 398, column: 5, scope: !115) -// CHECK:STDOUT: !119 = !{null, !6, !6} -// CHECK:STDOUT: !120 = !DISubroutineType(types: !119) -// CHECK:STDOUT: !121 = !DILocation(line: 396, column: 3, scope: !115) -// CHECK:STDOUT: !122 = !{!116} -// CHECK:STDOUT: !123 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.63bc0bf740b17859", scope: null, file: !95, line: 33, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !130) -// CHECK:STDOUT: !124 = !DILocalVariable(arg: 1, scope: !123, type: !6) -// CHECK:STDOUT: !128 = !DILocation(line: 34, column: 12, scope: !123) -// CHECK:STDOUT: !129 = !DILocation(line: 34, column: 5, scope: !123) -// CHECK:STDOUT: !130 = !{!124} -// CHECK:STDOUT: !131 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.63bc0bf740b17859", scope: null, file: !95, line: 30, type: !92, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !134 = !DILocation(line: 31, column: 12, scope: !131) -// CHECK:STDOUT: !135 = !DILocation(line: 31, column: 5, scope: !131) -// CHECK:STDOUT: !136 = distinct !DISubprogram(name: "Has", linkageName: "_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.89a3e87df6fdafe1", scope: null, file: !95, line: 141, type: !26, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !143) -// CHECK:STDOUT: !137 = !DILocalVariable(arg: 1, scope: !136, type: !9) -// CHECK:STDOUT: !141 = !DILocation(line: 142, column: 12, scope: !136) -// CHECK:STDOUT: !142 = !DILocation(line: 142, column: 5, scope: !136) -// CHECK:STDOUT: !143 = !{!137} -// CHECK:STDOUT: !144 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.89a3e87df6fdafe1", scope: null, file: !95, line: 144, type: !22, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !151) -// CHECK:STDOUT: !145 = !DILocalVariable(arg: 1, scope: !144, type: !9) -// CHECK:STDOUT: !149 = !DILocation(line: 145, column: 12, scope: !144) -// CHECK:STDOUT: !150 = !DILocation(line: 145, column: 5, scope: !144) -// CHECK:STDOUT: !151 = !{!145} -// CHECK:STDOUT: !152 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895", scope: null, file: !114, line: 331, type: !120, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !159) -// CHECK:STDOUT: !153 = !DILocalVariable(arg: 1, scope: !152, type: !6) -// CHECK:STDOUT: !154 = !DILocalVariable(arg: 2, scope: !152, type: !6) -// CHECK:STDOUT: !155 = !DILocation(line: 0, scope: !152) -// CHECK:STDOUT: !156 = !DILocation(line: 331, column: 3, scope: !152) -// CHECK:STDOUT: !157 = !{!6, !6} -// CHECK:STDOUT: !158 = !DISubroutineType(types: !157) -// CHECK:STDOUT: !159 = !{!153, !154} -// CHECK:STDOUT: !160 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.89a3e87df6fdafe1", scope: null, file: !95, line: 131, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !173) -// CHECK:STDOUT: !161 = !DILocalVariable(arg: 1, scope: !160, type: !6) -// CHECK:STDOUT: !169 = !DILocation(line: 137, column: 5, scope: !160) -// CHECK:STDOUT: !171 = !DILocation(line: 138, column: 5, scope: !160) -// CHECK:STDOUT: !172 = !DILocation(line: 139, column: 5, scope: !160) -// CHECK:STDOUT: !173 = !{!161} -// CHECK:STDOUT: !174 = distinct !DISubprogram(name: "None", linkageName: "_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.89a3e87df6fdafe1", scope: null, file: !95, line: 125, type: !92, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !181 = !DILocation(line: 128, column: 5, scope: !174) -// CHECK:STDOUT: !182 = !DILocation(line: 129, column: 5, scope: !174) -// CHECK:STDOUT: !183 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044", scope: null, file: !114, line: 64, type: !158, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !191) -// CHECK:STDOUT: !184 = !DILocalVariable(arg: 1, scope: !183, type: !6) -// CHECK:STDOUT: !188 = !DILocation(line: 66, column: 17, scope: !183) -// CHECK:STDOUT: !190 = !DILocation(line: 66, column: 5, scope: !183) -// CHECK:STDOUT: !191 = !{!184} -// CHECK:STDOUT: !192 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !114, line: 59, type: !158, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !199) -// CHECK:STDOUT: !193 = !DILocalVariable(arg: 1, scope: !192, type: !6) -// CHECK:STDOUT: !198 = !DILocation(line: 59, column: 28, scope: !192) -// CHECK:STDOUT: !199 = !{!193} +// CHECK:STDOUT: !31 = !DIFile(filename: "{{.*}}/prelude/range.carbon", directory: "") +// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !31, line: 18, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !35) +// CHECK:STDOUT: !33 = !DILocalVariable(arg: 1, scope: !32, type: !6) +// CHECK:STDOUT: !34 = !DILocation(line: 18, column: 39, scope: !32) +// CHECK:STDOUT: !35 = !{!33} +// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.1d6a7672bf2f14c6:core.Destroy.Core", scope: null, file: !4, line: 19, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !39) +// CHECK:STDOUT: !37 = !DILocalVariable(arg: 1, scope: !36, type: !9) +// CHECK:STDOUT: !38 = !DILocation(line: 19, column: 7, scope: !36) +// CHECK:STDOUT: !39 = !{!37} +// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.1d6a7672bf2f14c6:core.Destroy.Core", scope: null, file: !4, line: 19, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !43) +// CHECK:STDOUT: !41 = !DILocalVariable(arg: 1, scope: !40, type: !9) +// CHECK:STDOUT: !42 = !DILocation(line: 19, column: 7, scope: !40) +// CHECK:STDOUT: !43 = !{!41} +// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.51569357b34b54dc:core.Destroy.Core", scope: null, file: !4, line: 19, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !47) +// CHECK:STDOUT: !45 = !DILocalVariable(arg: 1, scope: !44, type: !6) +// CHECK:STDOUT: !46 = !DILocation(line: 19, column: 7, scope: !44) +// CHECK:STDOUT: !47 = !{!45} +// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.51569357b34b54dc:core.Destroy.Core", scope: null, file: !4, line: 19, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !51) +// CHECK:STDOUT: !49 = !DILocalVariable(arg: 1, scope: !48, type: !6) +// CHECK:STDOUT: !50 = !DILocation(line: 19, column: 7, scope: !48) +// CHECK:STDOUT: !51 = !{!49} +// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.48e0adf639fe7af4:core.Destroy.Core", scope: null, file: !4, line: 19, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !55) +// CHECK:STDOUT: !53 = !DILocalVariable(arg: 1, scope: !52, type: !9) +// CHECK:STDOUT: !54 = !DILocation(line: 19, column: 7, scope: !52) +// CHECK:STDOUT: !55 = !{!53} +// CHECK:STDOUT: !56 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f6a63055ea5a1824:core.Destroy.Core", scope: null, file: !4, line: 19, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !59) +// CHECK:STDOUT: !57 = !DILocalVariable(arg: 1, scope: !56, type: !9) +// CHECK:STDOUT: !58 = !DILocation(line: 19, column: 7, scope: !56) +// CHECK:STDOUT: !59 = !{!57} +// CHECK:STDOUT: !60 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f6a63055ea5a1824:core.Destroy.Core", scope: null, file: !4, line: 19, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !63) +// CHECK:STDOUT: !61 = !DILocalVariable(arg: 1, scope: !60, type: !9) +// CHECK:STDOUT: !62 = !DILocation(line: 19, column: 7, scope: !60) +// CHECK:STDOUT: !63 = !{!61} +// CHECK:STDOUT: !64 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.b7a533f3082ff11b:core.Destroy.Core", scope: null, file: !4, line: 19, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !67) +// CHECK:STDOUT: !65 = !DILocalVariable(arg: 1, scope: !64, type: !9) +// CHECK:STDOUT: !66 = !DILocation(line: 19, column: 7, scope: !64) +// CHECK:STDOUT: !67 = !{!65} +// CHECK:STDOUT: !68 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.b7a533f3082ff11b:core.Destroy.Core", scope: null, file: !4, line: 19, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !71) +// CHECK:STDOUT: !69 = !DILocalVariable(arg: 1, scope: !68, type: !9) +// CHECK:STDOUT: !70 = !DILocation(line: 19, column: 7, scope: !68) +// CHECK:STDOUT: !71 = !{!69} +// CHECK:STDOUT: !72 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.a8a4e50b707d8bfe:core.Destroy.Core", scope: null, file: !4, line: 19, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !75) +// CHECK:STDOUT: !73 = !DILocalVariable(arg: 1, scope: !72, type: !9) +// CHECK:STDOUT: !74 = !DILocation(line: 19, column: 7, scope: !72) +// CHECK:STDOUT: !75 = !{!73} +// CHECK:STDOUT: !76 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.a8a4e50b707d8bfe:core.Destroy.Core", scope: null, file: !4, line: 19, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !79) +// CHECK:STDOUT: !77 = !DILocalVariable(arg: 1, scope: !76, type: !9) +// CHECK:STDOUT: !78 = !DILocation(line: 19, column: 7, scope: !76) +// CHECK:STDOUT: !79 = !{!77} +// CHECK:STDOUT: !80 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.e933d5ff8212e171:core.Destroy.Core", scope: null, file: !4, line: 19, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !83) +// CHECK:STDOUT: !81 = !DILocalVariable(arg: 1, scope: !80, type: !9) +// CHECK:STDOUT: !82 = !DILocation(line: 19, column: 18, scope: !80) +// CHECK:STDOUT: !83 = !{!81} +// CHECK:STDOUT: !84 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.e933d5ff8212e171:core.Destroy.Core", scope: null, file: !4, line: 19, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !87) +// CHECK:STDOUT: !85 = !DILocalVariable(arg: 1, scope: !84, type: !9) +// CHECK:STDOUT: !86 = !DILocation(line: 19, column: 18, scope: !84) +// CHECK:STDOUT: !87 = !{!85} +// CHECK:STDOUT: !88 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.c9184c281ed4335d:core.Destroy.Core", scope: null, file: !4, line: 19, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !91) +// CHECK:STDOUT: !89 = !DILocalVariable(arg: 1, scope: !88, type: !9) +// CHECK:STDOUT: !90 = !DILocation(line: 19, column: 18, scope: !88) +// CHECK:STDOUT: !91 = !{!89} +// CHECK:STDOUT: !92 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.c9184c281ed4335d:core.Destroy.Core", scope: null, file: !4, line: 19, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !95) +// CHECK:STDOUT: !93 = !DILocalVariable(arg: 1, scope: !92, type: !9) +// CHECK:STDOUT: !94 = !DILocation(line: 19, column: 18, scope: !92) +// CHECK:STDOUT: !95 = !{!93} +// CHECK:STDOUT: !98 = distinct !DISubprogram(name: "NewCursor", linkageName: "_CNewCursor.IntRange.9452f4c51951679b.Core:Iterate.Core.be1e879c1ad406d8", scope: null, file: !31, line: 19, type: !22, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !105) +// CHECK:STDOUT: !99 = !DILocalVariable(arg: 1, scope: !98, type: !9) +// CHECK:STDOUT: !103 = !DILocation(line: 19, column: 43, scope: !98) +// CHECK:STDOUT: !104 = !DILocation(line: 19, column: 36, scope: !98) +// CHECK:STDOUT: !105 = !{!99} +// CHECK:STDOUT: !106 = distinct !DISubprogram(name: "Next", linkageName: "_CNext.IntRange.9452f4c51951679b.Core:Iterate.Core.be1e879c1ad406d8", scope: null, file: !31, line: 20, type: !24, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !130) +// CHECK:STDOUT: !107 = !DILocalVariable(arg: 1, scope: !106, type: !9) +// CHECK:STDOUT: !108 = !DILocalVariable(arg: 2, scope: !106, type: !9) +// CHECK:STDOUT: !113 = !DILocation(line: 21, column: 7, scope: !106) +// CHECK:STDOUT: !115 = !DILocation(line: 21, column: 27, scope: !106) +// CHECK:STDOUT: !117 = !DILocation(line: 22, column: 11, scope: !106) +// CHECK:STDOUT: !118 = !DILocation(line: 22, column: 19, scope: !106) +// CHECK:STDOUT: !119 = !DILocation(line: 22, column: 10, scope: !106) +// CHECK:STDOUT: !122 = !DILocation(line: 23, column: 9, scope: !106) +// CHECK:STDOUT: !123 = !DILocation(line: 24, column: 38, scope: !106) +// CHECK:STDOUT: !124 = !DILocation(line: 24, column: 16, scope: !106) +// CHECK:STDOUT: !125 = !DILocation(line: 24, column: 9, scope: !106) +// CHECK:STDOUT: !126 = !DILocation(line: 26, column: 16, scope: !106) +// CHECK:STDOUT: !127 = !{!9} +// CHECK:STDOUT: !128 = !DISubroutineType(types: !127) +// CHECK:STDOUT: !129 = !DILocation(line: 26, column: 9, scope: !106) +// CHECK:STDOUT: !130 = !{!107, !108} +// CHECK:STDOUT: !131 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") +// CHECK:STDOUT: !132 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.fc4496a6c25d418b", scope: null, file: !131, line: 36, type: !26, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !140) +// CHECK:STDOUT: !133 = !DILocalVariable(arg: 1, scope: !132, type: !9) +// CHECK:STDOUT: !138 = !DILocation(line: 37, column: 12, scope: !132) +// CHECK:STDOUT: !139 = !DILocation(line: 37, column: 5, scope: !132) +// CHECK:STDOUT: !140 = !{!133} +// CHECK:STDOUT: !141 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.fc4496a6c25d418b", scope: null, file: !131, line: 39, type: !22, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !149) +// CHECK:STDOUT: !142 = !DILocalVariable(arg: 1, scope: !141, type: !9) +// CHECK:STDOUT: !147 = !DILocation(line: 40, column: 12, scope: !141) +// CHECK:STDOUT: !148 = !DILocation(line: 40, column: 5, scope: !141) +// CHECK:STDOUT: !149 = !{!142} +// CHECK:STDOUT: !150 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "") +// CHECK:STDOUT: !151 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !150, line: 396, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !158) +// CHECK:STDOUT: !152 = !DILocalVariable(arg: 1, scope: !151, type: !6) +// CHECK:STDOUT: !154 = !DILocation(line: 398, column: 5, scope: !151) +// CHECK:STDOUT: !155 = !{null, !6, !6} +// CHECK:STDOUT: !156 = !DISubroutineType(types: !155) +// CHECK:STDOUT: !157 = !DILocation(line: 396, column: 3, scope: !151) +// CHECK:STDOUT: !158 = !{!152} +// CHECK:STDOUT: !159 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.fc4496a6c25d418b", scope: null, file: !131, line: 33, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !166) +// CHECK:STDOUT: !160 = !DILocalVariable(arg: 1, scope: !159, type: !6) +// CHECK:STDOUT: !164 = !DILocation(line: 34, column: 12, scope: !159) +// CHECK:STDOUT: !165 = !DILocation(line: 34, column: 5, scope: !159) +// CHECK:STDOUT: !166 = !{!160} +// CHECK:STDOUT: !167 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.fc4496a6c25d418b", scope: null, file: !131, line: 30, type: !128, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !170 = !DILocation(line: 31, column: 12, scope: !167) +// CHECK:STDOUT: !171 = !DILocation(line: 31, column: 5, scope: !167) +// CHECK:STDOUT: !172 = distinct !DISubprogram(name: "Has", linkageName: "_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f", scope: null, file: !131, line: 141, type: !26, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !179) +// CHECK:STDOUT: !173 = !DILocalVariable(arg: 1, scope: !172, type: !9) +// CHECK:STDOUT: !177 = !DILocation(line: 142, column: 12, scope: !172) +// CHECK:STDOUT: !178 = !DILocation(line: 142, column: 5, scope: !172) +// CHECK:STDOUT: !179 = !{!173} +// CHECK:STDOUT: !180 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f", scope: null, file: !131, line: 144, type: !22, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !187) +// CHECK:STDOUT: !181 = !DILocalVariable(arg: 1, scope: !180, type: !9) +// CHECK:STDOUT: !185 = !DILocation(line: 145, column: 12, scope: !180) +// CHECK:STDOUT: !186 = !DILocation(line: 145, column: 5, scope: !180) +// CHECK:STDOUT: !187 = !{!181} +// CHECK:STDOUT: !188 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895", scope: null, file: !150, line: 331, type: !156, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !195) +// CHECK:STDOUT: !189 = !DILocalVariable(arg: 1, scope: !188, type: !6) +// CHECK:STDOUT: !190 = !DILocalVariable(arg: 2, scope: !188, type: !6) +// CHECK:STDOUT: !191 = !DILocation(line: 0, scope: !188) +// CHECK:STDOUT: !192 = !DILocation(line: 331, column: 3, scope: !188) +// CHECK:STDOUT: !193 = !{!6, !6} +// CHECK:STDOUT: !194 = !DISubroutineType(types: !193) +// CHECK:STDOUT: !195 = !{!189, !190} +// CHECK:STDOUT: !196 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f", scope: null, file: !131, line: 131, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !209) +// CHECK:STDOUT: !197 = !DILocalVariable(arg: 1, scope: !196, type: !6) +// CHECK:STDOUT: !205 = !DILocation(line: 137, column: 5, scope: !196) +// CHECK:STDOUT: !207 = !DILocation(line: 138, column: 5, scope: !196) +// CHECK:STDOUT: !208 = !DILocation(line: 139, column: 5, scope: !196) +// CHECK:STDOUT: !209 = !{!197} +// CHECK:STDOUT: !210 = distinct !DISubprogram(name: "None", linkageName: "_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.4d9f279dbc2b9f6f", scope: null, file: !131, line: 125, type: !128, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !217 = !DILocation(line: 128, column: 5, scope: !210) +// CHECK:STDOUT: !218 = !DILocation(line: 129, column: 5, scope: !210) +// CHECK:STDOUT: !219 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044", scope: null, file: !150, line: 64, type: !194, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !227) +// CHECK:STDOUT: !220 = !DILocalVariable(arg: 1, scope: !219, type: !6) +// CHECK:STDOUT: !224 = !DILocation(line: 66, column: 17, scope: !219) +// CHECK:STDOUT: !226 = !DILocation(line: 66, column: 5, scope: !219) +// CHECK:STDOUT: !227 = !{!220} +// CHECK:STDOUT: !228 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !150, line: 59, type: !194, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !235) +// CHECK:STDOUT: !229 = !DILocalVariable(arg: 1, scope: !228, type: !6) +// CHECK:STDOUT: !234 = !DILocation(line: 59, column: 28, scope: !228) +// CHECK:STDOUT: !235 = !{!229} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/function/call/empty_struct.carbon b/toolchain/lower/testdata/function/call/empty_struct.carbon index c86e3ed39622..9cc81b287f34 100644 --- a/toolchain/lower/testdata/function/call/empty_struct.carbon +++ b/toolchain/lower/testdata/function/call/empty_struct.carbon @@ -23,18 +23,25 @@ fn Main() { // CHECK:STDOUT: source_filename = "empty_struct.carbon" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CEcho.Main() #0 !dbg !18 { +// CHECK:STDOUT: define void @_CEcho.Main() #0 !dbg !21 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !22 +// CHECK:STDOUT: ret void, !dbg !25 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CMain.Main() #0 !dbg !23 { +// CHECK:STDOUT: define void @_CMain.Main() #0 !dbg !26 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca {}, align 1, !dbg !24 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !24 -// CHECK:STDOUT: call void @_CEcho.Main(), !dbg !25 -// CHECK:STDOUT: ret void, !dbg !27 +// CHECK:STDOUT: %_.var = alloca {}, align 1, !dbg !27 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !27 +// CHECK:STDOUT: call void @_CEcho.Main(), !dbg !28 +// CHECK:STDOUT: call void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %_.var), !dbg !27 +// CHECK:STDOUT: ret void, !dbg !30 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %self) #0 !dbg !31 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !33 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -52,10 +59,17 @@ fn Main() { // CHECK:STDOUT: !15 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !14, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) // CHECK:STDOUT: !16 = !{null} // CHECK:STDOUT: !17 = !DISubroutineType(types: !16) -// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "Echo", linkageName: "_CEcho.Main", scope: null, file: !14, line: 13, type: !17, spFlags: DISPFlagDefinition, unit: !15) -// CHECK:STDOUT: !22 = !DILocation(line: 14, column: 3, scope: !18) -// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "Main", linkageName: "_CMain.Main", scope: null, file: !14, line: 17, type: !17, spFlags: DISPFlagDefinition, unit: !15) -// CHECK:STDOUT: !24 = !DILocation(line: 18, column: 3, scope: !23) -// CHECK:STDOUT: !25 = !DILocation(line: 18, column: 15, scope: !23) -// CHECK:STDOUT: !27 = !DILocation(line: 17, column: 1, scope: !23) +// CHECK:STDOUT: !18 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !19 = !{null, !18} +// CHECK:STDOUT: !20 = !DISubroutineType(types: !19) +// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "Echo", linkageName: "_CEcho.Main", scope: null, file: !14, line: 13, type: !17, spFlags: DISPFlagDefinition, unit: !15) +// CHECK:STDOUT: !25 = !DILocation(line: 14, column: 3, scope: !21) +// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "Main", linkageName: "_CMain.Main", scope: null, file: !14, line: 17, type: !17, spFlags: DISPFlagDefinition, unit: !15) +// CHECK:STDOUT: !27 = !DILocation(line: 18, column: 3, scope: !26) +// CHECK:STDOUT: !28 = !DILocation(line: 18, column: 15, scope: !26) +// CHECK:STDOUT: !30 = !DILocation(line: 17, column: 1, scope: !26) +// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !14, line: 18, type: !20, spFlags: DISPFlagDefinition, unit: !15, retainedNodes: !34) +// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !31, type: !18) +// CHECK:STDOUT: !33 = !DILocation(line: 18, column: 3, scope: !31) +// CHECK:STDOUT: !34 = !{!32} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/function/call/empty_tuple.carbon b/toolchain/lower/testdata/function/call/empty_tuple.carbon index 112c272673ad..0c58c31a5643 100644 --- a/toolchain/lower/testdata/function/call/empty_tuple.carbon +++ b/toolchain/lower/testdata/function/call/empty_tuple.carbon @@ -23,18 +23,25 @@ fn Main() { // CHECK:STDOUT: source_filename = "empty_tuple.carbon" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CEcho.Main() #0 !dbg !18 { +// CHECK:STDOUT: define void @_CEcho.Main() #0 !dbg !21 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !23 +// CHECK:STDOUT: ret void, !dbg !26 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CMain.Main() #0 !dbg !24 { +// CHECK:STDOUT: define void @_CMain.Main() #0 !dbg !27 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca {}, align 1, !dbg !25 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !25 -// CHECK:STDOUT: call void @_CEcho.Main(), !dbg !26 -// CHECK:STDOUT: ret void, !dbg !28 +// CHECK:STDOUT: %_.var = alloca {}, align 1, !dbg !28 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !28 +// CHECK:STDOUT: call void @_CEcho.Main(), !dbg !29 +// CHECK:STDOUT: call void @"_CSelfDestruct.61ea2aba74ab3bf1:core.Destroy.Core"(ptr %_.var), !dbg !28 +// CHECK:STDOUT: ret void, !dbg !31 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.61ea2aba74ab3bf1:core.Destroy.Core"(ptr %self) #0 !dbg !32 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !34 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -52,10 +59,17 @@ fn Main() { // CHECK:STDOUT: !15 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !14, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) // CHECK:STDOUT: !16 = !{null} // CHECK:STDOUT: !17 = !DISubroutineType(types: !16) -// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "Echo", linkageName: "_CEcho.Main", scope: null, file: !14, line: 13, type: !17, spFlags: DISPFlagDefinition, unit: !15) -// CHECK:STDOUT: !23 = !DILocation(line: 14, column: 3, scope: !18) -// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "Main", linkageName: "_CMain.Main", scope: null, file: !14, line: 17, type: !17, spFlags: DISPFlagDefinition, unit: !15) -// CHECK:STDOUT: !25 = !DILocation(line: 18, column: 3, scope: !24) -// CHECK:STDOUT: !26 = !DILocation(line: 18, column: 15, scope: !24) -// CHECK:STDOUT: !28 = !DILocation(line: 17, column: 1, scope: !24) +// CHECK:STDOUT: !18 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !19 = !{null, !18} +// CHECK:STDOUT: !20 = !DISubroutineType(types: !19) +// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "Echo", linkageName: "_CEcho.Main", scope: null, file: !14, line: 13, type: !17, spFlags: DISPFlagDefinition, unit: !15) +// CHECK:STDOUT: !26 = !DILocation(line: 14, column: 3, scope: !21) +// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "Main", linkageName: "_CMain.Main", scope: null, file: !14, line: 17, type: !17, spFlags: DISPFlagDefinition, unit: !15) +// CHECK:STDOUT: !28 = !DILocation(line: 18, column: 3, scope: !27) +// CHECK:STDOUT: !29 = !DILocation(line: 18, column: 15, scope: !27) +// CHECK:STDOUT: !31 = !DILocation(line: 17, column: 1, scope: !27) +// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.61ea2aba74ab3bf1:core.Destroy.Core", scope: null, file: !14, line: 18, type: !20, spFlags: DISPFlagDefinition, unit: !15, retainedNodes: !35) +// CHECK:STDOUT: !33 = !DILocalVariable(arg: 1, scope: !32, type: !18) +// CHECK:STDOUT: !34 = !DILocation(line: 18, column: 3, scope: !32) +// CHECK:STDOUT: !35 = !{!33} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/function/call/form.carbon b/toolchain/lower/testdata/function/call/form.carbon index 96d7c9ebbd82..369fd4d77b2d 100644 --- a/toolchain/lower/testdata/function/call/form.carbon +++ b/toolchain/lower/testdata/function/call/form.carbon @@ -78,16 +78,29 @@ fn G() { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %y.var), !dbg !26 // CHECK:STDOUT: store i32 0, ptr %y.var, align 4, !dbg !26 // CHECK:STDOUT: call void @_CF.Main(ptr %y.var), !dbg !30 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %y.var), !dbg !26 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %y.var), !dbg !26 // CHECK:STDOUT: ret void, !dbg !31 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !32 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !32 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !34 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !36 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !38 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !40 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !42 +// CHECK:STDOUT: ret void, !dbg !42 +// 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: @@ -110,10 +123,18 @@ fn G() { // CHECK:STDOUT: !26 = !DILocation(line: 6, column: 3, scope: !25) // CHECK:STDOUT: !30 = !DILocation(line: 7, column: 3, scope: !25) // CHECK:STDOUT: !31 = !DILocation(line: 5, column: 1, scope: !25) -// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 6, type: !22, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !35) +// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !18, line: 6, type: !22, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !35) // CHECK:STDOUT: !33 = !DILocalVariable(arg: 1, scope: !32, type: !20) // CHECK:STDOUT: !34 = !DILocation(line: 6, column: 3, scope: !32) // CHECK:STDOUT: !35 = !{!33} +// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 6, type: !22, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !39) +// CHECK:STDOUT: !37 = !DILocalVariable(arg: 1, scope: !36, type: !20) +// CHECK:STDOUT: !38 = !DILocation(line: 6, column: 3, scope: !36) +// CHECK:STDOUT: !39 = !{!37} +// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 6, type: !22, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !43) +// CHECK:STDOUT: !41 = !DILocalVariable(arg: 1, scope: !40, type: !20) +// CHECK:STDOUT: !42 = !DILocation(line: 6, column: 3, scope: !40) +// CHECK:STDOUT: !43 = !{!41} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'var_form_param.carbon' @@ -122,20 +143,33 @@ fn G() { // CHECK:STDOUT: declare void @_CF.Main(ptr) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CG.Main() #0 !dbg !38 { +// CHECK:STDOUT: define void @_CG.Main() #0 !dbg !46 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %x.var = alloca i32, align 4, !dbg !39 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %x.var), !dbg !39 -// CHECK:STDOUT: store i32 0, ptr %x.var, align 4, !dbg !39 -// CHECK:STDOUT: call void @_CF.Main(ptr %x.var), !dbg !40 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %x.var), !dbg !39 -// CHECK:STDOUT: ret void, !dbg !41 +// CHECK:STDOUT: %x.var = alloca i32, align 4, !dbg !47 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %x.var), !dbg !47 +// CHECK:STDOUT: store i32 0, ptr %x.var, align 4, !dbg !47 +// CHECK:STDOUT: call void @_CF.Main(ptr %x.var), !dbg !48 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %x.var), !dbg !47 +// CHECK:STDOUT: ret void, !dbg !49 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !42 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !50 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !44 +// CHECK:STDOUT: ret void, !dbg !52 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !54 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !56 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !58 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !60 +// CHECK:STDOUT: ret void, !dbg !60 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -144,7 +178,7 @@ fn G() { // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!37} +// CHECK:STDOUT: !llvm.dbg.cu = !{!45} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} @@ -154,16 +188,24 @@ fn G() { // CHECK:STDOUT: !22 = !DISubroutineType(types: !21) // CHECK:STDOUT: !23 = !{null} // CHECK:STDOUT: !24 = !DISubroutineType(types: !23) -// CHECK:STDOUT: !36 = !DIFile(filename: "var_form_param.carbon", directory: "") -// CHECK:STDOUT: !37 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !36, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !36, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !37) -// CHECK:STDOUT: !39 = !DILocation(line: 3, column: 6, scope: !38) -// CHECK:STDOUT: !40 = !DILocation(line: 6, column: 3, scope: !38) -// CHECK:STDOUT: !41 = !DILocation(line: 5, column: 1, scope: !38) -// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !36, line: 3, type: !22, spFlags: DISPFlagDefinition, unit: !37, retainedNodes: !45) -// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !42, type: !20) -// CHECK:STDOUT: !44 = !DILocation(line: 3, column: 6, scope: !42) -// CHECK:STDOUT: !45 = !{!43} +// CHECK:STDOUT: !44 = !DIFile(filename: "var_form_param.carbon", directory: "") +// CHECK:STDOUT: !45 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !44, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !46 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !44, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !45) +// CHECK:STDOUT: !47 = !DILocation(line: 3, column: 6, scope: !46) +// CHECK:STDOUT: !48 = !DILocation(line: 6, column: 3, scope: !46) +// CHECK:STDOUT: !49 = !DILocation(line: 5, column: 1, scope: !46) +// CHECK:STDOUT: !50 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !44, line: 3, type: !22, spFlags: DISPFlagDefinition, unit: !45, retainedNodes: !53) +// CHECK:STDOUT: !51 = !DILocalVariable(arg: 1, scope: !50, type: !20) +// CHECK:STDOUT: !52 = !DILocation(line: 3, column: 6, scope: !50) +// CHECK:STDOUT: !53 = !{!51} +// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !44, line: 3, type: !22, spFlags: DISPFlagDefinition, unit: !45, retainedNodes: !57) +// CHECK:STDOUT: !55 = !DILocalVariable(arg: 1, scope: !54, type: !20) +// CHECK:STDOUT: !56 = !DILocation(line: 3, column: 6, scope: !54) +// CHECK:STDOUT: !57 = !{!55} +// CHECK:STDOUT: !58 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !44, line: 3, type: !22, spFlags: DISPFlagDefinition, unit: !45, retainedNodes: !61) +// CHECK:STDOUT: !59 = !DILocalVariable(arg: 1, scope: !58, type: !20) +// CHECK:STDOUT: !60 = !DILocation(line: 3, column: 6, scope: !58) +// CHECK:STDOUT: !61 = !{!59} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'val_form_param.carbon' @@ -172,26 +214,26 @@ fn G() { // CHECK:STDOUT: declare void @_CF.Main(i32) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CG.Main() #0 !dbg !48 { +// CHECK:STDOUT: define void @_CG.Main() #0 !dbg !64 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CF.Main(i32 0), !dbg !49 -// CHECK:STDOUT: ret void, !dbg !50 +// CHECK:STDOUT: call void @_CF.Main(i32 0), !dbg !65 +// CHECK:STDOUT: ret void, !dbg !66 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!47} +// CHECK:STDOUT: !llvm.dbg.cu = !{!63} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !23 = !{null} // CHECK:STDOUT: !24 = !DISubroutineType(types: !23) -// CHECK:STDOUT: !46 = !DIFile(filename: "val_form_param.carbon", directory: "") -// CHECK:STDOUT: !47 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !46, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !46, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !47) -// CHECK:STDOUT: !49 = !DILocation(line: 6, column: 3, scope: !48) -// CHECK:STDOUT: !50 = !DILocation(line: 5, column: 1, scope: !48) +// CHECK:STDOUT: !62 = !DIFile(filename: "val_form_param.carbon", directory: "") +// CHECK:STDOUT: !63 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !62, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !64 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !62, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !63) +// CHECK:STDOUT: !65 = !DILocation(line: 6, column: 3, scope: !64) +// CHECK:STDOUT: !66 = !DILocation(line: 5, column: 1, scope: !64) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'ref_return_form.carbon' @@ -200,26 +242,26 @@ fn G() { // CHECK:STDOUT: declare ptr @_CF.Main() // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CG.Main() #0 !dbg !56 { +// CHECK:STDOUT: define void @_CG.Main() #0 !dbg !72 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %F.call = call ptr @_CF.Main(), !dbg !57 -// CHECK:STDOUT: ret void, !dbg !60 +// CHECK:STDOUT: %F.call = call ptr @_CF.Main(), !dbg !73 +// CHECK:STDOUT: ret void, !dbg !76 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!52} +// CHECK:STDOUT: !llvm.dbg.cu = !{!68} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !23 = !{null} // CHECK:STDOUT: !24 = !DISubroutineType(types: !23) -// CHECK:STDOUT: !51 = !DIFile(filename: "ref_return_form.carbon", directory: "") -// CHECK:STDOUT: !52 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !51, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !56 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !51, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !52) -// CHECK:STDOUT: !57 = !DILocation(line: 6, column: 27, scope: !56) -// CHECK:STDOUT: !60 = !DILocation(line: 5, column: 1, scope: !56) +// CHECK:STDOUT: !67 = !DIFile(filename: "ref_return_form.carbon", directory: "") +// CHECK:STDOUT: !68 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !67, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !72 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !67, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !68) +// CHECK:STDOUT: !73 = !DILocation(line: 6, column: 27, scope: !72) +// CHECK:STDOUT: !76 = !DILocation(line: 5, column: 1, scope: !72) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'var_return_form.carbon' @@ -228,20 +270,33 @@ fn G() { // CHECK:STDOUT: declare i32 @_CF.Main() // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CG.Main() #0 !dbg !65 { +// CHECK:STDOUT: define void @_CG.Main() #0 !dbg !81 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %x.var = alloca i32, align 4, !dbg !66 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %x.var), !dbg !66 -// CHECK:STDOUT: %F.call = call i32 @_CF.Main(), !dbg !67 -// CHECK:STDOUT: store i32 %F.call, ptr %x.var, align 4, !dbg !66 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %x.var), !dbg !66 -// CHECK:STDOUT: ret void, !dbg !70 +// CHECK:STDOUT: %x.var = alloca i32, align 4, !dbg !82 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %x.var), !dbg !82 +// CHECK:STDOUT: %F.call = call i32 @_CF.Main(), !dbg !83 +// CHECK:STDOUT: store i32 %F.call, ptr %x.var, align 4, !dbg !82 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %x.var), !dbg !82 +// CHECK:STDOUT: ret void, !dbg !86 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !71 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !87 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !73 +// CHECK:STDOUT: ret void, !dbg !89 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !91 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !93 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !95 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !97 +// CHECK:STDOUT: ret void, !dbg !97 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -250,7 +305,7 @@ fn G() { // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!62} +// CHECK:STDOUT: !llvm.dbg.cu = !{!78} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} @@ -260,16 +315,24 @@ fn G() { // CHECK:STDOUT: !22 = !DISubroutineType(types: !21) // CHECK:STDOUT: !23 = !{null} // CHECK:STDOUT: !24 = !DISubroutineType(types: !23) -// CHECK:STDOUT: !61 = !DIFile(filename: "var_return_form.carbon", directory: "") -// CHECK:STDOUT: !62 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !61, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !65 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !61, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !62) -// CHECK:STDOUT: !66 = !DILocation(line: 6, column: 14, scope: !65) -// CHECK:STDOUT: !67 = !DILocation(line: 6, column: 27, scope: !65) -// CHECK:STDOUT: !70 = !DILocation(line: 5, column: 1, scope: !65) -// CHECK:STDOUT: !71 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !61, line: 6, type: !22, spFlags: DISPFlagDefinition, unit: !62, retainedNodes: !74) -// CHECK:STDOUT: !72 = !DILocalVariable(arg: 1, scope: !71, type: !20) -// CHECK:STDOUT: !73 = !DILocation(line: 6, column: 14, scope: !71) -// CHECK:STDOUT: !74 = !{!72} +// CHECK:STDOUT: !77 = !DIFile(filename: "var_return_form.carbon", directory: "") +// CHECK:STDOUT: !78 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !77, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !81 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !77, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !78) +// CHECK:STDOUT: !82 = !DILocation(line: 6, column: 14, scope: !81) +// CHECK:STDOUT: !83 = !DILocation(line: 6, column: 27, scope: !81) +// CHECK:STDOUT: !86 = !DILocation(line: 5, column: 1, scope: !81) +// CHECK:STDOUT: !87 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !77, line: 6, type: !22, spFlags: DISPFlagDefinition, unit: !78, retainedNodes: !90) +// CHECK:STDOUT: !88 = !DILocalVariable(arg: 1, scope: !87, type: !20) +// CHECK:STDOUT: !89 = !DILocation(line: 6, column: 14, scope: !87) +// CHECK:STDOUT: !90 = !{!88} +// CHECK:STDOUT: !91 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !77, line: 6, type: !22, spFlags: DISPFlagDefinition, unit: !78, retainedNodes: !94) +// CHECK:STDOUT: !92 = !DILocalVariable(arg: 1, scope: !91, type: !20) +// CHECK:STDOUT: !93 = !DILocation(line: 6, column: 14, scope: !91) +// CHECK:STDOUT: !94 = !{!92} +// CHECK:STDOUT: !95 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !77, line: 6, type: !22, spFlags: DISPFlagDefinition, unit: !78, retainedNodes: !98) +// CHECK:STDOUT: !96 = !DILocalVariable(arg: 1, scope: !95, type: !20) +// CHECK:STDOUT: !97 = !DILocation(line: 6, column: 14, scope: !95) +// CHECK:STDOUT: !98 = !{!96} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'val_return_form.carbon' @@ -278,24 +341,24 @@ fn G() { // CHECK:STDOUT: declare i32 @_CF.Main() // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CG.Main() #0 !dbg !77 { +// CHECK:STDOUT: define void @_CG.Main() #0 !dbg !101 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %F.call = call i32 @_CF.Main(), !dbg !78 -// CHECK:STDOUT: ret void, !dbg !81 +// CHECK:STDOUT: %F.call = call i32 @_CF.Main(), !dbg !102 +// CHECK:STDOUT: ret void, !dbg !105 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!76} +// CHECK:STDOUT: !llvm.dbg.cu = !{!100} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !23 = !{null} // CHECK:STDOUT: !24 = !DISubroutineType(types: !23) -// CHECK:STDOUT: !75 = !DIFile(filename: "val_return_form.carbon", directory: "") -// CHECK:STDOUT: !76 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !75, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !77 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !75, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !76) -// CHECK:STDOUT: !78 = !DILocation(line: 6, column: 23, scope: !77) -// CHECK:STDOUT: !81 = !DILocation(line: 5, column: 1, scope: !77) +// CHECK:STDOUT: !99 = !DIFile(filename: "val_return_form.carbon", directory: "") +// CHECK:STDOUT: !100 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !99, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !101 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !99, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !100) +// CHECK:STDOUT: !102 = !DILocation(line: 6, column: 23, scope: !101) +// CHECK:STDOUT: !105 = !DILocation(line: 5, column: 1, scope: !101) // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/function/call/i32.carbon b/toolchain/lower/testdata/function/call/i32.carbon index 39c3951f998a..3479d07e4ccb 100644 --- a/toolchain/lower/testdata/function/call/i32.carbon +++ b/toolchain/lower/testdata/function/call/i32.carbon @@ -35,16 +35,29 @@ fn Main() { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !36 // CHECK:STDOUT: %Echo.call = call i32 @_CEcho.Main(i32 1), !dbg !37 // CHECK:STDOUT: store i32 %Echo.call, ptr %_.var, align 4, !dbg !36 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %_.var), !dbg !36 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %_.var), !dbg !36 // CHECK:STDOUT: ret void, !dbg !39 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !40 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !40 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !42 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !44 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !46 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !48 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !50 +// CHECK:STDOUT: ret void, !dbg !50 +// 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: @@ -73,8 +86,16 @@ fn Main() { // CHECK:STDOUT: !36 = !DILocation(line: 18, column: 3, scope: !35) // CHECK:STDOUT: !37 = !DILocation(line: 18, column: 16, scope: !35) // CHECK:STDOUT: !39 = !DILocation(line: 17, column: 1, scope: !35) -// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 18, type: !26, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !43) +// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !18, line: 18, type: !26, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !43) // CHECK:STDOUT: !41 = !DILocalVariable(arg: 1, scope: !40, type: !20) // CHECK:STDOUT: !42 = !DILocation(line: 18, column: 3, scope: !40) // CHECK:STDOUT: !43 = !{!41} +// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 18, type: !26, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !47) +// CHECK:STDOUT: !45 = !DILocalVariable(arg: 1, scope: !44, type: !20) +// CHECK:STDOUT: !46 = !DILocation(line: 18, column: 3, scope: !44) +// CHECK:STDOUT: !47 = !{!45} +// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 18, type: !26, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !51) +// CHECK:STDOUT: !49 = !DILocalVariable(arg: 1, scope: !48, type: !20) +// CHECK:STDOUT: !50 = !DILocation(line: 18, column: 3, scope: !48) +// CHECK:STDOUT: !51 = !{!49} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/function/call/implicit_empty_tuple_as_arg.carbon b/toolchain/lower/testdata/function/call/implicit_empty_tuple_as_arg.carbon index 42f3308b4539..5c98e8c8af93 100644 --- a/toolchain/lower/testdata/function/call/implicit_empty_tuple_as_arg.carbon +++ b/toolchain/lower/testdata/function/call/implicit_empty_tuple_as_arg.carbon @@ -24,33 +24,42 @@ fn Main() { // CHECK:STDOUT: source_filename = "implicit_empty_tuple_as_arg.carbon" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CFoo.Main() #0 !dbg !18 { +// CHECK:STDOUT: define void @_CFoo.Main() #0 !dbg !21 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !19 +// CHECK:STDOUT: ret void, !dbg !22 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CBar.Main() #0 !dbg !20 { +// CHECK:STDOUT: define void @_CBar.Main() #0 !dbg !23 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !25 +// CHECK:STDOUT: ret void, !dbg !28 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CMain.Main() #0 !dbg !26 { +// CHECK:STDOUT: define void @_CMain.Main() #0 !dbg !29 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca {}, align 1, !dbg !27 -// CHECK:STDOUT: %.loc19_23.1.temp = alloca {}, align 1, !dbg !28 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !27 -// CHECK:STDOUT: call void @_CFoo.Main(), !dbg !28 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc19_23.1.temp), !dbg !28 -// CHECK:STDOUT: call void @_CBar.Main(), !dbg !29 -// CHECK:STDOUT: ret void, !dbg !31 +// CHECK:STDOUT: %_.var = alloca {}, align 1, !dbg !30 +// CHECK:STDOUT: %.loc19_23.1.temp = alloca {}, align 1, !dbg !31 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !30 +// CHECK:STDOUT: call void @_CFoo.Main(), !dbg !31 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc19_23.1.temp), !dbg !31 +// CHECK:STDOUT: call void @_CBar.Main(), !dbg !32 +// CHECK:STDOUT: call void @"_CSelfDestruct.61ea2aba74ab3bf1:core.Destroy.Core"(ptr %.loc19_23.1.temp), !dbg !31 +// CHECK:STDOUT: call void @"_CSelfDestruct.61ea2aba74ab3bf1:core.Destroy.Core"(ptr %_.var), !dbg !30 +// CHECK:STDOUT: ret void, !dbg !34 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.61ea2aba74ab3bf1:core.Destroy.Core"(ptr %self) #0 !dbg !35 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !37 // 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: ; uselistorder directives +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.61ea2aba74ab3bf1:core.Destroy.Core", { 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -65,13 +74,20 @@ fn Main() { // CHECK:STDOUT: !15 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !14, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) // CHECK:STDOUT: !16 = !{null} // CHECK:STDOUT: !17 = !DISubroutineType(types: !16) -// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "Foo", linkageName: "_CFoo.Main", scope: null, file: !14, line: 14, type: !17, spFlags: DISPFlagDefinition, unit: !15) -// CHECK:STDOUT: !19 = !DILocation(line: 14, column: 1, scope: !18) -// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "Bar", linkageName: "_CBar.Main", scope: null, file: !14, line: 16, type: !17, spFlags: DISPFlagDefinition, unit: !15) -// CHECK:STDOUT: !25 = !DILocation(line: 16, column: 23, scope: !20) -// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "Main", linkageName: "_CMain.Main", scope: null, file: !14, line: 18, type: !17, spFlags: DISPFlagDefinition, unit: !15) -// CHECK:STDOUT: !27 = !DILocation(line: 19, column: 3, scope: !26) -// CHECK:STDOUT: !28 = !DILocation(line: 19, column: 19, scope: !26) -// CHECK:STDOUT: !29 = !DILocation(line: 19, column: 15, scope: !26) -// CHECK:STDOUT: !31 = !DILocation(line: 18, column: 1, scope: !26) +// CHECK:STDOUT: !18 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !19 = !{null, !18} +// CHECK:STDOUT: !20 = !DISubroutineType(types: !19) +// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "Foo", linkageName: "_CFoo.Main", scope: null, file: !14, line: 14, type: !17, spFlags: DISPFlagDefinition, unit: !15) +// CHECK:STDOUT: !22 = !DILocation(line: 14, column: 1, scope: !21) +// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "Bar", linkageName: "_CBar.Main", scope: null, file: !14, line: 16, type: !17, spFlags: DISPFlagDefinition, unit: !15) +// CHECK:STDOUT: !28 = !DILocation(line: 16, column: 23, scope: !23) +// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "Main", linkageName: "_CMain.Main", scope: null, file: !14, line: 18, type: !17, spFlags: DISPFlagDefinition, unit: !15) +// CHECK:STDOUT: !30 = !DILocation(line: 19, column: 3, scope: !29) +// CHECK:STDOUT: !31 = !DILocation(line: 19, column: 19, scope: !29) +// CHECK:STDOUT: !32 = !DILocation(line: 19, column: 15, scope: !29) +// CHECK:STDOUT: !34 = !DILocation(line: 18, column: 1, scope: !29) +// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.61ea2aba74ab3bf1:core.Destroy.Core", scope: null, file: !14, line: 19, type: !20, spFlags: DISPFlagDefinition, unit: !15, retainedNodes: !38) +// CHECK:STDOUT: !36 = !DILocalVariable(arg: 1, scope: !35, type: !18) +// CHECK:STDOUT: !37 = !DILocation(line: 19, column: 19, scope: !35) +// CHECK:STDOUT: !38 = !{!36} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/function/call/ref_param.carbon b/toolchain/lower/testdata/function/call/ref_param.carbon index c09c7a41ab17..9ee2609ba54f 100644 --- a/toolchain/lower/testdata/function/call/ref_param.carbon +++ b/toolchain/lower/testdata/function/call/ref_param.carbon @@ -34,16 +34,29 @@ fn Main() { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !31 // CHECK:STDOUT: store i32 0, ptr %a.var, align 4, !dbg !31 // CHECK:STDOUT: call void @_CDoNothing.Main(ptr %a.var), !dbg !35 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %a.var), !dbg !31 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %a.var), !dbg !31 // CHECK:STDOUT: ret void, !dbg !36 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !37 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !37 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !39 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !41 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !43 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !45 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !47 +// CHECK:STDOUT: ret void, !dbg !47 +// 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: @@ -70,8 +83,16 @@ fn Main() { // CHECK:STDOUT: !31 = !DILocation(line: 16, column: 3, scope: !30) // CHECK:STDOUT: !35 = !DILocation(line: 17, column: 3, scope: !30) // CHECK:STDOUT: !36 = !DILocation(line: 15, column: 1, scope: !30) -// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 16, type: !22, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !40) +// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !18, line: 16, type: !22, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !40) // CHECK:STDOUT: !38 = !DILocalVariable(arg: 1, scope: !37, type: !20) // CHECK:STDOUT: !39 = !DILocation(line: 16, column: 3, scope: !37) // CHECK:STDOUT: !40 = !{!38} +// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 16, type: !22, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !44) +// CHECK:STDOUT: !42 = !DILocalVariable(arg: 1, scope: !41, type: !20) +// CHECK:STDOUT: !43 = !DILocation(line: 16, column: 3, scope: !41) +// CHECK:STDOUT: !44 = !{!42} +// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 16, type: !22, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !48) +// CHECK:STDOUT: !46 = !DILocalVariable(arg: 1, scope: !45, type: !20) +// CHECK:STDOUT: !47 = !DILocation(line: 16, column: 3, scope: !45) +// CHECK:STDOUT: !48 = !{!46} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/function/call/ref_return.carbon b/toolchain/lower/testdata/function/call/ref_return.carbon index a9102d18f667..92a132b78e13 100644 --- a/toolchain/lower/testdata/function/call/ref_return.carbon +++ b/toolchain/lower/testdata/function/call/ref_return.carbon @@ -37,16 +37,29 @@ fn Main() { // CHECK:STDOUT: store i32 0, ptr %a.var, align 4, !dbg !37 // CHECK:STDOUT: %Echo.call = call ptr @_CEcho.Main(ptr %a.var), !dbg !41 // CHECK:STDOUT: store i32 1, ptr %Echo.call, align 4, !dbg !41 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %a.var), !dbg !37 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %a.var), !dbg !37 // CHECK:STDOUT: ret void, !dbg !42 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !43 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !43 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !45 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !47 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !49 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !51 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !53 +// CHECK:STDOUT: ret void, !dbg !53 +// 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: @@ -76,8 +89,16 @@ fn Main() { // CHECK:STDOUT: !37 = !DILocation(line: 18, column: 3, scope: !36) // CHECK:STDOUT: !41 = !DILocation(line: 19, column: 3, scope: !36) // CHECK:STDOUT: !42 = !DILocation(line: 17, column: 1, scope: !36) -// CHECK:STDOUT: !43 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 18, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !46) +// CHECK:STDOUT: !43 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !18, line: 18, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !46) // CHECK:STDOUT: !44 = !DILocalVariable(arg: 1, scope: !43, type: !20) // CHECK:STDOUT: !45 = !DILocation(line: 18, column: 3, scope: !43) // CHECK:STDOUT: !46 = !{!44} +// CHECK:STDOUT: !47 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 18, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !50) +// CHECK:STDOUT: !48 = !DILocalVariable(arg: 1, scope: !47, type: !20) +// CHECK:STDOUT: !49 = !DILocation(line: 18, column: 3, scope: !47) +// CHECK:STDOUT: !50 = !{!48} +// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 18, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !54) +// CHECK:STDOUT: !52 = !DILocalVariable(arg: 1, scope: !51, type: !20) +// CHECK:STDOUT: !53 = !DILocation(line: 18, column: 3, scope: !51) +// CHECK:STDOUT: !54 = !{!52} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/function/call/return_implicit.carbon b/toolchain/lower/testdata/function/call/return_implicit.carbon index e6063c85a4f8..500e267ace80 100644 --- a/toolchain/lower/testdata/function/call/return_implicit.carbon +++ b/toolchain/lower/testdata/function/call/return_implicit.carbon @@ -23,18 +23,25 @@ fn Main() { // CHECK:STDOUT: source_filename = "return_implicit.carbon" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CMakeImplicitEmptyTuple.Main() #0 !dbg !18 { +// CHECK:STDOUT: define void @_CMakeImplicitEmptyTuple.Main() #0 !dbg !21 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !19 +// CHECK:STDOUT: ret void, !dbg !22 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CMain.Main() #0 !dbg !20 { +// CHECK:STDOUT: define void @_CMain.Main() #0 !dbg !23 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca {}, align 1, !dbg !21 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !21 -// CHECK:STDOUT: call void @_CMakeImplicitEmptyTuple.Main(), !dbg !22 -// CHECK:STDOUT: ret void, !dbg !24 +// CHECK:STDOUT: %_.var = alloca {}, align 1, !dbg !24 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !24 +// CHECK:STDOUT: call void @_CMakeImplicitEmptyTuple.Main(), !dbg !25 +// CHECK:STDOUT: call void @"_CSelfDestruct.61ea2aba74ab3bf1:core.Destroy.Core"(ptr %_.var), !dbg !24 +// CHECK:STDOUT: ret void, !dbg !27 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.61ea2aba74ab3bf1:core.Destroy.Core"(ptr %self) #0 !dbg !28 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !30 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -52,10 +59,17 @@ fn Main() { // CHECK:STDOUT: !15 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !14, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) // CHECK:STDOUT: !16 = !{null} // CHECK:STDOUT: !17 = !DISubroutineType(types: !16) -// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "MakeImplicitEmptyTuple", linkageName: "_CMakeImplicitEmptyTuple.Main", scope: null, file: !14, line: 14, type: !17, spFlags: DISPFlagDefinition, unit: !15) -// CHECK:STDOUT: !19 = !DILocation(line: 14, column: 1, scope: !18) -// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "Main", linkageName: "_CMain.Main", scope: null, file: !14, line: 17, type: !17, spFlags: DISPFlagDefinition, unit: !15) -// CHECK:STDOUT: !21 = !DILocation(line: 18, column: 3, scope: !20) -// CHECK:STDOUT: !22 = !DILocation(line: 18, column: 15, scope: !20) -// CHECK:STDOUT: !24 = !DILocation(line: 17, column: 1, scope: !20) +// CHECK:STDOUT: !18 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !19 = !{null, !18} +// CHECK:STDOUT: !20 = !DISubroutineType(types: !19) +// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "MakeImplicitEmptyTuple", linkageName: "_CMakeImplicitEmptyTuple.Main", scope: null, file: !14, line: 14, type: !17, spFlags: DISPFlagDefinition, unit: !15) +// CHECK:STDOUT: !22 = !DILocation(line: 14, column: 1, scope: !21) +// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "Main", linkageName: "_CMain.Main", scope: null, file: !14, line: 17, type: !17, spFlags: DISPFlagDefinition, unit: !15) +// CHECK:STDOUT: !24 = !DILocation(line: 18, column: 3, scope: !23) +// CHECK:STDOUT: !25 = !DILocation(line: 18, column: 15, scope: !23) +// CHECK:STDOUT: !27 = !DILocation(line: 17, column: 1, scope: !23) +// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.61ea2aba74ab3bf1:core.Destroy.Core", scope: null, file: !14, line: 18, type: !20, spFlags: DISPFlagDefinition, unit: !15, retainedNodes: !31) +// CHECK:STDOUT: !29 = !DILocalVariable(arg: 1, scope: !28, type: !18) +// CHECK:STDOUT: !30 = !DILocation(line: 18, column: 3, scope: !28) +// CHECK:STDOUT: !31 = !{!29} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/function/call/tuple_param_with_return_slot.carbon b/toolchain/lower/testdata/function/call/tuple_param_with_return_slot.carbon index 00790a5d7547..cb025b16aec0 100644 --- a/toolchain/lower/testdata/function/call/tuple_param_with_return_slot.carbon +++ b/toolchain/lower/testdata/function/call/tuple_param_with_return_slot.carbon @@ -47,22 +47,42 @@ fn Main() { // CHECK:STDOUT: %.loc18_21.1.temp = alloca { i32, i32, i32 }, align 4, !dbg !45 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_21.1.temp), !dbg !45 // CHECK:STDOUT: call void @_CF.Main(ptr %.loc18_21.1.temp, { i32 } { i32 1 }, ptr @tuple.97c.loc18_20.6), !dbg !45 -// CHECK:STDOUT: call void @"_COp.555b1314256372b8:core.Destroy.Core"(ptr %.loc18_21.1.temp), !dbg !45 +// CHECK:STDOUT: call void @"_CSelfDestruct.555b1314256372b8:core.Destroy.Core"(ptr %.loc18_21.1.temp), !dbg !45 // CHECK:STDOUT: ret void, !dbg !46 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !47 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !47 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !49 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.555b1314256372b8:core.Destroy.Core"(ptr %self) #0 !dbg !51 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !51 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !53 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !55 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !57 +// CHECK:STDOUT: ret void, !dbg !57 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.555b1314256372b8:core.Destroy.Core"(ptr %self) #0 !dbg !59 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !61 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.555b1314256372b8:core.Destroy.Core"(ptr %self) #0 !dbg !63 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.555b1314256372b8:core.Destroy.Core"(ptr %self), !dbg !65 +// CHECK:STDOUT: ret void, !dbg !65 +// 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: @@ -98,12 +118,24 @@ fn Main() { // CHECK:STDOUT: !44 = distinct !DISubprogram(name: "Main", linkageName: "_CMain.Main", scope: null, file: !18, line: 17, type: !25, spFlags: DISPFlagDefinition, unit: !19) // CHECK:STDOUT: !45 = !DILocation(line: 18, column: 3, scope: !44) // CHECK:STDOUT: !46 = !DILocation(line: 17, column: 1, scope: !44) -// CHECK:STDOUT: !47 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 18, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !50) +// CHECK:STDOUT: !47 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !18, line: 18, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !50) // CHECK:STDOUT: !48 = !DILocalVariable(arg: 1, scope: !47, type: !20) // CHECK:STDOUT: !49 = !DILocation(line: 18, column: 3, scope: !47) // CHECK:STDOUT: !50 = !{!48} -// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "Op", linkageName: "_COp.555b1314256372b8:core.Destroy.Core", scope: null, file: !18, line: 18, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !54) -// CHECK:STDOUT: !52 = !DILocalVariable(arg: 1, scope: !51, type: !21) +// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 18, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !54) +// CHECK:STDOUT: !52 = !DILocalVariable(arg: 1, scope: !51, type: !20) // CHECK:STDOUT: !53 = !DILocation(line: 18, column: 3, scope: !51) // CHECK:STDOUT: !54 = !{!52} +// CHECK:STDOUT: !55 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 18, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !58) +// CHECK:STDOUT: !56 = !DILocalVariable(arg: 1, scope: !55, type: !20) +// CHECK:STDOUT: !57 = !DILocation(line: 18, column: 3, scope: !55) +// CHECK:STDOUT: !58 = !{!56} +// CHECK:STDOUT: !59 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.555b1314256372b8:core.Destroy.Core", scope: null, file: !18, line: 18, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !62) +// CHECK:STDOUT: !60 = !DILocalVariable(arg: 1, scope: !59, type: !21) +// CHECK:STDOUT: !61 = !DILocation(line: 18, column: 3, scope: !59) +// CHECK:STDOUT: !62 = !{!60} +// CHECK:STDOUT: !63 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.555b1314256372b8:core.Destroy.Core", scope: null, file: !18, line: 18, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !66) +// CHECK:STDOUT: !64 = !DILocalVariable(arg: 1, scope: !63, type: !21) +// CHECK:STDOUT: !65 = !DILocation(line: 18, column: 3, scope: !63) +// CHECK:STDOUT: !66 = !{!64} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/function/call/var_param.carbon b/toolchain/lower/testdata/function/call/var_param.carbon index 651399b1aa32..749611b56bf8 100644 --- a/toolchain/lower/testdata/function/call/var_param.carbon +++ b/toolchain/lower/testdata/function/call/var_param.carbon @@ -35,16 +35,29 @@ fn Main() { // CHECK:STDOUT: store i32 0, ptr %a.var, align 4, !dbg !31 // CHECK:STDOUT: %.loc17 = load i32, ptr %a.var, align 4, !dbg !33 // CHECK:STDOUT: call void @_CDoNothing.Main(i32 %.loc17), !dbg !34 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %a.var), !dbg !31 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %a.var), !dbg !31 // CHECK:STDOUT: ret void, !dbg !35 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !36 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !36 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !38 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !40 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !42 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !44 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !46 +// CHECK:STDOUT: ret void, !dbg !46 +// 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: @@ -72,8 +85,16 @@ fn Main() { // CHECK:STDOUT: !33 = !DILocation(line: 17, column: 13, scope: !30) // CHECK:STDOUT: !34 = !DILocation(line: 17, column: 3, scope: !30) // CHECK:STDOUT: !35 = !DILocation(line: 15, column: 1, scope: !30) -// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 16, type: !22, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !39) +// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !18, line: 16, type: !22, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !39) // CHECK:STDOUT: !37 = !DILocalVariable(arg: 1, scope: !36, type: !20) // CHECK:STDOUT: !38 = !DILocation(line: 16, column: 3, scope: !36) // CHECK:STDOUT: !39 = !{!37} +// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 16, type: !22, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !43) +// CHECK:STDOUT: !41 = !DILocalVariable(arg: 1, scope: !40, type: !20) +// CHECK:STDOUT: !42 = !DILocation(line: 16, column: 3, scope: !40) +// CHECK:STDOUT: !43 = !{!41} +// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 16, type: !22, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !47) +// CHECK:STDOUT: !45 = !DILocalVariable(arg: 1, scope: !44, type: !20) +// CHECK:STDOUT: !46 = !DILocation(line: 16, column: 3, scope: !44) +// CHECK:STDOUT: !47 = !{!45} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/function/definition/destroy.carbon b/toolchain/lower/testdata/function/definition/destroy.carbon index 6b22021f06a2..6a919b577f1c 100644 --- a/toolchain/lower/testdata/function/definition/destroy.carbon +++ b/toolchain/lower/testdata/function/definition/destroy.carbon @@ -89,17 +89,30 @@ fn InitLet() { // CHECK:STDOUT: %.loc12_6.2.temp = alloca {}, align 1, !dbg !27 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_6.2.temp), !dbg !27 // CHECK:STDOUT: call void @_CF.Main(ptr @C.val.loc12_6.6), !dbg !28 -// CHECK:STDOUT: call void @"_COp.08d9e38b928ba575:core.Destroy.Core"(ptr @C.val), !dbg !27 +// CHECK:STDOUT: call void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr @C.val), !dbg !27 // CHECK:STDOUT: call void @_CG.Main(), !dbg !29 // CHECK:STDOUT: ret void, !dbg !30 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !31 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %self) #0 !dbg !31 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !33 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !35 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !37 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !39 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core"(ptr %self), !dbg !41 +// CHECK:STDOUT: ret void, !dbg !41 +// 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: @@ -127,10 +140,18 @@ fn InitLet() { // CHECK:STDOUT: !28 = !DILocation(line: 12, column: 3, scope: !26) // CHECK:STDOUT: !29 = !DILocation(line: 13, column: 3, scope: !26) // CHECK:STDOUT: !30 = !DILocation(line: 11, column: 1, scope: !26) -// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "Op", linkageName: "_COp.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !14, line: 12, type: !18, spFlags: DISPFlagDefinition, unit: !15, retainedNodes: !34) +// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !14, line: 12, type: !18, spFlags: DISPFlagDefinition, unit: !15, retainedNodes: !34) // CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !31, type: !16) // CHECK:STDOUT: !33 = !DILocation(line: 12, column: 5, scope: !31) // CHECK:STDOUT: !34 = !{!32} +// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !14, line: 12, type: !18, spFlags: DISPFlagDefinition, unit: !15, retainedNodes: !38) +// CHECK:STDOUT: !36 = !DILocalVariable(arg: 1, scope: !35, type: !16) +// CHECK:STDOUT: !37 = !DILocation(line: 12, column: 5, scope: !35) +// CHECK:STDOUT: !38 = !{!36} +// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !14, line: 12, type: !18, spFlags: DISPFlagDefinition, unit: !15, retainedNodes: !42) +// CHECK:STDOUT: !40 = !DILocalVariable(arg: 1, scope: !39, type: !16) +// CHECK:STDOUT: !41 = !DILocation(line: 12, column: 5, scope: !39) +// CHECK:STDOUT: !42 = !{!40} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'var_param.carbon' @@ -139,29 +160,42 @@ fn InitLet() { // CHECK:STDOUT: @C.val.loc6 = internal constant {} zeroinitializer // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF.Main(ptr %_) #0 !dbg !37 { +// CHECK:STDOUT: define void @_CF.Main(ptr %_) #0 !dbg !45 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !41 +// CHECK:STDOUT: ret void, !dbg !49 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_CG.Main() // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CCallF.Main() #0 !dbg !43 { +// CHECK:STDOUT: define void @_CCallF.Main() #0 !dbg !51 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca {}, align 1, !dbg !44 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !44 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %_.var, ptr align 1 @C.val.loc6, i64 0, i1 false), !dbg !44 -// CHECK:STDOUT: call void @_CF.Main(ptr %_.var), !dbg !45 -// CHECK:STDOUT: call void @"_COp.08d9e38b928ba575:core.Destroy.Core"(ptr %_.var), !dbg !44 -// CHECK:STDOUT: call void @_CG.Main(), !dbg !46 -// CHECK:STDOUT: ret void, !dbg !47 +// CHECK:STDOUT: %_.var = alloca {}, align 1, !dbg !52 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !52 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %_.var, ptr align 1 @C.val.loc6, i64 0, i1 false), !dbg !52 +// CHECK:STDOUT: call void @_CF.Main(ptr %_.var), !dbg !53 +// CHECK:STDOUT: call void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr %_.var), !dbg !52 +// CHECK:STDOUT: call void @_CG.Main(), !dbg !54 +// CHECK:STDOUT: ret void, !dbg !55 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !48 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %self) #0 !dbg !56 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !50 +// CHECK:STDOUT: ret void, !dbg !58 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !60 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !62 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !64 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core"(ptr %self), !dbg !66 +// CHECK:STDOUT: ret void, !dbg !66 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -173,7 +207,7 @@ fn InitLet() { // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!36} +// CHECK:STDOUT: !llvm.dbg.cu = !{!44} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} @@ -183,21 +217,29 @@ fn InitLet() { // CHECK:STDOUT: !18 = !DISubroutineType(types: !17) // CHECK:STDOUT: !19 = !{null} // CHECK:STDOUT: !20 = !DISubroutineType(types: !19) -// CHECK:STDOUT: !35 = !DIFile(filename: "var_param.carbon", directory: "") -// CHECK:STDOUT: !36 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !35, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !35, line: 6, type: !18, spFlags: DISPFlagDefinition, unit: !36, retainedNodes: !42) -// CHECK:STDOUT: !38 = !DILocalVariable(arg: 1, scope: !37, type: !16) -// CHECK:STDOUT: !41 = !DILocation(line: 6, column: 1, scope: !37) -// CHECK:STDOUT: !42 = !{!38} -// CHECK:STDOUT: !43 = distinct !DISubprogram(name: "CallF", linkageName: "_CCallF.Main", scope: null, file: !35, line: 11, type: !20, spFlags: DISPFlagDefinition, unit: !36) -// CHECK:STDOUT: !44 = !DILocation(line: 6, column: 6, scope: !43) -// CHECK:STDOUT: !45 = !DILocation(line: 12, column: 3, scope: !43) -// CHECK:STDOUT: !46 = !DILocation(line: 13, column: 3, scope: !43) -// CHECK:STDOUT: !47 = !DILocation(line: 11, column: 1, scope: !43) -// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "Op", linkageName: "_COp.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !35, line: 6, type: !18, spFlags: DISPFlagDefinition, unit: !36, retainedNodes: !51) -// CHECK:STDOUT: !49 = !DILocalVariable(arg: 1, scope: !48, type: !16) -// CHECK:STDOUT: !50 = !DILocation(line: 6, column: 6, scope: !48) -// CHECK:STDOUT: !51 = !{!49} +// CHECK:STDOUT: !43 = !DIFile(filename: "var_param.carbon", directory: "") +// CHECK:STDOUT: !44 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !43, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !43, line: 6, type: !18, spFlags: DISPFlagDefinition, unit: !44, retainedNodes: !50) +// CHECK:STDOUT: !46 = !DILocalVariable(arg: 1, scope: !45, type: !16) +// CHECK:STDOUT: !49 = !DILocation(line: 6, column: 1, scope: !45) +// CHECK:STDOUT: !50 = !{!46} +// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "CallF", linkageName: "_CCallF.Main", scope: null, file: !43, line: 11, type: !20, spFlags: DISPFlagDefinition, unit: !44) +// CHECK:STDOUT: !52 = !DILocation(line: 6, column: 6, scope: !51) +// CHECK:STDOUT: !53 = !DILocation(line: 12, column: 3, scope: !51) +// CHECK:STDOUT: !54 = !DILocation(line: 13, column: 3, scope: !51) +// CHECK:STDOUT: !55 = !DILocation(line: 11, column: 1, scope: !51) +// CHECK:STDOUT: !56 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !43, line: 6, type: !18, spFlags: DISPFlagDefinition, unit: !44, retainedNodes: !59) +// CHECK:STDOUT: !57 = !DILocalVariable(arg: 1, scope: !56, type: !16) +// CHECK:STDOUT: !58 = !DILocation(line: 6, column: 6, scope: !56) +// CHECK:STDOUT: !59 = !{!57} +// CHECK:STDOUT: !60 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !43, line: 6, type: !18, spFlags: DISPFlagDefinition, unit: !44, retainedNodes: !63) +// CHECK:STDOUT: !61 = !DILocalVariable(arg: 1, scope: !60, type: !16) +// CHECK:STDOUT: !62 = !DILocation(line: 6, column: 6, scope: !60) +// CHECK:STDOUT: !63 = !{!61} +// CHECK:STDOUT: !64 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !43, line: 6, type: !18, spFlags: DISPFlagDefinition, unit: !44, retainedNodes: !67) +// CHECK:STDOUT: !65 = !DILocalVariable(arg: 1, scope: !64, type: !16) +// CHECK:STDOUT: !66 = !DILocation(line: 6, column: 6, scope: !64) +// CHECK:STDOUT: !67 = !{!65} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'return_slot.carbon' @@ -206,49 +248,62 @@ fn InitLet() { // CHECK:STDOUT: @C.val.loc7_12 = internal constant {} zeroinitializer // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF.Main(ptr sret({}) %return) #0 !dbg !56 { +// CHECK:STDOUT: define void @_CF.Main(ptr sret({}) %return) #0 !dbg !72 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %return, ptr align 1 @C.val.loc7_12, i64 0, i1 false), !dbg !59 -// CHECK:STDOUT: ret void, !dbg !59 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %return, ptr align 1 @C.val.loc7_12, i64 0, i1 false), !dbg !75 +// CHECK:STDOUT: ret void, !dbg !75 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_CG.Main() // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CForward.Main(ptr sret({}) %return) #0 !dbg !60 { +// CHECK:STDOUT: define void @_CForward.Main(ptr sret({}) %return) #0 !dbg !76 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CF.Main(ptr %return), !dbg !63 -// CHECK:STDOUT: ret void, !dbg !64 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CInitVar.Main() #0 !dbg !65 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca {}, align 1, !dbg !66 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !66 -// CHECK:STDOUT: call void @_CF.Main(ptr %_.var), !dbg !67 -// CHECK:STDOUT: call void @_CG.Main(), !dbg !69 -// CHECK:STDOUT: call void @"_COp.08d9e38b928ba575:core.Destroy.Core"(ptr %_.var), !dbg !66 -// CHECK:STDOUT: ret void, !dbg !70 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !71 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !73 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CInitLet.Main() #0 !dbg !75 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc22_16.1.temp = alloca {}, align 1, !dbg !76 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc22_16.1.temp), !dbg !76 -// CHECK:STDOUT: call void @_CF.Main(ptr %.loc22_16.1.temp), !dbg !76 -// CHECK:STDOUT: call void @_CG.Main(), !dbg !79 -// CHECK:STDOUT: call void @"_COp.08d9e38b928ba575:core.Destroy.Core"(ptr %.loc22_16.1.temp), !dbg !76 +// CHECK:STDOUT: call void @_CF.Main(ptr %return), !dbg !79 // CHECK:STDOUT: ret void, !dbg !80 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CInitVar.Main() #0 !dbg !81 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %_.var = alloca {}, align 1, !dbg !82 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !82 +// CHECK:STDOUT: call void @_CF.Main(ptr %_.var), !dbg !83 +// CHECK:STDOUT: call void @_CG.Main(), !dbg !85 +// CHECK:STDOUT: call void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr %_.var), !dbg !82 +// CHECK:STDOUT: ret void, !dbg !86 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %self) #0 !dbg !87 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !89 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !91 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !93 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !95 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core"(ptr %self), !dbg !97 +// CHECK:STDOUT: ret void, !dbg !97 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CInitLet.Main() #0 !dbg !99 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %.loc22_16.1.temp = alloca {}, align 1, !dbg !100 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc22_16.1.temp), !dbg !100 +// CHECK:STDOUT: call void @_CF.Main(ptr %.loc22_16.1.temp), !dbg !100 +// CHECK:STDOUT: call void @_CG.Main(), !dbg !103 +// CHECK:STDOUT: call void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr %.loc22_16.1.temp), !dbg !100 +// CHECK:STDOUT: ret void, !dbg !104 +// 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: @@ -261,7 +316,7 @@ fn InitLet() { // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!53} +// CHECK:STDOUT: !llvm.dbg.cu = !{!69} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} @@ -271,26 +326,34 @@ fn InitLet() { // CHECK:STDOUT: !18 = !DISubroutineType(types: !17) // CHECK:STDOUT: !19 = !{null} // CHECK:STDOUT: !20 = !DISubroutineType(types: !19) -// CHECK:STDOUT: !52 = !DIFile(filename: "return_slot.carbon", directory: "") -// CHECK:STDOUT: !53 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !52, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !54 = !{!16} -// CHECK:STDOUT: !55 = !DISubroutineType(types: !54) -// CHECK:STDOUT: !56 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !52, line: 6, type: !55, spFlags: DISPFlagDefinition, unit: !53) -// CHECK:STDOUT: !59 = !DILocation(line: 7, column: 3, scope: !56) -// CHECK:STDOUT: !60 = distinct !DISubprogram(name: "Forward", linkageName: "_CForward.Main", scope: null, file: !52, line: 12, type: !55, spFlags: DISPFlagDefinition, unit: !53) -// CHECK:STDOUT: !63 = !DILocation(line: 13, column: 10, scope: !60) -// CHECK:STDOUT: !64 = !DILocation(line: 13, column: 3, scope: !60) -// CHECK:STDOUT: !65 = distinct !DISubprogram(name: "InitVar", linkageName: "_CInitVar.Main", scope: null, file: !52, line: 16, type: !20, spFlags: DISPFlagDefinition, unit: !53) -// CHECK:STDOUT: !66 = !DILocation(line: 17, column: 3, scope: !65) -// CHECK:STDOUT: !67 = !DILocation(line: 17, column: 14, scope: !65) -// CHECK:STDOUT: !69 = !DILocation(line: 18, column: 3, scope: !65) -// CHECK:STDOUT: !70 = !DILocation(line: 16, column: 1, scope: !65) -// CHECK:STDOUT: !71 = distinct !DISubprogram(name: "Op", linkageName: "_COp.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !52, line: 17, type: !18, spFlags: DISPFlagDefinition, unit: !53, retainedNodes: !74) -// CHECK:STDOUT: !72 = !DILocalVariable(arg: 1, scope: !71, type: !16) -// CHECK:STDOUT: !73 = !DILocation(line: 17, column: 3, scope: !71) -// CHECK:STDOUT: !74 = !{!72} -// CHECK:STDOUT: !75 = distinct !DISubprogram(name: "InitLet", linkageName: "_CInitLet.Main", scope: null, file: !52, line: 21, type: !20, spFlags: DISPFlagDefinition, unit: !53) -// CHECK:STDOUT: !76 = !DILocation(line: 22, column: 14, scope: !75) -// CHECK:STDOUT: !79 = !DILocation(line: 23, column: 3, scope: !75) -// CHECK:STDOUT: !80 = !DILocation(line: 21, column: 1, scope: !75) +// CHECK:STDOUT: !68 = !DIFile(filename: "return_slot.carbon", directory: "") +// CHECK:STDOUT: !69 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !68, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !70 = !{!16} +// CHECK:STDOUT: !71 = !DISubroutineType(types: !70) +// CHECK:STDOUT: !72 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !68, line: 6, type: !71, spFlags: DISPFlagDefinition, unit: !69) +// CHECK:STDOUT: !75 = !DILocation(line: 7, column: 3, scope: !72) +// CHECK:STDOUT: !76 = distinct !DISubprogram(name: "Forward", linkageName: "_CForward.Main", scope: null, file: !68, line: 12, type: !71, spFlags: DISPFlagDefinition, unit: !69) +// CHECK:STDOUT: !79 = !DILocation(line: 13, column: 10, scope: !76) +// CHECK:STDOUT: !80 = !DILocation(line: 13, column: 3, scope: !76) +// CHECK:STDOUT: !81 = distinct !DISubprogram(name: "InitVar", linkageName: "_CInitVar.Main", scope: null, file: !68, line: 16, type: !20, spFlags: DISPFlagDefinition, unit: !69) +// CHECK:STDOUT: !82 = !DILocation(line: 17, column: 3, scope: !81) +// CHECK:STDOUT: !83 = !DILocation(line: 17, column: 14, scope: !81) +// CHECK:STDOUT: !85 = !DILocation(line: 18, column: 3, scope: !81) +// CHECK:STDOUT: !86 = !DILocation(line: 16, column: 1, scope: !81) +// CHECK:STDOUT: !87 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !68, line: 17, type: !18, spFlags: DISPFlagDefinition, unit: !69, retainedNodes: !90) +// CHECK:STDOUT: !88 = !DILocalVariable(arg: 1, scope: !87, type: !16) +// CHECK:STDOUT: !89 = !DILocation(line: 17, column: 3, scope: !87) +// CHECK:STDOUT: !90 = !{!88} +// CHECK:STDOUT: !91 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !68, line: 17, type: !18, spFlags: DISPFlagDefinition, unit: !69, retainedNodes: !94) +// CHECK:STDOUT: !92 = !DILocalVariable(arg: 1, scope: !91, type: !16) +// CHECK:STDOUT: !93 = !DILocation(line: 17, column: 3, scope: !91) +// CHECK:STDOUT: !94 = !{!92} +// CHECK:STDOUT: !95 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !68, line: 17, type: !18, spFlags: DISPFlagDefinition, unit: !69, retainedNodes: !98) +// CHECK:STDOUT: !96 = !DILocalVariable(arg: 1, scope: !95, type: !16) +// CHECK:STDOUT: !97 = !DILocation(line: 17, column: 3, scope: !95) +// CHECK:STDOUT: !98 = !{!96} +// CHECK:STDOUT: !99 = distinct !DISubprogram(name: "InitLet", linkageName: "_CInitLet.Main", scope: null, file: !68, line: 21, type: !20, spFlags: DISPFlagDefinition, unit: !69) +// CHECK:STDOUT: !100 = !DILocation(line: 22, column: 14, scope: !99) +// CHECK:STDOUT: !103 = !DILocation(line: 23, column: 3, scope: !99) +// CHECK:STDOUT: !104 = !DILocation(line: 21, column: 1, scope: !99) // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/function/definition/var_param.carbon b/toolchain/lower/testdata/function/definition/var_param.carbon index 76bbd5aad6b6..4d94aab0df69 100644 --- a/toolchain/lower/testdata/function/definition/var_param.carbon +++ b/toolchain/lower/testdata/function/definition/var_param.carbon @@ -80,43 +80,69 @@ fn Call() { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc15), !dbg !68 // CHECK:STDOUT: store i32 1, ptr %_.var.loc15, align 4, !dbg !68 // CHECK:STDOUT: call void @_COneVar_i32.Main(ptr %_.var.loc15), !dbg !69 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %_.var.loc15), !dbg !68 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %_.var.loc15), !dbg !68 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc16), !dbg !70 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %_.var.loc16, ptr align 1 @X.val.loc16, i64 0, i1 false), !dbg !70 // CHECK:STDOUT: call void @_COneVar_X.Main(ptr %_.var.loc16), !dbg !71 -// CHECK:STDOUT: call void @"_COp.8b0bf151036f045a:core.Destroy.Core"(ptr %_.var.loc16), !dbg !70 +// CHECK:STDOUT: call void @"_CSelfDestruct.8b0bf151036f045a:core.Destroy.Core"(ptr %_.var.loc16), !dbg !70 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc18_12), !dbg !72 // CHECK:STDOUT: store i32 1, ptr %_.var.loc18_12, align 4, !dbg !72 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc18_24), !dbg !73 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %_.var.loc18_24, ptr align 1 @X.val.loc16, i64 0, i1 false), !dbg !73 // CHECK:STDOUT: call void @_CTwoVars.Main(ptr %_.var.loc18_12, ptr %_.var.loc18_24), !dbg !74 -// CHECK:STDOUT: call void @"_COp.8b0bf151036f045a:core.Destroy.Core"(ptr %_.var.loc18_24), !dbg !73 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %_.var.loc18_12), !dbg !72 +// CHECK:STDOUT: call void @"_CSelfDestruct.8b0bf151036f045a:core.Destroy.Core"(ptr %_.var.loc18_24), !dbg !73 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %_.var.loc18_12), !dbg !72 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc20), !dbg !75 // CHECK:STDOUT: store i32 1, ptr %_.var.loc20, align 4, !dbg !75 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc29_18.2.temp), !dbg !76 // CHECK:STDOUT: call void @_CVarThenLet.Main(ptr %_.var.loc20, ptr @X.val.loc16), !dbg !77 -// CHECK:STDOUT: call void @"_COp.8b0bf151036f045a:core.Destroy.Core"(ptr @X.val), !dbg !76 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %_.var.loc20), !dbg !75 +// CHECK:STDOUT: call void @"_CSelfDestruct.8b0bf151036f045a:core.Destroy.Core"(ptr @X.val), !dbg !76 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %_.var.loc20), !dbg !75 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc21), !dbg !78 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %_.var.loc21, ptr align 1 @X.val.loc16, i64 0, i1 false), !dbg !78 // CHECK:STDOUT: call void @_CLetThenVar.Main(i32 1, ptr %_.var.loc21), !dbg !79 -// CHECK:STDOUT: call void @"_COp.8b0bf151036f045a:core.Destroy.Core"(ptr %_.var.loc21), !dbg !78 +// CHECK:STDOUT: call void @"_CSelfDestruct.8b0bf151036f045a:core.Destroy.Core"(ptr %_.var.loc21), !dbg !78 // CHECK:STDOUT: ret void, !dbg !80 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !81 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !81 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !83 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.8b0bf151036f045a:core.Destroy.Core"(ptr %self) #0 !dbg !85 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !85 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !87 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !89 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !91 +// CHECK:STDOUT: ret void, !dbg !91 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %self) #0 !dbg !93 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !95 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.8b0bf151036f045a:core.Destroy.Core"(ptr %self) #0 !dbg !97 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !99 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.8b0bf151036f045a:core.Destroy.Core"(ptr %self) #0 !dbg !101 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.8b0bf151036f045a:core.Destroy.Core"(ptr %self), !dbg !103 +// CHECK:STDOUT: ret void, !dbg !103 +// 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: @@ -124,8 +150,8 @@ fn Call() { // 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: ; uselistorder directives -// CHECK:STDOUT: uselistorder ptr @"_COp.f58524831c37807e:core.Destroy.Core", { 2, 1, 0 } -// CHECK:STDOUT: uselistorder ptr @"_COp.8b0bf151036f045a:core.Destroy.Core", { 3, 2, 1, 0 } +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core", { 2, 1, 0 } +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.8b0bf151036f045a:core.Destroy.Core", { 3, 2, 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 6, 5, 4, 3, 2, 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.memcpy.p0.p0.i64, { 2, 1, 0 } // CHECK:STDOUT: @@ -186,12 +212,28 @@ fn Call() { // CHECK:STDOUT: !78 = !DILocation(line: 21, column: 23, scope: !67) // CHECK:STDOUT: !79 = !DILocation(line: 30, column: 3, scope: !67) // CHECK:STDOUT: !80 = !DILocation(line: 23, column: 1, scope: !67) -// CHECK:STDOUT: !81 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 15, type: !22, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !84) +// CHECK:STDOUT: !81 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !18, line: 15, type: !22, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !84) // CHECK:STDOUT: !82 = !DILocalVariable(arg: 1, scope: !81, type: !20) // CHECK:STDOUT: !83 = !DILocation(line: 15, column: 15, scope: !81) // CHECK:STDOUT: !84 = !{!82} -// CHECK:STDOUT: !85 = distinct !DISubprogram(name: "Op", linkageName: "_COp.8b0bf151036f045a:core.Destroy.Core", scope: null, file: !18, line: 16, type: !25, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !88) -// CHECK:STDOUT: !86 = !DILocalVariable(arg: 1, scope: !85, type: !23) -// CHECK:STDOUT: !87 = !DILocation(line: 16, column: 13, scope: !85) +// CHECK:STDOUT: !85 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 15, type: !22, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !88) +// CHECK:STDOUT: !86 = !DILocalVariable(arg: 1, scope: !85, type: !20) +// CHECK:STDOUT: !87 = !DILocation(line: 15, column: 15, scope: !85) // CHECK:STDOUT: !88 = !{!86} +// CHECK:STDOUT: !89 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 15, type: !22, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !92) +// CHECK:STDOUT: !90 = !DILocalVariable(arg: 1, scope: !89, type: !20) +// CHECK:STDOUT: !91 = !DILocation(line: 15, column: 15, scope: !89) +// CHECK:STDOUT: !92 = !{!90} +// CHECK:STDOUT: !93 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !18, line: 16, type: !25, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !96) +// CHECK:STDOUT: !94 = !DILocalVariable(arg: 1, scope: !93, type: !23) +// CHECK:STDOUT: !95 = !DILocation(line: 16, column: 13, scope: !93) +// CHECK:STDOUT: !96 = !{!94} +// CHECK:STDOUT: !97 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.8b0bf151036f045a:core.Destroy.Core", scope: null, file: !18, line: 16, type: !25, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !100) +// CHECK:STDOUT: !98 = !DILocalVariable(arg: 1, scope: !97, type: !23) +// CHECK:STDOUT: !99 = !DILocation(line: 16, column: 13, scope: !97) +// CHECK:STDOUT: !100 = !{!98} +// CHECK:STDOUT: !101 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.8b0bf151036f045a:core.Destroy.Core", scope: null, file: !18, line: 16, type: !25, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !104) +// CHECK:STDOUT: !102 = !DILocalVariable(arg: 1, scope: !101, type: !23) +// CHECK:STDOUT: !103 = !DILocation(line: 16, column: 13, scope: !101) +// CHECK:STDOUT: !104 = !{!102} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/function/generic/call.carbon b/toolchain/lower/testdata/function/generic/call.carbon index 0cf1a612f3fa..66851abd127a 100644 --- a/toolchain/lower/testdata/function/generic/call.carbon +++ b/toolchain/lower/testdata/function/generic/call.carbon @@ -60,37 +60,83 @@ fn G() { // CHECK:STDOUT: %.loc28 = load double, ptr %m.var, align 8, !dbg !57 // CHECK:STDOUT: call void @_CF.Main.073fbce68be6103e(double %.loc28), !dbg !58 // CHECK:STDOUT: call void @_CF.Main.99ea8cc237f84c8d(%type.26 zeroinitializer), !dbg !59 -// CHECK:STDOUT: call void @"_COp.dc14d4dd21801791:core.Destroy.Core"(ptr %m.var), !dbg !49 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %n.var), !dbg !47 -// CHECK:STDOUT: call void @"_COp.a50fd899f969e609:core.Destroy.Core"(ptr %d.var), !dbg !45 -// CHECK:STDOUT: call void @"_COp.08d9e38b928ba575:core.Destroy.Core"(ptr %c.var), !dbg !43 +// CHECK:STDOUT: call void @"_CSelfDestruct.dc14d4dd21801791:core.Destroy.Core"(ptr %m.var), !dbg !49 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %n.var), !dbg !47 +// CHECK:STDOUT: call void @"_CSelfDestruct.a50fd899f969e609:core.Destroy.Core"(ptr %d.var), !dbg !45 +// CHECK:STDOUT: call void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr %c.var), !dbg !43 // CHECK:STDOUT: ret void, !dbg !60 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.dc14d4dd21801791:core.Destroy.Core"(ptr %self) #0 !dbg !61 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.7945ecba5c505fc0:core.Destroy.Core"(ptr %self) #0 !dbg !61 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !63 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !65 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.dc14d4dd21801791:core.Destroy.Core"(ptr %self) #0 !dbg !65 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !67 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.a50fd899f969e609:core.Destroy.Core"(ptr %self) #0 !dbg !69 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.dc14d4dd21801791:core.Destroy.Core"(ptr %self) #0 !dbg !69 { // CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.dc14d4dd21801791:core.Destroy.Core"(ptr %self), !dbg !71 // CHECK:STDOUT: ret void, !dbg !71 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !73 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !73 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !75 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !77 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !79 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !81 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !83 +// CHECK:STDOUT: ret void, !dbg !83 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %self) #0 !dbg !85 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !87 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.a50fd899f969e609:core.Destroy.Core"(ptr %self) #0 !dbg !89 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !91 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.a50fd899f969e609:core.Destroy.Core"(ptr %self) #0 !dbg !93 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.a50fd899f969e609:core.Destroy.Core"(ptr %self), !dbg !95 +// CHECK:STDOUT: ret void, !dbg !95 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !97 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !99 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !101 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core"(ptr %self), !dbg !103 +// CHECK:STDOUT: ret void, !dbg !103 +// 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: @@ -98,27 +144,27 @@ fn G() { // 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 @_CF.Main.9522ff908e97e267(ptr %_) #0 !dbg !77 { +// CHECK:STDOUT: define linkonce_odr void @_CF.Main.9522ff908e97e267(ptr %_) #0 !dbg !105 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !80 +// CHECK:STDOUT: ret void, !dbg !108 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CF.Main.84588f41d61dafba(i32 %_) #0 !dbg !87 { +// CHECK:STDOUT: define linkonce_odr void @_CF.Main.84588f41d61dafba(i32 %_) #0 !dbg !115 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !90 +// CHECK:STDOUT: ret void, !dbg !118 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CF.Main.073fbce68be6103e(double %_) #0 !dbg !92 { +// CHECK:STDOUT: define linkonce_odr void @_CF.Main.073fbce68be6103e(double %_) #0 !dbg !120 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !95 +// CHECK:STDOUT: ret void, !dbg !123 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CF.Main.99ea8cc237f84c8d(%type.26 %_) #0 !dbg !97 { +// CHECK:STDOUT: define linkonce_odr void @_CF.Main.99ea8cc237f84c8d(%type.26 %_) #0 !dbg !125 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !100 +// CHECK:STDOUT: ret void, !dbg !128 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -157,36 +203,64 @@ fn G() { // CHECK:STDOUT: !58 = !DILocation(line: 28, column: 3, scope: !42) // CHECK:STDOUT: !59 = !DILocation(line: 29, column: 3, scope: !42) // CHECK:STDOUT: !60 = !DILocation(line: 19, column: 1, scope: !42) -// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "Op", linkageName: "_COp.dc14d4dd21801791:core.Destroy.Core", scope: null, file: !32, line: 23, type: !39, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !64) +// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.7945ecba5c505fc0:core.Destroy.Core", scope: null, file: !32, line: 23, type: !39, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !64) // CHECK:STDOUT: !62 = !DILocalVariable(arg: 1, scope: !61, type: !37) // CHECK:STDOUT: !63 = !DILocation(line: 23, column: 3, scope: !61) // CHECK:STDOUT: !64 = !{!62} -// CHECK:STDOUT: !65 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !32, line: 22, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !68) -// CHECK:STDOUT: !66 = !DILocalVariable(arg: 1, scope: !65, type: !34) -// CHECK:STDOUT: !67 = !DILocation(line: 22, column: 3, scope: !65) +// CHECK:STDOUT: !65 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.dc14d4dd21801791:core.Destroy.Core", scope: null, file: !32, line: 23, type: !39, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !68) +// CHECK:STDOUT: !66 = !DILocalVariable(arg: 1, scope: !65, type: !37) +// CHECK:STDOUT: !67 = !DILocation(line: 23, column: 3, scope: !65) // CHECK:STDOUT: !68 = !{!66} -// CHECK:STDOUT: !69 = distinct !DISubprogram(name: "Op", linkageName: "_COp.a50fd899f969e609:core.Destroy.Core", scope: null, file: !32, line: 21, type: !39, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !72) +// CHECK:STDOUT: !69 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.dc14d4dd21801791:core.Destroy.Core", scope: null, file: !32, line: 23, type: !39, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !72) // CHECK:STDOUT: !70 = !DILocalVariable(arg: 1, scope: !69, type: !37) -// CHECK:STDOUT: !71 = !DILocation(line: 21, column: 3, scope: !69) +// CHECK:STDOUT: !71 = !DILocation(line: 23, column: 3, scope: !69) // CHECK:STDOUT: !72 = !{!70} -// CHECK:STDOUT: !73 = distinct !DISubprogram(name: "Op", linkageName: "_COp.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !32, line: 20, type: !39, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !76) -// CHECK:STDOUT: !74 = !DILocalVariable(arg: 1, scope: !73, type: !37) -// CHECK:STDOUT: !75 = !DILocation(line: 20, column: 3, scope: !73) +// CHECK:STDOUT: !73 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !32, line: 22, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !76) +// CHECK:STDOUT: !74 = !DILocalVariable(arg: 1, scope: !73, type: !34) +// CHECK:STDOUT: !75 = !DILocation(line: 22, column: 3, scope: !73) // CHECK:STDOUT: !76 = !{!74} -// CHECK:STDOUT: !77 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.9522ff908e97e267", scope: null, file: !32, line: 13, type: !39, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !81) -// CHECK:STDOUT: !78 = !DILocalVariable(arg: 1, scope: !77, type: !37) -// CHECK:STDOUT: !80 = !DILocation(line: 13, column: 1, scope: !77) -// CHECK:STDOUT: !81 = !{!78} -// CHECK:STDOUT: !87 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.84588f41d61dafba", scope: null, file: !32, line: 13, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !91) -// CHECK:STDOUT: !88 = !DILocalVariable(arg: 1, scope: !87, type: !34) -// CHECK:STDOUT: !90 = !DILocation(line: 13, column: 1, scope: !87) -// CHECK:STDOUT: !91 = !{!88} -// CHECK:STDOUT: !92 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.073fbce68be6103e", scope: null, file: !32, line: 13, type: !39, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !96) -// CHECK:STDOUT: !93 = !DILocalVariable(arg: 1, scope: !92, type: !37) -// CHECK:STDOUT: !95 = !DILocation(line: 13, column: 1, scope: !92) -// CHECK:STDOUT: !96 = !{!93} -// CHECK:STDOUT: !97 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.99ea8cc237f84c8d", scope: null, file: !32, line: 13, type: !39, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !101) +// CHECK:STDOUT: !77 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !32, line: 22, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !80) +// CHECK:STDOUT: !78 = !DILocalVariable(arg: 1, scope: !77, type: !34) +// CHECK:STDOUT: !79 = !DILocation(line: 22, column: 3, scope: !77) +// CHECK:STDOUT: !80 = !{!78} +// CHECK:STDOUT: !81 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !32, line: 22, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !84) +// CHECK:STDOUT: !82 = !DILocalVariable(arg: 1, scope: !81, type: !34) +// CHECK:STDOUT: !83 = !DILocation(line: 22, column: 3, scope: !81) +// CHECK:STDOUT: !84 = !{!82} +// CHECK:STDOUT: !85 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !32, line: 21, type: !39, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !88) +// CHECK:STDOUT: !86 = !DILocalVariable(arg: 1, scope: !85, type: !37) +// CHECK:STDOUT: !87 = !DILocation(line: 21, column: 3, scope: !85) +// CHECK:STDOUT: !88 = !{!86} +// CHECK:STDOUT: !89 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.a50fd899f969e609:core.Destroy.Core", scope: null, file: !32, line: 21, type: !39, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !92) +// CHECK:STDOUT: !90 = !DILocalVariable(arg: 1, scope: !89, type: !37) +// CHECK:STDOUT: !91 = !DILocation(line: 21, column: 3, scope: !89) +// CHECK:STDOUT: !92 = !{!90} +// CHECK:STDOUT: !93 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.a50fd899f969e609:core.Destroy.Core", scope: null, file: !32, line: 21, type: !39, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !96) +// CHECK:STDOUT: !94 = !DILocalVariable(arg: 1, scope: !93, type: !37) +// CHECK:STDOUT: !95 = !DILocation(line: 21, column: 3, scope: !93) +// CHECK:STDOUT: !96 = !{!94} +// CHECK:STDOUT: !97 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !32, line: 20, type: !39, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !100) // CHECK:STDOUT: !98 = !DILocalVariable(arg: 1, scope: !97, type: !37) -// CHECK:STDOUT: !100 = !DILocation(line: 13, column: 1, scope: !97) -// CHECK:STDOUT: !101 = !{!98} +// CHECK:STDOUT: !99 = !DILocation(line: 20, column: 3, scope: !97) +// CHECK:STDOUT: !100 = !{!98} +// CHECK:STDOUT: !101 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !32, line: 20, type: !39, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !104) +// CHECK:STDOUT: !102 = !DILocalVariable(arg: 1, scope: !101, type: !37) +// CHECK:STDOUT: !103 = !DILocation(line: 20, column: 3, scope: !101) +// CHECK:STDOUT: !104 = !{!102} +// CHECK:STDOUT: !105 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.9522ff908e97e267", scope: null, file: !32, line: 13, type: !39, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !109) +// CHECK:STDOUT: !106 = !DILocalVariable(arg: 1, scope: !105, type: !37) +// CHECK:STDOUT: !108 = !DILocation(line: 13, column: 1, scope: !105) +// CHECK:STDOUT: !109 = !{!106} +// CHECK:STDOUT: !115 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.84588f41d61dafba", scope: null, file: !32, line: 13, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !119) +// CHECK:STDOUT: !116 = !DILocalVariable(arg: 1, scope: !115, type: !34) +// CHECK:STDOUT: !118 = !DILocation(line: 13, column: 1, scope: !115) +// CHECK:STDOUT: !119 = !{!116} +// CHECK:STDOUT: !120 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.073fbce68be6103e", scope: null, file: !32, line: 13, type: !39, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !124) +// CHECK:STDOUT: !121 = !DILocalVariable(arg: 1, scope: !120, type: !37) +// CHECK:STDOUT: !123 = !DILocation(line: 13, column: 1, scope: !120) +// CHECK:STDOUT: !124 = !{!121} +// CHECK:STDOUT: !125 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.99ea8cc237f84c8d", scope: null, file: !32, line: 13, type: !39, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !129) +// CHECK:STDOUT: !126 = !DILocalVariable(arg: 1, scope: !125, type: !37) +// CHECK:STDOUT: !128 = !DILocation(line: 13, column: 1, scope: !125) +// CHECK:STDOUT: !129 = !{!126} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/function/generic/call_basic.carbon b/toolchain/lower/testdata/function/generic/call_basic.carbon index a07edf05a34d..d1abf45a86df 100644 --- a/toolchain/lower/testdata/function/generic/call_basic.carbon +++ b/toolchain/lower/testdata/function/generic/call_basic.carbon @@ -71,45 +71,102 @@ fn M() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !51 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %self) #0 !dbg !51 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !53 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.dc14d4dd21801791:core.Destroy.Core"(ptr %self) #0 !dbg !55 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !55 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !57 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CM.Main() #0 !dbg !59 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !59 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %n.var = alloca i32, align 4, !dbg !60 -// CHECK:STDOUT: %p.var = alloca double, align 8, !dbg !62 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %n.var), !dbg !60 -// CHECK:STDOUT: store i32 0, ptr %n.var, align 4, !dbg !60 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %p.var), !dbg !62 -// CHECK:STDOUT: store double 1.000000e+00, ptr %p.var, align 8, !dbg !62 -// CHECK:STDOUT: %.loc52 = load i32, ptr %n.var, align 4, !dbg !64 -// CHECK:STDOUT: call void @_CF.Main.84588f41d61dafba(i32 %.loc52), !dbg !65 -// CHECK:STDOUT: %.loc53_18 = load i32, ptr %n.var, align 4, !dbg !66 -// CHECK:STDOUT: %G.call.loc53 = call i32 @_CG.Main.89a3e87df6fdafe1(i32 %.loc53_18), !dbg !67 -// CHECK:STDOUT: %.loc54 = load double, ptr %p.var, align 8, !dbg !72 -// CHECK:STDOUT: call void @_CF.Main.073fbce68be6103e(double %.loc54), !dbg !73 -// CHECK:STDOUT: %.loc55_18 = load double, ptr %p.var, align 8, !dbg !74 -// CHECK:STDOUT: %G.call.loc55 = call double @_CG.Main.38241ddc2cd9d74d(double %.loc55_18), !dbg !75 -// CHECK:STDOUT: call void @"_COp.dc14d4dd21801791:core.Destroy.Core"(ptr %p.var), !dbg !62 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %n.var), !dbg !60 -// CHECK:STDOUT: ret void, !dbg !78 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core"(ptr %self), !dbg !61 +// CHECK:STDOUT: ret void, !dbg !61 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !79 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.de57ff04fd84f9c8:core.Destroy.Core"(ptr %self) #0 !dbg !63 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !65 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.749b51755634ad17:core.Destroy.Core"(ptr %self) #0 !dbg !67 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !69 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.d088c7eb746488be:core.Destroy.Core"(ptr %self) #0 !dbg !71 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !73 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.7945ecba5c505fc0:core.Destroy.Core"(ptr %self) #0 !dbg !75 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !77 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.dc14d4dd21801791:core.Destroy.Core"(ptr %self) #0 !dbg !79 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !81 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.dc14d4dd21801791:core.Destroy.Core"(ptr %self) #0 !dbg !83 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.dc14d4dd21801791:core.Destroy.Core"(ptr %self), !dbg !85 +// CHECK:STDOUT: ret void, !dbg !85 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CM.Main() #0 !dbg !87 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %n.var = alloca i32, align 4, !dbg !88 +// CHECK:STDOUT: %p.var = alloca double, align 8, !dbg !90 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %n.var), !dbg !88 +// CHECK:STDOUT: store i32 0, ptr %n.var, align 4, !dbg !88 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %p.var), !dbg !90 +// CHECK:STDOUT: store double 1.000000e+00, ptr %p.var, align 8, !dbg !90 +// CHECK:STDOUT: %.loc52 = load i32, ptr %n.var, align 4, !dbg !92 +// CHECK:STDOUT: call void @_CF.Main.84588f41d61dafba(i32 %.loc52), !dbg !93 +// CHECK:STDOUT: %.loc53_18 = load i32, ptr %n.var, align 4, !dbg !94 +// CHECK:STDOUT: %G.call.loc53 = call i32 @_CG.Main.4d9f279dbc2b9f6f(i32 %.loc53_18), !dbg !95 +// CHECK:STDOUT: %.loc54 = load double, ptr %p.var, align 8, !dbg !100 +// CHECK:STDOUT: call void @_CF.Main.073fbce68be6103e(double %.loc54), !dbg !101 +// CHECK:STDOUT: %.loc55_18 = load double, ptr %p.var, align 8, !dbg !102 +// CHECK:STDOUT: %G.call.loc55 = call double @_CG.Main.cfa50e0c7743522e(double %.loc55_18), !dbg !103 +// CHECK:STDOUT: call void @"_CSelfDestruct.dc14d4dd21801791:core.Destroy.Core"(ptr %p.var), !dbg !90 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %n.var), !dbg !88 +// CHECK:STDOUT: ret void, !dbg !106 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !107 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !109 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !111 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !113 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !115 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !117 +// CHECK:STDOUT: ret void, !dbg !117 +// 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: @@ -117,148 +174,154 @@ fn M() { // 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 @_CF.Main.84588f41d61dafba(i32 %_) #0 !dbg !83 { +// CHECK:STDOUT: define linkonce_odr void @_CF.Main.84588f41d61dafba(i32 %_) #0 !dbg !119 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !86 +// CHECK:STDOUT: ret void, !dbg !122 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CG.Main.89a3e87df6fdafe1(i32 %x) #0 !dbg !88 { +// CHECK:STDOUT: define linkonce_odr i32 @_CG.Main.4d9f279dbc2b9f6f(i32 %x) #0 !dbg !124 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc29_6.3.temp = alloca i32, align 4, !dbg !94 -// CHECK:STDOUT: %.loc31_8.3.temp = alloca i32, align 4, !dbg !97 -// CHECK:STDOUT: %.loc31_9.3.temp = alloca i32, align 4, !dbg !98 -// CHECK:STDOUT: %var_f64.var = alloca double, align 8, !dbg !99 -// CHECK:STDOUT: %ptr_i32.var = alloca ptr, align 8, !dbg !103 -// CHECK:STDOUT: %ptr_f64.var = alloca ptr, align 8, !dbg !107 -// CHECK:STDOUT: %ptr_i8.var = alloca ptr, align 8, !dbg !111 -// CHECK:STDOUT: %c.var = alloca {}, align 1, !dbg !115 -// CHECK:STDOUT: %.loc43_6.3.temp = alloca {}, align 1, !dbg !118 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc29_6.3.temp), !dbg !94 -// CHECK:STDOUT: %H.call.loc29 = call i32 @_CH.Main.4d6ceefeb7f772f4(i32 %x), !dbg !94 -// CHECK:STDOUT: store i32 %H.call.loc29, ptr %.loc29_6.3.temp, align 4, !dbg !94 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %.loc29_6.3.temp), !dbg !94 -// CHECK:STDOUT: %H.call.loc30 = call %type.26 @_CH.Main.c3359c2c217ad593(%type.26 zeroinitializer), !dbg !95 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc31_8.3.temp), !dbg !97 -// CHECK:STDOUT: %G.call = call i32 @_CG.Main.89a3e87df6fdafe1(i32 %x), !dbg !97 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc31_9.3.temp), !dbg !98 -// CHECK:STDOUT: store i32 %G.call, ptr %.loc31_8.3.temp, align 4, !dbg !97 -// CHECK:STDOUT: %.loc31_8.5 = load i32, ptr %.loc31_8.3.temp, align 4, !dbg !97 -// CHECK:STDOUT: %H.call.loc31 = call i32 @_CH.Main.4d6ceefeb7f772f4(i32 %.loc31_8.5), !dbg !98 -// CHECK:STDOUT: store i32 %H.call.loc31, ptr %.loc31_9.3.temp, align 4, !dbg !98 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %.loc31_9.3.temp), !dbg !98 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %.loc31_8.3.temp), !dbg !97 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %var_f64.var), !dbg !99 -// CHECK:STDOUT: store double poison, ptr %var_f64.var, align 8, !dbg !99 -// CHECK:STDOUT: %.loc35_5 = load double, ptr %var_f64.var, align 8, !dbg !101 -// CHECK:STDOUT: %H.call.loc35 = call double @_CH.Main.c5e4ba542a56b71f(double %.loc35_5), !dbg !102 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %ptr_i32.var), !dbg !103 -// CHECK:STDOUT: store ptr poison, ptr %ptr_i32.var, align 8, !dbg !103 -// CHECK:STDOUT: %.loc37_5 = load ptr, ptr %ptr_i32.var, align 8, !dbg !105 -// CHECK:STDOUT: %H.call.loc37 = call ptr @_CH.Main.a76b78461416b4a8(ptr %.loc37_5), !dbg !106 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %ptr_f64.var), !dbg !107 -// CHECK:STDOUT: store ptr poison, ptr %ptr_f64.var, align 8, !dbg !107 -// CHECK:STDOUT: %.loc39_5 = load ptr, ptr %ptr_f64.var, align 8, !dbg !109 -// CHECK:STDOUT: %H.call.loc39 = call ptr @_CH.Main.a76b78461416b4a8(ptr %.loc39_5), !dbg !110 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %ptr_i8.var), !dbg !111 -// CHECK:STDOUT: store ptr poison, ptr %ptr_i8.var, align 8, !dbg !111 -// CHECK:STDOUT: %.loc41_5 = load ptr, ptr %ptr_i8.var, align 8, !dbg !113 -// CHECK:STDOUT: %H.call.loc41 = call ptr @_CH.Main.a76b78461416b4a8(ptr %.loc41_5), !dbg !114 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !115 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc43_6.3.temp), !dbg !118 -// CHECK:STDOUT: call void @_CH.Main.42513763e01cba2c(ptr %.loc43_6.3.temp, ptr %c.var), !dbg !118 -// CHECK:STDOUT: call void @"_COp.08d9e38b928ba575:core.Destroy.Core"(ptr %.loc43_6.3.temp), !dbg !118 -// CHECK:STDOUT: call void @"_COp.08d9e38b928ba575:core.Destroy.Core"(ptr %c.var), !dbg !115 -// CHECK:STDOUT: call void @"_COp.dc14d4dd21801791:core.Destroy.Core"(ptr %var_f64.var), !dbg !99 -// CHECK:STDOUT: ret i32 %x, !dbg !120 +// CHECK:STDOUT: %.loc29_6.3.temp = alloca i32, align 4, !dbg !130 +// CHECK:STDOUT: %.loc31_8.3.temp = alloca i32, align 4, !dbg !133 +// CHECK:STDOUT: %.loc31_9.3.temp = alloca i32, align 4, !dbg !134 +// CHECK:STDOUT: %var_f64.var = alloca double, align 8, !dbg !135 +// CHECK:STDOUT: %ptr_i32.var = alloca ptr, align 8, !dbg !139 +// CHECK:STDOUT: %ptr_f64.var = alloca ptr, align 8, !dbg !143 +// CHECK:STDOUT: %ptr_i8.var = alloca ptr, align 8, !dbg !147 +// CHECK:STDOUT: %c.var = alloca {}, align 1, !dbg !151 +// CHECK:STDOUT: %.loc43_6.3.temp = alloca {}, align 1, !dbg !154 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc29_6.3.temp), !dbg !130 +// CHECK:STDOUT: %H.call.loc29 = call i32 @_CH.Main.4d6ceefeb7f772f4(i32 %x), !dbg !130 +// CHECK:STDOUT: store i32 %H.call.loc29, ptr %.loc29_6.3.temp, align 4, !dbg !130 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %.loc29_6.3.temp), !dbg !130 +// CHECK:STDOUT: %H.call.loc30 = call %type.26 @_CH.Main.c3359c2c217ad593(%type.26 zeroinitializer), !dbg !131 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc31_8.3.temp), !dbg !133 +// CHECK:STDOUT: %G.call = call i32 @_CG.Main.4d9f279dbc2b9f6f(i32 %x), !dbg !133 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc31_9.3.temp), !dbg !134 +// CHECK:STDOUT: store i32 %G.call, ptr %.loc31_8.3.temp, align 4, !dbg !133 +// CHECK:STDOUT: %.loc31_8.5 = load i32, ptr %.loc31_8.3.temp, align 4, !dbg !133 +// CHECK:STDOUT: %H.call.loc31 = call i32 @_CH.Main.4d6ceefeb7f772f4(i32 %.loc31_8.5), !dbg !134 +// CHECK:STDOUT: store i32 %H.call.loc31, ptr %.loc31_9.3.temp, align 4, !dbg !134 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %.loc31_9.3.temp), !dbg !134 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %.loc31_8.3.temp), !dbg !133 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %var_f64.var), !dbg !135 +// CHECK:STDOUT: store double poison, ptr %var_f64.var, align 8, !dbg !135 +// CHECK:STDOUT: %.loc35_5 = load double, ptr %var_f64.var, align 8, !dbg !137 +// CHECK:STDOUT: %H.call.loc35 = call double @_CH.Main.c5e4ba542a56b71f(double %.loc35_5), !dbg !138 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %ptr_i32.var), !dbg !139 +// CHECK:STDOUT: store ptr poison, ptr %ptr_i32.var, align 8, !dbg !139 +// CHECK:STDOUT: %.loc37_5 = load ptr, ptr %ptr_i32.var, align 8, !dbg !141 +// CHECK:STDOUT: %H.call.loc37 = call ptr @_CH.Main.a76b78461416b4a8(ptr %.loc37_5), !dbg !142 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %ptr_f64.var), !dbg !143 +// CHECK:STDOUT: store ptr poison, ptr %ptr_f64.var, align 8, !dbg !143 +// CHECK:STDOUT: %.loc39_5 = load ptr, ptr %ptr_f64.var, align 8, !dbg !145 +// CHECK:STDOUT: %H.call.loc39 = call ptr @_CH.Main.a76b78461416b4a8(ptr %.loc39_5), !dbg !146 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %ptr_i8.var), !dbg !147 +// CHECK:STDOUT: store ptr poison, ptr %ptr_i8.var, align 8, !dbg !147 +// CHECK:STDOUT: %.loc41_5 = load ptr, ptr %ptr_i8.var, align 8, !dbg !149 +// CHECK:STDOUT: %H.call.loc41 = call ptr @_CH.Main.a76b78461416b4a8(ptr %.loc41_5), !dbg !150 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !151 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc43_6.3.temp), !dbg !154 +// CHECK:STDOUT: call void @_CH.Main.42513763e01cba2c(ptr %.loc43_6.3.temp, ptr %c.var), !dbg !154 +// CHECK:STDOUT: call void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr %.loc43_6.3.temp), !dbg !154 +// CHECK:STDOUT: call void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr %c.var), !dbg !151 +// CHECK:STDOUT: call void @"_CSelfDestruct.de57ff04fd84f9c8:core.Destroy.Core"(ptr %ptr_i8.var), !dbg !147 +// CHECK:STDOUT: call void @"_CSelfDestruct.749b51755634ad17:core.Destroy.Core"(ptr %ptr_f64.var), !dbg !143 +// CHECK:STDOUT: call void @"_CSelfDestruct.d088c7eb746488be:core.Destroy.Core"(ptr %ptr_i32.var), !dbg !139 +// CHECK:STDOUT: call void @"_CSelfDestruct.dc14d4dd21801791:core.Destroy.Core"(ptr %var_f64.var), !dbg !135 +// CHECK:STDOUT: ret i32 %x, !dbg !156 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CF.Main.073fbce68be6103e(double %_) #0 !dbg !122 { +// CHECK:STDOUT: define linkonce_odr void @_CF.Main.073fbce68be6103e(double %_) #0 !dbg !158 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !125 +// CHECK:STDOUT: ret void, !dbg !161 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr double @_CG.Main.38241ddc2cd9d74d(double %x) #0 !dbg !127 { +// CHECK:STDOUT: define linkonce_odr double @_CG.Main.cfa50e0c7743522e(double %x) #0 !dbg !163 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc29_6.3.temp = alloca double, align 8, !dbg !133 -// CHECK:STDOUT: %.loc31_8.3.temp = alloca double, align 8, !dbg !136 -// CHECK:STDOUT: %.loc31_9.3.temp = alloca double, align 8, !dbg !137 -// CHECK:STDOUT: %var_f64.var = alloca double, align 8, !dbg !138 -// CHECK:STDOUT: %ptr_i32.var = alloca ptr, align 8, !dbg !142 -// CHECK:STDOUT: %ptr_f64.var = alloca ptr, align 8, !dbg !146 -// CHECK:STDOUT: %ptr_i8.var = alloca ptr, align 8, !dbg !150 -// CHECK:STDOUT: %c.var = alloca {}, align 1, !dbg !154 -// CHECK:STDOUT: %.loc43_6.3.temp = alloca {}, align 1, !dbg !157 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc29_6.3.temp), !dbg !133 -// CHECK:STDOUT: %H.call.loc29 = call double @_CH.Main.c5e4ba542a56b71f(double %x), !dbg !133 -// CHECK:STDOUT: store double %H.call.loc29, ptr %.loc29_6.3.temp, align 8, !dbg !133 -// CHECK:STDOUT: call void @"_COp.dc14d4dd21801791:core.Destroy.Core"(ptr %.loc29_6.3.temp), !dbg !133 -// CHECK:STDOUT: %H.call.loc30 = call %type.26 @_CH.Main.c3359c2c217ad593(%type.26 zeroinitializer), !dbg !134 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc31_8.3.temp), !dbg !136 -// CHECK:STDOUT: %G.call = call double @_CG.Main.38241ddc2cd9d74d(double %x), !dbg !136 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc31_9.3.temp), !dbg !137 -// CHECK:STDOUT: store double %G.call, ptr %.loc31_8.3.temp, align 8, !dbg !136 -// CHECK:STDOUT: %.loc31_8.5 = load double, ptr %.loc31_8.3.temp, align 8, !dbg !136 -// CHECK:STDOUT: %H.call.loc31 = call double @_CH.Main.c5e4ba542a56b71f(double %.loc31_8.5), !dbg !137 -// CHECK:STDOUT: store double %H.call.loc31, ptr %.loc31_9.3.temp, align 8, !dbg !137 -// CHECK:STDOUT: call void @"_COp.dc14d4dd21801791:core.Destroy.Core"(ptr %.loc31_9.3.temp), !dbg !137 -// CHECK:STDOUT: call void @"_COp.dc14d4dd21801791:core.Destroy.Core"(ptr %.loc31_8.3.temp), !dbg !136 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %var_f64.var), !dbg !138 -// CHECK:STDOUT: store double poison, ptr %var_f64.var, align 8, !dbg !138 -// CHECK:STDOUT: %.loc35_5 = load double, ptr %var_f64.var, align 8, !dbg !140 -// CHECK:STDOUT: %H.call.loc35 = call double @_CH.Main.c5e4ba542a56b71f(double %.loc35_5), !dbg !141 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %ptr_i32.var), !dbg !142 -// CHECK:STDOUT: store ptr poison, ptr %ptr_i32.var, align 8, !dbg !142 -// CHECK:STDOUT: %.loc37_5 = load ptr, ptr %ptr_i32.var, align 8, !dbg !144 -// CHECK:STDOUT: %H.call.loc37 = call ptr @_CH.Main.a76b78461416b4a8(ptr %.loc37_5), !dbg !145 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %ptr_f64.var), !dbg !146 -// CHECK:STDOUT: store ptr poison, ptr %ptr_f64.var, align 8, !dbg !146 -// CHECK:STDOUT: %.loc39_5 = load ptr, ptr %ptr_f64.var, align 8, !dbg !148 -// CHECK:STDOUT: %H.call.loc39 = call ptr @_CH.Main.a76b78461416b4a8(ptr %.loc39_5), !dbg !149 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %ptr_i8.var), !dbg !150 -// CHECK:STDOUT: store ptr poison, ptr %ptr_i8.var, align 8, !dbg !150 -// CHECK:STDOUT: %.loc41_5 = load ptr, ptr %ptr_i8.var, align 8, !dbg !152 -// CHECK:STDOUT: %H.call.loc41 = call ptr @_CH.Main.a76b78461416b4a8(ptr %.loc41_5), !dbg !153 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !154 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc43_6.3.temp), !dbg !157 -// CHECK:STDOUT: call void @_CH.Main.42513763e01cba2c(ptr %.loc43_6.3.temp, ptr %c.var), !dbg !157 -// CHECK:STDOUT: call void @"_COp.08d9e38b928ba575:core.Destroy.Core"(ptr %.loc43_6.3.temp), !dbg !157 -// CHECK:STDOUT: call void @"_COp.08d9e38b928ba575:core.Destroy.Core"(ptr %c.var), !dbg !154 -// CHECK:STDOUT: call void @"_COp.dc14d4dd21801791:core.Destroy.Core"(ptr %var_f64.var), !dbg !138 -// CHECK:STDOUT: ret double %x, !dbg !159 +// CHECK:STDOUT: %.loc29_6.3.temp = alloca double, align 8, !dbg !169 +// CHECK:STDOUT: %.loc31_8.3.temp = alloca double, align 8, !dbg !172 +// CHECK:STDOUT: %.loc31_9.3.temp = alloca double, align 8, !dbg !173 +// CHECK:STDOUT: %var_f64.var = alloca double, align 8, !dbg !174 +// CHECK:STDOUT: %ptr_i32.var = alloca ptr, align 8, !dbg !178 +// CHECK:STDOUT: %ptr_f64.var = alloca ptr, align 8, !dbg !182 +// CHECK:STDOUT: %ptr_i8.var = alloca ptr, align 8, !dbg !186 +// CHECK:STDOUT: %c.var = alloca {}, align 1, !dbg !190 +// CHECK:STDOUT: %.loc43_6.3.temp = alloca {}, align 1, !dbg !193 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc29_6.3.temp), !dbg !169 +// CHECK:STDOUT: %H.call.loc29 = call double @_CH.Main.c5e4ba542a56b71f(double %x), !dbg !169 +// CHECK:STDOUT: store double %H.call.loc29, ptr %.loc29_6.3.temp, align 8, !dbg !169 +// CHECK:STDOUT: call void @"_CSelfDestruct.dc14d4dd21801791:core.Destroy.Core"(ptr %.loc29_6.3.temp), !dbg !169 +// CHECK:STDOUT: %H.call.loc30 = call %type.26 @_CH.Main.c3359c2c217ad593(%type.26 zeroinitializer), !dbg !170 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc31_8.3.temp), !dbg !172 +// CHECK:STDOUT: %G.call = call double @_CG.Main.cfa50e0c7743522e(double %x), !dbg !172 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc31_9.3.temp), !dbg !173 +// CHECK:STDOUT: store double %G.call, ptr %.loc31_8.3.temp, align 8, !dbg !172 +// CHECK:STDOUT: %.loc31_8.5 = load double, ptr %.loc31_8.3.temp, align 8, !dbg !172 +// CHECK:STDOUT: %H.call.loc31 = call double @_CH.Main.c5e4ba542a56b71f(double %.loc31_8.5), !dbg !173 +// CHECK:STDOUT: store double %H.call.loc31, ptr %.loc31_9.3.temp, align 8, !dbg !173 +// CHECK:STDOUT: call void @"_CSelfDestruct.dc14d4dd21801791:core.Destroy.Core"(ptr %.loc31_9.3.temp), !dbg !173 +// CHECK:STDOUT: call void @"_CSelfDestruct.dc14d4dd21801791:core.Destroy.Core"(ptr %.loc31_8.3.temp), !dbg !172 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %var_f64.var), !dbg !174 +// CHECK:STDOUT: store double poison, ptr %var_f64.var, align 8, !dbg !174 +// CHECK:STDOUT: %.loc35_5 = load double, ptr %var_f64.var, align 8, !dbg !176 +// CHECK:STDOUT: %H.call.loc35 = call double @_CH.Main.c5e4ba542a56b71f(double %.loc35_5), !dbg !177 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %ptr_i32.var), !dbg !178 +// CHECK:STDOUT: store ptr poison, ptr %ptr_i32.var, align 8, !dbg !178 +// CHECK:STDOUT: %.loc37_5 = load ptr, ptr %ptr_i32.var, align 8, !dbg !180 +// CHECK:STDOUT: %H.call.loc37 = call ptr @_CH.Main.a76b78461416b4a8(ptr %.loc37_5), !dbg !181 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %ptr_f64.var), !dbg !182 +// CHECK:STDOUT: store ptr poison, ptr %ptr_f64.var, align 8, !dbg !182 +// CHECK:STDOUT: %.loc39_5 = load ptr, ptr %ptr_f64.var, align 8, !dbg !184 +// CHECK:STDOUT: %H.call.loc39 = call ptr @_CH.Main.a76b78461416b4a8(ptr %.loc39_5), !dbg !185 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %ptr_i8.var), !dbg !186 +// CHECK:STDOUT: store ptr poison, ptr %ptr_i8.var, align 8, !dbg !186 +// CHECK:STDOUT: %.loc41_5 = load ptr, ptr %ptr_i8.var, align 8, !dbg !188 +// CHECK:STDOUT: %H.call.loc41 = call ptr @_CH.Main.a76b78461416b4a8(ptr %.loc41_5), !dbg !189 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !190 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc43_6.3.temp), !dbg !193 +// CHECK:STDOUT: call void @_CH.Main.42513763e01cba2c(ptr %.loc43_6.3.temp, ptr %c.var), !dbg !193 +// CHECK:STDOUT: call void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr %.loc43_6.3.temp), !dbg !193 +// CHECK:STDOUT: call void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr %c.var), !dbg !190 +// CHECK:STDOUT: call void @"_CSelfDestruct.de57ff04fd84f9c8:core.Destroy.Core"(ptr %ptr_i8.var), !dbg !186 +// CHECK:STDOUT: call void @"_CSelfDestruct.749b51755634ad17:core.Destroy.Core"(ptr %ptr_f64.var), !dbg !182 +// CHECK:STDOUT: call void @"_CSelfDestruct.d088c7eb746488be:core.Destroy.Core"(ptr %ptr_i32.var), !dbg !178 +// CHECK:STDOUT: call void @"_CSelfDestruct.dc14d4dd21801791:core.Destroy.Core"(ptr %var_f64.var), !dbg !174 +// CHECK:STDOUT: ret double %x, !dbg !195 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CH.Main.4d6ceefeb7f772f4(i32 %x) #0 !dbg !161 { +// CHECK:STDOUT: define linkonce_odr i32 @_CH.Main.4d6ceefeb7f772f4(i32 %x) #0 !dbg !197 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret i32 %x, !dbg !167 +// CHECK:STDOUT: ret i32 %x, !dbg !203 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr %type.26 @_CH.Main.c3359c2c217ad593(%type.26 %x) #0 !dbg !169 { +// CHECK:STDOUT: define linkonce_odr %type.26 @_CH.Main.c3359c2c217ad593(%type.26 %x) #0 !dbg !205 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret %type.26 %x, !dbg !175 +// CHECK:STDOUT: ret %type.26 %x, !dbg !211 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr double @_CH.Main.c5e4ba542a56b71f(double %x) #0 !dbg !177 { +// CHECK:STDOUT: define linkonce_odr double @_CH.Main.c5e4ba542a56b71f(double %x) #0 !dbg !213 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret double %x, !dbg !183 +// CHECK:STDOUT: ret double %x, !dbg !219 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CH.Main.a76b78461416b4a8(ptr %x) #0 !dbg !185 { +// CHECK:STDOUT: define linkonce_odr ptr @_CH.Main.a76b78461416b4a8(ptr %x) #0 !dbg !221 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret ptr %x, !dbg !191 +// CHECK:STDOUT: ret ptr %x, !dbg !227 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CH.Main.42513763e01cba2c(ptr sret({}) %return, ptr %x) #0 !dbg !209 { +// CHECK:STDOUT: define linkonce_odr void @_CH.Main.42513763e01cba2c(ptr sret({}) %return, ptr %x) #0 !dbg !245 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @"_COp.C.Main:Copy.Core"(ptr %return, ptr %x), !dbg !214 -// CHECK:STDOUT: ret void, !dbg !215 +// CHECK:STDOUT: call void @"_COp.C.Main:Copy.Core"(ptr %return, ptr %x), !dbg !250 +// CHECK:STDOUT: ret void, !dbg !251 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -293,103 +356,139 @@ fn M() { // CHECK:STDOUT: !45 = !DILocalVariable(arg: 1, scope: !44, type: !35) // CHECK:STDOUT: !49 = !DILocation(line: 15, column: 34, scope: !44) // CHECK:STDOUT: !50 = !{!45} -// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "Op", linkageName: "_COp.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !32, line: 43, type: !39, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !54) +// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !32, line: 43, type: !39, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !54) // CHECK:STDOUT: !52 = !DILocalVariable(arg: 1, scope: !51, type: !35) // CHECK:STDOUT: !53 = !DILocation(line: 43, column: 3, scope: !51) // CHECK:STDOUT: !54 = !{!52} -// CHECK:STDOUT: !55 = distinct !DISubprogram(name: "Op", linkageName: "_COp.dc14d4dd21801791:core.Destroy.Core", scope: null, file: !32, line: 34, type: !39, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !58) +// CHECK:STDOUT: !55 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !32, line: 43, type: !39, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !58) // CHECK:STDOUT: !56 = !DILocalVariable(arg: 1, scope: !55, type: !35) -// CHECK:STDOUT: !57 = !DILocation(line: 34, column: 3, scope: !55) +// CHECK:STDOUT: !57 = !DILocation(line: 43, column: 3, scope: !55) // CHECK:STDOUT: !58 = !{!56} -// CHECK:STDOUT: !59 = distinct !DISubprogram(name: "M", linkageName: "_CM.Main", scope: null, file: !32, line: 48, type: !41, spFlags: DISPFlagDefinition, unit: !33) -// CHECK:STDOUT: !60 = !DILocation(line: 49, column: 3, scope: !59) -// CHECK:STDOUT: !62 = !DILocation(line: 50, column: 3, scope: !59) -// CHECK:STDOUT: !64 = !DILocation(line: 52, column: 5, scope: !59) -// CHECK:STDOUT: !65 = !DILocation(line: 52, column: 3, scope: !59) -// CHECK:STDOUT: !66 = !DILocation(line: 53, column: 18, scope: !59) -// CHECK:STDOUT: !67 = !DILocation(line: 53, column: 16, scope: !59) -// CHECK:STDOUT: !68 = !{!34, !34} -// CHECK:STDOUT: !69 = !DISubroutineType(types: !68) -// CHECK:STDOUT: !72 = !DILocation(line: 54, column: 5, scope: !59) -// CHECK:STDOUT: !73 = !DILocation(line: 54, column: 3, scope: !59) -// CHECK:STDOUT: !74 = !DILocation(line: 55, column: 18, scope: !59) -// CHECK:STDOUT: !75 = !DILocation(line: 55, column: 16, scope: !59) -// CHECK:STDOUT: !78 = !DILocation(line: 48, column: 1, scope: !59) -// CHECK:STDOUT: !79 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !32, line: 53, type: !43, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !82) -// CHECK:STDOUT: !80 = !DILocalVariable(arg: 1, scope: !79, type: !34) -// CHECK:STDOUT: !81 = !DILocation(line: 53, column: 16, scope: !79) +// CHECK:STDOUT: !59 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !32, line: 43, type: !39, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !62) +// CHECK:STDOUT: !60 = !DILocalVariable(arg: 1, scope: !59, type: !35) +// CHECK:STDOUT: !61 = !DILocation(line: 43, column: 3, scope: !59) +// CHECK:STDOUT: !62 = !{!60} +// CHECK:STDOUT: !63 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.de57ff04fd84f9c8:core.Destroy.Core", scope: null, file: !32, line: 40, type: !39, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !66) +// CHECK:STDOUT: !64 = !DILocalVariable(arg: 1, scope: !63, type: !35) +// CHECK:STDOUT: !65 = !DILocation(line: 40, column: 3, scope: !63) +// CHECK:STDOUT: !66 = !{!64} +// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.749b51755634ad17:core.Destroy.Core", scope: null, file: !32, line: 38, type: !39, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !70) +// CHECK:STDOUT: !68 = !DILocalVariable(arg: 1, scope: !67, type: !35) +// CHECK:STDOUT: !69 = !DILocation(line: 38, column: 3, scope: !67) +// CHECK:STDOUT: !70 = !{!68} +// CHECK:STDOUT: !71 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.d088c7eb746488be:core.Destroy.Core", scope: null, file: !32, line: 36, type: !39, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !74) +// CHECK:STDOUT: !72 = !DILocalVariable(arg: 1, scope: !71, type: !35) +// CHECK:STDOUT: !73 = !DILocation(line: 36, column: 3, scope: !71) +// CHECK:STDOUT: !74 = !{!72} +// CHECK:STDOUT: !75 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.7945ecba5c505fc0:core.Destroy.Core", scope: null, file: !32, line: 34, type: !39, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !78) +// CHECK:STDOUT: !76 = !DILocalVariable(arg: 1, scope: !75, type: !35) +// CHECK:STDOUT: !77 = !DILocation(line: 34, column: 3, scope: !75) +// CHECK:STDOUT: !78 = !{!76} +// CHECK:STDOUT: !79 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.dc14d4dd21801791:core.Destroy.Core", scope: null, file: !32, line: 34, type: !39, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !82) +// CHECK:STDOUT: !80 = !DILocalVariable(arg: 1, scope: !79, type: !35) +// CHECK:STDOUT: !81 = !DILocation(line: 34, column: 3, scope: !79) // CHECK:STDOUT: !82 = !{!80} -// CHECK:STDOUT: !83 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.84588f41d61dafba", scope: null, file: !32, line: 19, type: !43, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !87) -// CHECK:STDOUT: !84 = !DILocalVariable(arg: 1, scope: !83, type: !34) -// CHECK:STDOUT: !86 = !DILocation(line: 19, column: 1, scope: !83) -// CHECK:STDOUT: !87 = !{!84} -// CHECK:STDOUT: !88 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.89a3e87df6fdafe1", scope: null, file: !32, line: 28, type: !69, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !121) -// CHECK:STDOUT: !89 = !DILocalVariable(arg: 1, scope: !88, type: !34) -// CHECK:STDOUT: !94 = !DILocation(line: 29, column: 3, scope: !88) -// CHECK:STDOUT: !95 = !DILocation(line: 30, column: 3, scope: !88) -// CHECK:STDOUT: !97 = !DILocation(line: 31, column: 5, scope: !88) -// CHECK:STDOUT: !98 = !DILocation(line: 31, column: 3, scope: !88) -// CHECK:STDOUT: !99 = !DILocation(line: 34, column: 3, scope: !88) -// CHECK:STDOUT: !101 = !DILocation(line: 35, column: 5, scope: !88) -// CHECK:STDOUT: !102 = !DILocation(line: 35, column: 3, scope: !88) -// CHECK:STDOUT: !103 = !DILocation(line: 36, column: 3, scope: !88) -// CHECK:STDOUT: !105 = !DILocation(line: 37, column: 5, scope: !88) -// CHECK:STDOUT: !106 = !DILocation(line: 37, column: 3, scope: !88) -// CHECK:STDOUT: !107 = !DILocation(line: 38, column: 3, scope: !88) -// CHECK:STDOUT: !109 = !DILocation(line: 39, column: 5, scope: !88) -// CHECK:STDOUT: !110 = !DILocation(line: 39, column: 3, scope: !88) -// CHECK:STDOUT: !111 = !DILocation(line: 40, column: 3, scope: !88) -// CHECK:STDOUT: !113 = !DILocation(line: 41, column: 5, scope: !88) -// CHECK:STDOUT: !114 = !DILocation(line: 41, column: 3, scope: !88) -// CHECK:STDOUT: !115 = !DILocation(line: 42, column: 3, scope: !88) -// CHECK:STDOUT: !118 = !DILocation(line: 43, column: 3, scope: !88) -// CHECK:STDOUT: !120 = !DILocation(line: 45, column: 3, scope: !88) -// CHECK:STDOUT: !121 = !{!89} -// CHECK:STDOUT: !122 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.073fbce68be6103e", scope: null, file: !32, line: 19, type: !39, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !126) -// CHECK:STDOUT: !123 = !DILocalVariable(arg: 1, scope: !122, type: !35) -// CHECK:STDOUT: !125 = !DILocation(line: 19, column: 1, scope: !122) -// CHECK:STDOUT: !126 = !{!123} -// CHECK:STDOUT: !127 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.38241ddc2cd9d74d", scope: null, file: !32, line: 28, type: !37, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !160) -// CHECK:STDOUT: !128 = !DILocalVariable(arg: 1, scope: !127, type: !35) -// CHECK:STDOUT: !133 = !DILocation(line: 29, column: 3, scope: !127) -// CHECK:STDOUT: !134 = !DILocation(line: 30, column: 3, scope: !127) -// CHECK:STDOUT: !136 = !DILocation(line: 31, column: 5, scope: !127) -// CHECK:STDOUT: !137 = !DILocation(line: 31, column: 3, scope: !127) -// CHECK:STDOUT: !138 = !DILocation(line: 34, column: 3, scope: !127) -// CHECK:STDOUT: !140 = !DILocation(line: 35, column: 5, scope: !127) -// CHECK:STDOUT: !141 = !DILocation(line: 35, column: 3, scope: !127) -// CHECK:STDOUT: !142 = !DILocation(line: 36, column: 3, scope: !127) -// CHECK:STDOUT: !144 = !DILocation(line: 37, column: 5, scope: !127) -// CHECK:STDOUT: !145 = !DILocation(line: 37, column: 3, scope: !127) -// CHECK:STDOUT: !146 = !DILocation(line: 38, column: 3, scope: !127) -// CHECK:STDOUT: !148 = !DILocation(line: 39, column: 5, scope: !127) -// CHECK:STDOUT: !149 = !DILocation(line: 39, column: 3, scope: !127) -// CHECK:STDOUT: !150 = !DILocation(line: 40, column: 3, scope: !127) -// CHECK:STDOUT: !152 = !DILocation(line: 41, column: 5, scope: !127) -// CHECK:STDOUT: !153 = !DILocation(line: 41, column: 3, scope: !127) -// CHECK:STDOUT: !154 = !DILocation(line: 42, column: 3, scope: !127) -// CHECK:STDOUT: !157 = !DILocation(line: 43, column: 3, scope: !127) -// CHECK:STDOUT: !159 = !DILocation(line: 45, column: 3, scope: !127) -// CHECK:STDOUT: !160 = !{!128} -// CHECK:STDOUT: !161 = distinct !DISubprogram(name: "H", linkageName: "_CH.Main.4d6ceefeb7f772f4", scope: null, file: !32, line: 22, type: !69, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !168) -// CHECK:STDOUT: !162 = !DILocalVariable(arg: 1, scope: !161, type: !34) -// CHECK:STDOUT: !167 = !DILocation(line: 23, column: 3, scope: !161) -// CHECK:STDOUT: !168 = !{!162} -// CHECK:STDOUT: !169 = distinct !DISubprogram(name: "H", linkageName: "_CH.Main.c3359c2c217ad593", scope: null, file: !32, line: 22, type: !37, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !176) -// CHECK:STDOUT: !170 = !DILocalVariable(arg: 1, scope: !169, type: !35) -// CHECK:STDOUT: !175 = !DILocation(line: 23, column: 3, scope: !169) -// CHECK:STDOUT: !176 = !{!170} -// CHECK:STDOUT: !177 = distinct !DISubprogram(name: "H", linkageName: "_CH.Main.c5e4ba542a56b71f", scope: null, file: !32, line: 22, type: !37, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !184) -// CHECK:STDOUT: !178 = !DILocalVariable(arg: 1, scope: !177, type: !35) -// CHECK:STDOUT: !183 = !DILocation(line: 23, column: 3, scope: !177) -// CHECK:STDOUT: !184 = !{!178} -// CHECK:STDOUT: !185 = distinct !DISubprogram(name: "H", linkageName: "_CH.Main.a76b78461416b4a8", scope: null, file: !32, line: 22, type: !37, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !192) -// CHECK:STDOUT: !186 = !DILocalVariable(arg: 1, scope: !185, type: !35) -// CHECK:STDOUT: !191 = !DILocation(line: 23, column: 3, scope: !185) -// CHECK:STDOUT: !192 = !{!186} -// CHECK:STDOUT: !209 = distinct !DISubprogram(name: "H", linkageName: "_CH.Main.42513763e01cba2c", scope: null, file: !32, line: 22, type: !37, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !216) -// CHECK:STDOUT: !210 = !DILocalVariable(arg: 1, scope: !209, type: !35) -// CHECK:STDOUT: !214 = !DILocation(line: 23, column: 10, scope: !209) -// CHECK:STDOUT: !215 = !DILocation(line: 23, column: 3, scope: !209) -// CHECK:STDOUT: !216 = !{!210} +// CHECK:STDOUT: !83 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.dc14d4dd21801791:core.Destroy.Core", scope: null, file: !32, line: 34, type: !39, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !86) +// CHECK:STDOUT: !84 = !DILocalVariable(arg: 1, scope: !83, type: !35) +// CHECK:STDOUT: !85 = !DILocation(line: 34, column: 3, scope: !83) +// CHECK:STDOUT: !86 = !{!84} +// CHECK:STDOUT: !87 = distinct !DISubprogram(name: "M", linkageName: "_CM.Main", scope: null, file: !32, line: 48, type: !41, spFlags: DISPFlagDefinition, unit: !33) +// CHECK:STDOUT: !88 = !DILocation(line: 49, column: 3, scope: !87) +// CHECK:STDOUT: !90 = !DILocation(line: 50, column: 3, scope: !87) +// CHECK:STDOUT: !92 = !DILocation(line: 52, column: 5, scope: !87) +// CHECK:STDOUT: !93 = !DILocation(line: 52, column: 3, scope: !87) +// CHECK:STDOUT: !94 = !DILocation(line: 53, column: 18, scope: !87) +// CHECK:STDOUT: !95 = !DILocation(line: 53, column: 16, scope: !87) +// CHECK:STDOUT: !96 = !{!34, !34} +// CHECK:STDOUT: !97 = !DISubroutineType(types: !96) +// CHECK:STDOUT: !100 = !DILocation(line: 54, column: 5, scope: !87) +// CHECK:STDOUT: !101 = !DILocation(line: 54, column: 3, scope: !87) +// CHECK:STDOUT: !102 = !DILocation(line: 55, column: 18, scope: !87) +// CHECK:STDOUT: !103 = !DILocation(line: 55, column: 16, scope: !87) +// CHECK:STDOUT: !106 = !DILocation(line: 48, column: 1, scope: !87) +// CHECK:STDOUT: !107 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !32, line: 53, type: !43, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !110) +// CHECK:STDOUT: !108 = !DILocalVariable(arg: 1, scope: !107, type: !34) +// CHECK:STDOUT: !109 = !DILocation(line: 53, column: 16, scope: !107) +// CHECK:STDOUT: !110 = !{!108} +// CHECK:STDOUT: !111 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !32, line: 53, type: !43, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !114) +// CHECK:STDOUT: !112 = !DILocalVariable(arg: 1, scope: !111, type: !34) +// CHECK:STDOUT: !113 = !DILocation(line: 53, column: 16, scope: !111) +// CHECK:STDOUT: !114 = !{!112} +// CHECK:STDOUT: !115 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !32, line: 53, type: !43, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !118) +// CHECK:STDOUT: !116 = !DILocalVariable(arg: 1, scope: !115, type: !34) +// CHECK:STDOUT: !117 = !DILocation(line: 53, column: 16, scope: !115) +// CHECK:STDOUT: !118 = !{!116} +// CHECK:STDOUT: !119 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.84588f41d61dafba", scope: null, file: !32, line: 19, type: !43, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !123) +// CHECK:STDOUT: !120 = !DILocalVariable(arg: 1, scope: !119, type: !34) +// CHECK:STDOUT: !122 = !DILocation(line: 19, column: 1, scope: !119) +// CHECK:STDOUT: !123 = !{!120} +// CHECK:STDOUT: !124 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.4d9f279dbc2b9f6f", scope: null, file: !32, line: 28, type: !97, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !157) +// CHECK:STDOUT: !125 = !DILocalVariable(arg: 1, scope: !124, type: !34) +// CHECK:STDOUT: !130 = !DILocation(line: 29, column: 3, scope: !124) +// CHECK:STDOUT: !131 = !DILocation(line: 30, column: 3, scope: !124) +// CHECK:STDOUT: !133 = !DILocation(line: 31, column: 5, scope: !124) +// CHECK:STDOUT: !134 = !DILocation(line: 31, column: 3, scope: !124) +// CHECK:STDOUT: !135 = !DILocation(line: 34, column: 3, scope: !124) +// CHECK:STDOUT: !137 = !DILocation(line: 35, column: 5, scope: !124) +// CHECK:STDOUT: !138 = !DILocation(line: 35, column: 3, scope: !124) +// CHECK:STDOUT: !139 = !DILocation(line: 36, column: 3, scope: !124) +// CHECK:STDOUT: !141 = !DILocation(line: 37, column: 5, scope: !124) +// CHECK:STDOUT: !142 = !DILocation(line: 37, column: 3, scope: !124) +// CHECK:STDOUT: !143 = !DILocation(line: 38, column: 3, scope: !124) +// CHECK:STDOUT: !145 = !DILocation(line: 39, column: 5, scope: !124) +// CHECK:STDOUT: !146 = !DILocation(line: 39, column: 3, scope: !124) +// CHECK:STDOUT: !147 = !DILocation(line: 40, column: 3, scope: !124) +// CHECK:STDOUT: !149 = !DILocation(line: 41, column: 5, scope: !124) +// CHECK:STDOUT: !150 = !DILocation(line: 41, column: 3, scope: !124) +// CHECK:STDOUT: !151 = !DILocation(line: 42, column: 3, scope: !124) +// CHECK:STDOUT: !154 = !DILocation(line: 43, column: 3, scope: !124) +// CHECK:STDOUT: !156 = !DILocation(line: 45, column: 3, scope: !124) +// CHECK:STDOUT: !157 = !{!125} +// CHECK:STDOUT: !158 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.073fbce68be6103e", scope: null, file: !32, line: 19, type: !39, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !162) +// CHECK:STDOUT: !159 = !DILocalVariable(arg: 1, scope: !158, type: !35) +// CHECK:STDOUT: !161 = !DILocation(line: 19, column: 1, scope: !158) +// CHECK:STDOUT: !162 = !{!159} +// CHECK:STDOUT: !163 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.cfa50e0c7743522e", scope: null, file: !32, line: 28, type: !37, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !196) +// CHECK:STDOUT: !164 = !DILocalVariable(arg: 1, scope: !163, type: !35) +// CHECK:STDOUT: !169 = !DILocation(line: 29, column: 3, scope: !163) +// CHECK:STDOUT: !170 = !DILocation(line: 30, column: 3, scope: !163) +// CHECK:STDOUT: !172 = !DILocation(line: 31, column: 5, scope: !163) +// CHECK:STDOUT: !173 = !DILocation(line: 31, column: 3, scope: !163) +// CHECK:STDOUT: !174 = !DILocation(line: 34, column: 3, scope: !163) +// CHECK:STDOUT: !176 = !DILocation(line: 35, column: 5, scope: !163) +// CHECK:STDOUT: !177 = !DILocation(line: 35, column: 3, scope: !163) +// CHECK:STDOUT: !178 = !DILocation(line: 36, column: 3, scope: !163) +// CHECK:STDOUT: !180 = !DILocation(line: 37, column: 5, scope: !163) +// CHECK:STDOUT: !181 = !DILocation(line: 37, column: 3, scope: !163) +// CHECK:STDOUT: !182 = !DILocation(line: 38, column: 3, scope: !163) +// CHECK:STDOUT: !184 = !DILocation(line: 39, column: 5, scope: !163) +// CHECK:STDOUT: !185 = !DILocation(line: 39, column: 3, scope: !163) +// CHECK:STDOUT: !186 = !DILocation(line: 40, column: 3, scope: !163) +// CHECK:STDOUT: !188 = !DILocation(line: 41, column: 5, scope: !163) +// CHECK:STDOUT: !189 = !DILocation(line: 41, column: 3, scope: !163) +// CHECK:STDOUT: !190 = !DILocation(line: 42, column: 3, scope: !163) +// CHECK:STDOUT: !193 = !DILocation(line: 43, column: 3, scope: !163) +// CHECK:STDOUT: !195 = !DILocation(line: 45, column: 3, scope: !163) +// CHECK:STDOUT: !196 = !{!164} +// CHECK:STDOUT: !197 = distinct !DISubprogram(name: "H", linkageName: "_CH.Main.4d6ceefeb7f772f4", scope: null, file: !32, line: 22, type: !97, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !204) +// CHECK:STDOUT: !198 = !DILocalVariable(arg: 1, scope: !197, type: !34) +// CHECK:STDOUT: !203 = !DILocation(line: 23, column: 3, scope: !197) +// CHECK:STDOUT: !204 = !{!198} +// CHECK:STDOUT: !205 = distinct !DISubprogram(name: "H", linkageName: "_CH.Main.c3359c2c217ad593", scope: null, file: !32, line: 22, type: !37, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !212) +// CHECK:STDOUT: !206 = !DILocalVariable(arg: 1, scope: !205, type: !35) +// CHECK:STDOUT: !211 = !DILocation(line: 23, column: 3, scope: !205) +// CHECK:STDOUT: !212 = !{!206} +// CHECK:STDOUT: !213 = distinct !DISubprogram(name: "H", linkageName: "_CH.Main.c5e4ba542a56b71f", scope: null, file: !32, line: 22, type: !37, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !220) +// CHECK:STDOUT: !214 = !DILocalVariable(arg: 1, scope: !213, type: !35) +// CHECK:STDOUT: !219 = !DILocation(line: 23, column: 3, scope: !213) +// CHECK:STDOUT: !220 = !{!214} +// CHECK:STDOUT: !221 = distinct !DISubprogram(name: "H", linkageName: "_CH.Main.a76b78461416b4a8", scope: null, file: !32, line: 22, type: !37, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !228) +// CHECK:STDOUT: !222 = !DILocalVariable(arg: 1, scope: !221, type: !35) +// CHECK:STDOUT: !227 = !DILocation(line: 23, column: 3, scope: !221) +// CHECK:STDOUT: !228 = !{!222} +// CHECK:STDOUT: !245 = distinct !DISubprogram(name: "H", linkageName: "_CH.Main.42513763e01cba2c", scope: null, file: !32, line: 22, type: !37, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !252) +// CHECK:STDOUT: !246 = !DILocalVariable(arg: 1, scope: !245, type: !35) +// CHECK:STDOUT: !250 = !DILocation(line: 23, column: 10, scope: !245) +// CHECK:STDOUT: !251 = !DILocation(line: 23, column: 3, scope: !245) +// CHECK:STDOUT: !252 = !{!246} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/function/generic/call_basic_depth.carbon b/toolchain/lower/testdata/function/generic/call_basic_depth.carbon index d20ae314caeb..0f5b84fee36e 100644 --- a/toolchain/lower/testdata/function/generic/call_basic_depth.carbon +++ b/toolchain/lower/testdata/function/generic/call_basic_depth.carbon @@ -52,50 +52,63 @@ fn M() -> i32 { // CHECK:STDOUT: %.loc34 = load i32, ptr %n.var, align 4, !dbg !32 // CHECK:STDOUT: call void @_CF.Main.84588f41d61dafba(i32 %.loc34), !dbg !33 // CHECK:STDOUT: %.loc35_9 = load i32, ptr %n.var, align 4, !dbg !35 -// CHECK:STDOUT: %G.call = call i32 @_CG.Main.89a3e87df6fdafe1(i32 %.loc35_9), !dbg !36 +// CHECK:STDOUT: %G.call = call i32 @_CG.Main.4d9f279dbc2b9f6f(i32 %.loc35_9), !dbg !36 // CHECK:STDOUT: store i32 %G.call, ptr %m.var, align 4, !dbg !34 // CHECK:STDOUT: %.loc36 = load i32, ptr %m.var, align 4, !dbg !39 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %m.var), !dbg !30 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %n.var), !dbg !28 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %m.var), !dbg !30 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %n.var), !dbg !28 // CHECK:STDOUT: ret i32 %.loc36, !dbg !40 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !41 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !41 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !43 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !45 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !47 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !49 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !51 +// CHECK:STDOUT: ret void, !dbg !51 +// 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 @_CF.Main.84588f41d61dafba(i32 %_) #0 !dbg !45 { +// CHECK:STDOUT: define linkonce_odr void @_CF.Main.84588f41d61dafba(i32 %_) #0 !dbg !53 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !48 +// CHECK:STDOUT: ret void, !dbg !56 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CG.Main.89a3e87df6fdafe1(i32 %x) #0 !dbg !50 { +// CHECK:STDOUT: define linkonce_odr i32 @_CG.Main.4d9f279dbc2b9f6f(i32 %x) #0 !dbg !58 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc25_6.3.temp = alloca i32, align 4, !dbg !56 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc25_6.3.temp), !dbg !56 -// CHECK:STDOUT: %H.call = call i32 @_CH.Main.4d6ceefeb7f772f4(i32 %x), !dbg !56 -// CHECK:STDOUT: store i32 %H.call, ptr %.loc25_6.3.temp, align 4, !dbg !56 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %.loc25_6.3.temp), !dbg !56 -// CHECK:STDOUT: call void @_CF.Main.84588f41d61dafba(i32 %x), !dbg !58 -// CHECK:STDOUT: ret i32 %x, !dbg !60 +// CHECK:STDOUT: %.loc25_6.3.temp = alloca i32, align 4, !dbg !64 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc25_6.3.temp), !dbg !64 +// CHECK:STDOUT: %H.call = call i32 @_CH.Main.4d6ceefeb7f772f4(i32 %x), !dbg !64 +// CHECK:STDOUT: store i32 %H.call, ptr %.loc25_6.3.temp, align 4, !dbg !64 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %.loc25_6.3.temp), !dbg !64 +// CHECK:STDOUT: call void @_CF.Main.84588f41d61dafba(i32 %x), !dbg !66 +// CHECK:STDOUT: ret i32 %x, !dbg !68 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CH.Main.4d6ceefeb7f772f4(i32 %x) #0 !dbg !62 { +// CHECK:STDOUT: define linkonce_odr i32 @_CH.Main.4d6ceefeb7f772f4(i32 %x) #0 !dbg !70 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CF.Main.84588f41d61dafba(i32 %x), !dbg !68 -// CHECK:STDOUT: ret i32 %x, !dbg !70 +// CHECK:STDOUT: call void @_CF.Main.84588f41d61dafba(i32 %x), !dbg !76 +// CHECK:STDOUT: ret i32 %x, !dbg !78 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives -// CHECK:STDOUT: uselistorder ptr @"_COp.f58524831c37807e:core.Destroy.Core", { 0, 2, 1 } +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core", { 0, 2, 1 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 0, 2, 1 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -125,23 +138,31 @@ fn M() -> i32 { // CHECK:STDOUT: !38 = !DISubroutineType(types: !37) // CHECK:STDOUT: !39 = !DILocation(line: 36, column: 10, scope: !25) // CHECK:STDOUT: !40 = !DILocation(line: 36, column: 3, scope: !25) -// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 35, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !44) +// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !18, line: 35, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !44) // CHECK:STDOUT: !42 = !DILocalVariable(arg: 1, scope: !41, type: !20) // CHECK:STDOUT: !43 = !DILocation(line: 35, column: 7, scope: !41) // CHECK:STDOUT: !44 = !{!42} -// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.84588f41d61dafba", scope: null, file: !18, line: 16, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !49) +// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 35, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !48) // CHECK:STDOUT: !46 = !DILocalVariable(arg: 1, scope: !45, type: !20) -// CHECK:STDOUT: !48 = !DILocation(line: 16, column: 1, scope: !45) -// CHECK:STDOUT: !49 = !{!46} -// CHECK:STDOUT: !50 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.89a3e87df6fdafe1", scope: null, file: !18, line: 24, type: !38, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !61) -// CHECK:STDOUT: !51 = !DILocalVariable(arg: 1, scope: !50, type: !20) -// CHECK:STDOUT: !56 = !DILocation(line: 25, column: 3, scope: !50) -// CHECK:STDOUT: !58 = !DILocation(line: 26, column: 3, scope: !50) -// CHECK:STDOUT: !60 = !DILocation(line: 27, column: 3, scope: !50) -// CHECK:STDOUT: !61 = !{!51} -// CHECK:STDOUT: !62 = distinct !DISubprogram(name: "H", linkageName: "_CH.Main.4d6ceefeb7f772f4", scope: null, file: !18, line: 19, type: !38, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !71) -// CHECK:STDOUT: !63 = !DILocalVariable(arg: 1, scope: !62, type: !20) -// CHECK:STDOUT: !68 = !DILocation(line: 20, column: 3, scope: !62) -// CHECK:STDOUT: !70 = !DILocation(line: 21, column: 3, scope: !62) -// CHECK:STDOUT: !71 = !{!63} +// CHECK:STDOUT: !47 = !DILocation(line: 35, column: 7, scope: !45) +// CHECK:STDOUT: !48 = !{!46} +// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 35, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !52) +// CHECK:STDOUT: !50 = !DILocalVariable(arg: 1, scope: !49, type: !20) +// CHECK:STDOUT: !51 = !DILocation(line: 35, column: 7, scope: !49) +// CHECK:STDOUT: !52 = !{!50} +// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.84588f41d61dafba", scope: null, file: !18, line: 16, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !57) +// CHECK:STDOUT: !54 = !DILocalVariable(arg: 1, scope: !53, type: !20) +// CHECK:STDOUT: !56 = !DILocation(line: 16, column: 1, scope: !53) +// CHECK:STDOUT: !57 = !{!54} +// CHECK:STDOUT: !58 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.4d9f279dbc2b9f6f", scope: null, file: !18, line: 24, type: !38, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !69) +// CHECK:STDOUT: !59 = !DILocalVariable(arg: 1, scope: !58, type: !20) +// CHECK:STDOUT: !64 = !DILocation(line: 25, column: 3, scope: !58) +// CHECK:STDOUT: !66 = !DILocation(line: 26, column: 3, scope: !58) +// CHECK:STDOUT: !68 = !DILocation(line: 27, column: 3, scope: !58) +// CHECK:STDOUT: !69 = !{!59} +// CHECK:STDOUT: !70 = distinct !DISubprogram(name: "H", linkageName: "_CH.Main.4d6ceefeb7f772f4", scope: null, file: !18, line: 19, type: !38, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !79) +// CHECK:STDOUT: !71 = !DILocalVariable(arg: 1, scope: !70, type: !20) +// CHECK:STDOUT: !76 = !DILocation(line: 20, column: 3, scope: !70) +// CHECK:STDOUT: !78 = !DILocation(line: 21, column: 3, scope: !70) +// CHECK:STDOUT: !79 = !{!71} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/function/generic/call_dedup_ptr.carbon b/toolchain/lower/testdata/function/generic/call_dedup_ptr.carbon index f2044ccccefc..6d0572527272 100644 --- a/toolchain/lower/testdata/function/generic/call_dedup_ptr.carbon +++ b/toolchain/lower/testdata/function/generic/call_dedup_ptr.carbon @@ -28,33 +28,54 @@ fn M() { // CHECK:STDOUT: source_filename = "call_dedup_ptr.carbon" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CM.Main() #0 !dbg !36 { +// CHECK:STDOUT: define void @_CM.Main() #0 !dbg !39 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %ptr_i32.var = alloca ptr, align 8, !dbg !37 -// CHECK:STDOUT: %ptr_f64.var = alloca ptr, align 8, !dbg !44 -// CHECK:STDOUT: %ptr_i8.var = alloca ptr, align 8, !dbg !48 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %ptr_i32.var), !dbg !37 -// CHECK:STDOUT: store ptr poison, ptr %ptr_i32.var, align 8, !dbg !37 -// CHECK:STDOUT: %.loc19_5 = load ptr, ptr %ptr_i32.var, align 8, !dbg !39 -// CHECK:STDOUT: %F.call.loc19 = call ptr @_CF.Main.a76b78461416b4a8(ptr %.loc19_5), !dbg !40 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %ptr_f64.var), !dbg !44 -// CHECK:STDOUT: store ptr poison, ptr %ptr_f64.var, align 8, !dbg !44 -// CHECK:STDOUT: %.loc21_5 = load ptr, ptr %ptr_f64.var, align 8, !dbg !46 -// CHECK:STDOUT: %F.call.loc21 = call ptr @_CF.Main.a76b78461416b4a8(ptr %.loc21_5), !dbg !47 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %ptr_i8.var), !dbg !48 -// CHECK:STDOUT: store ptr poison, ptr %ptr_i8.var, align 8, !dbg !48 -// CHECK:STDOUT: %.loc23_5 = load ptr, ptr %ptr_i8.var, align 8, !dbg !50 -// CHECK:STDOUT: %F.call.loc23 = call ptr @_CF.Main.a76b78461416b4a8(ptr %.loc23_5), !dbg !51 -// CHECK:STDOUT: ret void, !dbg !52 +// CHECK:STDOUT: %ptr_i32.var = alloca ptr, align 8, !dbg !40 +// CHECK:STDOUT: %ptr_f64.var = alloca ptr, align 8, !dbg !46 +// CHECK:STDOUT: %ptr_i8.var = alloca ptr, align 8, !dbg !50 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %ptr_i32.var), !dbg !40 +// CHECK:STDOUT: store ptr poison, ptr %ptr_i32.var, align 8, !dbg !40 +// CHECK:STDOUT: %.loc19_5 = load ptr, ptr %ptr_i32.var, align 8, !dbg !42 +// CHECK:STDOUT: %F.call.loc19 = call ptr @_CF.Main.a76b78461416b4a8(ptr %.loc19_5), !dbg !43 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %ptr_f64.var), !dbg !46 +// CHECK:STDOUT: store ptr poison, ptr %ptr_f64.var, align 8, !dbg !46 +// CHECK:STDOUT: %.loc21_5 = load ptr, ptr %ptr_f64.var, align 8, !dbg !48 +// CHECK:STDOUT: %F.call.loc21 = call ptr @_CF.Main.a76b78461416b4a8(ptr %.loc21_5), !dbg !49 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %ptr_i8.var), !dbg !50 +// CHECK:STDOUT: store ptr poison, ptr %ptr_i8.var, align 8, !dbg !50 +// CHECK:STDOUT: %.loc23_5 = load ptr, ptr %ptr_i8.var, align 8, !dbg !52 +// CHECK:STDOUT: %F.call.loc23 = call ptr @_CF.Main.a76b78461416b4a8(ptr %.loc23_5), !dbg !53 +// CHECK:STDOUT: call void @"_CSelfDestruct.de57ff04fd84f9c8:core.Destroy.Core"(ptr %ptr_i8.var), !dbg !50 +// CHECK:STDOUT: call void @"_CSelfDestruct.749b51755634ad17:core.Destroy.Core"(ptr %ptr_f64.var), !dbg !46 +// CHECK:STDOUT: call void @"_CSelfDestruct.d088c7eb746488be:core.Destroy.Core"(ptr %ptr_i32.var), !dbg !40 +// CHECK:STDOUT: ret void, !dbg !54 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.de57ff04fd84f9c8:core.Destroy.Core"(ptr %self) #0 !dbg !55 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !57 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.749b51755634ad17:core.Destroy.Core"(ptr %self) #0 !dbg !59 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !61 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.d088c7eb746488be:core.Destroy.Core"(ptr %self) #0 !dbg !63 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !65 // 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 ptr @_CF.Main.a76b78461416b4a8(ptr %x) #0 !dbg !53 { +// CHECK:STDOUT: define linkonce_odr ptr @_CF.Main.a76b78461416b4a8(ptr %x) #0 !dbg !67 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret ptr %x, !dbg !59 +// CHECK:STDOUT: ret ptr %x, !dbg !73 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -73,22 +94,36 @@ fn M() { // CHECK:STDOUT: !33 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !32, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) // CHECK:STDOUT: !34 = !{null} // CHECK:STDOUT: !35 = !DISubroutineType(types: !34) -// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "M", linkageName: "_CM.Main", scope: null, file: !32, line: 17, type: !35, spFlags: DISPFlagDefinition, unit: !33) -// CHECK:STDOUT: !37 = !DILocation(line: 18, column: 3, scope: !36) -// CHECK:STDOUT: !39 = !DILocation(line: 19, column: 5, scope: !36) -// CHECK:STDOUT: !40 = !DILocation(line: 19, column: 3, scope: !36) -// CHECK:STDOUT: !41 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !42 = !{!41, !41} -// CHECK:STDOUT: !43 = !DISubroutineType(types: !42) -// CHECK:STDOUT: !44 = !DILocation(line: 20, column: 3, scope: !36) -// CHECK:STDOUT: !46 = !DILocation(line: 21, column: 5, scope: !36) -// CHECK:STDOUT: !47 = !DILocation(line: 21, column: 3, scope: !36) -// CHECK:STDOUT: !48 = !DILocation(line: 22, column: 3, scope: !36) -// CHECK:STDOUT: !50 = !DILocation(line: 23, column: 5, scope: !36) -// CHECK:STDOUT: !51 = !DILocation(line: 23, column: 3, scope: !36) -// CHECK:STDOUT: !52 = !DILocation(line: 17, column: 1, scope: !36) -// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.a76b78461416b4a8", scope: null, file: !32, line: 13, type: !43, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !60) -// CHECK:STDOUT: !54 = !DILocalVariable(arg: 1, scope: !53, type: !41) -// CHECK:STDOUT: !59 = !DILocation(line: 14, column: 3, scope: !53) -// CHECK:STDOUT: !60 = !{!54} +// CHECK:STDOUT: !36 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !37 = !{null, !36} +// CHECK:STDOUT: !38 = !DISubroutineType(types: !37) +// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "M", linkageName: "_CM.Main", scope: null, file: !32, line: 17, type: !35, spFlags: DISPFlagDefinition, unit: !33) +// CHECK:STDOUT: !40 = !DILocation(line: 18, column: 3, scope: !39) +// CHECK:STDOUT: !42 = !DILocation(line: 19, column: 5, scope: !39) +// CHECK:STDOUT: !43 = !DILocation(line: 19, column: 3, scope: !39) +// CHECK:STDOUT: !44 = !{!36, !36} +// CHECK:STDOUT: !45 = !DISubroutineType(types: !44) +// CHECK:STDOUT: !46 = !DILocation(line: 20, column: 3, scope: !39) +// CHECK:STDOUT: !48 = !DILocation(line: 21, column: 5, scope: !39) +// CHECK:STDOUT: !49 = !DILocation(line: 21, column: 3, scope: !39) +// CHECK:STDOUT: !50 = !DILocation(line: 22, column: 3, scope: !39) +// CHECK:STDOUT: !52 = !DILocation(line: 23, column: 5, scope: !39) +// CHECK:STDOUT: !53 = !DILocation(line: 23, column: 3, scope: !39) +// CHECK:STDOUT: !54 = !DILocation(line: 17, column: 1, scope: !39) +// CHECK:STDOUT: !55 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.de57ff04fd84f9c8:core.Destroy.Core", scope: null, file: !32, line: 22, type: !38, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !58) +// CHECK:STDOUT: !56 = !DILocalVariable(arg: 1, scope: !55, type: !36) +// CHECK:STDOUT: !57 = !DILocation(line: 22, column: 3, scope: !55) +// CHECK:STDOUT: !58 = !{!56} +// CHECK:STDOUT: !59 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.749b51755634ad17:core.Destroy.Core", scope: null, file: !32, line: 20, type: !38, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !62) +// CHECK:STDOUT: !60 = !DILocalVariable(arg: 1, scope: !59, type: !36) +// CHECK:STDOUT: !61 = !DILocation(line: 20, column: 3, scope: !59) +// CHECK:STDOUT: !62 = !{!60} +// CHECK:STDOUT: !63 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.d088c7eb746488be:core.Destroy.Core", scope: null, file: !32, line: 18, type: !38, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !66) +// CHECK:STDOUT: !64 = !DILocalVariable(arg: 1, scope: !63, type: !36) +// CHECK:STDOUT: !65 = !DILocation(line: 18, column: 3, scope: !63) +// CHECK:STDOUT: !66 = !{!64} +// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.a76b78461416b4a8", scope: null, file: !32, line: 13, type: !45, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !74) +// CHECK:STDOUT: !68 = !DILocalVariable(arg: 1, scope: !67, type: !36) +// CHECK:STDOUT: !73 = !DILocation(line: 14, column: 3, scope: !67) +// CHECK:STDOUT: !74 = !{!68} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/function/generic/call_deref_ptr.carbon b/toolchain/lower/testdata/function/generic/call_deref_ptr.carbon index 5dd96a447484..ef18dbbb9901 100644 --- a/toolchain/lower/testdata/function/generic/call_deref_ptr.carbon +++ b/toolchain/lower/testdata/function/generic/call_deref_ptr.carbon @@ -56,83 +56,123 @@ fn M() { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %ptr_f64.var), !dbg !45 // CHECK:STDOUT: store ptr poison, ptr %ptr_f64.var, align 8, !dbg !45 // CHECK:STDOUT: %.loc39_5 = load ptr, ptr %ptr_i32.var, align 8, !dbg !47 -// CHECK:STDOUT: call void @_CF.Main.89a3e87df6fdafe1(ptr %.loc39_5), !dbg !48 +// CHECK:STDOUT: call void @_CF.Main.4d9f279dbc2b9f6f(ptr %.loc39_5), !dbg !48 // CHECK:STDOUT: %.loc40_5 = load ptr, ptr %ptr_f64.var, align 8, !dbg !49 -// CHECK:STDOUT: call void @_CF.Main.38241ddc2cd9d74d(ptr %.loc40_5), !dbg !50 +// CHECK:STDOUT: call void @_CF.Main.cfa50e0c7743522e(ptr %.loc40_5), !dbg !50 +// CHECK:STDOUT: call void @"_CSelfDestruct.749b51755634ad17:core.Destroy.Core"(ptr %ptr_f64.var), !dbg !45 +// CHECK:STDOUT: call void @"_CSelfDestruct.d088c7eb746488be:core.Destroy.Core"(ptr %ptr_i32.var), !dbg !43 // CHECK:STDOUT: ret void, !dbg !51 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !52 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !52 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !54 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.dc14d4dd21801791:core.Destroy.Core"(ptr %self) #0 !dbg !56 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !56 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !58 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !60 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !62 +// CHECK:STDOUT: ret void, !dbg !62 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.7945ecba5c505fc0:core.Destroy.Core"(ptr %self) #0 !dbg !64 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !66 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.dc14d4dd21801791:core.Destroy.Core"(ptr %self) #0 !dbg !68 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !70 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.dc14d4dd21801791:core.Destroy.Core"(ptr %self) #0 !dbg !72 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.dc14d4dd21801791:core.Destroy.Core"(ptr %self), !dbg !74 +// CHECK:STDOUT: ret void, !dbg !74 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.749b51755634ad17:core.Destroy.Core"(ptr %self) #0 !dbg !76 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !78 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.d088c7eb746488be:core.Destroy.Core"(ptr %self) #0 !dbg !80 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !82 +// 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 @_CF.Main.89a3e87df6fdafe1(ptr %x) #0 !dbg !60 { +// CHECK:STDOUT: define linkonce_odr void @_CF.Main.4d9f279dbc2b9f6f(ptr %x) #0 !dbg !84 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %A.call = call %type.26 @_CA.Main.c3359c2c217ad593(%type.26 zeroinitializer), !dbg !63 -// CHECK:STDOUT: call void @_CB.Main.89a3e87df6fdafe1(ptr %x), !dbg !67 -// CHECK:STDOUT: ret void, !dbg !68 +// CHECK:STDOUT: %A.call = call %type.26 @_CA.Main.c3359c2c217ad593(%type.26 zeroinitializer), !dbg !87 +// CHECK:STDOUT: call void @_CB.Main.4d9f279dbc2b9f6f(ptr %x), !dbg !91 +// CHECK:STDOUT: ret void, !dbg !92 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CF.Main.38241ddc2cd9d74d(ptr %x) #0 !dbg !70 { +// CHECK:STDOUT: define linkonce_odr void @_CF.Main.cfa50e0c7743522e(ptr %x) #0 !dbg !94 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %A.call = call %type.26 @_CA.Main.c3359c2c217ad593(%type.26 zeroinitializer), !dbg !73 -// CHECK:STDOUT: call void @_CB.Main.38241ddc2cd9d74d(ptr %x), !dbg !75 -// CHECK:STDOUT: ret void, !dbg !76 +// CHECK:STDOUT: %A.call = call %type.26 @_CA.Main.c3359c2c217ad593(%type.26 zeroinitializer), !dbg !97 +// CHECK:STDOUT: call void @_CB.Main.cfa50e0c7743522e(ptr %x), !dbg !99 +// CHECK:STDOUT: ret void, !dbg !100 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr %type.26 @_CA.Main.c3359c2c217ad593(%type.26 %x) #0 !dbg !78 { +// CHECK:STDOUT: define linkonce_odr %type.26 @_CA.Main.c3359c2c217ad593(%type.26 %x) #0 !dbg !102 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret %type.26 %x, !dbg !84 +// CHECK:STDOUT: ret %type.26 %x, !dbg !108 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CB.Main.89a3e87df6fdafe1(ptr %x) #0 !dbg !86 { +// CHECK:STDOUT: define linkonce_odr void @_CB.Main.4d9f279dbc2b9f6f(ptr %x) #0 !dbg !110 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc27_7.3.temp = alloca i32, align 4, !dbg !91 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc27_7.3.temp), !dbg !91 -// CHECK:STDOUT: %.loc27_5.2 = load i32, ptr %x, align 4, !dbg !90 -// CHECK:STDOUT: %D.call = call i32 @_CD.Main.4d6ceefeb7f772f4(i32 %.loc27_5.2), !dbg !91 -// CHECK:STDOUT: store i32 %D.call, ptr %.loc27_7.3.temp, align 4, !dbg !91 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %.loc27_7.3.temp), !dbg !91 -// CHECK:STDOUT: ret void, !dbg !94 +// CHECK:STDOUT: %.loc27_7.3.temp = alloca i32, align 4, !dbg !115 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc27_7.3.temp), !dbg !115 +// CHECK:STDOUT: %.loc27_5.2 = load i32, ptr %x, align 4, !dbg !114 +// CHECK:STDOUT: %D.call = call i32 @_CD.Main.4d6ceefeb7f772f4(i32 %.loc27_5.2), !dbg !115 +// CHECK:STDOUT: store i32 %D.call, ptr %.loc27_7.3.temp, align 4, !dbg !115 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %.loc27_7.3.temp), !dbg !115 +// CHECK:STDOUT: ret void, !dbg !118 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CB.Main.38241ddc2cd9d74d(ptr %x) #0 !dbg !96 { +// CHECK:STDOUT: define linkonce_odr void @_CB.Main.cfa50e0c7743522e(ptr %x) #0 !dbg !120 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc27_7.3.temp = alloca double, align 8, !dbg !101 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc27_7.3.temp), !dbg !101 -// CHECK:STDOUT: %.loc27_5.2 = load double, ptr %x, align 8, !dbg !100 -// CHECK:STDOUT: %D.call = call double @_CD.Main.c5e4ba542a56b71f(double %.loc27_5.2), !dbg !101 -// CHECK:STDOUT: store double %D.call, ptr %.loc27_7.3.temp, align 8, !dbg !101 -// CHECK:STDOUT: call void @"_COp.dc14d4dd21801791:core.Destroy.Core"(ptr %.loc27_7.3.temp), !dbg !101 -// CHECK:STDOUT: ret void, !dbg !102 +// CHECK:STDOUT: %.loc27_7.3.temp = alloca double, align 8, !dbg !125 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc27_7.3.temp), !dbg !125 +// CHECK:STDOUT: %.loc27_5.2 = load double, ptr %x, align 8, !dbg !124 +// CHECK:STDOUT: %D.call = call double @_CD.Main.c5e4ba542a56b71f(double %.loc27_5.2), !dbg !125 +// CHECK:STDOUT: store double %D.call, ptr %.loc27_7.3.temp, align 8, !dbg !125 +// CHECK:STDOUT: call void @"_CSelfDestruct.dc14d4dd21801791:core.Destroy.Core"(ptr %.loc27_7.3.temp), !dbg !125 +// CHECK:STDOUT: ret void, !dbg !126 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CD.Main.4d6ceefeb7f772f4(i32 %x) #0 !dbg !104 { +// CHECK:STDOUT: define linkonce_odr i32 @_CD.Main.4d6ceefeb7f772f4(i32 %x) #0 !dbg !128 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret i32 %x, !dbg !110 +// CHECK:STDOUT: ret i32 %x, !dbg !134 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr double @_CD.Main.c5e4ba542a56b71f(double %x) #0 !dbg !112 { +// CHECK:STDOUT: define linkonce_odr double @_CD.Main.c5e4ba542a56b71f(double %x) #0 !dbg !136 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret double %x, !dbg !118 +// CHECK:STDOUT: ret double %x, !dbg !142 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -165,52 +205,76 @@ fn M() { // CHECK:STDOUT: !49 = !DILocation(line: 40, column: 5, scope: !42) // CHECK:STDOUT: !50 = !DILocation(line: 40, column: 3, scope: !42) // CHECK:STDOUT: !51 = !DILocation(line: 35, column: 1, scope: !42) -// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !32, line: 39, type: !38, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !55) +// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !32, line: 39, type: !38, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !55) // CHECK:STDOUT: !53 = !DILocalVariable(arg: 1, scope: !52, type: !34) // CHECK:STDOUT: !54 = !DILocation(line: 39, column: 3, scope: !52) // CHECK:STDOUT: !55 = !{!53} -// CHECK:STDOUT: !56 = distinct !DISubprogram(name: "Op", linkageName: "_COp.dc14d4dd21801791:core.Destroy.Core", scope: null, file: !32, line: 40, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !59) -// CHECK:STDOUT: !57 = !DILocalVariable(arg: 1, scope: !56, type: !39) -// CHECK:STDOUT: !58 = !DILocation(line: 40, column: 3, scope: !56) +// CHECK:STDOUT: !56 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !32, line: 39, type: !38, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !59) +// CHECK:STDOUT: !57 = !DILocalVariable(arg: 1, scope: !56, type: !34) +// CHECK:STDOUT: !58 = !DILocation(line: 39, column: 3, scope: !56) // CHECK:STDOUT: !59 = !{!57} -// CHECK:STDOUT: !60 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.89a3e87df6fdafe1", scope: null, file: !32, line: 30, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !69) -// CHECK:STDOUT: !61 = !DILocalVariable(arg: 1, scope: !60, type: !39) -// CHECK:STDOUT: !63 = !DILocation(line: 31, column: 3, scope: !60) -// CHECK:STDOUT: !64 = !{!39, !39} -// CHECK:STDOUT: !65 = !DISubroutineType(types: !64) -// CHECK:STDOUT: !67 = !DILocation(line: 32, column: 3, scope: !60) -// CHECK:STDOUT: !68 = !DILocation(line: 30, column: 1, scope: !60) -// CHECK:STDOUT: !69 = !{!61} -// CHECK:STDOUT: !70 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.38241ddc2cd9d74d", scope: null, file: !32, line: 30, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !77) -// CHECK:STDOUT: !71 = !DILocalVariable(arg: 1, scope: !70, type: !39) -// CHECK:STDOUT: !73 = !DILocation(line: 31, column: 3, scope: !70) -// CHECK:STDOUT: !75 = !DILocation(line: 32, column: 3, scope: !70) -// CHECK:STDOUT: !76 = !DILocation(line: 30, column: 1, scope: !70) -// CHECK:STDOUT: !77 = !{!71} -// CHECK:STDOUT: !78 = distinct !DISubprogram(name: "A", linkageName: "_CA.Main.c3359c2c217ad593", scope: null, file: !32, line: 18, type: !65, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !85) -// CHECK:STDOUT: !79 = !DILocalVariable(arg: 1, scope: !78, type: !39) -// CHECK:STDOUT: !84 = !DILocation(line: 19, column: 3, scope: !78) -// CHECK:STDOUT: !85 = !{!79} -// CHECK:STDOUT: !86 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.89a3e87df6fdafe1", scope: null, file: !32, line: 26, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !95) -// CHECK:STDOUT: !87 = !DILocalVariable(arg: 1, scope: !86, type: !39) -// CHECK:STDOUT: !90 = !DILocation(line: 27, column: 5, scope: !86) -// CHECK:STDOUT: !91 = !DILocation(line: 27, column: 3, scope: !86) -// CHECK:STDOUT: !92 = !{!34, !34} -// CHECK:STDOUT: !93 = !DISubroutineType(types: !92) -// CHECK:STDOUT: !94 = !DILocation(line: 26, column: 1, scope: !86) -// CHECK:STDOUT: !95 = !{!87} -// CHECK:STDOUT: !96 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.38241ddc2cd9d74d", scope: null, file: !32, line: 26, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !103) -// CHECK:STDOUT: !97 = !DILocalVariable(arg: 1, scope: !96, type: !39) -// CHECK:STDOUT: !100 = !DILocation(line: 27, column: 5, scope: !96) -// CHECK:STDOUT: !101 = !DILocation(line: 27, column: 3, scope: !96) -// CHECK:STDOUT: !102 = !DILocation(line: 26, column: 1, scope: !96) -// CHECK:STDOUT: !103 = !{!97} -// CHECK:STDOUT: !104 = distinct !DISubprogram(name: "D", linkageName: "_CD.Main.4d6ceefeb7f772f4", scope: null, file: !32, line: 22, type: !93, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !111) -// CHECK:STDOUT: !105 = !DILocalVariable(arg: 1, scope: !104, type: !34) -// CHECK:STDOUT: !110 = !DILocation(line: 23, column: 3, scope: !104) -// CHECK:STDOUT: !111 = !{!105} -// CHECK:STDOUT: !112 = distinct !DISubprogram(name: "D", linkageName: "_CD.Main.c5e4ba542a56b71f", scope: null, file: !32, line: 22, type: !65, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !119) -// CHECK:STDOUT: !113 = !DILocalVariable(arg: 1, scope: !112, type: !39) -// CHECK:STDOUT: !118 = !DILocation(line: 23, column: 3, scope: !112) -// CHECK:STDOUT: !119 = !{!113} +// CHECK:STDOUT: !60 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !32, line: 39, type: !38, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !63) +// CHECK:STDOUT: !61 = !DILocalVariable(arg: 1, scope: !60, type: !34) +// CHECK:STDOUT: !62 = !DILocation(line: 39, column: 3, scope: !60) +// CHECK:STDOUT: !63 = !{!61} +// CHECK:STDOUT: !64 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.7945ecba5c505fc0:core.Destroy.Core", scope: null, file: !32, line: 40, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !67) +// CHECK:STDOUT: !65 = !DILocalVariable(arg: 1, scope: !64, type: !39) +// CHECK:STDOUT: !66 = !DILocation(line: 40, column: 3, scope: !64) +// CHECK:STDOUT: !67 = !{!65} +// CHECK:STDOUT: !68 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.dc14d4dd21801791:core.Destroy.Core", scope: null, file: !32, line: 40, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !71) +// CHECK:STDOUT: !69 = !DILocalVariable(arg: 1, scope: !68, type: !39) +// CHECK:STDOUT: !70 = !DILocation(line: 40, column: 3, scope: !68) +// CHECK:STDOUT: !71 = !{!69} +// CHECK:STDOUT: !72 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.dc14d4dd21801791:core.Destroy.Core", scope: null, file: !32, line: 40, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !75) +// CHECK:STDOUT: !73 = !DILocalVariable(arg: 1, scope: !72, type: !39) +// CHECK:STDOUT: !74 = !DILocation(line: 40, column: 3, scope: !72) +// CHECK:STDOUT: !75 = !{!73} +// CHECK:STDOUT: !76 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.749b51755634ad17:core.Destroy.Core", scope: null, file: !32, line: 37, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !79) +// CHECK:STDOUT: !77 = !DILocalVariable(arg: 1, scope: !76, type: !39) +// CHECK:STDOUT: !78 = !DILocation(line: 37, column: 3, scope: !76) +// CHECK:STDOUT: !79 = !{!77} +// CHECK:STDOUT: !80 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.d088c7eb746488be:core.Destroy.Core", scope: null, file: !32, line: 36, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !83) +// CHECK:STDOUT: !81 = !DILocalVariable(arg: 1, scope: !80, type: !39) +// CHECK:STDOUT: !82 = !DILocation(line: 36, column: 3, scope: !80) +// CHECK:STDOUT: !83 = !{!81} +// CHECK:STDOUT: !84 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.4d9f279dbc2b9f6f", scope: null, file: !32, line: 30, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !93) +// CHECK:STDOUT: !85 = !DILocalVariable(arg: 1, scope: !84, type: !39) +// CHECK:STDOUT: !87 = !DILocation(line: 31, column: 3, scope: !84) +// CHECK:STDOUT: !88 = !{!39, !39} +// CHECK:STDOUT: !89 = !DISubroutineType(types: !88) +// CHECK:STDOUT: !91 = !DILocation(line: 32, column: 3, scope: !84) +// CHECK:STDOUT: !92 = !DILocation(line: 30, column: 1, scope: !84) +// CHECK:STDOUT: !93 = !{!85} +// CHECK:STDOUT: !94 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.cfa50e0c7743522e", scope: null, file: !32, line: 30, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !101) +// CHECK:STDOUT: !95 = !DILocalVariable(arg: 1, scope: !94, type: !39) +// CHECK:STDOUT: !97 = !DILocation(line: 31, column: 3, scope: !94) +// CHECK:STDOUT: !99 = !DILocation(line: 32, column: 3, scope: !94) +// CHECK:STDOUT: !100 = !DILocation(line: 30, column: 1, scope: !94) +// CHECK:STDOUT: !101 = !{!95} +// CHECK:STDOUT: !102 = distinct !DISubprogram(name: "A", linkageName: "_CA.Main.c3359c2c217ad593", scope: null, file: !32, line: 18, type: !89, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !109) +// CHECK:STDOUT: !103 = !DILocalVariable(arg: 1, scope: !102, type: !39) +// CHECK:STDOUT: !108 = !DILocation(line: 19, column: 3, scope: !102) +// CHECK:STDOUT: !109 = !{!103} +// CHECK:STDOUT: !110 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.4d9f279dbc2b9f6f", scope: null, file: !32, line: 26, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !119) +// CHECK:STDOUT: !111 = !DILocalVariable(arg: 1, scope: !110, type: !39) +// CHECK:STDOUT: !114 = !DILocation(line: 27, column: 5, scope: !110) +// CHECK:STDOUT: !115 = !DILocation(line: 27, column: 3, scope: !110) +// CHECK:STDOUT: !116 = !{!34, !34} +// CHECK:STDOUT: !117 = !DISubroutineType(types: !116) +// CHECK:STDOUT: !118 = !DILocation(line: 26, column: 1, scope: !110) +// CHECK:STDOUT: !119 = !{!111} +// CHECK:STDOUT: !120 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.cfa50e0c7743522e", scope: null, file: !32, line: 26, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !127) +// CHECK:STDOUT: !121 = !DILocalVariable(arg: 1, scope: !120, type: !39) +// CHECK:STDOUT: !124 = !DILocation(line: 27, column: 5, scope: !120) +// CHECK:STDOUT: !125 = !DILocation(line: 27, column: 3, scope: !120) +// CHECK:STDOUT: !126 = !DILocation(line: 26, column: 1, scope: !120) +// CHECK:STDOUT: !127 = !{!121} +// CHECK:STDOUT: !128 = distinct !DISubprogram(name: "D", linkageName: "_CD.Main.4d6ceefeb7f772f4", scope: null, file: !32, line: 22, type: !117, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !135) +// CHECK:STDOUT: !129 = !DILocalVariable(arg: 1, scope: !128, type: !34) +// CHECK:STDOUT: !134 = !DILocation(line: 23, column: 3, scope: !128) +// CHECK:STDOUT: !135 = !{!129} +// CHECK:STDOUT: !136 = distinct !DISubprogram(name: "D", linkageName: "_CD.Main.c5e4ba542a56b71f", scope: null, file: !32, line: 22, type: !89, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !143) +// CHECK:STDOUT: !137 = !DILocalVariable(arg: 1, scope: !136, type: !39) +// CHECK:STDOUT: !142 = !DILocation(line: 23, column: 3, scope: !136) +// CHECK:STDOUT: !143 = !{!137} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/function/generic/call_different_associated_const.carbon b/toolchain/lower/testdata/function/generic/call_different_associated_const.carbon index 2704fa2b6889..ed14689eec6b 100644 --- a/toolchain/lower/testdata/function/generic/call_different_associated_const.carbon +++ b/toolchain/lower/testdata/function/generic/call_different_associated_const.carbon @@ -42,29 +42,43 @@ fn H() { // CHECK:STDOUT: source_filename = "call_different_associated_const.carbon" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CH.Main() #0 !dbg !36 { +// CHECK:STDOUT: define void @_CH.Main() #0 !dbg !39 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CG.Main.0676fa98bb7dbd66(), !dbg !37 -// CHECK:STDOUT: call void @_CG.Main.3e979ea3a37f4bf1(), !dbg !38 -// CHECK:STDOUT: ret void, !dbg !39 +// CHECK:STDOUT: call void @_CG.Main.0676fa98bb7dbd66(), !dbg !40 +// CHECK:STDOUT: call void @_CG.Main.3e979ea3a37f4bf1(), !dbg !41 +// CHECK:STDOUT: ret void, !dbg !42 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CG.Main.0676fa98bb7dbd66() #0 !dbg !40 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.bb2383e5e4785e19:core.Destroy.Core"(ptr %self) #0 !dbg !43 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca ptr, align 8, !dbg !41 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !41 -// CHECK:STDOUT: store ptr poison, ptr %_.var, align 8, !dbg !41 -// CHECK:STDOUT: ret void, !dbg !43 +// CHECK:STDOUT: ret void, !dbg !45 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CG.Main.3e979ea3a37f4bf1() #0 !dbg !44 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.d088c7eb746488be:core.Destroy.Core"(ptr %self) #0 !dbg !47 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca ptr, align 8, !dbg !45 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !45 -// CHECK:STDOUT: store ptr poison, ptr %_.var, align 8, !dbg !45 -// CHECK:STDOUT: ret void, !dbg !47 +// CHECK:STDOUT: ret void, !dbg !49 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @_CG.Main.0676fa98bb7dbd66() #0 !dbg !51 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %_.var = alloca ptr, align 8, !dbg !52 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !52 +// CHECK:STDOUT: store ptr poison, ptr %_.var, align 8, !dbg !52 +// CHECK:STDOUT: call void @"_CSelfDestruct.bb2383e5e4785e19:core.Destroy.Core"(ptr %_.var), !dbg !52 +// CHECK:STDOUT: ret void, !dbg !54 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @_CG.Main.3e979ea3a37f4bf1() #0 !dbg !55 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %_.var = alloca ptr, align 8, !dbg !56 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !56 +// CHECK:STDOUT: store ptr poison, ptr %_.var, align 8, !dbg !56 +// CHECK:STDOUT: call void @"_CSelfDestruct.d088c7eb746488be:core.Destroy.Core"(ptr %_.var), !dbg !56 +// CHECK:STDOUT: ret void, !dbg !58 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -85,14 +99,25 @@ fn H() { // CHECK:STDOUT: !33 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !32, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) // CHECK:STDOUT: !34 = !{null} // CHECK:STDOUT: !35 = !DISubroutineType(types: !34) -// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "H", linkageName: "_CH.Main", scope: null, file: !32, line: 35, type: !35, spFlags: DISPFlagDefinition, unit: !33) -// CHECK:STDOUT: !37 = !DILocation(line: 36, column: 3, scope: !36) -// CHECK:STDOUT: !38 = !DILocation(line: 37, column: 3, scope: !36) -// CHECK:STDOUT: !39 = !DILocation(line: 35, column: 1, scope: !36) -// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.0676fa98bb7dbd66", scope: null, file: !32, line: 22, type: !35, spFlags: DISPFlagDefinition, unit: !33) -// CHECK:STDOUT: !41 = !DILocation(line: 23, column: 3, scope: !40) -// CHECK:STDOUT: !43 = !DILocation(line: 22, column: 1, scope: !40) -// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.3e979ea3a37f4bf1", scope: null, file: !32, line: 22, type: !35, spFlags: DISPFlagDefinition, unit: !33) -// CHECK:STDOUT: !45 = !DILocation(line: 23, column: 3, scope: !44) -// CHECK:STDOUT: !47 = !DILocation(line: 22, column: 1, scope: !44) +// CHECK:STDOUT: !36 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !37 = !{null, !36} +// CHECK:STDOUT: !38 = !DISubroutineType(types: !37) +// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "H", linkageName: "_CH.Main", scope: null, file: !32, line: 35, type: !35, spFlags: DISPFlagDefinition, unit: !33) +// CHECK:STDOUT: !40 = !DILocation(line: 36, column: 3, scope: !39) +// CHECK:STDOUT: !41 = !DILocation(line: 37, column: 3, scope: !39) +// CHECK:STDOUT: !42 = !DILocation(line: 35, column: 1, scope: !39) +// CHECK:STDOUT: !43 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.bb2383e5e4785e19:core.Destroy.Core", scope: null, file: !32, line: 23, type: !38, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !46) +// CHECK:STDOUT: !44 = !DILocalVariable(arg: 1, scope: !43, type: !36) +// CHECK:STDOUT: !45 = !DILocation(line: 23, column: 3, scope: !43) +// CHECK:STDOUT: !46 = !{!44} +// CHECK:STDOUT: !47 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.d088c7eb746488be:core.Destroy.Core", scope: null, file: !32, line: 23, type: !38, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !50) +// CHECK:STDOUT: !48 = !DILocalVariable(arg: 1, scope: !47, type: !36) +// CHECK:STDOUT: !49 = !DILocation(line: 23, column: 3, scope: !47) +// CHECK:STDOUT: !50 = !{!48} +// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.0676fa98bb7dbd66", scope: null, file: !32, line: 22, type: !35, spFlags: DISPFlagDefinition, unit: !33) +// CHECK:STDOUT: !52 = !DILocation(line: 23, column: 3, scope: !51) +// CHECK:STDOUT: !54 = !DILocation(line: 22, column: 1, scope: !51) +// CHECK:STDOUT: !55 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.3e979ea3a37f4bf1", scope: null, file: !32, line: 22, type: !35, spFlags: DISPFlagDefinition, unit: !33) +// CHECK:STDOUT: !56 = !DILocation(line: 23, column: 3, scope: !55) +// CHECK:STDOUT: !58 = !DILocation(line: 22, column: 1, scope: !55) // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/function/generic/call_different_impls_with_const.carbon b/toolchain/lower/testdata/function/generic/call_different_impls_with_const.carbon index 5623a3e00855..e9cd247fdbcf 100644 --- a/toolchain/lower/testdata/function/generic/call_different_impls_with_const.carbon +++ b/toolchain/lower/testdata/function/generic/call_different_impls_with_const.carbon @@ -50,58 +50,78 @@ fn Run() { // CHECK:STDOUT: @printf.int.format = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i1 @"_CF.X.Main:I.Main"() #0 !dbg !14 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.48e0adf639fe7af4:core.Destroy.Core"(ptr %self) #0 !dbg !16 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Print.call = call i32 (ptr, ...) @printf(ptr @printf.int.format, i32 1), !dbg !17 -// CHECK:STDOUT: ret i1 false, !dbg !18 +// CHECK:STDOUT: ret void, !dbg !18 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !19 { +// CHECK:STDOUT: define i1 @"_CF.X.Main:I.Main"() #0 !dbg !20 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !21 +// CHECK:STDOUT: %Print.call = call i32 (ptr, ...) @printf(ptr @printf.int.format, i32 1), !dbg !23 +// CHECK:STDOUT: ret i1 false, !dbg !24 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @"_CF.Y.Main:I.Main"() #0 !dbg !23 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !25 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Print.call = call i32 (ptr, ...) @printf(ptr @printf.int.format, i32 2), !dbg !26 -// CHECK:STDOUT: ret i32 2, !dbg !27 +// CHECK:STDOUT: ret void, !dbg !27 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @main() #0 !dbg !28 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !29 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CG.Main.d0cc85b6c89517e3(), !dbg !29 -// CHECK:STDOUT: call void @_CG.Main.e8d4d639bae9ba40(), !dbg !32 -// CHECK:STDOUT: ret i32 0, !dbg !33 +// CHECK:STDOUT: ret void, !dbg !31 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !33 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !35 +// CHECK:STDOUT: ret void, !dbg !35 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define i32 @"_CF.Y.Main:I.Main"() #0 !dbg !37 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %Print.call = call i32 (ptr, ...) @printf(ptr @printf.int.format, i32 2), !dbg !40 +// CHECK:STDOUT: ret i32 2, !dbg !41 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define i32 @main() #0 !dbg !42 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @_CG.Main.d0cc85b6c89517e3(), !dbg !43 +// CHECK:STDOUT: call void @_CG.Main.e8d4d639bae9ba40(), !dbg !46 +// CHECK:STDOUT: ret i32 0, !dbg !47 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare i32 @printf(ptr, ...) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CG.Main.d0cc85b6c89517e3() #0 !dbg !34 { +// CHECK:STDOUT: define linkonce_odr void @_CG.Main.d0cc85b6c89517e3() #0 !dbg !48 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc38_20.1.temp = alloca i1, align 1, !dbg !35 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc38_20.1.temp), !dbg !35 -// CHECK:STDOUT: %I.WithSelf.F.call = call i1 @"_CF.X.Main:I.Main"(), !dbg !35 -// CHECK:STDOUT: %.loc38_20.2 = zext i1 %I.WithSelf.F.call to i8, !dbg !35 -// CHECK:STDOUT: store i8 %.loc38_20.2, ptr %.loc38_20.1.temp, align 1, !dbg !35 -// CHECK:STDOUT: %.loc38_20.3 = load i8, ptr %.loc38_20.1.temp, align 1, !dbg !35 -// CHECK:STDOUT: %.loc38_20.31 = trunc i8 %.loc38_20.3 to i1, !dbg !35 -// CHECK:STDOUT: ret void, !dbg !38 +// CHECK:STDOUT: %.loc38_20.1.temp = alloca i1, align 1, !dbg !49 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc38_20.1.temp), !dbg !49 +// CHECK:STDOUT: %I.WithSelf.F.call = call i1 @"_CF.X.Main:I.Main"(), !dbg !49 +// CHECK:STDOUT: %.loc38_20.2 = zext i1 %I.WithSelf.F.call to i8, !dbg !49 +// CHECK:STDOUT: store i8 %.loc38_20.2, ptr %.loc38_20.1.temp, align 1, !dbg !49 +// CHECK:STDOUT: %.loc38_20.3 = load i8, ptr %.loc38_20.1.temp, align 1, !dbg !49 +// CHECK:STDOUT: %.loc38_20.31 = trunc i8 %.loc38_20.3 to i1, !dbg !49 +// CHECK:STDOUT: call void @"_CSelfDestruct.48e0adf639fe7af4:core.Destroy.Core"(ptr %.loc38_20.1.temp), !dbg !49 +// CHECK:STDOUT: ret void, !dbg !52 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CG.Main.e8d4d639bae9ba40() #0 !dbg !39 { +// CHECK:STDOUT: define linkonce_odr void @_CG.Main.e8d4d639bae9ba40() #0 !dbg !53 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc38_20.1.temp = alloca i32, align 4, !dbg !40 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc38_20.1.temp), !dbg !40 -// CHECK:STDOUT: %I.WithSelf.F.call = call i32 @"_CF.Y.Main:I.Main"(), !dbg !40 -// CHECK:STDOUT: store i32 %I.WithSelf.F.call, ptr %.loc38_20.1.temp, align 4, !dbg !40 -// CHECK:STDOUT: %.loc38_20.3 = load i32, ptr %.loc38_20.1.temp, align 4, !dbg !40 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %.loc38_20.1.temp), !dbg !40 -// CHECK:STDOUT: ret void, !dbg !43 +// CHECK:STDOUT: %.loc38_20.1.temp = alloca i32, align 4, !dbg !54 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc38_20.1.temp), !dbg !54 +// CHECK:STDOUT: %I.WithSelf.F.call = call i32 @"_CF.Y.Main:I.Main"(), !dbg !54 +// CHECK:STDOUT: store i32 %I.WithSelf.F.call, ptr %.loc38_20.1.temp, align 4, !dbg !54 +// CHECK:STDOUT: %.loc38_20.3 = load i32, ptr %.loc38_20.1.temp, align 4, !dbg !54 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %.loc38_20.1.temp), !dbg !54 +// CHECK:STDOUT: ret void, !dbg !57 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -123,32 +143,46 @@ fn Run() { // CHECK:STDOUT: !5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !4, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) // CHECK:STDOUT: !6 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) // CHECK:STDOUT: !7 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !8 = !{!7} +// CHECK:STDOUT: !8 = !{null, !7} // CHECK:STDOUT: !9 = !DISubroutineType(types: !8) -// CHECK:STDOUT: !10 = !{null, !6} +// CHECK:STDOUT: !10 = !{!7} // CHECK:STDOUT: !11 = !DISubroutineType(types: !10) -// CHECK:STDOUT: !12 = !{!6} +// CHECK:STDOUT: !12 = !{null, !6} // CHECK:STDOUT: !13 = !DISubroutineType(types: !12) -// CHECK:STDOUT: !14 = distinct !DISubprogram(name: "F", linkageName: "_CF.X.Main:I.Main", scope: null, file: !4, line: 22, type: !9, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !17 = !DILocation(line: 23, column: 5, scope: !14) -// CHECK:STDOUT: !18 = !DILocation(line: 24, column: 5, scope: !14) -// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 28, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !22) -// CHECK:STDOUT: !20 = !DILocalVariable(arg: 1, scope: !19, type: !6) -// CHECK:STDOUT: !21 = !DILocation(line: 28, column: 24, scope: !19) -// CHECK:STDOUT: !22 = !{!20} -// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "F", linkageName: "_CF.Y.Main:I.Main", scope: null, file: !4, line: 29, type: !13, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !26 = !DILocation(line: 30, column: 5, scope: !23) -// CHECK:STDOUT: !27 = !DILocation(line: 31, column: 5, scope: !23) -// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "Run", linkageName: "main", scope: null, file: !4, line: 41, type: !13, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !29 = !DILocation(line: 42, column: 3, scope: !28) -// CHECK:STDOUT: !30 = !{null} -// CHECK:STDOUT: !31 = !DISubroutineType(types: !30) -// CHECK:STDOUT: !32 = !DILocation(line: 43, column: 3, scope: !28) -// CHECK:STDOUT: !33 = !DILocation(line: 41, column: 1, scope: !28) -// CHECK:STDOUT: !34 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.d0cc85b6c89517e3", scope: null, file: !4, line: 37, type: !31, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !35 = !DILocation(line: 38, column: 16, scope: !34) -// CHECK:STDOUT: !38 = !DILocation(line: 37, column: 1, scope: !34) -// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.e8d4d639bae9ba40", scope: null, file: !4, line: 37, type: !31, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !40 = !DILocation(line: 38, column: 16, scope: !39) -// CHECK:STDOUT: !43 = !DILocation(line: 37, column: 1, scope: !39) +// CHECK:STDOUT: !14 = !{!6} +// CHECK:STDOUT: !15 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !16 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.48e0adf639fe7af4:core.Destroy.Core", scope: null, file: !4, line: 21, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !19) +// CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !16, type: !7) +// CHECK:STDOUT: !18 = !DILocation(line: 21, column: 24, scope: !16) +// CHECK:STDOUT: !19 = !{!17} +// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "F", linkageName: "_CF.X.Main:I.Main", scope: null, file: !4, line: 22, type: !11, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !23 = !DILocation(line: 23, column: 5, scope: !20) +// CHECK:STDOUT: !24 = !DILocation(line: 24, column: 5, scope: !20) +// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !4, line: 28, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !28) +// CHECK:STDOUT: !26 = !DILocalVariable(arg: 1, scope: !25, type: !6) +// CHECK:STDOUT: !27 = !DILocation(line: 28, column: 24, scope: !25) +// CHECK:STDOUT: !28 = !{!26} +// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 28, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !32) +// CHECK:STDOUT: !30 = !DILocalVariable(arg: 1, scope: !29, type: !6) +// CHECK:STDOUT: !31 = !DILocation(line: 28, column: 24, scope: !29) +// CHECK:STDOUT: !32 = !{!30} +// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 28, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !36) +// CHECK:STDOUT: !34 = !DILocalVariable(arg: 1, scope: !33, type: !6) +// CHECK:STDOUT: !35 = !DILocation(line: 28, column: 24, scope: !33) +// CHECK:STDOUT: !36 = !{!34} +// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "F", linkageName: "_CF.Y.Main:I.Main", scope: null, file: !4, line: 29, type: !15, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !40 = !DILocation(line: 30, column: 5, scope: !37) +// CHECK:STDOUT: !41 = !DILocation(line: 31, column: 5, scope: !37) +// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "Run", linkageName: "main", scope: null, file: !4, line: 41, type: !15, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !43 = !DILocation(line: 42, column: 3, scope: !42) +// CHECK:STDOUT: !44 = !{null} +// CHECK:STDOUT: !45 = !DISubroutineType(types: !44) +// CHECK:STDOUT: !46 = !DILocation(line: 43, column: 3, scope: !42) +// CHECK:STDOUT: !47 = !DILocation(line: 41, column: 1, scope: !42) +// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.d0cc85b6c89517e3", scope: null, file: !4, line: 37, type: !45, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !49 = !DILocation(line: 38, column: 16, scope: !48) +// CHECK:STDOUT: !52 = !DILocation(line: 37, column: 1, scope: !48) +// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.e8d4d639bae9ba40", scope: null, file: !4, line: 37, type: !45, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !54 = !DILocation(line: 38, column: 16, scope: !53) +// CHECK:STDOUT: !57 = !DILocation(line: 37, column: 1, scope: !53) // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/function/generic/call_different_specific.carbon b/toolchain/lower/testdata/function/generic/call_different_specific.carbon index 6155b7e8e319..78f775531851 100644 --- a/toolchain/lower/testdata/function/generic/call_different_specific.carbon +++ b/toolchain/lower/testdata/function/generic/call_different_specific.carbon @@ -53,82 +53,108 @@ fn M(ptr_i32: i32*, ptr_f64: f64*) { // CHECK:STDOUT: ; Function Attrs: nounwind // CHECK:STDOUT: define void @_CM.Main(ptr %ptr_i32, ptr %ptr_f64) #0 !dbg !14 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CF.Main.89a3e87df6fdafe1(ptr %ptr_i32), !dbg !20 -// CHECK:STDOUT: call void @_CF.Main.38241ddc2cd9d74d(ptr %ptr_f64), !dbg !22 +// CHECK:STDOUT: call void @_CF.Main.4d9f279dbc2b9f6f(ptr %ptr_i32), !dbg !20 +// CHECK:STDOUT: call void @_CF.Main.cfa50e0c7743522e(ptr %ptr_f64), !dbg !22 // CHECK:STDOUT: ret void, !dbg !23 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !25 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !25 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !27 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.dc14d4dd21801791:core.Destroy.Core"(ptr %self) #0 !dbg !29 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !29 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !31 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CF.Main.89a3e87df6fdafe1(ptr %x) #0 !dbg !33 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !33 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %A.call = call %type.0 @_CA.Main.c3359c2c217ad593(%type.0 zeroinitializer), !dbg !36 -// CHECK:STDOUT: call void @_CB.Main.89a3e87df6fdafe1(ptr %x), !dbg !40 -// CHECK:STDOUT: ret void, !dbg !41 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !35 +// CHECK:STDOUT: ret void, !dbg !35 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CF.Main.38241ddc2cd9d74d(ptr %x) #0 !dbg !43 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.7945ecba5c505fc0:core.Destroy.Core"(ptr %self) #0 !dbg !37 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %A.call = call %type.0 @_CA.Main.c3359c2c217ad593(%type.0 zeroinitializer), !dbg !46 -// CHECK:STDOUT: call void @_CB.Main.38241ddc2cd9d74d(ptr %x), !dbg !48 -// CHECK:STDOUT: ret void, !dbg !49 +// CHECK:STDOUT: ret void, !dbg !39 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr %type.0 @_CA.Main.c3359c2c217ad593(%type.0 %x) #0 !dbg !51 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.dc14d4dd21801791:core.Destroy.Core"(ptr %self) #0 !dbg !41 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret %type.0 %x, !dbg !57 +// CHECK:STDOUT: ret void, !dbg !43 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CB.Main.89a3e87df6fdafe1(ptr %x) #0 !dbg !59 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.dc14d4dd21801791:core.Destroy.Core"(ptr %self) #0 !dbg !45 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc34_7.3.temp = alloca i32, align 4, !dbg !64 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc34_7.3.temp), !dbg !64 -// CHECK:STDOUT: %.loc34_5.2 = load i32, ptr %x, align 4, !dbg !63 -// CHECK:STDOUT: %D.call = call i32 @_CD.Main.4d6ceefeb7f772f4(i32 %.loc34_5.2), !dbg !64 -// CHECK:STDOUT: store i32 %D.call, ptr %.loc34_7.3.temp, align 4, !dbg !64 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %.loc34_7.3.temp), !dbg !64 -// CHECK:STDOUT: ret void, !dbg !67 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.dc14d4dd21801791:core.Destroy.Core"(ptr %self), !dbg !47 +// CHECK:STDOUT: ret void, !dbg !47 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CB.Main.38241ddc2cd9d74d(ptr %x) #0 !dbg !69 { +// CHECK:STDOUT: define linkonce_odr void @_CF.Main.4d9f279dbc2b9f6f(ptr %x) #0 !dbg !49 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc34_7.3.temp = alloca double, align 8, !dbg !74 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc34_7.3.temp), !dbg !74 -// CHECK:STDOUT: %.loc34_5.2 = load double, ptr %x, align 8, !dbg !73 -// CHECK:STDOUT: %D.call = call double @_CD.Main.c5e4ba542a56b71f(double %.loc34_5.2), !dbg !74 -// CHECK:STDOUT: store double %D.call, ptr %.loc34_7.3.temp, align 8, !dbg !74 -// CHECK:STDOUT: call void @"_COp.dc14d4dd21801791:core.Destroy.Core"(ptr %.loc34_7.3.temp), !dbg !74 -// CHECK:STDOUT: ret void, !dbg !75 +// CHECK:STDOUT: %A.call = call %type.0 @_CA.Main.c3359c2c217ad593(%type.0 zeroinitializer), !dbg !52 +// CHECK:STDOUT: call void @_CB.Main.4d9f279dbc2b9f6f(ptr %x), !dbg !56 +// CHECK:STDOUT: ret void, !dbg !57 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @_CF.Main.cfa50e0c7743522e(ptr %x) #0 !dbg !59 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %A.call = call %type.0 @_CA.Main.c3359c2c217ad593(%type.0 zeroinitializer), !dbg !62 +// CHECK:STDOUT: call void @_CB.Main.cfa50e0c7743522e(ptr %x), !dbg !64 +// CHECK:STDOUT: ret void, !dbg !65 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr %type.0 @_CA.Main.c3359c2c217ad593(%type.0 %x) #0 !dbg !67 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret %type.0 %x, !dbg !73 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @_CB.Main.4d9f279dbc2b9f6f(ptr %x) #0 !dbg !75 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %.loc34_7.3.temp = alloca i32, align 4, !dbg !80 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc34_7.3.temp), !dbg !80 +// CHECK:STDOUT: %.loc34_5.2 = load i32, ptr %x, align 4, !dbg !79 +// CHECK:STDOUT: %D.call = call i32 @_CD.Main.4d6ceefeb7f772f4(i32 %.loc34_5.2), !dbg !80 +// CHECK:STDOUT: store i32 %D.call, ptr %.loc34_7.3.temp, align 4, !dbg !80 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %.loc34_7.3.temp), !dbg !80 +// CHECK:STDOUT: ret void, !dbg !83 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @_CB.Main.cfa50e0c7743522e(ptr %x) #0 !dbg !85 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %.loc34_7.3.temp = alloca double, align 8, !dbg !90 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc34_7.3.temp), !dbg !90 +// CHECK:STDOUT: %.loc34_5.2 = load double, ptr %x, align 8, !dbg !89 +// CHECK:STDOUT: %D.call = call double @_CD.Main.c5e4ba542a56b71f(double %.loc34_5.2), !dbg !90 +// CHECK:STDOUT: store double %D.call, ptr %.loc34_7.3.temp, align 8, !dbg !90 +// CHECK:STDOUT: call void @"_CSelfDestruct.dc14d4dd21801791:core.Destroy.Core"(ptr %.loc34_7.3.temp), !dbg !90 +// CHECK:STDOUT: ret void, !dbg !91 // 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 i32 @_CD.Main.4d6ceefeb7f772f4(i32 %x) #0 !dbg !77 { +// CHECK:STDOUT: define linkonce_odr i32 @_CD.Main.4d6ceefeb7f772f4(i32 %x) #0 !dbg !93 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret i32 %x, !dbg !83 +// CHECK:STDOUT: ret i32 %x, !dbg !99 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr double @_CD.Main.c5e4ba542a56b71f(double %x) #0 !dbg !85 { +// CHECK:STDOUT: define linkonce_odr double @_CD.Main.c5e4ba542a56b71f(double %x) #0 !dbg !101 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret double %x, !dbg !91 +// CHECK:STDOUT: ret double %x, !dbg !107 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -160,52 +186,68 @@ fn M(ptr_i32: i32*, ptr_f64: f64*) { // CHECK:STDOUT: !22 = !DILocation(line: 44, column: 3, scope: !14) // CHECK:STDOUT: !23 = !DILocation(line: 42, column: 1, scope: !14) // CHECK:STDOUT: !24 = !{!15, !16} -// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 43, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !28) +// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !4, line: 43, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !28) // CHECK:STDOUT: !26 = !DILocalVariable(arg: 1, scope: !25, type: !6) // CHECK:STDOUT: !27 = !DILocation(line: 43, column: 3, scope: !25) // CHECK:STDOUT: !28 = !{!26} -// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "Op", linkageName: "_COp.dc14d4dd21801791:core.Destroy.Core", scope: null, file: !4, line: 44, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !32) -// CHECK:STDOUT: !30 = !DILocalVariable(arg: 1, scope: !29, type: !7) -// CHECK:STDOUT: !31 = !DILocation(line: 44, column: 3, scope: !29) +// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 43, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !32) +// CHECK:STDOUT: !30 = !DILocalVariable(arg: 1, scope: !29, type: !6) +// CHECK:STDOUT: !31 = !DILocation(line: 43, column: 3, scope: !29) // CHECK:STDOUT: !32 = !{!30} -// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.89a3e87df6fdafe1", scope: null, file: !4, line: 37, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !42) -// CHECK:STDOUT: !34 = !DILocalVariable(arg: 1, scope: !33, type: !7) -// CHECK:STDOUT: !36 = !DILocation(line: 38, column: 3, scope: !33) -// CHECK:STDOUT: !37 = !{!7, !7} -// CHECK:STDOUT: !38 = !DISubroutineType(types: !37) -// CHECK:STDOUT: !40 = !DILocation(line: 39, column: 3, scope: !33) -// CHECK:STDOUT: !41 = !DILocation(line: 37, column: 1, scope: !33) -// CHECK:STDOUT: !42 = !{!34} -// CHECK:STDOUT: !43 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.38241ddc2cd9d74d", scope: null, file: !4, line: 37, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !50) -// CHECK:STDOUT: !44 = !DILocalVariable(arg: 1, scope: !43, type: !7) -// CHECK:STDOUT: !46 = !DILocation(line: 38, column: 3, scope: !43) -// CHECK:STDOUT: !48 = !DILocation(line: 39, column: 3, scope: !43) -// CHECK:STDOUT: !49 = !DILocation(line: 37, column: 1, scope: !43) -// CHECK:STDOUT: !50 = !{!44} -// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "A", linkageName: "_CA.Main.c3359c2c217ad593", scope: null, file: !4, line: 25, type: !38, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !58) -// CHECK:STDOUT: !52 = !DILocalVariable(arg: 1, scope: !51, type: !7) -// CHECK:STDOUT: !57 = !DILocation(line: 26, column: 3, scope: !51) -// CHECK:STDOUT: !58 = !{!52} -// CHECK:STDOUT: !59 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.89a3e87df6fdafe1", scope: null, file: !4, line: 33, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !68) +// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 43, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !36) +// CHECK:STDOUT: !34 = !DILocalVariable(arg: 1, scope: !33, type: !6) +// CHECK:STDOUT: !35 = !DILocation(line: 43, column: 3, scope: !33) +// CHECK:STDOUT: !36 = !{!34} +// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.7945ecba5c505fc0:core.Destroy.Core", scope: null, file: !4, line: 44, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !40) +// CHECK:STDOUT: !38 = !DILocalVariable(arg: 1, scope: !37, type: !7) +// CHECK:STDOUT: !39 = !DILocation(line: 44, column: 3, scope: !37) +// CHECK:STDOUT: !40 = !{!38} +// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.dc14d4dd21801791:core.Destroy.Core", scope: null, file: !4, line: 44, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !44) +// CHECK:STDOUT: !42 = !DILocalVariable(arg: 1, scope: !41, type: !7) +// CHECK:STDOUT: !43 = !DILocation(line: 44, column: 3, scope: !41) +// CHECK:STDOUT: !44 = !{!42} +// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.dc14d4dd21801791:core.Destroy.Core", scope: null, file: !4, line: 44, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !48) +// CHECK:STDOUT: !46 = !DILocalVariable(arg: 1, scope: !45, type: !7) +// CHECK:STDOUT: !47 = !DILocation(line: 44, column: 3, scope: !45) +// CHECK:STDOUT: !48 = !{!46} +// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.4d9f279dbc2b9f6f", scope: null, file: !4, line: 37, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !58) +// CHECK:STDOUT: !50 = !DILocalVariable(arg: 1, scope: !49, type: !7) +// CHECK:STDOUT: !52 = !DILocation(line: 38, column: 3, scope: !49) +// CHECK:STDOUT: !53 = !{!7, !7} +// CHECK:STDOUT: !54 = !DISubroutineType(types: !53) +// CHECK:STDOUT: !56 = !DILocation(line: 39, column: 3, scope: !49) +// CHECK:STDOUT: !57 = !DILocation(line: 37, column: 1, scope: !49) +// CHECK:STDOUT: !58 = !{!50} +// CHECK:STDOUT: !59 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.cfa50e0c7743522e", scope: null, file: !4, line: 37, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !66) // CHECK:STDOUT: !60 = !DILocalVariable(arg: 1, scope: !59, type: !7) -// CHECK:STDOUT: !63 = !DILocation(line: 34, column: 5, scope: !59) -// CHECK:STDOUT: !64 = !DILocation(line: 34, column: 3, scope: !59) -// CHECK:STDOUT: !65 = !{!6, !6} -// CHECK:STDOUT: !66 = !DISubroutineType(types: !65) -// CHECK:STDOUT: !67 = !DILocation(line: 33, column: 1, scope: !59) -// CHECK:STDOUT: !68 = !{!60} -// CHECK:STDOUT: !69 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.38241ddc2cd9d74d", scope: null, file: !4, line: 33, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !76) -// CHECK:STDOUT: !70 = !DILocalVariable(arg: 1, scope: !69, type: !7) -// CHECK:STDOUT: !73 = !DILocation(line: 34, column: 5, scope: !69) -// CHECK:STDOUT: !74 = !DILocation(line: 34, column: 3, scope: !69) -// CHECK:STDOUT: !75 = !DILocation(line: 33, column: 1, scope: !69) -// CHECK:STDOUT: !76 = !{!70} -// CHECK:STDOUT: !77 = distinct !DISubprogram(name: "D", linkageName: "_CD.Main.4d6ceefeb7f772f4", scope: null, file: !4, line: 29, type: !66, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !84) -// CHECK:STDOUT: !78 = !DILocalVariable(arg: 1, scope: !77, type: !6) -// CHECK:STDOUT: !83 = !DILocation(line: 30, column: 3, scope: !77) -// CHECK:STDOUT: !84 = !{!78} -// CHECK:STDOUT: !85 = distinct !DISubprogram(name: "D", linkageName: "_CD.Main.c5e4ba542a56b71f", scope: null, file: !4, line: 29, type: !38, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !92) +// CHECK:STDOUT: !62 = !DILocation(line: 38, column: 3, scope: !59) +// CHECK:STDOUT: !64 = !DILocation(line: 39, column: 3, scope: !59) +// CHECK:STDOUT: !65 = !DILocation(line: 37, column: 1, scope: !59) +// CHECK:STDOUT: !66 = !{!60} +// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "A", linkageName: "_CA.Main.c3359c2c217ad593", scope: null, file: !4, line: 25, type: !54, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !74) +// CHECK:STDOUT: !68 = !DILocalVariable(arg: 1, scope: !67, type: !7) +// CHECK:STDOUT: !73 = !DILocation(line: 26, column: 3, scope: !67) +// CHECK:STDOUT: !74 = !{!68} +// CHECK:STDOUT: !75 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.4d9f279dbc2b9f6f", scope: null, file: !4, line: 33, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !84) +// CHECK:STDOUT: !76 = !DILocalVariable(arg: 1, scope: !75, type: !7) +// CHECK:STDOUT: !79 = !DILocation(line: 34, column: 5, scope: !75) +// CHECK:STDOUT: !80 = !DILocation(line: 34, column: 3, scope: !75) +// CHECK:STDOUT: !81 = !{!6, !6} +// CHECK:STDOUT: !82 = !DISubroutineType(types: !81) +// CHECK:STDOUT: !83 = !DILocation(line: 33, column: 1, scope: !75) +// CHECK:STDOUT: !84 = !{!76} +// CHECK:STDOUT: !85 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.cfa50e0c7743522e", scope: null, file: !4, line: 33, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !92) // CHECK:STDOUT: !86 = !DILocalVariable(arg: 1, scope: !85, type: !7) -// CHECK:STDOUT: !91 = !DILocation(line: 30, column: 3, scope: !85) +// CHECK:STDOUT: !89 = !DILocation(line: 34, column: 5, scope: !85) +// CHECK:STDOUT: !90 = !DILocation(line: 34, column: 3, scope: !85) +// CHECK:STDOUT: !91 = !DILocation(line: 33, column: 1, scope: !85) // CHECK:STDOUT: !92 = !{!86} +// CHECK:STDOUT: !93 = distinct !DISubprogram(name: "D", linkageName: "_CD.Main.4d6ceefeb7f772f4", scope: null, file: !4, line: 29, type: !82, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !100) +// CHECK:STDOUT: !94 = !DILocalVariable(arg: 1, scope: !93, type: !6) +// CHECK:STDOUT: !99 = !DILocation(line: 30, column: 3, scope: !93) +// CHECK:STDOUT: !100 = !{!94} +// CHECK:STDOUT: !101 = distinct !DISubprogram(name: "D", linkageName: "_CD.Main.c5e4ba542a56b71f", scope: null, file: !4, line: 29, type: !54, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !108) +// CHECK:STDOUT: !102 = !DILocalVariable(arg: 1, scope: !101, type: !7) +// CHECK:STDOUT: !107 = !DILocation(line: 30, column: 3, scope: !101) +// CHECK:STDOUT: !108 = !{!102} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/function/generic/call_method.carbon b/toolchain/lower/testdata/function/generic/call_method.carbon index 218f56c9bb19..395e54fff2af 100644 --- a/toolchain/lower/testdata/function/generic/call_method.carbon +++ b/toolchain/lower/testdata/function/generic/call_method.carbon @@ -39,23 +39,49 @@ fn CallF() -> i32 { // CHECK:STDOUT: store i32 0, ptr %n.var, align 4, !dbg !33 // CHECK:STDOUT: %.loc22_14 = load i32, ptr %n.var, align 4, !dbg !36 // CHECK:STDOUT: %C.F.call = call i32 @_CF.C.Main.4d6ceefeb7f772f4(ptr %c.var, i32 %.loc22_14), !dbg !35 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %n.var), !dbg !33 -// CHECK:STDOUT: call void @"_COp.08d9e38b928ba575:core.Destroy.Core"(ptr %c.var), !dbg !31 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %n.var), !dbg !33 +// CHECK:STDOUT: call void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr %c.var), !dbg !31 // CHECK:STDOUT: ret i32 %C.F.call, !dbg !39 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !40 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !40 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !42 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !44 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !44 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !46 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !48 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !50 +// CHECK:STDOUT: ret void, !dbg !50 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %self) #0 !dbg !52 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !54 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !56 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !58 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !60 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core"(ptr %self), !dbg !62 +// CHECK:STDOUT: ret void, !dbg !62 +// 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: @@ -63,9 +89,9 @@ fn CallF() -> i32 { // 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 i32 @_CF.C.Main.4d6ceefeb7f772f4(ptr %self, i32 %x) #0 !dbg !48 { +// CHECK:STDOUT: define linkonce_odr i32 @_CF.C.Main.4d6ceefeb7f772f4(ptr %self, i32 %x) #0 !dbg !64 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret i32 %x, !dbg !56 +// CHECK:STDOUT: ret i32 %x, !dbg !72 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -97,17 +123,33 @@ fn CallF() -> i32 { // CHECK:STDOUT: !37 = !{!20, !25, !20} // CHECK:STDOUT: !38 = !DISubroutineType(types: !37) // CHECK:STDOUT: !39 = !DILocation(line: 22, column: 3, scope: !28) -// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 21, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !43) +// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !18, line: 21, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !43) // CHECK:STDOUT: !41 = !DILocalVariable(arg: 1, scope: !40, type: !20) // CHECK:STDOUT: !42 = !DILocation(line: 21, column: 3, scope: !40) // CHECK:STDOUT: !43 = !{!41} -// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "Op", linkageName: "_COp.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !18, line: 20, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !47) -// CHECK:STDOUT: !45 = !DILocalVariable(arg: 1, scope: !44, type: !25) -// CHECK:STDOUT: !46 = !DILocation(line: 20, column: 3, scope: !44) +// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 21, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !47) +// CHECK:STDOUT: !45 = !DILocalVariable(arg: 1, scope: !44, type: !20) +// CHECK:STDOUT: !46 = !DILocation(line: 21, column: 3, scope: !44) // CHECK:STDOUT: !47 = !{!45} -// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "F", linkageName: "_CF.C.Main.4d6ceefeb7f772f4", scope: null, file: !18, line: 14, type: !38, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !57) -// CHECK:STDOUT: !49 = !DILocalVariable(arg: 1, scope: !48, type: !25) -// CHECK:STDOUT: !50 = !DILocalVariable(arg: 2, scope: !48, type: !20) -// CHECK:STDOUT: !56 = !DILocation(line: 15, column: 5, scope: !48) -// CHECK:STDOUT: !57 = !{!49, !50} +// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 21, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !51) +// CHECK:STDOUT: !49 = !DILocalVariable(arg: 1, scope: !48, type: !20) +// CHECK:STDOUT: !50 = !DILocation(line: 21, column: 3, scope: !48) +// CHECK:STDOUT: !51 = !{!49} +// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !18, line: 20, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !55) +// CHECK:STDOUT: !53 = !DILocalVariable(arg: 1, scope: !52, type: !25) +// CHECK:STDOUT: !54 = !DILocation(line: 20, column: 3, scope: !52) +// CHECK:STDOUT: !55 = !{!53} +// CHECK:STDOUT: !56 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !18, line: 20, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !59) +// CHECK:STDOUT: !57 = !DILocalVariable(arg: 1, scope: !56, type: !25) +// CHECK:STDOUT: !58 = !DILocation(line: 20, column: 3, scope: !56) +// CHECK:STDOUT: !59 = !{!57} +// CHECK:STDOUT: !60 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !18, line: 20, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !63) +// CHECK:STDOUT: !61 = !DILocalVariable(arg: 1, scope: !60, type: !25) +// CHECK:STDOUT: !62 = !DILocation(line: 20, column: 3, scope: !60) +// CHECK:STDOUT: !63 = !{!61} +// CHECK:STDOUT: !64 = distinct !DISubprogram(name: "F", linkageName: "_CF.C.Main.4d6ceefeb7f772f4", scope: null, file: !18, line: 14, type: !38, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !73) +// CHECK:STDOUT: !65 = !DILocalVariable(arg: 1, scope: !64, type: !25) +// CHECK:STDOUT: !66 = !DILocalVariable(arg: 2, scope: !64, type: !20) +// CHECK:STDOUT: !72 = !DILocation(line: 15, column: 5, scope: !64) +// CHECK:STDOUT: !73 = !{!65, !66} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/function/generic/call_recursive_basic.carbon b/toolchain/lower/testdata/function/generic/call_recursive_basic.carbon index 70e442ede98a..3b5c5f8072b6 100644 --- a/toolchain/lower/testdata/function/generic/call_recursive_basic.carbon +++ b/toolchain/lower/testdata/function/generic/call_recursive_basic.carbon @@ -82,31 +82,84 @@ fn M() { // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %c.var, ptr align 1 @C.val.loc15_43, i64 0, i1 false), !dbg !48 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc40_9.3.temp), !dbg !51 // CHECK:STDOUT: call void @_CF.Main.42513763e01cba2c(ptr %.loc40_9.3.temp, ptr %c.var, i32 0), !dbg !51 -// CHECK:STDOUT: call void @"_COp.08d9e38b928ba575:core.Destroy.Core"(ptr %.loc40_9.3.temp), !dbg !51 -// CHECK:STDOUT: call void @"_COp.08d9e38b928ba575:core.Destroy.Core"(ptr %c.var), !dbg !48 -// CHECK:STDOUT: call void @"_COp.dc14d4dd21801791:core.Destroy.Core"(ptr %m.var), !dbg !26 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %n.var), !dbg !24 +// CHECK:STDOUT: call void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr %.loc40_9.3.temp), !dbg !51 +// CHECK:STDOUT: call void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr %c.var), !dbg !48 +// CHECK:STDOUT: call void @"_CSelfDestruct.749b51755634ad17:core.Destroy.Core"(ptr %ptr_f64.var), !dbg !32 +// CHECK:STDOUT: call void @"_CSelfDestruct.d088c7eb746488be:core.Destroy.Core"(ptr %ptr_i32.var), !dbg !28 +// CHECK:STDOUT: call void @"_CSelfDestruct.dc14d4dd21801791:core.Destroy.Core"(ptr %m.var), !dbg !26 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %n.var), !dbg !24 // CHECK:STDOUT: ret void, !dbg !52 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !53 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %self) #0 !dbg !53 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !55 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.dc14d4dd21801791:core.Destroy.Core"(ptr %self) #0 !dbg !57 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !57 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !59 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !61 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !61 { // CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core"(ptr %self), !dbg !63 // CHECK:STDOUT: ret void, !dbg !63 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.749b51755634ad17:core.Destroy.Core"(ptr %self) #0 !dbg !65 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !67 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.d088c7eb746488be:core.Destroy.Core"(ptr %self) #0 !dbg !69 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !71 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.7945ecba5c505fc0:core.Destroy.Core"(ptr %self) #0 !dbg !73 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !75 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.dc14d4dd21801791:core.Destroy.Core"(ptr %self) #0 !dbg !77 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !79 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.dc14d4dd21801791:core.Destroy.Core"(ptr %self) #0 !dbg !81 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.dc14d4dd21801791:core.Destroy.Core"(ptr %self), !dbg !83 +// CHECK:STDOUT: ret void, !dbg !83 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !85 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !87 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !89 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !91 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !93 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !95 +// CHECK:STDOUT: ret void, !dbg !95 +// 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: @@ -114,68 +167,68 @@ fn M() { // CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #1 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CF.Main.4d6ceefeb7f772f4(i32 %x, i32 %count) #0 !dbg !65 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 0, !dbg !72 -// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !73 -// CHECK:STDOUT: -// CHECK:STDOUT: if.then: ; preds = %entry -// CHECK:STDOUT: ret i32 %x, !dbg !75 -// CHECK:STDOUT: -// CHECK:STDOUT: if.else: ; preds = %entry -// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !77 -// CHECK:STDOUT: %F.call = call i32 @_CF.Main.4d6ceefeb7f772f4(i32 %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !78 -// CHECK:STDOUT: ret i32 %F.call, !dbg !79 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr double @_CF.Main.c5e4ba542a56b71f(double %x, i32 %count) #0 !dbg !81 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 0, !dbg !88 -// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !89 -// CHECK:STDOUT: -// CHECK:STDOUT: if.then: ; preds = %entry -// CHECK:STDOUT: ret double %x, !dbg !91 -// CHECK:STDOUT: -// CHECK:STDOUT: if.else: ; preds = %entry -// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !93 -// CHECK:STDOUT: %F.call = call double @_CF.Main.c5e4ba542a56b71f(double %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !94 -// CHECK:STDOUT: ret double %F.call, !dbg !95 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CF.Main.a76b78461416b4a8(ptr %x, i32 %count) #0 !dbg !97 { +// CHECK:STDOUT: define linkonce_odr i32 @_CF.Main.4d6ceefeb7f772f4(i32 %x, i32 %count) #0 !dbg !97 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 0, !dbg !104 // CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !105 // CHECK:STDOUT: // CHECK:STDOUT: if.then: ; preds = %entry -// CHECK:STDOUT: ret ptr %x, !dbg !107 +// CHECK:STDOUT: ret i32 %x, !dbg !107 // CHECK:STDOUT: // CHECK:STDOUT: if.else: ; preds = %entry // CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !109 -// CHECK:STDOUT: %F.call = call ptr @_CF.Main.a76b78461416b4a8(ptr %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !110 -// CHECK:STDOUT: ret ptr %F.call, !dbg !111 +// CHECK:STDOUT: %F.call = call i32 @_CF.Main.4d6ceefeb7f772f4(i32 %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !110 +// CHECK:STDOUT: ret i32 %F.call, !dbg !111 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CF.Main.42513763e01cba2c(ptr sret({}) %return, ptr %x, i32 %count) #0 !dbg !129 { +// CHECK:STDOUT: define linkonce_odr double @_CF.Main.c5e4ba542a56b71f(double %x, i32 %count) #0 !dbg !113 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 0, !dbg !120 +// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !121 +// CHECK:STDOUT: +// CHECK:STDOUT: if.then: ; preds = %entry +// CHECK:STDOUT: ret double %x, !dbg !123 +// CHECK:STDOUT: +// CHECK:STDOUT: if.else: ; preds = %entry +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !125 +// CHECK:STDOUT: %F.call = call double @_CF.Main.c5e4ba542a56b71f(double %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !126 +// CHECK:STDOUT: ret double %F.call, !dbg !127 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr ptr @_CF.Main.a76b78461416b4a8(ptr %x, i32 %count) #0 !dbg !129 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 0, !dbg !136 // CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !137 // CHECK:STDOUT: // CHECK:STDOUT: if.then: ; preds = %entry -// CHECK:STDOUT: call void @"_COp.C.Main:Copy.Core"(ptr %return, ptr %x), !dbg !138 -// CHECK:STDOUT: ret void, !dbg !139 +// CHECK:STDOUT: ret ptr %x, !dbg !139 // CHECK:STDOUT: // CHECK:STDOUT: if.else: ; preds = %entry // CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !141 -// CHECK:STDOUT: call void @_CF.Main.42513763e01cba2c(ptr %return, ptr %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !142 -// CHECK:STDOUT: ret void, !dbg !143 +// CHECK:STDOUT: %F.call = call ptr @_CF.Main.a76b78461416b4a8(ptr %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !142 +// CHECK:STDOUT: ret ptr %F.call, !dbg !143 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @_CF.Main.42513763e01cba2c(ptr sret({}) %return, ptr %x, i32 %count) #0 !dbg !161 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 0, !dbg !168 +// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !169 +// CHECK:STDOUT: +// CHECK:STDOUT: if.then: ; preds = %entry +// CHECK:STDOUT: call void @"_COp.C.Main:Copy.Core"(ptr %return, ptr %x), !dbg !170 +// CHECK:STDOUT: ret void, !dbg !171 +// CHECK:STDOUT: +// CHECK:STDOUT: if.else: ; preds = %entry +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !173 +// CHECK:STDOUT: call void @_CF.Main.42513763e01cba2c(ptr %return, ptr %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !174 +// CHECK:STDOUT: ret void, !dbg !175 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives -// CHECK:STDOUT: uselistorder ptr @"_COp.08d9e38b928ba575:core.Destroy.Core", { 1, 0 } +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core", { 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.memcpy.p0.p0.i64, { 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 5, 4, 3, 2, 1, 0 } // CHECK:STDOUT: uselistorder ptr @_CF.Main.a76b78461416b4a8, { 1, 2, 0 } @@ -224,40 +277,52 @@ fn M() { // CHECK:STDOUT: !48 = !DILocation(line: 39, column: 3, scope: !23) // CHECK:STDOUT: !51 = !DILocation(line: 40, column: 3, scope: !23) // CHECK:STDOUT: !52 = !DILocation(line: 28, column: 1, scope: !23) -// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "Op", linkageName: "_COp.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !4, line: 40, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !56) +// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !4, line: 40, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !56) // CHECK:STDOUT: !54 = !DILocalVariable(arg: 1, scope: !53, type: !7) // CHECK:STDOUT: !55 = !DILocation(line: 40, column: 3, scope: !53) // CHECK:STDOUT: !56 = !{!54} -// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "Op", linkageName: "_COp.dc14d4dd21801791:core.Destroy.Core", scope: null, file: !4, line: 30, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !60) +// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !4, line: 40, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !60) // CHECK:STDOUT: !58 = !DILocalVariable(arg: 1, scope: !57, type: !7) -// CHECK:STDOUT: !59 = !DILocation(line: 30, column: 3, scope: !57) +// CHECK:STDOUT: !59 = !DILocation(line: 40, column: 3, scope: !57) // CHECK:STDOUT: !60 = !{!58} -// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 29, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !64) -// CHECK:STDOUT: !62 = !DILocalVariable(arg: 1, scope: !61, type: !6) -// CHECK:STDOUT: !63 = !DILocation(line: 29, column: 3, scope: !61) +// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !4, line: 40, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !64) +// CHECK:STDOUT: !62 = !DILocalVariable(arg: 1, scope: !61, type: !7) +// CHECK:STDOUT: !63 = !DILocation(line: 40, column: 3, scope: !61) // CHECK:STDOUT: !64 = !{!62} -// CHECK:STDOUT: !65 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.4d6ceefeb7f772f4", scope: null, file: !4, line: 21, type: !39, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !80) -// CHECK:STDOUT: !66 = !DILocalVariable(arg: 1, scope: !65, type: !6) -// CHECK:STDOUT: !67 = !DILocalVariable(arg: 2, scope: !65, type: !6) -// CHECK:STDOUT: !72 = !DILocation(line: 22, column: 7, scope: !65) -// CHECK:STDOUT: !73 = !DILocation(line: 22, column: 6, scope: !65) -// CHECK:STDOUT: !75 = !DILocation(line: 23, column: 5, scope: !65) -// CHECK:STDOUT: !77 = !DILocation(line: 25, column: 15, scope: !65) -// CHECK:STDOUT: !78 = !DILocation(line: 25, column: 10, scope: !65) -// CHECK:STDOUT: !79 = !DILocation(line: 25, column: 3, scope: !65) -// CHECK:STDOUT: !80 = !{!66, !67} -// CHECK:STDOUT: !81 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.c5e4ba542a56b71f", scope: null, file: !4, line: 21, type: !43, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !96) +// CHECK:STDOUT: !65 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.749b51755634ad17:core.Destroy.Core", scope: null, file: !4, line: 32, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !68) +// CHECK:STDOUT: !66 = !DILocalVariable(arg: 1, scope: !65, type: !7) +// CHECK:STDOUT: !67 = !DILocation(line: 32, column: 3, scope: !65) +// CHECK:STDOUT: !68 = !{!66} +// CHECK:STDOUT: !69 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.d088c7eb746488be:core.Destroy.Core", scope: null, file: !4, line: 31, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !72) +// CHECK:STDOUT: !70 = !DILocalVariable(arg: 1, scope: !69, type: !7) +// CHECK:STDOUT: !71 = !DILocation(line: 31, column: 3, scope: !69) +// CHECK:STDOUT: !72 = !{!70} +// CHECK:STDOUT: !73 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.7945ecba5c505fc0:core.Destroy.Core", scope: null, file: !4, line: 30, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !76) +// CHECK:STDOUT: !74 = !DILocalVariable(arg: 1, scope: !73, type: !7) +// CHECK:STDOUT: !75 = !DILocation(line: 30, column: 3, scope: !73) +// CHECK:STDOUT: !76 = !{!74} +// CHECK:STDOUT: !77 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.dc14d4dd21801791:core.Destroy.Core", scope: null, file: !4, line: 30, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !80) +// CHECK:STDOUT: !78 = !DILocalVariable(arg: 1, scope: !77, type: !7) +// CHECK:STDOUT: !79 = !DILocation(line: 30, column: 3, scope: !77) +// CHECK:STDOUT: !80 = !{!78} +// CHECK:STDOUT: !81 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.dc14d4dd21801791:core.Destroy.Core", scope: null, file: !4, line: 30, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !84) // CHECK:STDOUT: !82 = !DILocalVariable(arg: 1, scope: !81, type: !7) -// CHECK:STDOUT: !83 = !DILocalVariable(arg: 2, scope: !81, type: !6) -// CHECK:STDOUT: !88 = !DILocation(line: 22, column: 7, scope: !81) -// CHECK:STDOUT: !89 = !DILocation(line: 22, column: 6, scope: !81) -// CHECK:STDOUT: !91 = !DILocation(line: 23, column: 5, scope: !81) -// CHECK:STDOUT: !93 = !DILocation(line: 25, column: 15, scope: !81) -// CHECK:STDOUT: !94 = !DILocation(line: 25, column: 10, scope: !81) -// CHECK:STDOUT: !95 = !DILocation(line: 25, column: 3, scope: !81) -// CHECK:STDOUT: !96 = !{!82, !83} -// CHECK:STDOUT: !97 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.a76b78461416b4a8", scope: null, file: !4, line: 21, type: !43, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !112) -// CHECK:STDOUT: !98 = !DILocalVariable(arg: 1, scope: !97, type: !7) +// CHECK:STDOUT: !83 = !DILocation(line: 30, column: 3, scope: !81) +// CHECK:STDOUT: !84 = !{!82} +// CHECK:STDOUT: !85 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !4, line: 29, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !88) +// CHECK:STDOUT: !86 = !DILocalVariable(arg: 1, scope: !85, type: !6) +// CHECK:STDOUT: !87 = !DILocation(line: 29, column: 3, scope: !85) +// CHECK:STDOUT: !88 = !{!86} +// CHECK:STDOUT: !89 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 29, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !92) +// CHECK:STDOUT: !90 = !DILocalVariable(arg: 1, scope: !89, type: !6) +// CHECK:STDOUT: !91 = !DILocation(line: 29, column: 3, scope: !89) +// CHECK:STDOUT: !92 = !{!90} +// CHECK:STDOUT: !93 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 29, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !96) +// CHECK:STDOUT: !94 = !DILocalVariable(arg: 1, scope: !93, type: !6) +// CHECK:STDOUT: !95 = !DILocation(line: 29, column: 3, scope: !93) +// CHECK:STDOUT: !96 = !{!94} +// CHECK:STDOUT: !97 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.4d6ceefeb7f772f4", scope: null, file: !4, line: 21, type: !39, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !112) +// CHECK:STDOUT: !98 = !DILocalVariable(arg: 1, scope: !97, type: !6) // CHECK:STDOUT: !99 = !DILocalVariable(arg: 2, scope: !97, type: !6) // CHECK:STDOUT: !104 = !DILocation(line: 22, column: 7, scope: !97) // CHECK:STDOUT: !105 = !DILocation(line: 22, column: 6, scope: !97) @@ -266,15 +331,35 @@ fn M() { // CHECK:STDOUT: !110 = !DILocation(line: 25, column: 10, scope: !97) // CHECK:STDOUT: !111 = !DILocation(line: 25, column: 3, scope: !97) // CHECK:STDOUT: !112 = !{!98, !99} -// CHECK:STDOUT: !129 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.42513763e01cba2c", scope: null, file: !4, line: 21, type: !43, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !144) +// CHECK:STDOUT: !113 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.c5e4ba542a56b71f", scope: null, file: !4, line: 21, type: !43, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !128) +// CHECK:STDOUT: !114 = !DILocalVariable(arg: 1, scope: !113, type: !7) +// CHECK:STDOUT: !115 = !DILocalVariable(arg: 2, scope: !113, type: !6) +// CHECK:STDOUT: !120 = !DILocation(line: 22, column: 7, scope: !113) +// CHECK:STDOUT: !121 = !DILocation(line: 22, column: 6, scope: !113) +// CHECK:STDOUT: !123 = !DILocation(line: 23, column: 5, scope: !113) +// CHECK:STDOUT: !125 = !DILocation(line: 25, column: 15, scope: !113) +// CHECK:STDOUT: !126 = !DILocation(line: 25, column: 10, scope: !113) +// CHECK:STDOUT: !127 = !DILocation(line: 25, column: 3, scope: !113) +// CHECK:STDOUT: !128 = !{!114, !115} +// CHECK:STDOUT: !129 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.a76b78461416b4a8", scope: null, file: !4, line: 21, type: !43, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !144) // CHECK:STDOUT: !130 = !DILocalVariable(arg: 1, scope: !129, type: !7) // CHECK:STDOUT: !131 = !DILocalVariable(arg: 2, scope: !129, type: !6) // CHECK:STDOUT: !136 = !DILocation(line: 22, column: 7, scope: !129) // CHECK:STDOUT: !137 = !DILocation(line: 22, column: 6, scope: !129) -// CHECK:STDOUT: !138 = !DILocation(line: 23, column: 12, scope: !129) // CHECK:STDOUT: !139 = !DILocation(line: 23, column: 5, scope: !129) // CHECK:STDOUT: !141 = !DILocation(line: 25, column: 15, scope: !129) // CHECK:STDOUT: !142 = !DILocation(line: 25, column: 10, scope: !129) // CHECK:STDOUT: !143 = !DILocation(line: 25, column: 3, scope: !129) // CHECK:STDOUT: !144 = !{!130, !131} +// CHECK:STDOUT: !161 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.42513763e01cba2c", scope: null, file: !4, line: 21, type: !43, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !176) +// CHECK:STDOUT: !162 = !DILocalVariable(arg: 1, scope: !161, type: !7) +// CHECK:STDOUT: !163 = !DILocalVariable(arg: 2, scope: !161, type: !6) +// CHECK:STDOUT: !168 = !DILocation(line: 22, column: 7, scope: !161) +// CHECK:STDOUT: !169 = !DILocation(line: 22, column: 6, scope: !161) +// CHECK:STDOUT: !170 = !DILocation(line: 23, column: 12, scope: !161) +// CHECK:STDOUT: !171 = !DILocation(line: 23, column: 5, scope: !161) +// CHECK:STDOUT: !173 = !DILocation(line: 25, column: 15, scope: !161) +// CHECK:STDOUT: !174 = !DILocation(line: 25, column: 10, scope: !161) +// CHECK:STDOUT: !175 = !DILocation(line: 25, column: 3, scope: !161) +// CHECK:STDOUT: !176 = !{!162, !163} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/function/generic/call_recursive_diamond.carbon b/toolchain/lower/testdata/function/generic/call_recursive_diamond.carbon index d91066358d9b..0063accf24a3 100644 --- a/toolchain/lower/testdata/function/generic/call_recursive_diamond.carbon +++ b/toolchain/lower/testdata/function/generic/call_recursive_diamond.carbon @@ -86,167 +86,207 @@ fn M() { // CHECK:STDOUT: %A.call.loc56 = call ptr @_CA.Main.a76b78461416b4a8(ptr %.loc56_5, i32 0), !dbg !36 // CHECK:STDOUT: %.loc57_5 = load ptr, ptr %ptr_f64.var, align 8, !dbg !37 // CHECK:STDOUT: %A.call.loc57 = call ptr @_CA.Main.a76b78461416b4a8(ptr %.loc57_5, i32 0), !dbg !38 -// CHECK:STDOUT: call void @"_COp.dc14d4dd21801791:core.Destroy.Core"(ptr %m.var), !dbg !17 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %n.var), !dbg !15 +// CHECK:STDOUT: call void @"_CSelfDestruct.749b51755634ad17:core.Destroy.Core"(ptr %ptr_f64.var), !dbg !23 +// CHECK:STDOUT: call void @"_CSelfDestruct.d088c7eb746488be:core.Destroy.Core"(ptr %ptr_i32.var), !dbg !19 +// CHECK:STDOUT: call void @"_CSelfDestruct.dc14d4dd21801791:core.Destroy.Core"(ptr %m.var), !dbg !17 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %n.var), !dbg !15 // CHECK:STDOUT: ret void, !dbg !39 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.dc14d4dd21801791:core.Destroy.Core"(ptr %self) #0 !dbg !40 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.749b51755634ad17:core.Destroy.Core"(ptr %self) #0 !dbg !40 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !42 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !44 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.d088c7eb746488be:core.Destroy.Core"(ptr %self) #0 !dbg !44 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !46 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.7945ecba5c505fc0:core.Destroy.Core"(ptr %self) #0 !dbg !48 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !50 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.dc14d4dd21801791:core.Destroy.Core"(ptr %self) #0 !dbg !52 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !54 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.dc14d4dd21801791:core.Destroy.Core"(ptr %self) #0 !dbg !56 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.dc14d4dd21801791:core.Destroy.Core"(ptr %self), !dbg !58 +// CHECK:STDOUT: ret void, !dbg !58 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !60 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !62 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !64 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !66 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !68 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !70 +// CHECK:STDOUT: ret void, !dbg !70 +// 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 i32 @_CA.Main.4d6ceefeb7f772f4(i32 %x, i32 %count) #0 !dbg !48 { +// CHECK:STDOUT: define linkonce_odr i32 @_CA.Main.4d6ceefeb7f772f4(i32 %x, i32 %count) #0 !dbg !72 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 4, !dbg !55 -// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then.loc23, label %if.else.loc23, !dbg !56 +// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 4, !dbg !79 +// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then.loc23, label %if.else.loc23, !dbg !80 // CHECK:STDOUT: // CHECK:STDOUT: if.then.loc23: ; preds = %entry -// CHECK:STDOUT: ret i32 %x, !dbg !58 +// CHECK:STDOUT: ret i32 %x, !dbg !82 // CHECK:STDOUT: // CHECK:STDOUT: if.else.loc23: ; preds = %entry -// CHECK:STDOUT: %Int.as.ModWith.impl.Op.call = srem i32 %count, 2, !dbg !59 -// CHECK:STDOUT: %Int.as.EqWith.impl.Equal.call = icmp eq i32 %Int.as.ModWith.impl.Op.call, 0, !dbg !59 -// CHECK:STDOUT: br i1 %Int.as.EqWith.impl.Equal.call, label %if.then.loc26, label %if.else.loc26, !dbg !60 +// CHECK:STDOUT: %Int.as.ModWith.impl.Op.call = srem i32 %count, 2, !dbg !83 +// CHECK:STDOUT: %Int.as.EqWith.impl.Equal.call = icmp eq i32 %Int.as.ModWith.impl.Op.call, 0, !dbg !83 +// CHECK:STDOUT: br i1 %Int.as.EqWith.impl.Equal.call, label %if.then.loc26, label %if.else.loc26, !dbg !84 // CHECK:STDOUT: // CHECK:STDOUT: if.then.loc26: ; preds = %if.else.loc23 -// CHECK:STDOUT: %B.call = call i32 @_CB.Main.4d6ceefeb7f772f4(i32 %x, i32 %count), !dbg !63 -// CHECK:STDOUT: ret i32 %B.call, !dbg !64 +// CHECK:STDOUT: %B.call = call i32 @_CB.Main.4d6ceefeb7f772f4(i32 %x, i32 %count), !dbg !87 +// CHECK:STDOUT: ret i32 %B.call, !dbg !88 // CHECK:STDOUT: // CHECK:STDOUT: if.else.loc26: ; preds = %if.else.loc23 -// CHECK:STDOUT: %C.call = call i32 @_CC.Main.4d6ceefeb7f772f4(i32 %x, i32 %count), !dbg !67 -// CHECK:STDOUT: ret i32 %C.call, !dbg !68 +// CHECK:STDOUT: %C.call = call i32 @_CC.Main.4d6ceefeb7f772f4(i32 %x, i32 %count), !dbg !91 +// CHECK:STDOUT: ret i32 %C.call, !dbg !92 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr double @_CA.Main.c5e4ba542a56b71f(double %x, i32 %count) #0 !dbg !70 { +// CHECK:STDOUT: define linkonce_odr double @_CA.Main.c5e4ba542a56b71f(double %x, i32 %count) #0 !dbg !94 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 4, !dbg !77 -// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then.loc23, label %if.else.loc23, !dbg !78 +// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 4, !dbg !101 +// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then.loc23, label %if.else.loc23, !dbg !102 // CHECK:STDOUT: // CHECK:STDOUT: if.then.loc23: ; preds = %entry -// CHECK:STDOUT: ret double %x, !dbg !80 +// CHECK:STDOUT: ret double %x, !dbg !104 // CHECK:STDOUT: // CHECK:STDOUT: if.else.loc23: ; preds = %entry -// CHECK:STDOUT: %Int.as.ModWith.impl.Op.call = srem i32 %count, 2, !dbg !81 -// CHECK:STDOUT: %Int.as.EqWith.impl.Equal.call = icmp eq i32 %Int.as.ModWith.impl.Op.call, 0, !dbg !81 -// CHECK:STDOUT: br i1 %Int.as.EqWith.impl.Equal.call, label %if.then.loc26, label %if.else.loc26, !dbg !82 +// CHECK:STDOUT: %Int.as.ModWith.impl.Op.call = srem i32 %count, 2, !dbg !105 +// CHECK:STDOUT: %Int.as.EqWith.impl.Equal.call = icmp eq i32 %Int.as.ModWith.impl.Op.call, 0, !dbg !105 +// CHECK:STDOUT: br i1 %Int.as.EqWith.impl.Equal.call, label %if.then.loc26, label %if.else.loc26, !dbg !106 // CHECK:STDOUT: // CHECK:STDOUT: if.then.loc26: ; preds = %if.else.loc23 -// CHECK:STDOUT: %B.call = call double @_CB.Main.c5e4ba542a56b71f(double %x, i32 %count), !dbg !85 -// CHECK:STDOUT: ret double %B.call, !dbg !86 +// CHECK:STDOUT: %B.call = call double @_CB.Main.c5e4ba542a56b71f(double %x, i32 %count), !dbg !109 +// CHECK:STDOUT: ret double %B.call, !dbg !110 // CHECK:STDOUT: // CHECK:STDOUT: if.else.loc26: ; preds = %if.else.loc23 -// CHECK:STDOUT: %C.call = call double @_CC.Main.c5e4ba542a56b71f(double %x, i32 %count), !dbg !89 -// CHECK:STDOUT: ret double %C.call, !dbg !90 +// CHECK:STDOUT: %C.call = call double @_CC.Main.c5e4ba542a56b71f(double %x, i32 %count), !dbg !113 +// CHECK:STDOUT: ret double %C.call, !dbg !114 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CA.Main.a76b78461416b4a8(ptr %x, i32 %count) #0 !dbg !92 { +// CHECK:STDOUT: define linkonce_odr ptr @_CA.Main.a76b78461416b4a8(ptr %x, i32 %count) #0 !dbg !116 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 4, !dbg !99 -// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then.loc23, label %if.else.loc23, !dbg !100 +// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 4, !dbg !123 +// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then.loc23, label %if.else.loc23, !dbg !124 // CHECK:STDOUT: // CHECK:STDOUT: if.then.loc23: ; preds = %entry -// CHECK:STDOUT: ret ptr %x, !dbg !102 +// CHECK:STDOUT: ret ptr %x, !dbg !126 // CHECK:STDOUT: // CHECK:STDOUT: if.else.loc23: ; preds = %entry -// CHECK:STDOUT: %Int.as.ModWith.impl.Op.call = srem i32 %count, 2, !dbg !103 -// CHECK:STDOUT: %Int.as.EqWith.impl.Equal.call = icmp eq i32 %Int.as.ModWith.impl.Op.call, 0, !dbg !103 -// CHECK:STDOUT: br i1 %Int.as.EqWith.impl.Equal.call, label %if.then.loc26, label %if.else.loc26, !dbg !104 +// CHECK:STDOUT: %Int.as.ModWith.impl.Op.call = srem i32 %count, 2, !dbg !127 +// CHECK:STDOUT: %Int.as.EqWith.impl.Equal.call = icmp eq i32 %Int.as.ModWith.impl.Op.call, 0, !dbg !127 +// CHECK:STDOUT: br i1 %Int.as.EqWith.impl.Equal.call, label %if.then.loc26, label %if.else.loc26, !dbg !128 // CHECK:STDOUT: // CHECK:STDOUT: if.then.loc26: ; preds = %if.else.loc23 -// CHECK:STDOUT: %B.call = call ptr @_CB.Main.a76b78461416b4a8(ptr %x, i32 %count), !dbg !107 -// CHECK:STDOUT: ret ptr %B.call, !dbg !108 +// CHECK:STDOUT: %B.call = call ptr @_CB.Main.a76b78461416b4a8(ptr %x, i32 %count), !dbg !131 +// CHECK:STDOUT: ret ptr %B.call, !dbg !132 // CHECK:STDOUT: // CHECK:STDOUT: if.else.loc26: ; preds = %if.else.loc23 -// CHECK:STDOUT: %C.call = call ptr @_CC.Main.a76b78461416b4a8(ptr %x, i32 %count), !dbg !111 -// CHECK:STDOUT: ret ptr %C.call, !dbg !112 +// CHECK:STDOUT: %C.call = call ptr @_CC.Main.a76b78461416b4a8(ptr %x, i32 %count), !dbg !135 +// CHECK:STDOUT: ret ptr %C.call, !dbg !136 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CB.Main.4d6ceefeb7f772f4(i32 %x, i32 %count) #0 !dbg !136 { +// CHECK:STDOUT: define linkonce_odr i32 @_CB.Main.4d6ceefeb7f772f4(i32 %x, i32 %count) #0 !dbg !160 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Print.call = call i32 (ptr, ...) @printf(ptr @printf.int.format, i32 1), !dbg !143 -// CHECK:STDOUT: %D.call = call i32 @_CD.Main.4d6ceefeb7f772f4(i32 %x, i32 %count), !dbg !146 -// CHECK:STDOUT: ret i32 %D.call, !dbg !147 +// CHECK:STDOUT: %Print.call = call i32 (ptr, ...) @printf(ptr @printf.int.format, i32 1), !dbg !167 +// CHECK:STDOUT: %D.call = call i32 @_CD.Main.4d6ceefeb7f772f4(i32 %x, i32 %count), !dbg !170 +// CHECK:STDOUT: ret i32 %D.call, !dbg !171 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CC.Main.4d6ceefeb7f772f4(i32 %x, i32 %count) #0 !dbg !149 { +// CHECK:STDOUT: define linkonce_odr i32 @_CC.Main.4d6ceefeb7f772f4(i32 %x, i32 %count) #0 !dbg !173 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Print.call = call i32 (ptr, ...) @printf(ptr @printf.int.format, i32 2), !dbg !156 -// CHECK:STDOUT: %D.call = call i32 @_CD.Main.4d6ceefeb7f772f4(i32 %x, i32 %count), !dbg !159 -// CHECK:STDOUT: ret i32 %D.call, !dbg !160 +// CHECK:STDOUT: %Print.call = call i32 (ptr, ...) @printf(ptr @printf.int.format, i32 2), !dbg !180 +// CHECK:STDOUT: %D.call = call i32 @_CD.Main.4d6ceefeb7f772f4(i32 %x, i32 %count), !dbg !183 +// CHECK:STDOUT: ret i32 %D.call, !dbg !184 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr double @_CB.Main.c5e4ba542a56b71f(double %x, i32 %count) #0 !dbg !162 { +// CHECK:STDOUT: define linkonce_odr double @_CB.Main.c5e4ba542a56b71f(double %x, i32 %count) #0 !dbg !186 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Print.call = call i32 (ptr, ...) @printf(ptr @printf.int.format, i32 1), !dbg !169 -// CHECK:STDOUT: %D.call = call double @_CD.Main.c5e4ba542a56b71f(double %x, i32 %count), !dbg !172 -// CHECK:STDOUT: ret double %D.call, !dbg !173 +// CHECK:STDOUT: %Print.call = call i32 (ptr, ...) @printf(ptr @printf.int.format, i32 1), !dbg !193 +// CHECK:STDOUT: %D.call = call double @_CD.Main.c5e4ba542a56b71f(double %x, i32 %count), !dbg !196 +// CHECK:STDOUT: ret double %D.call, !dbg !197 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr double @_CC.Main.c5e4ba542a56b71f(double %x, i32 %count) #0 !dbg !175 { +// CHECK:STDOUT: define linkonce_odr double @_CC.Main.c5e4ba542a56b71f(double %x, i32 %count) #0 !dbg !199 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Print.call = call i32 (ptr, ...) @printf(ptr @printf.int.format, i32 2), !dbg !182 -// CHECK:STDOUT: %D.call = call double @_CD.Main.c5e4ba542a56b71f(double %x, i32 %count), !dbg !185 -// CHECK:STDOUT: ret double %D.call, !dbg !186 +// CHECK:STDOUT: %Print.call = call i32 (ptr, ...) @printf(ptr @printf.int.format, i32 2), !dbg !206 +// CHECK:STDOUT: %D.call = call double @_CD.Main.c5e4ba542a56b71f(double %x, i32 %count), !dbg !209 +// CHECK:STDOUT: ret double %D.call, !dbg !210 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CB.Main.a76b78461416b4a8(ptr %x, i32 %count) #0 !dbg !188 { +// CHECK:STDOUT: define linkonce_odr ptr @_CB.Main.a76b78461416b4a8(ptr %x, i32 %count) #0 !dbg !212 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Print.call = call i32 (ptr, ...) @printf(ptr @printf.int.format, i32 1), !dbg !195 -// CHECK:STDOUT: %D.call = call ptr @_CD.Main.a76b78461416b4a8(ptr %x, i32 %count), !dbg !198 -// CHECK:STDOUT: ret ptr %D.call, !dbg !199 +// CHECK:STDOUT: %Print.call = call i32 (ptr, ...) @printf(ptr @printf.int.format, i32 1), !dbg !219 +// CHECK:STDOUT: %D.call = call ptr @_CD.Main.a76b78461416b4a8(ptr %x, i32 %count), !dbg !222 +// CHECK:STDOUT: ret ptr %D.call, !dbg !223 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CC.Main.a76b78461416b4a8(ptr %x, i32 %count) #0 !dbg !201 { +// CHECK:STDOUT: define linkonce_odr ptr @_CC.Main.a76b78461416b4a8(ptr %x, i32 %count) #0 !dbg !225 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Print.call = call i32 (ptr, ...) @printf(ptr @printf.int.format, i32 2), !dbg !208 -// CHECK:STDOUT: %D.call = call ptr @_CD.Main.a76b78461416b4a8(ptr %x, i32 %count), !dbg !211 -// CHECK:STDOUT: ret ptr %D.call, !dbg !212 +// CHECK:STDOUT: %Print.call = call i32 (ptr, ...) @printf(ptr @printf.int.format, i32 2), !dbg !232 +// CHECK:STDOUT: %D.call = call ptr @_CD.Main.a76b78461416b4a8(ptr %x, i32 %count), !dbg !235 +// CHECK:STDOUT: ret ptr %D.call, !dbg !236 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare i32 @printf(ptr, ...) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CD.Main.4d6ceefeb7f772f4(i32 %x, i32 %count) #0 !dbg !240 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !248 -// CHECK:STDOUT: %A.call = call i32 @_CA.Main.4d6ceefeb7f772f4(i32 %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !249 -// CHECK:STDOUT: ret i32 %A.call, !dbg !250 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr double @_CD.Main.c5e4ba542a56b71f(double %x, i32 %count) #0 !dbg !252 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !260 -// CHECK:STDOUT: %A.call = call double @_CA.Main.c5e4ba542a56b71f(double %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !261 -// CHECK:STDOUT: ret double %A.call, !dbg !262 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CD.Main.a76b78461416b4a8(ptr %x, i32 %count) #0 !dbg !264 { +// CHECK:STDOUT: define linkonce_odr i32 @_CD.Main.4d6ceefeb7f772f4(i32 %x, i32 %count) #0 !dbg !264 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !272 -// CHECK:STDOUT: %A.call = call ptr @_CA.Main.a76b78461416b4a8(ptr %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !273 -// CHECK:STDOUT: ret ptr %A.call, !dbg !274 +// CHECK:STDOUT: %A.call = call i32 @_CA.Main.4d6ceefeb7f772f4(i32 %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !273 +// CHECK:STDOUT: ret i32 %A.call, !dbg !274 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr double @_CD.Main.c5e4ba542a56b71f(double %x, i32 %count) #0 !dbg !276 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !284 +// CHECK:STDOUT: %A.call = call double @_CA.Main.c5e4ba542a56b71f(double %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !285 +// CHECK:STDOUT: ret double %A.call, !dbg !286 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr ptr @_CD.Main.a76b78461416b4a8(ptr %x, i32 %count) #0 !dbg !288 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !296 +// CHECK:STDOUT: %A.call = call ptr @_CA.Main.a76b78461416b4a8(ptr %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !297 +// CHECK:STDOUT: ret ptr %A.call, !dbg !298 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -293,114 +333,138 @@ fn M() { // CHECK:STDOUT: !37 = !DILocation(line: 57, column: 5, scope: !14) // CHECK:STDOUT: !38 = !DILocation(line: 57, column: 3, scope: !14) // CHECK:STDOUT: !39 = !DILocation(line: 48, column: 1, scope: !14) -// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "Op", linkageName: "_COp.dc14d4dd21801791:core.Destroy.Core", scope: null, file: !4, line: 50, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !43) +// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.749b51755634ad17:core.Destroy.Core", scope: null, file: !4, line: 52, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !43) // CHECK:STDOUT: !41 = !DILocalVariable(arg: 1, scope: !40, type: !9) -// CHECK:STDOUT: !42 = !DILocation(line: 50, column: 3, scope: !40) +// CHECK:STDOUT: !42 = !DILocation(line: 52, column: 3, scope: !40) // CHECK:STDOUT: !43 = !{!41} -// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 49, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !47) -// CHECK:STDOUT: !45 = !DILocalVariable(arg: 1, scope: !44, type: !6) -// CHECK:STDOUT: !46 = !DILocation(line: 49, column: 3, scope: !44) +// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.d088c7eb746488be:core.Destroy.Core", scope: null, file: !4, line: 51, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !47) +// CHECK:STDOUT: !45 = !DILocalVariable(arg: 1, scope: !44, type: !9) +// CHECK:STDOUT: !46 = !DILocation(line: 51, column: 3, scope: !44) // CHECK:STDOUT: !47 = !{!45} -// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "A", linkageName: "_CA.Main.4d6ceefeb7f772f4", scope: null, file: !4, line: 22, type: !30, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !69) -// CHECK:STDOUT: !49 = !DILocalVariable(arg: 1, scope: !48, type: !6) -// CHECK:STDOUT: !50 = !DILocalVariable(arg: 2, scope: !48, type: !6) -// CHECK:STDOUT: !55 = !DILocation(line: 23, column: 7, scope: !48) -// CHECK:STDOUT: !56 = !DILocation(line: 23, column: 6, scope: !48) -// CHECK:STDOUT: !58 = !DILocation(line: 24, column: 5, scope: !48) -// CHECK:STDOUT: !59 = !DILocation(line: 26, column: 7, scope: !48) -// CHECK:STDOUT: !60 = !DILocation(line: 26, column: 6, scope: !48) -// CHECK:STDOUT: !63 = !DILocation(line: 27, column: 12, scope: !48) -// CHECK:STDOUT: !64 = !DILocation(line: 27, column: 5, scope: !48) -// CHECK:STDOUT: !67 = !DILocation(line: 29, column: 12, scope: !48) -// CHECK:STDOUT: !68 = !DILocation(line: 29, column: 5, scope: !48) -// CHECK:STDOUT: !69 = !{!49, !50} -// CHECK:STDOUT: !70 = distinct !DISubprogram(name: "A", linkageName: "_CA.Main.c5e4ba542a56b71f", scope: null, file: !4, line: 22, type: !34, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !91) -// CHECK:STDOUT: !71 = !DILocalVariable(arg: 1, scope: !70, type: !9) -// CHECK:STDOUT: !72 = !DILocalVariable(arg: 2, scope: !70, type: !6) -// CHECK:STDOUT: !77 = !DILocation(line: 23, column: 7, scope: !70) -// CHECK:STDOUT: !78 = !DILocation(line: 23, column: 6, scope: !70) -// CHECK:STDOUT: !80 = !DILocation(line: 24, column: 5, scope: !70) -// CHECK:STDOUT: !81 = !DILocation(line: 26, column: 7, scope: !70) -// CHECK:STDOUT: !82 = !DILocation(line: 26, column: 6, scope: !70) -// CHECK:STDOUT: !85 = !DILocation(line: 27, column: 12, scope: !70) -// CHECK:STDOUT: !86 = !DILocation(line: 27, column: 5, scope: !70) -// CHECK:STDOUT: !89 = !DILocation(line: 29, column: 12, scope: !70) -// CHECK:STDOUT: !90 = !DILocation(line: 29, column: 5, scope: !70) -// CHECK:STDOUT: !91 = !{!71, !72} -// CHECK:STDOUT: !92 = distinct !DISubprogram(name: "A", linkageName: "_CA.Main.a76b78461416b4a8", scope: null, file: !4, line: 22, type: !34, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !113) -// CHECK:STDOUT: !93 = !DILocalVariable(arg: 1, scope: !92, type: !9) -// CHECK:STDOUT: !94 = !DILocalVariable(arg: 2, scope: !92, type: !6) -// CHECK:STDOUT: !99 = !DILocation(line: 23, column: 7, scope: !92) -// CHECK:STDOUT: !100 = !DILocation(line: 23, column: 6, scope: !92) -// CHECK:STDOUT: !102 = !DILocation(line: 24, column: 5, scope: !92) -// CHECK:STDOUT: !103 = !DILocation(line: 26, column: 7, scope: !92) -// CHECK:STDOUT: !104 = !DILocation(line: 26, column: 6, scope: !92) -// CHECK:STDOUT: !107 = !DILocation(line: 27, column: 12, scope: !92) -// CHECK:STDOUT: !108 = !DILocation(line: 27, column: 5, scope: !92) -// CHECK:STDOUT: !111 = !DILocation(line: 29, column: 12, scope: !92) -// CHECK:STDOUT: !112 = !DILocation(line: 29, column: 5, scope: !92) -// CHECK:STDOUT: !113 = !{!93, !94} -// CHECK:STDOUT: !136 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.4d6ceefeb7f772f4", scope: null, file: !4, line: 34, type: !30, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !148) -// CHECK:STDOUT: !137 = !DILocalVariable(arg: 1, scope: !136, type: !6) -// CHECK:STDOUT: !138 = !DILocalVariable(arg: 2, scope: !136, type: !6) -// CHECK:STDOUT: !143 = !DILocation(line: 35, column: 3, scope: !136) -// CHECK:STDOUT: !146 = !DILocation(line: 36, column: 10, scope: !136) -// CHECK:STDOUT: !147 = !DILocation(line: 36, column: 3, scope: !136) -// CHECK:STDOUT: !148 = !{!137, !138} -// CHECK:STDOUT: !149 = distinct !DISubprogram(name: "C", linkageName: "_CC.Main.4d6ceefeb7f772f4", scope: null, file: !4, line: 39, type: !30, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !161) -// CHECK:STDOUT: !150 = !DILocalVariable(arg: 1, scope: !149, type: !6) -// CHECK:STDOUT: !151 = !DILocalVariable(arg: 2, scope: !149, type: !6) -// CHECK:STDOUT: !156 = !DILocation(line: 40, column: 3, scope: !149) -// CHECK:STDOUT: !159 = !DILocation(line: 41, column: 10, scope: !149) -// CHECK:STDOUT: !160 = !DILocation(line: 41, column: 3, scope: !149) -// CHECK:STDOUT: !161 = !{!150, !151} -// CHECK:STDOUT: !162 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.c5e4ba542a56b71f", scope: null, file: !4, line: 34, type: !34, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !174) -// CHECK:STDOUT: !163 = !DILocalVariable(arg: 1, scope: !162, type: !9) -// CHECK:STDOUT: !164 = !DILocalVariable(arg: 2, scope: !162, type: !6) -// CHECK:STDOUT: !169 = !DILocation(line: 35, column: 3, scope: !162) -// CHECK:STDOUT: !172 = !DILocation(line: 36, column: 10, scope: !162) -// CHECK:STDOUT: !173 = !DILocation(line: 36, column: 3, scope: !162) -// CHECK:STDOUT: !174 = !{!163, !164} -// CHECK:STDOUT: !175 = distinct !DISubprogram(name: "C", linkageName: "_CC.Main.c5e4ba542a56b71f", scope: null, file: !4, line: 39, type: !34, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !187) -// CHECK:STDOUT: !176 = !DILocalVariable(arg: 1, scope: !175, type: !9) -// CHECK:STDOUT: !177 = !DILocalVariable(arg: 2, scope: !175, type: !6) -// CHECK:STDOUT: !182 = !DILocation(line: 40, column: 3, scope: !175) -// CHECK:STDOUT: !185 = !DILocation(line: 41, column: 10, scope: !175) -// CHECK:STDOUT: !186 = !DILocation(line: 41, column: 3, scope: !175) -// CHECK:STDOUT: !187 = !{!176, !177} -// CHECK:STDOUT: !188 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.a76b78461416b4a8", scope: null, file: !4, line: 34, type: !34, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !200) -// CHECK:STDOUT: !189 = !DILocalVariable(arg: 1, scope: !188, type: !9) -// CHECK:STDOUT: !190 = !DILocalVariable(arg: 2, scope: !188, type: !6) -// CHECK:STDOUT: !195 = !DILocation(line: 35, column: 3, scope: !188) -// CHECK:STDOUT: !198 = !DILocation(line: 36, column: 10, scope: !188) -// CHECK:STDOUT: !199 = !DILocation(line: 36, column: 3, scope: !188) -// CHECK:STDOUT: !200 = !{!189, !190} -// CHECK:STDOUT: !201 = distinct !DISubprogram(name: "C", linkageName: "_CC.Main.a76b78461416b4a8", scope: null, file: !4, line: 39, type: !34, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !213) -// CHECK:STDOUT: !202 = !DILocalVariable(arg: 1, scope: !201, type: !9) -// CHECK:STDOUT: !203 = !DILocalVariable(arg: 2, scope: !201, type: !6) -// CHECK:STDOUT: !208 = !DILocation(line: 40, column: 3, scope: !201) -// CHECK:STDOUT: !211 = !DILocation(line: 41, column: 10, scope: !201) -// CHECK:STDOUT: !212 = !DILocation(line: 41, column: 3, scope: !201) -// CHECK:STDOUT: !213 = !{!202, !203} -// CHECK:STDOUT: !240 = distinct !DISubprogram(name: "D", linkageName: "_CD.Main.4d6ceefeb7f772f4", scope: null, file: !4, line: 44, type: !30, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !251) -// CHECK:STDOUT: !241 = !DILocalVariable(arg: 1, scope: !240, type: !6) -// CHECK:STDOUT: !242 = !DILocalVariable(arg: 2, scope: !240, type: !6) -// CHECK:STDOUT: !248 = !DILocation(line: 45, column: 15, scope: !240) -// CHECK:STDOUT: !249 = !DILocation(line: 45, column: 10, scope: !240) -// CHECK:STDOUT: !250 = !DILocation(line: 45, column: 3, scope: !240) -// CHECK:STDOUT: !251 = !{!241, !242} -// CHECK:STDOUT: !252 = distinct !DISubprogram(name: "D", linkageName: "_CD.Main.c5e4ba542a56b71f", scope: null, file: !4, line: 44, type: !34, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !263) -// CHECK:STDOUT: !253 = !DILocalVariable(arg: 1, scope: !252, type: !9) -// CHECK:STDOUT: !254 = !DILocalVariable(arg: 2, scope: !252, type: !6) -// CHECK:STDOUT: !260 = !DILocation(line: 45, column: 15, scope: !252) -// CHECK:STDOUT: !261 = !DILocation(line: 45, column: 10, scope: !252) -// CHECK:STDOUT: !262 = !DILocation(line: 45, column: 3, scope: !252) -// CHECK:STDOUT: !263 = !{!253, !254} -// CHECK:STDOUT: !264 = distinct !DISubprogram(name: "D", linkageName: "_CD.Main.a76b78461416b4a8", scope: null, file: !4, line: 44, type: !34, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !275) -// CHECK:STDOUT: !265 = !DILocalVariable(arg: 1, scope: !264, type: !9) +// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.7945ecba5c505fc0:core.Destroy.Core", scope: null, file: !4, line: 50, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !51) +// CHECK:STDOUT: !49 = !DILocalVariable(arg: 1, scope: !48, type: !9) +// CHECK:STDOUT: !50 = !DILocation(line: 50, column: 3, scope: !48) +// CHECK:STDOUT: !51 = !{!49} +// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.dc14d4dd21801791:core.Destroy.Core", scope: null, file: !4, line: 50, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !55) +// CHECK:STDOUT: !53 = !DILocalVariable(arg: 1, scope: !52, type: !9) +// CHECK:STDOUT: !54 = !DILocation(line: 50, column: 3, scope: !52) +// CHECK:STDOUT: !55 = !{!53} +// CHECK:STDOUT: !56 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.dc14d4dd21801791:core.Destroy.Core", scope: null, file: !4, line: 50, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !59) +// CHECK:STDOUT: !57 = !DILocalVariable(arg: 1, scope: !56, type: !9) +// CHECK:STDOUT: !58 = !DILocation(line: 50, column: 3, scope: !56) +// CHECK:STDOUT: !59 = !{!57} +// CHECK:STDOUT: !60 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !4, line: 49, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !63) +// CHECK:STDOUT: !61 = !DILocalVariable(arg: 1, scope: !60, type: !6) +// CHECK:STDOUT: !62 = !DILocation(line: 49, column: 3, scope: !60) +// CHECK:STDOUT: !63 = !{!61} +// CHECK:STDOUT: !64 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 49, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !67) +// CHECK:STDOUT: !65 = !DILocalVariable(arg: 1, scope: !64, type: !6) +// CHECK:STDOUT: !66 = !DILocation(line: 49, column: 3, scope: !64) +// CHECK:STDOUT: !67 = !{!65} +// CHECK:STDOUT: !68 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 49, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !71) +// CHECK:STDOUT: !69 = !DILocalVariable(arg: 1, scope: !68, type: !6) +// CHECK:STDOUT: !70 = !DILocation(line: 49, column: 3, scope: !68) +// CHECK:STDOUT: !71 = !{!69} +// CHECK:STDOUT: !72 = distinct !DISubprogram(name: "A", linkageName: "_CA.Main.4d6ceefeb7f772f4", scope: null, file: !4, line: 22, type: !30, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !93) +// CHECK:STDOUT: !73 = !DILocalVariable(arg: 1, scope: !72, type: !6) +// CHECK:STDOUT: !74 = !DILocalVariable(arg: 2, scope: !72, type: !6) +// CHECK:STDOUT: !79 = !DILocation(line: 23, column: 7, scope: !72) +// CHECK:STDOUT: !80 = !DILocation(line: 23, column: 6, scope: !72) +// CHECK:STDOUT: !82 = !DILocation(line: 24, column: 5, scope: !72) +// CHECK:STDOUT: !83 = !DILocation(line: 26, column: 7, scope: !72) +// CHECK:STDOUT: !84 = !DILocation(line: 26, column: 6, scope: !72) +// CHECK:STDOUT: !87 = !DILocation(line: 27, column: 12, scope: !72) +// CHECK:STDOUT: !88 = !DILocation(line: 27, column: 5, scope: !72) +// CHECK:STDOUT: !91 = !DILocation(line: 29, column: 12, scope: !72) +// CHECK:STDOUT: !92 = !DILocation(line: 29, column: 5, scope: !72) +// CHECK:STDOUT: !93 = !{!73, !74} +// CHECK:STDOUT: !94 = distinct !DISubprogram(name: "A", linkageName: "_CA.Main.c5e4ba542a56b71f", scope: null, file: !4, line: 22, type: !34, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !115) +// CHECK:STDOUT: !95 = !DILocalVariable(arg: 1, scope: !94, type: !9) +// CHECK:STDOUT: !96 = !DILocalVariable(arg: 2, scope: !94, type: !6) +// CHECK:STDOUT: !101 = !DILocation(line: 23, column: 7, scope: !94) +// CHECK:STDOUT: !102 = !DILocation(line: 23, column: 6, scope: !94) +// CHECK:STDOUT: !104 = !DILocation(line: 24, column: 5, scope: !94) +// CHECK:STDOUT: !105 = !DILocation(line: 26, column: 7, scope: !94) +// CHECK:STDOUT: !106 = !DILocation(line: 26, column: 6, scope: !94) +// CHECK:STDOUT: !109 = !DILocation(line: 27, column: 12, scope: !94) +// CHECK:STDOUT: !110 = !DILocation(line: 27, column: 5, scope: !94) +// CHECK:STDOUT: !113 = !DILocation(line: 29, column: 12, scope: !94) +// CHECK:STDOUT: !114 = !DILocation(line: 29, column: 5, scope: !94) +// CHECK:STDOUT: !115 = !{!95, !96} +// CHECK:STDOUT: !116 = distinct !DISubprogram(name: "A", linkageName: "_CA.Main.a76b78461416b4a8", scope: null, file: !4, line: 22, type: !34, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !137) +// CHECK:STDOUT: !117 = !DILocalVariable(arg: 1, scope: !116, type: !9) +// CHECK:STDOUT: !118 = !DILocalVariable(arg: 2, scope: !116, type: !6) +// CHECK:STDOUT: !123 = !DILocation(line: 23, column: 7, scope: !116) +// CHECK:STDOUT: !124 = !DILocation(line: 23, column: 6, scope: !116) +// CHECK:STDOUT: !126 = !DILocation(line: 24, column: 5, scope: !116) +// CHECK:STDOUT: !127 = !DILocation(line: 26, column: 7, scope: !116) +// CHECK:STDOUT: !128 = !DILocation(line: 26, column: 6, scope: !116) +// CHECK:STDOUT: !131 = !DILocation(line: 27, column: 12, scope: !116) +// CHECK:STDOUT: !132 = !DILocation(line: 27, column: 5, scope: !116) +// CHECK:STDOUT: !135 = !DILocation(line: 29, column: 12, scope: !116) +// CHECK:STDOUT: !136 = !DILocation(line: 29, column: 5, scope: !116) +// CHECK:STDOUT: !137 = !{!117, !118} +// CHECK:STDOUT: !160 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.4d6ceefeb7f772f4", scope: null, file: !4, line: 34, type: !30, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !172) +// CHECK:STDOUT: !161 = !DILocalVariable(arg: 1, scope: !160, type: !6) +// CHECK:STDOUT: !162 = !DILocalVariable(arg: 2, scope: !160, type: !6) +// CHECK:STDOUT: !167 = !DILocation(line: 35, column: 3, scope: !160) +// CHECK:STDOUT: !170 = !DILocation(line: 36, column: 10, scope: !160) +// CHECK:STDOUT: !171 = !DILocation(line: 36, column: 3, scope: !160) +// CHECK:STDOUT: !172 = !{!161, !162} +// CHECK:STDOUT: !173 = distinct !DISubprogram(name: "C", linkageName: "_CC.Main.4d6ceefeb7f772f4", scope: null, file: !4, line: 39, type: !30, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !185) +// CHECK:STDOUT: !174 = !DILocalVariable(arg: 1, scope: !173, type: !6) +// CHECK:STDOUT: !175 = !DILocalVariable(arg: 2, scope: !173, type: !6) +// CHECK:STDOUT: !180 = !DILocation(line: 40, column: 3, scope: !173) +// CHECK:STDOUT: !183 = !DILocation(line: 41, column: 10, scope: !173) +// CHECK:STDOUT: !184 = !DILocation(line: 41, column: 3, scope: !173) +// CHECK:STDOUT: !185 = !{!174, !175} +// CHECK:STDOUT: !186 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.c5e4ba542a56b71f", scope: null, file: !4, line: 34, type: !34, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !198) +// CHECK:STDOUT: !187 = !DILocalVariable(arg: 1, scope: !186, type: !9) +// CHECK:STDOUT: !188 = !DILocalVariable(arg: 2, scope: !186, type: !6) +// CHECK:STDOUT: !193 = !DILocation(line: 35, column: 3, scope: !186) +// CHECK:STDOUT: !196 = !DILocation(line: 36, column: 10, scope: !186) +// CHECK:STDOUT: !197 = !DILocation(line: 36, column: 3, scope: !186) +// CHECK:STDOUT: !198 = !{!187, !188} +// CHECK:STDOUT: !199 = distinct !DISubprogram(name: "C", linkageName: "_CC.Main.c5e4ba542a56b71f", scope: null, file: !4, line: 39, type: !34, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !211) +// CHECK:STDOUT: !200 = !DILocalVariable(arg: 1, scope: !199, type: !9) +// CHECK:STDOUT: !201 = !DILocalVariable(arg: 2, scope: !199, type: !6) +// CHECK:STDOUT: !206 = !DILocation(line: 40, column: 3, scope: !199) +// CHECK:STDOUT: !209 = !DILocation(line: 41, column: 10, scope: !199) +// CHECK:STDOUT: !210 = !DILocation(line: 41, column: 3, scope: !199) +// CHECK:STDOUT: !211 = !{!200, !201} +// CHECK:STDOUT: !212 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.a76b78461416b4a8", scope: null, file: !4, line: 34, type: !34, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !224) +// CHECK:STDOUT: !213 = !DILocalVariable(arg: 1, scope: !212, type: !9) +// CHECK:STDOUT: !214 = !DILocalVariable(arg: 2, scope: !212, type: !6) +// CHECK:STDOUT: !219 = !DILocation(line: 35, column: 3, scope: !212) +// CHECK:STDOUT: !222 = !DILocation(line: 36, column: 10, scope: !212) +// CHECK:STDOUT: !223 = !DILocation(line: 36, column: 3, scope: !212) +// CHECK:STDOUT: !224 = !{!213, !214} +// CHECK:STDOUT: !225 = distinct !DISubprogram(name: "C", linkageName: "_CC.Main.a76b78461416b4a8", scope: null, file: !4, line: 39, type: !34, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !237) +// CHECK:STDOUT: !226 = !DILocalVariable(arg: 1, scope: !225, type: !9) +// CHECK:STDOUT: !227 = !DILocalVariable(arg: 2, scope: !225, type: !6) +// CHECK:STDOUT: !232 = !DILocation(line: 40, column: 3, scope: !225) +// CHECK:STDOUT: !235 = !DILocation(line: 41, column: 10, scope: !225) +// CHECK:STDOUT: !236 = !DILocation(line: 41, column: 3, scope: !225) +// CHECK:STDOUT: !237 = !{!226, !227} +// CHECK:STDOUT: !264 = distinct !DISubprogram(name: "D", linkageName: "_CD.Main.4d6ceefeb7f772f4", scope: null, file: !4, line: 44, type: !30, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !275) +// CHECK:STDOUT: !265 = !DILocalVariable(arg: 1, scope: !264, type: !6) // CHECK:STDOUT: !266 = !DILocalVariable(arg: 2, scope: !264, type: !6) // CHECK:STDOUT: !272 = !DILocation(line: 45, column: 15, scope: !264) // CHECK:STDOUT: !273 = !DILocation(line: 45, column: 10, scope: !264) // CHECK:STDOUT: !274 = !DILocation(line: 45, column: 3, scope: !264) // CHECK:STDOUT: !275 = !{!265, !266} +// CHECK:STDOUT: !276 = distinct !DISubprogram(name: "D", linkageName: "_CD.Main.c5e4ba542a56b71f", scope: null, file: !4, line: 44, type: !34, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !287) +// CHECK:STDOUT: !277 = !DILocalVariable(arg: 1, scope: !276, type: !9) +// CHECK:STDOUT: !278 = !DILocalVariable(arg: 2, scope: !276, type: !6) +// CHECK:STDOUT: !284 = !DILocation(line: 45, column: 15, scope: !276) +// CHECK:STDOUT: !285 = !DILocation(line: 45, column: 10, scope: !276) +// CHECK:STDOUT: !286 = !DILocation(line: 45, column: 3, scope: !276) +// CHECK:STDOUT: !287 = !{!277, !278} +// CHECK:STDOUT: !288 = distinct !DISubprogram(name: "D", linkageName: "_CD.Main.a76b78461416b4a8", scope: null, file: !4, line: 44, type: !34, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !299) +// CHECK:STDOUT: !289 = !DILocalVariable(arg: 1, scope: !288, type: !9) +// CHECK:STDOUT: !290 = !DILocalVariable(arg: 2, scope: !288, type: !6) +// CHECK:STDOUT: !296 = !DILocation(line: 45, column: 15, scope: !288) +// CHECK:STDOUT: !297 = !DILocation(line: 45, column: 10, scope: !288) +// CHECK:STDOUT: !298 = !DILocation(line: 45, column: 3, scope: !288) +// CHECK:STDOUT: !299 = !{!289, !290} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/function/generic/call_recursive_mutual.carbon b/toolchain/lower/testdata/function/generic/call_recursive_mutual.carbon index ef6a78c99011..495290ad841f 100644 --- a/toolchain/lower/testdata/function/generic/call_recursive_mutual.carbon +++ b/toolchain/lower/testdata/function/generic/call_recursive_mutual.carbon @@ -68,114 +68,154 @@ fn M() { // CHECK:STDOUT: %F.call.loc40 = call ptr @_CF.Main.a76b78461416b4a8(ptr %.loc40_5, i32 0), !dbg !36 // CHECK:STDOUT: %.loc41_5 = load ptr, ptr %ptr_f64.var, align 8, !dbg !37 // CHECK:STDOUT: %F.call.loc41 = call ptr @_CF.Main.a76b78461416b4a8(ptr %.loc41_5, i32 0), !dbg !38 -// CHECK:STDOUT: call void @"_COp.dc14d4dd21801791:core.Destroy.Core"(ptr %m.var), !dbg !17 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %n.var), !dbg !15 +// CHECK:STDOUT: call void @"_CSelfDestruct.749b51755634ad17:core.Destroy.Core"(ptr %ptr_f64.var), !dbg !23 +// CHECK:STDOUT: call void @"_CSelfDestruct.d088c7eb746488be:core.Destroy.Core"(ptr %ptr_i32.var), !dbg !19 +// CHECK:STDOUT: call void @"_CSelfDestruct.dc14d4dd21801791:core.Destroy.Core"(ptr %m.var), !dbg !17 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %n.var), !dbg !15 // CHECK:STDOUT: ret void, !dbg !39 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.dc14d4dd21801791:core.Destroy.Core"(ptr %self) #0 !dbg !40 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.749b51755634ad17:core.Destroy.Core"(ptr %self) #0 !dbg !40 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !42 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !44 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.d088c7eb746488be:core.Destroy.Core"(ptr %self) #0 !dbg !44 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !46 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.7945ecba5c505fc0:core.Destroy.Core"(ptr %self) #0 !dbg !48 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !50 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.dc14d4dd21801791:core.Destroy.Core"(ptr %self) #0 !dbg !52 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !54 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.dc14d4dd21801791:core.Destroy.Core"(ptr %self) #0 !dbg !56 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.dc14d4dd21801791:core.Destroy.Core"(ptr %self), !dbg !58 +// CHECK:STDOUT: ret void, !dbg !58 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !60 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !62 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !64 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !66 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !68 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !70 +// CHECK:STDOUT: ret void, !dbg !70 +// 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 i32 @_CF.Main.4d6ceefeb7f772f4(i32 %x, i32 %count) #0 !dbg !48 { +// CHECK:STDOUT: define linkonce_odr i32 @_CF.Main.4d6ceefeb7f772f4(i32 %x, i32 %count) #0 !dbg !72 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 3, !dbg !55 -// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !56 +// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 3, !dbg !79 +// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !80 // CHECK:STDOUT: // CHECK:STDOUT: if.then: ; preds = %entry -// CHECK:STDOUT: ret i32 %x, !dbg !58 +// CHECK:STDOUT: ret i32 %x, !dbg !82 // CHECK:STDOUT: // CHECK:STDOUT: if.else: ; preds = %entry -// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !60 -// CHECK:STDOUT: %G.call = call i32 @_CG.Main.4d6ceefeb7f772f4(i32 %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !61 -// CHECK:STDOUT: ret i32 %G.call, !dbg !62 +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !84 +// CHECK:STDOUT: %G.call = call i32 @_CG.Main.4d6ceefeb7f772f4(i32 %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !85 +// CHECK:STDOUT: ret i32 %G.call, !dbg !86 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr double @_CF.Main.c5e4ba542a56b71f(double %x, i32 %count) #0 !dbg !64 { +// CHECK:STDOUT: define linkonce_odr double @_CF.Main.c5e4ba542a56b71f(double %x, i32 %count) #0 !dbg !88 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 3, !dbg !71 -// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !72 +// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 3, !dbg !95 +// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !96 // CHECK:STDOUT: // CHECK:STDOUT: if.then: ; preds = %entry -// CHECK:STDOUT: ret double %x, !dbg !74 +// CHECK:STDOUT: ret double %x, !dbg !98 // CHECK:STDOUT: // CHECK:STDOUT: if.else: ; preds = %entry -// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !76 -// CHECK:STDOUT: %G.call = call double @_CG.Main.c5e4ba542a56b71f(double %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !77 -// CHECK:STDOUT: ret double %G.call, !dbg !78 +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !100 +// CHECK:STDOUT: %G.call = call double @_CG.Main.c5e4ba542a56b71f(double %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !101 +// CHECK:STDOUT: ret double %G.call, !dbg !102 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CF.Main.a76b78461416b4a8(ptr %x, i32 %count) #0 !dbg !80 { +// CHECK:STDOUT: define linkonce_odr ptr @_CF.Main.a76b78461416b4a8(ptr %x, i32 %count) #0 !dbg !104 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 3, !dbg !87 -// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !88 +// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 3, !dbg !111 +// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !112 // CHECK:STDOUT: // CHECK:STDOUT: if.then: ; preds = %entry -// CHECK:STDOUT: ret ptr %x, !dbg !90 +// CHECK:STDOUT: ret ptr %x, !dbg !114 // CHECK:STDOUT: // CHECK:STDOUT: if.else: ; preds = %entry -// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !92 -// CHECK:STDOUT: %G.call = call ptr @_CG.Main.a76b78461416b4a8(ptr %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !93 -// CHECK:STDOUT: ret ptr %G.call, !dbg !94 +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !116 +// CHECK:STDOUT: %G.call = call ptr @_CG.Main.a76b78461416b4a8(ptr %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !117 +// CHECK:STDOUT: ret ptr %G.call, !dbg !118 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CG.Main.4d6ceefeb7f772f4(i32 %x, i32 %count) #0 !dbg !112 { +// CHECK:STDOUT: define linkonce_odr i32 @_CG.Main.4d6ceefeb7f772f4(i32 %x, i32 %count) #0 !dbg !136 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 4, !dbg !119 -// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !120 +// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 4, !dbg !143 +// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !144 // CHECK:STDOUT: // CHECK:STDOUT: if.then: ; preds = %entry -// CHECK:STDOUT: ret i32 %x, !dbg !122 +// CHECK:STDOUT: ret i32 %x, !dbg !146 // CHECK:STDOUT: // CHECK:STDOUT: if.else: ; preds = %entry -// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !124 -// CHECK:STDOUT: %F.call = call i32 @_CF.Main.4d6ceefeb7f772f4(i32 %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !125 -// CHECK:STDOUT: ret i32 %F.call, !dbg !126 +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !148 +// CHECK:STDOUT: %F.call = call i32 @_CF.Main.4d6ceefeb7f772f4(i32 %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !149 +// CHECK:STDOUT: ret i32 %F.call, !dbg !150 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr double @_CG.Main.c5e4ba542a56b71f(double %x, i32 %count) #0 !dbg !128 { +// CHECK:STDOUT: define linkonce_odr double @_CG.Main.c5e4ba542a56b71f(double %x, i32 %count) #0 !dbg !152 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 4, !dbg !135 -// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !136 +// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 4, !dbg !159 +// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !160 // CHECK:STDOUT: // CHECK:STDOUT: if.then: ; preds = %entry -// CHECK:STDOUT: ret double %x, !dbg !138 +// CHECK:STDOUT: ret double %x, !dbg !162 // CHECK:STDOUT: // CHECK:STDOUT: if.else: ; preds = %entry -// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !140 -// CHECK:STDOUT: %F.call = call double @_CF.Main.c5e4ba542a56b71f(double %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !141 -// CHECK:STDOUT: ret double %F.call, !dbg !142 +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !164 +// CHECK:STDOUT: %F.call = call double @_CF.Main.c5e4ba542a56b71f(double %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !165 +// CHECK:STDOUT: ret double %F.call, !dbg !166 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CG.Main.a76b78461416b4a8(ptr %x, i32 %count) #0 !dbg !144 { +// CHECK:STDOUT: define linkonce_odr ptr @_CG.Main.a76b78461416b4a8(ptr %x, i32 %count) #0 !dbg !168 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 4, !dbg !151 -// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !152 +// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 4, !dbg !175 +// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !176 // CHECK:STDOUT: // CHECK:STDOUT: if.then: ; preds = %entry -// CHECK:STDOUT: ret ptr %x, !dbg !154 +// CHECK:STDOUT: ret ptr %x, !dbg !178 // CHECK:STDOUT: // CHECK:STDOUT: if.else: ; preds = %entry -// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !156 -// CHECK:STDOUT: %F.call = call ptr @_CF.Main.a76b78461416b4a8(ptr %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !157 -// CHECK:STDOUT: ret ptr %F.call, !dbg !158 +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !180 +// CHECK:STDOUT: %F.call = call ptr @_CF.Main.a76b78461416b4a8(ptr %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !181 +// CHECK:STDOUT: ret ptr %F.call, !dbg !182 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -218,72 +258,96 @@ fn M() { // CHECK:STDOUT: !37 = !DILocation(line: 41, column: 5, scope: !14) // CHECK:STDOUT: !38 = !DILocation(line: 41, column: 3, scope: !14) // CHECK:STDOUT: !39 = !DILocation(line: 32, column: 1, scope: !14) -// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "Op", linkageName: "_COp.dc14d4dd21801791:core.Destroy.Core", scope: null, file: !4, line: 34, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !43) +// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.749b51755634ad17:core.Destroy.Core", scope: null, file: !4, line: 36, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !43) // CHECK:STDOUT: !41 = !DILocalVariable(arg: 1, scope: !40, type: !9) -// CHECK:STDOUT: !42 = !DILocation(line: 34, column: 3, scope: !40) +// CHECK:STDOUT: !42 = !DILocation(line: 36, column: 3, scope: !40) // CHECK:STDOUT: !43 = !{!41} -// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 33, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !47) -// CHECK:STDOUT: !45 = !DILocalVariable(arg: 1, scope: !44, type: !6) -// CHECK:STDOUT: !46 = !DILocation(line: 33, column: 3, scope: !44) +// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.d088c7eb746488be:core.Destroy.Core", scope: null, file: !4, line: 35, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !47) +// CHECK:STDOUT: !45 = !DILocalVariable(arg: 1, scope: !44, type: !9) +// CHECK:STDOUT: !46 = !DILocation(line: 35, column: 3, scope: !44) // CHECK:STDOUT: !47 = !{!45} -// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.4d6ceefeb7f772f4", scope: null, file: !4, line: 18, type: !30, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !63) -// CHECK:STDOUT: !49 = !DILocalVariable(arg: 1, scope: !48, type: !6) -// CHECK:STDOUT: !50 = !DILocalVariable(arg: 2, scope: !48, type: !6) -// CHECK:STDOUT: !55 = !DILocation(line: 19, column: 7, scope: !48) -// CHECK:STDOUT: !56 = !DILocation(line: 19, column: 6, scope: !48) -// CHECK:STDOUT: !58 = !DILocation(line: 20, column: 5, scope: !48) -// CHECK:STDOUT: !60 = !DILocation(line: 22, column: 15, scope: !48) -// CHECK:STDOUT: !61 = !DILocation(line: 22, column: 10, scope: !48) -// CHECK:STDOUT: !62 = !DILocation(line: 22, column: 3, scope: !48) -// CHECK:STDOUT: !63 = !{!49, !50} -// CHECK:STDOUT: !64 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.c5e4ba542a56b71f", scope: null, file: !4, line: 18, type: !34, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !79) -// CHECK:STDOUT: !65 = !DILocalVariable(arg: 1, scope: !64, type: !9) -// CHECK:STDOUT: !66 = !DILocalVariable(arg: 2, scope: !64, type: !6) -// CHECK:STDOUT: !71 = !DILocation(line: 19, column: 7, scope: !64) -// CHECK:STDOUT: !72 = !DILocation(line: 19, column: 6, scope: !64) -// CHECK:STDOUT: !74 = !DILocation(line: 20, column: 5, scope: !64) -// CHECK:STDOUT: !76 = !DILocation(line: 22, column: 15, scope: !64) -// CHECK:STDOUT: !77 = !DILocation(line: 22, column: 10, scope: !64) -// CHECK:STDOUT: !78 = !DILocation(line: 22, column: 3, scope: !64) -// CHECK:STDOUT: !79 = !{!65, !66} -// CHECK:STDOUT: !80 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.a76b78461416b4a8", scope: null, file: !4, line: 18, type: !34, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !95) -// CHECK:STDOUT: !81 = !DILocalVariable(arg: 1, scope: !80, type: !9) -// CHECK:STDOUT: !82 = !DILocalVariable(arg: 2, scope: !80, type: !6) -// CHECK:STDOUT: !87 = !DILocation(line: 19, column: 7, scope: !80) -// CHECK:STDOUT: !88 = !DILocation(line: 19, column: 6, scope: !80) -// CHECK:STDOUT: !90 = !DILocation(line: 20, column: 5, scope: !80) -// CHECK:STDOUT: !92 = !DILocation(line: 22, column: 15, scope: !80) -// CHECK:STDOUT: !93 = !DILocation(line: 22, column: 10, scope: !80) -// CHECK:STDOUT: !94 = !DILocation(line: 22, column: 3, scope: !80) -// CHECK:STDOUT: !95 = !{!81, !82} -// CHECK:STDOUT: !112 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.4d6ceefeb7f772f4", scope: null, file: !4, line: 25, type: !30, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !127) -// CHECK:STDOUT: !113 = !DILocalVariable(arg: 1, scope: !112, type: !6) -// CHECK:STDOUT: !114 = !DILocalVariable(arg: 2, scope: !112, type: !6) -// CHECK:STDOUT: !119 = !DILocation(line: 26, column: 7, scope: !112) -// CHECK:STDOUT: !120 = !DILocation(line: 26, column: 6, scope: !112) -// CHECK:STDOUT: !122 = !DILocation(line: 27, column: 5, scope: !112) -// CHECK:STDOUT: !124 = !DILocation(line: 29, column: 15, scope: !112) -// CHECK:STDOUT: !125 = !DILocation(line: 29, column: 10, scope: !112) -// CHECK:STDOUT: !126 = !DILocation(line: 29, column: 3, scope: !112) -// CHECK:STDOUT: !127 = !{!113, !114} -// CHECK:STDOUT: !128 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.c5e4ba542a56b71f", scope: null, file: !4, line: 25, type: !34, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !143) -// CHECK:STDOUT: !129 = !DILocalVariable(arg: 1, scope: !128, type: !9) -// CHECK:STDOUT: !130 = !DILocalVariable(arg: 2, scope: !128, type: !6) -// CHECK:STDOUT: !135 = !DILocation(line: 26, column: 7, scope: !128) -// CHECK:STDOUT: !136 = !DILocation(line: 26, column: 6, scope: !128) -// CHECK:STDOUT: !138 = !DILocation(line: 27, column: 5, scope: !128) -// CHECK:STDOUT: !140 = !DILocation(line: 29, column: 15, scope: !128) -// CHECK:STDOUT: !141 = !DILocation(line: 29, column: 10, scope: !128) -// CHECK:STDOUT: !142 = !DILocation(line: 29, column: 3, scope: !128) -// CHECK:STDOUT: !143 = !{!129, !130} -// CHECK:STDOUT: !144 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.a76b78461416b4a8", scope: null, file: !4, line: 25, type: !34, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !159) -// CHECK:STDOUT: !145 = !DILocalVariable(arg: 1, scope: !144, type: !9) -// CHECK:STDOUT: !146 = !DILocalVariable(arg: 2, scope: !144, type: !6) -// CHECK:STDOUT: !151 = !DILocation(line: 26, column: 7, scope: !144) -// CHECK:STDOUT: !152 = !DILocation(line: 26, column: 6, scope: !144) -// CHECK:STDOUT: !154 = !DILocation(line: 27, column: 5, scope: !144) -// CHECK:STDOUT: !156 = !DILocation(line: 29, column: 15, scope: !144) -// CHECK:STDOUT: !157 = !DILocation(line: 29, column: 10, scope: !144) -// CHECK:STDOUT: !158 = !DILocation(line: 29, column: 3, scope: !144) -// CHECK:STDOUT: !159 = !{!145, !146} +// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.7945ecba5c505fc0:core.Destroy.Core", scope: null, file: !4, line: 34, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !51) +// CHECK:STDOUT: !49 = !DILocalVariable(arg: 1, scope: !48, type: !9) +// CHECK:STDOUT: !50 = !DILocation(line: 34, column: 3, scope: !48) +// CHECK:STDOUT: !51 = !{!49} +// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.dc14d4dd21801791:core.Destroy.Core", scope: null, file: !4, line: 34, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !55) +// CHECK:STDOUT: !53 = !DILocalVariable(arg: 1, scope: !52, type: !9) +// CHECK:STDOUT: !54 = !DILocation(line: 34, column: 3, scope: !52) +// CHECK:STDOUT: !55 = !{!53} +// CHECK:STDOUT: !56 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.dc14d4dd21801791:core.Destroy.Core", scope: null, file: !4, line: 34, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !59) +// CHECK:STDOUT: !57 = !DILocalVariable(arg: 1, scope: !56, type: !9) +// CHECK:STDOUT: !58 = !DILocation(line: 34, column: 3, scope: !56) +// CHECK:STDOUT: !59 = !{!57} +// CHECK:STDOUT: !60 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !4, line: 33, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !63) +// CHECK:STDOUT: !61 = !DILocalVariable(arg: 1, scope: !60, type: !6) +// CHECK:STDOUT: !62 = !DILocation(line: 33, column: 3, scope: !60) +// CHECK:STDOUT: !63 = !{!61} +// CHECK:STDOUT: !64 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 33, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !67) +// CHECK:STDOUT: !65 = !DILocalVariable(arg: 1, scope: !64, type: !6) +// CHECK:STDOUT: !66 = !DILocation(line: 33, column: 3, scope: !64) +// CHECK:STDOUT: !67 = !{!65} +// CHECK:STDOUT: !68 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 33, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !71) +// CHECK:STDOUT: !69 = !DILocalVariable(arg: 1, scope: !68, type: !6) +// CHECK:STDOUT: !70 = !DILocation(line: 33, column: 3, scope: !68) +// CHECK:STDOUT: !71 = !{!69} +// CHECK:STDOUT: !72 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.4d6ceefeb7f772f4", scope: null, file: !4, line: 18, type: !30, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !87) +// CHECK:STDOUT: !73 = !DILocalVariable(arg: 1, scope: !72, type: !6) +// CHECK:STDOUT: !74 = !DILocalVariable(arg: 2, scope: !72, type: !6) +// CHECK:STDOUT: !79 = !DILocation(line: 19, column: 7, scope: !72) +// CHECK:STDOUT: !80 = !DILocation(line: 19, column: 6, scope: !72) +// CHECK:STDOUT: !82 = !DILocation(line: 20, column: 5, scope: !72) +// CHECK:STDOUT: !84 = !DILocation(line: 22, column: 15, scope: !72) +// CHECK:STDOUT: !85 = !DILocation(line: 22, column: 10, scope: !72) +// CHECK:STDOUT: !86 = !DILocation(line: 22, column: 3, scope: !72) +// CHECK:STDOUT: !87 = !{!73, !74} +// CHECK:STDOUT: !88 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.c5e4ba542a56b71f", scope: null, file: !4, line: 18, type: !34, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !103) +// CHECK:STDOUT: !89 = !DILocalVariable(arg: 1, scope: !88, type: !9) +// CHECK:STDOUT: !90 = !DILocalVariable(arg: 2, scope: !88, type: !6) +// CHECK:STDOUT: !95 = !DILocation(line: 19, column: 7, scope: !88) +// CHECK:STDOUT: !96 = !DILocation(line: 19, column: 6, scope: !88) +// CHECK:STDOUT: !98 = !DILocation(line: 20, column: 5, scope: !88) +// CHECK:STDOUT: !100 = !DILocation(line: 22, column: 15, scope: !88) +// CHECK:STDOUT: !101 = !DILocation(line: 22, column: 10, scope: !88) +// CHECK:STDOUT: !102 = !DILocation(line: 22, column: 3, scope: !88) +// CHECK:STDOUT: !103 = !{!89, !90} +// CHECK:STDOUT: !104 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.a76b78461416b4a8", scope: null, file: !4, line: 18, type: !34, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !119) +// CHECK:STDOUT: !105 = !DILocalVariable(arg: 1, scope: !104, type: !9) +// CHECK:STDOUT: !106 = !DILocalVariable(arg: 2, scope: !104, type: !6) +// CHECK:STDOUT: !111 = !DILocation(line: 19, column: 7, scope: !104) +// CHECK:STDOUT: !112 = !DILocation(line: 19, column: 6, scope: !104) +// CHECK:STDOUT: !114 = !DILocation(line: 20, column: 5, scope: !104) +// CHECK:STDOUT: !116 = !DILocation(line: 22, column: 15, scope: !104) +// CHECK:STDOUT: !117 = !DILocation(line: 22, column: 10, scope: !104) +// CHECK:STDOUT: !118 = !DILocation(line: 22, column: 3, scope: !104) +// CHECK:STDOUT: !119 = !{!105, !106} +// CHECK:STDOUT: !136 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.4d6ceefeb7f772f4", scope: null, file: !4, line: 25, type: !30, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !151) +// CHECK:STDOUT: !137 = !DILocalVariable(arg: 1, scope: !136, type: !6) +// CHECK:STDOUT: !138 = !DILocalVariable(arg: 2, scope: !136, type: !6) +// CHECK:STDOUT: !143 = !DILocation(line: 26, column: 7, scope: !136) +// CHECK:STDOUT: !144 = !DILocation(line: 26, column: 6, scope: !136) +// CHECK:STDOUT: !146 = !DILocation(line: 27, column: 5, scope: !136) +// CHECK:STDOUT: !148 = !DILocation(line: 29, column: 15, scope: !136) +// CHECK:STDOUT: !149 = !DILocation(line: 29, column: 10, scope: !136) +// CHECK:STDOUT: !150 = !DILocation(line: 29, column: 3, scope: !136) +// CHECK:STDOUT: !151 = !{!137, !138} +// CHECK:STDOUT: !152 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.c5e4ba542a56b71f", scope: null, file: !4, line: 25, type: !34, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !167) +// CHECK:STDOUT: !153 = !DILocalVariable(arg: 1, scope: !152, type: !9) +// CHECK:STDOUT: !154 = !DILocalVariable(arg: 2, scope: !152, type: !6) +// CHECK:STDOUT: !159 = !DILocation(line: 26, column: 7, scope: !152) +// CHECK:STDOUT: !160 = !DILocation(line: 26, column: 6, scope: !152) +// CHECK:STDOUT: !162 = !DILocation(line: 27, column: 5, scope: !152) +// CHECK:STDOUT: !164 = !DILocation(line: 29, column: 15, scope: !152) +// CHECK:STDOUT: !165 = !DILocation(line: 29, column: 10, scope: !152) +// CHECK:STDOUT: !166 = !DILocation(line: 29, column: 3, scope: !152) +// CHECK:STDOUT: !167 = !{!153, !154} +// CHECK:STDOUT: !168 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.a76b78461416b4a8", scope: null, file: !4, line: 25, type: !34, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !183) +// CHECK:STDOUT: !169 = !DILocalVariable(arg: 1, scope: !168, type: !9) +// CHECK:STDOUT: !170 = !DILocalVariable(arg: 2, scope: !168, type: !6) +// CHECK:STDOUT: !175 = !DILocation(line: 26, column: 7, scope: !168) +// CHECK:STDOUT: !176 = !DILocation(line: 26, column: 6, scope: !168) +// CHECK:STDOUT: !178 = !DILocation(line: 27, column: 5, scope: !168) +// CHECK:STDOUT: !180 = !DILocation(line: 29, column: 15, scope: !168) +// CHECK:STDOUT: !181 = !DILocation(line: 29, column: 10, scope: !168) +// CHECK:STDOUT: !182 = !DILocation(line: 29, column: 3, scope: !168) +// CHECK:STDOUT: !183 = !{!169, !170} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/function/generic/call_recursive_reorder.carbon b/toolchain/lower/testdata/function/generic/call_recursive_reorder.carbon index 51e88b96c318..1706c079e151 100644 --- a/toolchain/lower/testdata/function/generic/call_recursive_reorder.carbon +++ b/toolchain/lower/testdata/function/generic/call_recursive_reorder.carbon @@ -62,39 +62,93 @@ fn M() { // CHECK:STDOUT: %.loc31_5 = load ptr, ptr %ptr_f64.var, align 8, !dbg !38 // CHECK:STDOUT: %.loc31_14 = load ptr, ptr %ptr_bool.var, align 8, !dbg !39 // CHECK:STDOUT: %F.call.loc31 = call i32 @_CF.Main.369f53a8d4c38871(ptr %.loc31_5, ptr %.loc31_14, i32 0), !dbg !40 -// CHECK:STDOUT: call void @"_COp.dc14d4dd21801791:core.Destroy.Core"(ptr %m.var), !dbg !17 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %n.var), !dbg !15 +// CHECK:STDOUT: call void @"_CSelfDestruct.bb2383e5e4785e19:core.Destroy.Core"(ptr %ptr_bool.var), !dbg !29 +// CHECK:STDOUT: call void @"_CSelfDestruct.749b51755634ad17:core.Destroy.Core"(ptr %ptr_f64.var), !dbg !25 +// CHECK:STDOUT: call void @"_CSelfDestruct.d088c7eb746488be:core.Destroy.Core"(ptr %ptr_i32.var), !dbg !21 +// CHECK:STDOUT: call void @"_CSelfDestruct.48e0adf639fe7af4:core.Destroy.Core"(ptr %b.var), !dbg !19 +// CHECK:STDOUT: call void @"_CSelfDestruct.dc14d4dd21801791:core.Destroy.Core"(ptr %m.var), !dbg !17 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %n.var), !dbg !15 // CHECK:STDOUT: ret void, !dbg !41 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.dc14d4dd21801791:core.Destroy.Core"(ptr %self) #0 !dbg !42 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.bb2383e5e4785e19:core.Destroy.Core"(ptr %self) #0 !dbg !42 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !44 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !46 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.749b51755634ad17:core.Destroy.Core"(ptr %self) #0 !dbg !46 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !48 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.d088c7eb746488be:core.Destroy.Core"(ptr %self) #0 !dbg !50 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !52 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.48e0adf639fe7af4:core.Destroy.Core"(ptr %self) #0 !dbg !54 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !56 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.7945ecba5c505fc0:core.Destroy.Core"(ptr %self) #0 !dbg !58 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !60 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.dc14d4dd21801791:core.Destroy.Core"(ptr %self) #0 !dbg !62 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !64 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.dc14d4dd21801791:core.Destroy.Core"(ptr %self) #0 !dbg !66 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.dc14d4dd21801791:core.Destroy.Core"(ptr %self), !dbg !68 +// CHECK:STDOUT: ret void, !dbg !68 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !70 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !72 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !74 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !76 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !78 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !80 +// CHECK:STDOUT: ret void, !dbg !80 +// 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 i32 @_CF.Main.369f53a8d4c38871(ptr %x, ptr %y, i32 %count) #0 !dbg !50 { +// CHECK:STDOUT: define linkonce_odr i32 @_CF.Main.369f53a8d4c38871(ptr %x, ptr %y, i32 %count) #0 !dbg !82 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 2, !dbg !59 -// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !60 +// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 2, !dbg !91 +// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !92 // CHECK:STDOUT: // CHECK:STDOUT: if.then: ; preds = %entry -// CHECK:STDOUT: ret i32 %count, !dbg !62 +// CHECK:STDOUT: ret i32 %count, !dbg !94 // CHECK:STDOUT: // CHECK:STDOUT: if.else: ; preds = %entry -// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !65 -// CHECK:STDOUT: %F.call = call i32 @_CF.Main.369f53a8d4c38871(ptr %y, ptr %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !66 -// CHECK:STDOUT: ret i32 %F.call, !dbg !67 +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !97 +// CHECK:STDOUT: %F.call = call i32 @_CF.Main.369f53a8d4c38871(ptr %y, ptr %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !98 +// CHECK:STDOUT: ret i32 %F.call, !dbg !99 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -135,23 +189,55 @@ fn M() { // CHECK:STDOUT: !39 = !DILocation(line: 31, column: 14, scope: !14) // CHECK:STDOUT: !40 = !DILocation(line: 31, column: 3, scope: !14) // CHECK:STDOUT: !41 = !DILocation(line: 22, column: 1, scope: !14) -// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "Op", linkageName: "_COp.dc14d4dd21801791:core.Destroy.Core", scope: null, file: !4, line: 24, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !45) +// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.bb2383e5e4785e19:core.Destroy.Core", scope: null, file: !4, line: 28, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !45) // CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !42, type: !9) -// CHECK:STDOUT: !44 = !DILocation(line: 24, column: 3, scope: !42) +// CHECK:STDOUT: !44 = !DILocation(line: 28, column: 3, scope: !42) // CHECK:STDOUT: !45 = !{!43} -// CHECK:STDOUT: !46 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 23, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !49) -// CHECK:STDOUT: !47 = !DILocalVariable(arg: 1, scope: !46, type: !6) -// CHECK:STDOUT: !48 = !DILocation(line: 23, column: 3, scope: !46) +// CHECK:STDOUT: !46 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.749b51755634ad17:core.Destroy.Core", scope: null, file: !4, line: 27, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !49) +// CHECK:STDOUT: !47 = !DILocalVariable(arg: 1, scope: !46, type: !9) +// CHECK:STDOUT: !48 = !DILocation(line: 27, column: 3, scope: !46) // CHECK:STDOUT: !49 = !{!47} -// CHECK:STDOUT: !50 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.369f53a8d4c38871", scope: null, file: !4, line: 15, type: !37, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !68) +// CHECK:STDOUT: !50 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.d088c7eb746488be:core.Destroy.Core", scope: null, file: !4, line: 26, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !53) // CHECK:STDOUT: !51 = !DILocalVariable(arg: 1, scope: !50, type: !9) -// CHECK:STDOUT: !52 = !DILocalVariable(arg: 2, scope: !50, type: !9) -// CHECK:STDOUT: !53 = !DILocalVariable(arg: 3, scope: !50, type: !6) -// CHECK:STDOUT: !59 = !DILocation(line: 16, column: 7, scope: !50) -// CHECK:STDOUT: !60 = !DILocation(line: 16, column: 6, scope: !50) -// CHECK:STDOUT: !62 = !DILocation(line: 17, column: 5, scope: !50) -// CHECK:STDOUT: !65 = !DILocation(line: 19, column: 18, scope: !50) -// CHECK:STDOUT: !66 = !DILocation(line: 19, column: 10, scope: !50) -// CHECK:STDOUT: !67 = !DILocation(line: 19, column: 3, scope: !50) -// CHECK:STDOUT: !68 = !{!51, !52, !53} +// CHECK:STDOUT: !52 = !DILocation(line: 26, column: 3, scope: !50) +// CHECK:STDOUT: !53 = !{!51} +// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.48e0adf639fe7af4:core.Destroy.Core", scope: null, file: !4, line: 25, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !57) +// CHECK:STDOUT: !55 = !DILocalVariable(arg: 1, scope: !54, type: !9) +// CHECK:STDOUT: !56 = !DILocation(line: 25, column: 3, scope: !54) +// CHECK:STDOUT: !57 = !{!55} +// CHECK:STDOUT: !58 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.7945ecba5c505fc0:core.Destroy.Core", scope: null, file: !4, line: 24, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !61) +// CHECK:STDOUT: !59 = !DILocalVariable(arg: 1, scope: !58, type: !9) +// CHECK:STDOUT: !60 = !DILocation(line: 24, column: 3, scope: !58) +// CHECK:STDOUT: !61 = !{!59} +// CHECK:STDOUT: !62 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.dc14d4dd21801791:core.Destroy.Core", scope: null, file: !4, line: 24, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !65) +// CHECK:STDOUT: !63 = !DILocalVariable(arg: 1, scope: !62, type: !9) +// CHECK:STDOUT: !64 = !DILocation(line: 24, column: 3, scope: !62) +// CHECK:STDOUT: !65 = !{!63} +// CHECK:STDOUT: !66 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.dc14d4dd21801791:core.Destroy.Core", scope: null, file: !4, line: 24, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !69) +// CHECK:STDOUT: !67 = !DILocalVariable(arg: 1, scope: !66, type: !9) +// CHECK:STDOUT: !68 = !DILocation(line: 24, column: 3, scope: !66) +// CHECK:STDOUT: !69 = !{!67} +// CHECK:STDOUT: !70 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !4, line: 23, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !73) +// CHECK:STDOUT: !71 = !DILocalVariable(arg: 1, scope: !70, type: !6) +// CHECK:STDOUT: !72 = !DILocation(line: 23, column: 3, scope: !70) +// CHECK:STDOUT: !73 = !{!71} +// CHECK:STDOUT: !74 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 23, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !77) +// CHECK:STDOUT: !75 = !DILocalVariable(arg: 1, scope: !74, type: !6) +// CHECK:STDOUT: !76 = !DILocation(line: 23, column: 3, scope: !74) +// CHECK:STDOUT: !77 = !{!75} +// CHECK:STDOUT: !78 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 23, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !81) +// CHECK:STDOUT: !79 = !DILocalVariable(arg: 1, scope: !78, type: !6) +// CHECK:STDOUT: !80 = !DILocation(line: 23, column: 3, scope: !78) +// CHECK:STDOUT: !81 = !{!79} +// CHECK:STDOUT: !82 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.369f53a8d4c38871", scope: null, file: !4, line: 15, type: !37, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !100) +// CHECK:STDOUT: !83 = !DILocalVariable(arg: 1, scope: !82, type: !9) +// CHECK:STDOUT: !84 = !DILocalVariable(arg: 2, scope: !82, type: !9) +// CHECK:STDOUT: !85 = !DILocalVariable(arg: 3, scope: !82, type: !6) +// CHECK:STDOUT: !91 = !DILocation(line: 16, column: 7, scope: !82) +// CHECK:STDOUT: !92 = !DILocation(line: 16, column: 6, scope: !82) +// CHECK:STDOUT: !94 = !DILocation(line: 17, column: 5, scope: !82) +// CHECK:STDOUT: !97 = !DILocation(line: 19, column: 18, scope: !82) +// CHECK:STDOUT: !98 = !DILocation(line: 19, column: 10, scope: !82) +// CHECK:STDOUT: !99 = !DILocation(line: 19, column: 3, scope: !82) +// CHECK:STDOUT: !100 = !{!83, !84, !85} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/function/generic/call_recursive_reorder_more.carbon b/toolchain/lower/testdata/function/generic/call_recursive_reorder_more.carbon index 2e55acfe18bb..b1423779ba74 100644 --- a/toolchain/lower/testdata/function/generic/call_recursive_reorder_more.carbon +++ b/toolchain/lower/testdata/function/generic/call_recursive_reorder_more.carbon @@ -136,143 +136,230 @@ fn M() { // CHECK:STDOUT: %.loc52_15 = load ptr, ptr %ptr_bool.var, align 8, !dbg !100 // CHECK:STDOUT: %.loc52_25 = load ptr, ptr %ptr_bool.var, align 8, !dbg !101 // CHECK:STDOUT: %F.call.loc52 = call i32 @_CF.Main.732da705e71cd359(ptr %.loc52_5, ptr %.loc52_15, ptr %.loc52_25, i32 0), !dbg !102 -// CHECK:STDOUT: call void @"_COp.dc14d4dd21801791:core.Destroy.Core"(ptr %val_f64.var), !dbg !27 -// CHECK:STDOUT: call void @"_COp.5aacfd7dcc330b17:core.Destroy.Core"(ptr %val_i64.var), !dbg !25 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %val_i32.var), !dbg !23 -// CHECK:STDOUT: call void @"_COp.d57cb32fcf12ec07:core.Destroy.Core"(ptr %val_i16.var), !dbg !21 +// CHECK:STDOUT: call void @"_CSelfDestruct.bb2383e5e4785e19:core.Destroy.Core"(ptr %ptr_bool.var), !dbg !43 +// CHECK:STDOUT: call void @"_CSelfDestruct.6438500ec3acb664:core.Destroy.Core"(ptr %ptr_i64.var), !dbg !39 +// CHECK:STDOUT: call void @"_CSelfDestruct.d088c7eb746488be:core.Destroy.Core"(ptr %ptr_i32.var), !dbg !35 +// CHECK:STDOUT: call void @"_CSelfDestruct.686cf03349556866:core.Destroy.Core"(ptr %ptr_i16.var), !dbg !31 +// CHECK:STDOUT: call void @"_CSelfDestruct.48e0adf639fe7af4:core.Destroy.Core"(ptr %val_bool.var), !dbg !29 +// CHECK:STDOUT: call void @"_CSelfDestruct.dc14d4dd21801791:core.Destroy.Core"(ptr %val_f64.var), !dbg !27 +// CHECK:STDOUT: call void @"_CSelfDestruct.5aacfd7dcc330b17:core.Destroy.Core"(ptr %val_i64.var), !dbg !25 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %val_i32.var), !dbg !23 +// CHECK:STDOUT: call void @"_CSelfDestruct.d57cb32fcf12ec07:core.Destroy.Core"(ptr %val_i16.var), !dbg !21 // CHECK:STDOUT: ret void, !dbg !103 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.dc14d4dd21801791:core.Destroy.Core"(ptr %self) #0 !dbg !104 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.bb2383e5e4785e19:core.Destroy.Core"(ptr %self) #0 !dbg !104 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !106 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.5aacfd7dcc330b17:core.Destroy.Core"(ptr %self) #0 !dbg !108 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6438500ec3acb664:core.Destroy.Core"(ptr %self) #0 !dbg !108 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !110 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !112 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.d088c7eb746488be:core.Destroy.Core"(ptr %self) #0 !dbg !112 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !114 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.d57cb32fcf12ec07:core.Destroy.Core"(ptr %self) #0 !dbg !116 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.686cf03349556866:core.Destroy.Core"(ptr %self) #0 !dbg !116 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !118 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.48e0adf639fe7af4:core.Destroy.Core"(ptr %self) #0 !dbg !120 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !122 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.7945ecba5c505fc0:core.Destroy.Core"(ptr %self) #0 !dbg !124 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !126 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.dc14d4dd21801791:core.Destroy.Core"(ptr %self) #0 !dbg !128 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !130 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.dc14d4dd21801791:core.Destroy.Core"(ptr %self) #0 !dbg !132 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.dc14d4dd21801791:core.Destroy.Core"(ptr %self), !dbg !134 +// CHECK:STDOUT: ret void, !dbg !134 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6e5a4ef51c9e705a:core.Destroy.Core"(ptr %self) #0 !dbg !136 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !138 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.5aacfd7dcc330b17:core.Destroy.Core"(ptr %self) #0 !dbg !140 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !142 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.5aacfd7dcc330b17:core.Destroy.Core"(ptr %self) #0 !dbg !144 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.5aacfd7dcc330b17:core.Destroy.Core"(ptr %self), !dbg !146 +// CHECK:STDOUT: ret void, !dbg !146 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !148 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !150 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !152 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !154 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !156 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !158 +// CHECK:STDOUT: ret void, !dbg !158 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.ea6dff92ea7b44ef:core.Destroy.Core"(ptr %self) #0 !dbg !160 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !162 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.d57cb32fcf12ec07:core.Destroy.Core"(ptr %self) #0 !dbg !164 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !166 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.d57cb32fcf12ec07:core.Destroy.Core"(ptr %self) #0 !dbg !168 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.d57cb32fcf12ec07:core.Destroy.Core"(ptr %self), !dbg !170 +// CHECK:STDOUT: ret void, !dbg !170 +// 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 i32 @_CF.Main.bb004feba9dd474d(i16 %x, ptr %y, ptr %z, i32 %count) #0 !dbg !120 { +// CHECK:STDOUT: define linkonce_odr i32 @_CF.Main.bb004feba9dd474d(i16 %x, ptr %y, ptr %z, i32 %count) #0 !dbg !172 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 2, !dbg !131 -// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !132 +// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 2, !dbg !183 +// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !184 // CHECK:STDOUT: // CHECK:STDOUT: if.then: ; preds = %entry -// CHECK:STDOUT: ret i32 %count, !dbg !134 +// CHECK:STDOUT: ret i32 %count, !dbg !186 // CHECK:STDOUT: // CHECK:STDOUT: if.else: ; preds = %entry -// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !138 -// CHECK:STDOUT: %F.call = call i32 @_CF.Main.bb004feba9dd474d(i16 %x, ptr %z, ptr %y, i32 %Int.as.AddWith.impl.Op.call), !dbg !139 -// CHECK:STDOUT: ret i32 %F.call, !dbg !140 +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !190 +// CHECK:STDOUT: %F.call = call i32 @_CF.Main.bb004feba9dd474d(i16 %x, ptr %z, ptr %y, i32 %Int.as.AddWith.impl.Op.call), !dbg !191 +// CHECK:STDOUT: ret i32 %F.call, !dbg !192 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CF.Main.f24eb6b05368f488(i32 %x, ptr %y, ptr %z, i32 %count) #0 !dbg !142 { +// CHECK:STDOUT: define linkonce_odr i32 @_CF.Main.f24eb6b05368f488(i32 %x, ptr %y, ptr %z, i32 %count) #0 !dbg !194 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 2, !dbg !153 -// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !154 +// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 2, !dbg !205 +// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !206 // CHECK:STDOUT: // CHECK:STDOUT: if.then: ; preds = %entry -// CHECK:STDOUT: ret i32 %count, !dbg !156 +// CHECK:STDOUT: ret i32 %count, !dbg !208 // CHECK:STDOUT: // CHECK:STDOUT: if.else: ; preds = %entry -// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !160 -// CHECK:STDOUT: %F.call = call i32 @_CF.Main.f24eb6b05368f488(i32 %x, ptr %z, ptr %y, i32 %Int.as.AddWith.impl.Op.call), !dbg !161 -// CHECK:STDOUT: ret i32 %F.call, !dbg !162 +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !212 +// CHECK:STDOUT: %F.call = call i32 @_CF.Main.f24eb6b05368f488(i32 %x, ptr %z, ptr %y, i32 %Int.as.AddWith.impl.Op.call), !dbg !213 +// CHECK:STDOUT: ret i32 %F.call, !dbg !214 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CF.Main.427cba2b3278d1dc(i1 %x, ptr %y, ptr %z, i32 %count) #0 !dbg !164 { +// CHECK:STDOUT: define linkonce_odr i32 @_CF.Main.427cba2b3278d1dc(i1 %x, ptr %y, ptr %z, i32 %count) #0 !dbg !216 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 2, !dbg !175 -// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !176 +// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 2, !dbg !227 +// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !228 // CHECK:STDOUT: // CHECK:STDOUT: if.then: ; preds = %entry -// CHECK:STDOUT: ret i32 %count, !dbg !178 +// CHECK:STDOUT: ret i32 %count, !dbg !230 // CHECK:STDOUT: // CHECK:STDOUT: if.else: ; preds = %entry -// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !182 -// CHECK:STDOUT: %F.call = call i32 @_CF.Main.427cba2b3278d1dc(i1 %x, ptr %z, ptr %y, i32 %Int.as.AddWith.impl.Op.call), !dbg !183 -// CHECK:STDOUT: ret i32 %F.call, !dbg !184 +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !234 +// CHECK:STDOUT: %F.call = call i32 @_CF.Main.427cba2b3278d1dc(i1 %x, ptr %z, ptr %y, i32 %Int.as.AddWith.impl.Op.call), !dbg !235 +// CHECK:STDOUT: ret i32 %F.call, !dbg !236 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CF.Main.ea32bb7f769e7967(i64 %x, i1 %y, ptr %z, i32 %count) #0 !dbg !186 { +// CHECK:STDOUT: define linkonce_odr i32 @_CF.Main.ea32bb7f769e7967(i64 %x, i1 %y, ptr %z, i32 %count) #0 !dbg !238 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 2, !dbg !197 -// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !198 +// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 2, !dbg !249 +// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !250 // CHECK:STDOUT: // CHECK:STDOUT: if.then: ; preds = %entry -// CHECK:STDOUT: ret i32 %count, !dbg !200 +// CHECK:STDOUT: ret i32 %count, !dbg !252 // CHECK:STDOUT: // CHECK:STDOUT: if.else: ; preds = %entry -// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !204 -// CHECK:STDOUT: %F.call = call i32 @_CF.Main.b1f6aa8c7fcac0ca(i64 %x, ptr %z, i1 %y, i32 %Int.as.AddWith.impl.Op.call), !dbg !205 -// CHECK:STDOUT: ret i32 %F.call, !dbg !206 +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !256 +// CHECK:STDOUT: %F.call = call i32 @_CF.Main.b1f6aa8c7fcac0ca(i64 %x, ptr %z, i1 %y, i32 %Int.as.AddWith.impl.Op.call), !dbg !257 +// CHECK:STDOUT: ret i32 %F.call, !dbg !258 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CF.Main.6eab5c6411742e70(double %x, ptr %y, ptr %z, i32 %count) #0 !dbg !208 { +// CHECK:STDOUT: define linkonce_odr i32 @_CF.Main.6eab5c6411742e70(double %x, ptr %y, ptr %z, i32 %count) #0 !dbg !260 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 2, !dbg !219 -// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !220 +// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 2, !dbg !271 +// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !272 // CHECK:STDOUT: // CHECK:STDOUT: if.then: ; preds = %entry -// CHECK:STDOUT: ret i32 %count, !dbg !222 +// CHECK:STDOUT: ret i32 %count, !dbg !274 // CHECK:STDOUT: // CHECK:STDOUT: if.else: ; preds = %entry -// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !226 -// CHECK:STDOUT: %F.call = call i32 @_CF.Main.6eab5c6411742e70(double %x, ptr %z, ptr %y, i32 %Int.as.AddWith.impl.Op.call), !dbg !227 -// CHECK:STDOUT: ret i32 %F.call, !dbg !228 +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !278 +// CHECK:STDOUT: %F.call = call i32 @_CF.Main.6eab5c6411742e70(double %x, ptr %z, ptr %y, i32 %Int.as.AddWith.impl.Op.call), !dbg !279 +// CHECK:STDOUT: ret i32 %F.call, !dbg !280 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CF.Main.732da705e71cd359(ptr %x, ptr %y, ptr %z, i32 %count) #0 !dbg !230 { +// CHECK:STDOUT: define linkonce_odr i32 @_CF.Main.732da705e71cd359(ptr %x, ptr %y, ptr %z, i32 %count) #0 !dbg !282 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 2, !dbg !241 -// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !242 +// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 2, !dbg !293 +// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !294 // CHECK:STDOUT: // CHECK:STDOUT: if.then: ; preds = %entry -// CHECK:STDOUT: ret i32 %count, !dbg !244 +// CHECK:STDOUT: ret i32 %count, !dbg !296 // CHECK:STDOUT: // CHECK:STDOUT: if.else: ; preds = %entry -// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !248 -// CHECK:STDOUT: %F.call = call i32 @_CF.Main.732da705e71cd359(ptr %x, ptr %z, ptr %y, i32 %Int.as.AddWith.impl.Op.call), !dbg !249 -// CHECK:STDOUT: ret i32 %F.call, !dbg !250 +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !300 +// CHECK:STDOUT: %F.call = call i32 @_CF.Main.732da705e71cd359(ptr %x, ptr %z, ptr %y, i32 %Int.as.AddWith.impl.Op.call), !dbg !301 +// CHECK:STDOUT: ret i32 %F.call, !dbg !302 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CF.Main.b1f6aa8c7fcac0ca(i64 %x, ptr %y, i1 %z, i32 %count) #0 !dbg !450 { +// CHECK:STDOUT: define linkonce_odr i32 @_CF.Main.b1f6aa8c7fcac0ca(i64 %x, ptr %y, i1 %z, i32 %count) #0 !dbg !502 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 2, !dbg !461 -// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !462 +// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 2, !dbg !513 +// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !514 // CHECK:STDOUT: // CHECK:STDOUT: if.then: ; preds = %entry -// CHECK:STDOUT: ret i32 %count, !dbg !464 +// CHECK:STDOUT: ret i32 %count, !dbg !516 // CHECK:STDOUT: // CHECK:STDOUT: if.else: ; preds = %entry -// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !468 -// CHECK:STDOUT: %F.call = call i32 @_CF.Main.ea32bb7f769e7967(i64 %x, i1 %z, ptr %y, i32 %Int.as.AddWith.impl.Op.call), !dbg !469 -// CHECK:STDOUT: ret i32 %F.call, !dbg !470 +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !520 +// CHECK:STDOUT: %F.call = call i32 @_CF.Main.ea32bb7f769e7967(i64 %x, i1 %z, ptr %y, i32 %Int.as.AddWith.impl.Op.call), !dbg !521 +// CHECK:STDOUT: ret i32 %F.call, !dbg !522 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -370,104 +457,156 @@ fn M() { // CHECK:STDOUT: !101 = !DILocation(line: 52, column: 25, scope: !20) // CHECK:STDOUT: !102 = !DILocation(line: 52, column: 3, scope: !20) // CHECK:STDOUT: !103 = !DILocation(line: 22, column: 1, scope: !20) -// CHECK:STDOUT: !104 = distinct !DISubprogram(name: "Op", linkageName: "_COp.dc14d4dd21801791:core.Destroy.Core", scope: null, file: !4, line: 26, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !107) +// CHECK:STDOUT: !104 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.bb2383e5e4785e19:core.Destroy.Core", scope: null, file: !4, line: 32, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !107) // CHECK:STDOUT: !105 = !DILocalVariable(arg: 1, scope: !104, type: !11) -// CHECK:STDOUT: !106 = !DILocation(line: 26, column: 3, scope: !104) +// CHECK:STDOUT: !106 = !DILocation(line: 32, column: 3, scope: !104) // CHECK:STDOUT: !107 = !{!105} -// CHECK:STDOUT: !108 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5aacfd7dcc330b17:core.Destroy.Core", scope: null, file: !4, line: 25, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !111) -// CHECK:STDOUT: !109 = !DILocalVariable(arg: 1, scope: !108, type: !8) -// CHECK:STDOUT: !110 = !DILocation(line: 25, column: 3, scope: !108) +// CHECK:STDOUT: !108 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6438500ec3acb664:core.Destroy.Core", scope: null, file: !4, line: 31, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !111) +// CHECK:STDOUT: !109 = !DILocalVariable(arg: 1, scope: !108, type: !11) +// CHECK:STDOUT: !110 = !DILocation(line: 31, column: 3, scope: !108) // CHECK:STDOUT: !111 = !{!109} -// CHECK:STDOUT: !112 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 24, type: !17, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !115) -// CHECK:STDOUT: !113 = !DILocalVariable(arg: 1, scope: !112, type: !6) -// CHECK:STDOUT: !114 = !DILocation(line: 24, column: 3, scope: !112) +// CHECK:STDOUT: !112 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.d088c7eb746488be:core.Destroy.Core", scope: null, file: !4, line: 30, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !115) +// CHECK:STDOUT: !113 = !DILocalVariable(arg: 1, scope: !112, type: !11) +// CHECK:STDOUT: !114 = !DILocation(line: 30, column: 3, scope: !112) // CHECK:STDOUT: !115 = !{!113} -// CHECK:STDOUT: !116 = distinct !DISubprogram(name: "Op", linkageName: "_COp.d57cb32fcf12ec07:core.Destroy.Core", scope: null, file: !4, line: 23, type: !19, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !119) -// CHECK:STDOUT: !117 = !DILocalVariable(arg: 1, scope: !116, type: !7) -// CHECK:STDOUT: !118 = !DILocation(line: 23, column: 3, scope: !116) +// CHECK:STDOUT: !116 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.686cf03349556866:core.Destroy.Core", scope: null, file: !4, line: 29, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !119) +// CHECK:STDOUT: !117 = !DILocalVariable(arg: 1, scope: !116, type: !11) +// CHECK:STDOUT: !118 = !DILocation(line: 29, column: 3, scope: !116) // CHECK:STDOUT: !119 = !{!117} -// CHECK:STDOUT: !120 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.bb004feba9dd474d", scope: null, file: !4, line: 15, type: !52, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !141) -// CHECK:STDOUT: !121 = !DILocalVariable(arg: 1, scope: !120, type: !7) -// CHECK:STDOUT: !122 = !DILocalVariable(arg: 2, scope: !120, type: !11) -// CHECK:STDOUT: !123 = !DILocalVariable(arg: 3, scope: !120, type: !11) -// CHECK:STDOUT: !124 = !DILocalVariable(arg: 4, scope: !120, type: !6) -// CHECK:STDOUT: !131 = !DILocation(line: 16, column: 7, scope: !120) -// CHECK:STDOUT: !132 = !DILocation(line: 16, column: 6, scope: !120) -// CHECK:STDOUT: !134 = !DILocation(line: 17, column: 5, scope: !120) -// CHECK:STDOUT: !138 = !DILocation(line: 19, column: 21, scope: !120) -// CHECK:STDOUT: !139 = !DILocation(line: 19, column: 10, scope: !120) -// CHECK:STDOUT: !140 = !DILocation(line: 19, column: 3, scope: !120) -// CHECK:STDOUT: !141 = !{!121, !122, !123, !124} -// CHECK:STDOUT: !142 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.f24eb6b05368f488", scope: null, file: !4, line: 15, type: !58, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !163) -// CHECK:STDOUT: !143 = !DILocalVariable(arg: 1, scope: !142, type: !6) -// CHECK:STDOUT: !144 = !DILocalVariable(arg: 2, scope: !142, type: !11) -// CHECK:STDOUT: !145 = !DILocalVariable(arg: 3, scope: !142, type: !11) -// CHECK:STDOUT: !146 = !DILocalVariable(arg: 4, scope: !142, type: !6) -// CHECK:STDOUT: !153 = !DILocation(line: 16, column: 7, scope: !142) -// CHECK:STDOUT: !154 = !DILocation(line: 16, column: 6, scope: !142) -// CHECK:STDOUT: !156 = !DILocation(line: 17, column: 5, scope: !142) -// CHECK:STDOUT: !160 = !DILocation(line: 19, column: 21, scope: !142) -// CHECK:STDOUT: !161 = !DILocation(line: 19, column: 10, scope: !142) -// CHECK:STDOUT: !162 = !DILocation(line: 19, column: 3, scope: !142) -// CHECK:STDOUT: !163 = !{!143, !144, !145, !146} -// CHECK:STDOUT: !164 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.427cba2b3278d1dc", scope: null, file: !4, line: 15, type: !64, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !185) -// CHECK:STDOUT: !165 = !DILocalVariable(arg: 1, scope: !164, type: !11) -// CHECK:STDOUT: !166 = !DILocalVariable(arg: 2, scope: !164, type: !11) -// CHECK:STDOUT: !167 = !DILocalVariable(arg: 3, scope: !164, type: !11) -// CHECK:STDOUT: !168 = !DILocalVariable(arg: 4, scope: !164, type: !6) -// CHECK:STDOUT: !175 = !DILocation(line: 16, column: 7, scope: !164) -// CHECK:STDOUT: !176 = !DILocation(line: 16, column: 6, scope: !164) -// CHECK:STDOUT: !178 = !DILocation(line: 17, column: 5, scope: !164) -// CHECK:STDOUT: !182 = !DILocation(line: 19, column: 21, scope: !164) -// CHECK:STDOUT: !183 = !DILocation(line: 19, column: 10, scope: !164) -// CHECK:STDOUT: !184 = !DILocation(line: 19, column: 3, scope: !164) -// CHECK:STDOUT: !185 = !{!165, !166, !167, !168} -// CHECK:STDOUT: !186 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.ea32bb7f769e7967", scope: null, file: !4, line: 15, type: !70, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !207) -// CHECK:STDOUT: !187 = !DILocalVariable(arg: 1, scope: !186, type: !8) -// CHECK:STDOUT: !188 = !DILocalVariable(arg: 2, scope: !186, type: !11) -// CHECK:STDOUT: !189 = !DILocalVariable(arg: 3, scope: !186, type: !11) -// CHECK:STDOUT: !190 = !DILocalVariable(arg: 4, scope: !186, type: !6) -// CHECK:STDOUT: !197 = !DILocation(line: 16, column: 7, scope: !186) -// CHECK:STDOUT: !198 = !DILocation(line: 16, column: 6, scope: !186) -// CHECK:STDOUT: !200 = !DILocation(line: 17, column: 5, scope: !186) -// CHECK:STDOUT: !204 = !DILocation(line: 19, column: 21, scope: !186) -// CHECK:STDOUT: !205 = !DILocation(line: 19, column: 10, scope: !186) -// CHECK:STDOUT: !206 = !DILocation(line: 19, column: 3, scope: !186) -// CHECK:STDOUT: !207 = !{!187, !188, !189, !190} -// CHECK:STDOUT: !208 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.6eab5c6411742e70", scope: null, file: !4, line: 15, type: !64, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !229) -// CHECK:STDOUT: !209 = !DILocalVariable(arg: 1, scope: !208, type: !11) -// CHECK:STDOUT: !210 = !DILocalVariable(arg: 2, scope: !208, type: !11) -// CHECK:STDOUT: !211 = !DILocalVariable(arg: 3, scope: !208, type: !11) -// CHECK:STDOUT: !212 = !DILocalVariable(arg: 4, scope: !208, type: !6) -// CHECK:STDOUT: !219 = !DILocation(line: 16, column: 7, scope: !208) -// CHECK:STDOUT: !220 = !DILocation(line: 16, column: 6, scope: !208) -// CHECK:STDOUT: !222 = !DILocation(line: 17, column: 5, scope: !208) -// CHECK:STDOUT: !226 = !DILocation(line: 19, column: 21, scope: !208) -// CHECK:STDOUT: !227 = !DILocation(line: 19, column: 10, scope: !208) -// CHECK:STDOUT: !228 = !DILocation(line: 19, column: 3, scope: !208) -// CHECK:STDOUT: !229 = !{!209, !210, !211, !212} -// CHECK:STDOUT: !230 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.732da705e71cd359", scope: null, file: !4, line: 15, type: !64, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !251) -// CHECK:STDOUT: !231 = !DILocalVariable(arg: 1, scope: !230, type: !11) -// CHECK:STDOUT: !232 = !DILocalVariable(arg: 2, scope: !230, type: !11) -// CHECK:STDOUT: !233 = !DILocalVariable(arg: 3, scope: !230, type: !11) -// CHECK:STDOUT: !234 = !DILocalVariable(arg: 4, scope: !230, type: !6) -// CHECK:STDOUT: !241 = !DILocation(line: 16, column: 7, scope: !230) -// CHECK:STDOUT: !242 = !DILocation(line: 16, column: 6, scope: !230) -// CHECK:STDOUT: !244 = !DILocation(line: 17, column: 5, scope: !230) -// CHECK:STDOUT: !248 = !DILocation(line: 19, column: 21, scope: !230) -// CHECK:STDOUT: !249 = !DILocation(line: 19, column: 10, scope: !230) -// CHECK:STDOUT: !250 = !DILocation(line: 19, column: 3, scope: !230) -// CHECK:STDOUT: !251 = !{!231, !232, !233, !234} -// CHECK:STDOUT: !450 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.b1f6aa8c7fcac0ca", scope: null, file: !4, line: 15, type: !70, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !471) -// CHECK:STDOUT: !451 = !DILocalVariable(arg: 1, scope: !450, type: !8) -// CHECK:STDOUT: !452 = !DILocalVariable(arg: 2, scope: !450, type: !11) -// CHECK:STDOUT: !453 = !DILocalVariable(arg: 3, scope: !450, type: !11) -// CHECK:STDOUT: !454 = !DILocalVariable(arg: 4, scope: !450, type: !6) -// CHECK:STDOUT: !461 = !DILocation(line: 16, column: 7, scope: !450) -// CHECK:STDOUT: !462 = !DILocation(line: 16, column: 6, scope: !450) -// CHECK:STDOUT: !464 = !DILocation(line: 17, column: 5, scope: !450) -// CHECK:STDOUT: !468 = !DILocation(line: 19, column: 21, scope: !450) -// CHECK:STDOUT: !469 = !DILocation(line: 19, column: 10, scope: !450) -// CHECK:STDOUT: !470 = !DILocation(line: 19, column: 3, scope: !450) -// CHECK:STDOUT: !471 = !{!451, !452, !453, !454} +// CHECK:STDOUT: !120 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.48e0adf639fe7af4:core.Destroy.Core", scope: null, file: !4, line: 27, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !123) +// CHECK:STDOUT: !121 = !DILocalVariable(arg: 1, scope: !120, type: !11) +// CHECK:STDOUT: !122 = !DILocation(line: 27, column: 3, scope: !120) +// CHECK:STDOUT: !123 = !{!121} +// CHECK:STDOUT: !124 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.7945ecba5c505fc0:core.Destroy.Core", scope: null, file: !4, line: 26, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !127) +// CHECK:STDOUT: !125 = !DILocalVariable(arg: 1, scope: !124, type: !11) +// CHECK:STDOUT: !126 = !DILocation(line: 26, column: 3, scope: !124) +// CHECK:STDOUT: !127 = !{!125} +// CHECK:STDOUT: !128 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.dc14d4dd21801791:core.Destroy.Core", scope: null, file: !4, line: 26, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !131) +// CHECK:STDOUT: !129 = !DILocalVariable(arg: 1, scope: !128, type: !11) +// CHECK:STDOUT: !130 = !DILocation(line: 26, column: 3, scope: !128) +// CHECK:STDOUT: !131 = !{!129} +// CHECK:STDOUT: !132 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.dc14d4dd21801791:core.Destroy.Core", scope: null, file: !4, line: 26, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !135) +// CHECK:STDOUT: !133 = !DILocalVariable(arg: 1, scope: !132, type: !11) +// CHECK:STDOUT: !134 = !DILocation(line: 26, column: 3, scope: !132) +// CHECK:STDOUT: !135 = !{!133} +// CHECK:STDOUT: !136 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6e5a4ef51c9e705a:core.Destroy.Core", scope: null, file: !4, line: 25, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !139) +// CHECK:STDOUT: !137 = !DILocalVariable(arg: 1, scope: !136, type: !8) +// CHECK:STDOUT: !138 = !DILocation(line: 25, column: 3, scope: !136) +// CHECK:STDOUT: !139 = !{!137} +// CHECK:STDOUT: !140 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.5aacfd7dcc330b17:core.Destroy.Core", scope: null, file: !4, line: 25, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !143) +// CHECK:STDOUT: !141 = !DILocalVariable(arg: 1, scope: !140, type: !8) +// CHECK:STDOUT: !142 = !DILocation(line: 25, column: 3, scope: !140) +// CHECK:STDOUT: !143 = !{!141} +// CHECK:STDOUT: !144 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.5aacfd7dcc330b17:core.Destroy.Core", scope: null, file: !4, line: 25, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !147) +// CHECK:STDOUT: !145 = !DILocalVariable(arg: 1, scope: !144, type: !8) +// CHECK:STDOUT: !146 = !DILocation(line: 25, column: 3, scope: !144) +// CHECK:STDOUT: !147 = !{!145} +// CHECK:STDOUT: !148 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !4, line: 24, type: !17, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !151) +// CHECK:STDOUT: !149 = !DILocalVariable(arg: 1, scope: !148, type: !6) +// CHECK:STDOUT: !150 = !DILocation(line: 24, column: 3, scope: !148) +// CHECK:STDOUT: !151 = !{!149} +// CHECK:STDOUT: !152 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 24, type: !17, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !155) +// CHECK:STDOUT: !153 = !DILocalVariable(arg: 1, scope: !152, type: !6) +// CHECK:STDOUT: !154 = !DILocation(line: 24, column: 3, scope: !152) +// CHECK:STDOUT: !155 = !{!153} +// CHECK:STDOUT: !156 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 24, type: !17, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !159) +// CHECK:STDOUT: !157 = !DILocalVariable(arg: 1, scope: !156, type: !6) +// CHECK:STDOUT: !158 = !DILocation(line: 24, column: 3, scope: !156) +// CHECK:STDOUT: !159 = !{!157} +// CHECK:STDOUT: !160 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.ea6dff92ea7b44ef:core.Destroy.Core", scope: null, file: !4, line: 23, type: !19, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !163) +// CHECK:STDOUT: !161 = !DILocalVariable(arg: 1, scope: !160, type: !7) +// CHECK:STDOUT: !162 = !DILocation(line: 23, column: 3, scope: !160) +// CHECK:STDOUT: !163 = !{!161} +// CHECK:STDOUT: !164 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.d57cb32fcf12ec07:core.Destroy.Core", scope: null, file: !4, line: 23, type: !19, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !167) +// CHECK:STDOUT: !165 = !DILocalVariable(arg: 1, scope: !164, type: !7) +// CHECK:STDOUT: !166 = !DILocation(line: 23, column: 3, scope: !164) +// CHECK:STDOUT: !167 = !{!165} +// CHECK:STDOUT: !168 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.d57cb32fcf12ec07:core.Destroy.Core", scope: null, file: !4, line: 23, type: !19, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !171) +// CHECK:STDOUT: !169 = !DILocalVariable(arg: 1, scope: !168, type: !7) +// CHECK:STDOUT: !170 = !DILocation(line: 23, column: 3, scope: !168) +// CHECK:STDOUT: !171 = !{!169} +// CHECK:STDOUT: !172 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.bb004feba9dd474d", scope: null, file: !4, line: 15, type: !52, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !193) +// CHECK:STDOUT: !173 = !DILocalVariable(arg: 1, scope: !172, type: !7) +// CHECK:STDOUT: !174 = !DILocalVariable(arg: 2, scope: !172, type: !11) +// CHECK:STDOUT: !175 = !DILocalVariable(arg: 3, scope: !172, type: !11) +// CHECK:STDOUT: !176 = !DILocalVariable(arg: 4, scope: !172, type: !6) +// CHECK:STDOUT: !183 = !DILocation(line: 16, column: 7, scope: !172) +// CHECK:STDOUT: !184 = !DILocation(line: 16, column: 6, scope: !172) +// CHECK:STDOUT: !186 = !DILocation(line: 17, column: 5, scope: !172) +// CHECK:STDOUT: !190 = !DILocation(line: 19, column: 21, scope: !172) +// CHECK:STDOUT: !191 = !DILocation(line: 19, column: 10, scope: !172) +// CHECK:STDOUT: !192 = !DILocation(line: 19, column: 3, scope: !172) +// CHECK:STDOUT: !193 = !{!173, !174, !175, !176} +// CHECK:STDOUT: !194 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.f24eb6b05368f488", scope: null, file: !4, line: 15, type: !58, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !215) +// CHECK:STDOUT: !195 = !DILocalVariable(arg: 1, scope: !194, type: !6) +// CHECK:STDOUT: !196 = !DILocalVariable(arg: 2, scope: !194, type: !11) +// CHECK:STDOUT: !197 = !DILocalVariable(arg: 3, scope: !194, type: !11) +// CHECK:STDOUT: !198 = !DILocalVariable(arg: 4, scope: !194, type: !6) +// CHECK:STDOUT: !205 = !DILocation(line: 16, column: 7, scope: !194) +// CHECK:STDOUT: !206 = !DILocation(line: 16, column: 6, scope: !194) +// CHECK:STDOUT: !208 = !DILocation(line: 17, column: 5, scope: !194) +// CHECK:STDOUT: !212 = !DILocation(line: 19, column: 21, scope: !194) +// CHECK:STDOUT: !213 = !DILocation(line: 19, column: 10, scope: !194) +// CHECK:STDOUT: !214 = !DILocation(line: 19, column: 3, scope: !194) +// CHECK:STDOUT: !215 = !{!195, !196, !197, !198} +// CHECK:STDOUT: !216 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.427cba2b3278d1dc", scope: null, file: !4, line: 15, type: !64, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !237) +// CHECK:STDOUT: !217 = !DILocalVariable(arg: 1, scope: !216, type: !11) +// CHECK:STDOUT: !218 = !DILocalVariable(arg: 2, scope: !216, type: !11) +// CHECK:STDOUT: !219 = !DILocalVariable(arg: 3, scope: !216, type: !11) +// CHECK:STDOUT: !220 = !DILocalVariable(arg: 4, scope: !216, type: !6) +// CHECK:STDOUT: !227 = !DILocation(line: 16, column: 7, scope: !216) +// CHECK:STDOUT: !228 = !DILocation(line: 16, column: 6, scope: !216) +// CHECK:STDOUT: !230 = !DILocation(line: 17, column: 5, scope: !216) +// CHECK:STDOUT: !234 = !DILocation(line: 19, column: 21, scope: !216) +// CHECK:STDOUT: !235 = !DILocation(line: 19, column: 10, scope: !216) +// CHECK:STDOUT: !236 = !DILocation(line: 19, column: 3, scope: !216) +// CHECK:STDOUT: !237 = !{!217, !218, !219, !220} +// CHECK:STDOUT: !238 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.ea32bb7f769e7967", scope: null, file: !4, line: 15, type: !70, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !259) +// CHECK:STDOUT: !239 = !DILocalVariable(arg: 1, scope: !238, type: !8) +// CHECK:STDOUT: !240 = !DILocalVariable(arg: 2, scope: !238, type: !11) +// CHECK:STDOUT: !241 = !DILocalVariable(arg: 3, scope: !238, type: !11) +// CHECK:STDOUT: !242 = !DILocalVariable(arg: 4, scope: !238, type: !6) +// CHECK:STDOUT: !249 = !DILocation(line: 16, column: 7, scope: !238) +// CHECK:STDOUT: !250 = !DILocation(line: 16, column: 6, scope: !238) +// CHECK:STDOUT: !252 = !DILocation(line: 17, column: 5, scope: !238) +// CHECK:STDOUT: !256 = !DILocation(line: 19, column: 21, scope: !238) +// CHECK:STDOUT: !257 = !DILocation(line: 19, column: 10, scope: !238) +// CHECK:STDOUT: !258 = !DILocation(line: 19, column: 3, scope: !238) +// CHECK:STDOUT: !259 = !{!239, !240, !241, !242} +// CHECK:STDOUT: !260 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.6eab5c6411742e70", scope: null, file: !4, line: 15, type: !64, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !281) +// CHECK:STDOUT: !261 = !DILocalVariable(arg: 1, scope: !260, type: !11) +// CHECK:STDOUT: !262 = !DILocalVariable(arg: 2, scope: !260, type: !11) +// CHECK:STDOUT: !263 = !DILocalVariable(arg: 3, scope: !260, type: !11) +// CHECK:STDOUT: !264 = !DILocalVariable(arg: 4, scope: !260, type: !6) +// CHECK:STDOUT: !271 = !DILocation(line: 16, column: 7, scope: !260) +// CHECK:STDOUT: !272 = !DILocation(line: 16, column: 6, scope: !260) +// CHECK:STDOUT: !274 = !DILocation(line: 17, column: 5, scope: !260) +// CHECK:STDOUT: !278 = !DILocation(line: 19, column: 21, scope: !260) +// CHECK:STDOUT: !279 = !DILocation(line: 19, column: 10, scope: !260) +// CHECK:STDOUT: !280 = !DILocation(line: 19, column: 3, scope: !260) +// CHECK:STDOUT: !281 = !{!261, !262, !263, !264} +// CHECK:STDOUT: !282 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.732da705e71cd359", scope: null, file: !4, line: 15, type: !64, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !303) +// CHECK:STDOUT: !283 = !DILocalVariable(arg: 1, scope: !282, type: !11) +// CHECK:STDOUT: !284 = !DILocalVariable(arg: 2, scope: !282, type: !11) +// CHECK:STDOUT: !285 = !DILocalVariable(arg: 3, scope: !282, type: !11) +// CHECK:STDOUT: !286 = !DILocalVariable(arg: 4, scope: !282, type: !6) +// CHECK:STDOUT: !293 = !DILocation(line: 16, column: 7, scope: !282) +// CHECK:STDOUT: !294 = !DILocation(line: 16, column: 6, scope: !282) +// CHECK:STDOUT: !296 = !DILocation(line: 17, column: 5, scope: !282) +// CHECK:STDOUT: !300 = !DILocation(line: 19, column: 21, scope: !282) +// CHECK:STDOUT: !301 = !DILocation(line: 19, column: 10, scope: !282) +// CHECK:STDOUT: !302 = !DILocation(line: 19, column: 3, scope: !282) +// CHECK:STDOUT: !303 = !{!283, !284, !285, !286} +// CHECK:STDOUT: !502 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.b1f6aa8c7fcac0ca", scope: null, file: !4, line: 15, type: !70, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !523) +// CHECK:STDOUT: !503 = !DILocalVariable(arg: 1, scope: !502, type: !8) +// CHECK:STDOUT: !504 = !DILocalVariable(arg: 2, scope: !502, type: !11) +// CHECK:STDOUT: !505 = !DILocalVariable(arg: 3, scope: !502, type: !11) +// CHECK:STDOUT: !506 = !DILocalVariable(arg: 4, scope: !502, type: !6) +// CHECK:STDOUT: !513 = !DILocation(line: 16, column: 7, scope: !502) +// CHECK:STDOUT: !514 = !DILocation(line: 16, column: 6, scope: !502) +// CHECK:STDOUT: !516 = !DILocation(line: 17, column: 5, scope: !502) +// CHECK:STDOUT: !520 = !DILocation(line: 19, column: 21, scope: !502) +// CHECK:STDOUT: !521 = !DILocation(line: 19, column: 10, scope: !502) +// CHECK:STDOUT: !522 = !DILocation(line: 19, column: 3, scope: !502) +// CHECK:STDOUT: !523 = !{!503, !504, !505, !506} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/function/generic/call_recursive_sccs_deep.carbon b/toolchain/lower/testdata/function/generic/call_recursive_sccs_deep.carbon index c0362eaec631..dc2b34f5b1d1 100644 --- a/toolchain/lower/testdata/function/generic/call_recursive_sccs_deep.carbon +++ b/toolchain/lower/testdata/function/generic/call_recursive_sccs_deep.carbon @@ -112,254 +112,294 @@ fn M() { // CHECK:STDOUT: %A.call.loc82 = call ptr @_CA.Main.a76b78461416b4a8(ptr %.loc82_5, i32 0), !dbg !36 // CHECK:STDOUT: %.loc83_5 = load ptr, ptr %ptr_f64.var, align 8, !dbg !37 // CHECK:STDOUT: %A.call.loc83 = call ptr @_CA.Main.a76b78461416b4a8(ptr %.loc83_5, i32 0), !dbg !38 -// CHECK:STDOUT: call void @"_COp.dc14d4dd21801791:core.Destroy.Core"(ptr %m.var), !dbg !17 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %n.var), !dbg !15 +// CHECK:STDOUT: call void @"_CSelfDestruct.749b51755634ad17:core.Destroy.Core"(ptr %ptr_f64.var), !dbg !23 +// CHECK:STDOUT: call void @"_CSelfDestruct.d088c7eb746488be:core.Destroy.Core"(ptr %ptr_i32.var), !dbg !19 +// CHECK:STDOUT: call void @"_CSelfDestruct.dc14d4dd21801791:core.Destroy.Core"(ptr %m.var), !dbg !17 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %n.var), !dbg !15 // CHECK:STDOUT: ret void, !dbg !39 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.dc14d4dd21801791:core.Destroy.Core"(ptr %self) #0 !dbg !40 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.749b51755634ad17:core.Destroy.Core"(ptr %self) #0 !dbg !40 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !42 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !44 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.d088c7eb746488be:core.Destroy.Core"(ptr %self) #0 !dbg !44 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !46 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.7945ecba5c505fc0:core.Destroy.Core"(ptr %self) #0 !dbg !48 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !50 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.dc14d4dd21801791:core.Destroy.Core"(ptr %self) #0 !dbg !52 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !54 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.dc14d4dd21801791:core.Destroy.Core"(ptr %self) #0 !dbg !56 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.dc14d4dd21801791:core.Destroy.Core"(ptr %self), !dbg !58 +// CHECK:STDOUT: ret void, !dbg !58 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !60 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !62 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !64 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !66 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !68 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !70 +// CHECK:STDOUT: ret void, !dbg !70 +// 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 i32 @_CA.Main.4d6ceefeb7f772f4(i32 %x, i32 %count) #0 !dbg !48 { +// CHECK:STDOUT: define linkonce_odr i32 @_CA.Main.4d6ceefeb7f772f4(i32 %x, i32 %count) #0 !dbg !72 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CB.Main.4d6ceefeb7f772f4(i32 %x, i32 %count), !dbg !57 -// CHECK:STDOUT: %D.call = call i32 @_CD.Main.4d6ceefeb7f772f4(i32 %x, i32 %count), !dbg !62 -// CHECK:STDOUT: ret i32 %D.call, !dbg !63 +// CHECK:STDOUT: call void @_CB.Main.4d6ceefeb7f772f4(i32 %x, i32 %count), !dbg !81 +// CHECK:STDOUT: %D.call = call i32 @_CD.Main.4d6ceefeb7f772f4(i32 %x, i32 %count), !dbg !86 +// CHECK:STDOUT: ret i32 %D.call, !dbg !87 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr double @_CA.Main.c5e4ba542a56b71f(double %x, i32 %count) #0 !dbg !65 { +// CHECK:STDOUT: define linkonce_odr double @_CA.Main.c5e4ba542a56b71f(double %x, i32 %count) #0 !dbg !89 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CB.Main.c5e4ba542a56b71f(double %x, i32 %count), !dbg !74 -// CHECK:STDOUT: %D.call = call double @_CD.Main.c5e4ba542a56b71f(double %x, i32 %count), !dbg !79 -// CHECK:STDOUT: ret double %D.call, !dbg !80 +// CHECK:STDOUT: call void @_CB.Main.c5e4ba542a56b71f(double %x, i32 %count), !dbg !98 +// CHECK:STDOUT: %D.call = call double @_CD.Main.c5e4ba542a56b71f(double %x, i32 %count), !dbg !103 +// CHECK:STDOUT: ret double %D.call, !dbg !104 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CA.Main.a76b78461416b4a8(ptr %x, i32 %count) #0 !dbg !82 { +// CHECK:STDOUT: define linkonce_odr ptr @_CA.Main.a76b78461416b4a8(ptr %x, i32 %count) #0 !dbg !106 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CB.Main.a76b78461416b4a8(ptr %x, i32 %count), !dbg !91 -// CHECK:STDOUT: %D.call = call ptr @_CD.Main.a76b78461416b4a8(ptr %x, i32 %count), !dbg !94 -// CHECK:STDOUT: ret ptr %D.call, !dbg !95 +// CHECK:STDOUT: call void @_CB.Main.a76b78461416b4a8(ptr %x, i32 %count), !dbg !115 +// CHECK:STDOUT: %D.call = call ptr @_CD.Main.a76b78461416b4a8(ptr %x, i32 %count), !dbg !118 +// CHECK:STDOUT: ret ptr %D.call, !dbg !119 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CB.Main.4d6ceefeb7f772f4(i32 %x, i32 %count) #0 !dbg !112 { +// CHECK:STDOUT: define linkonce_odr void @_CB.Main.4d6ceefeb7f772f4(i32 %x, i32 %count) #0 !dbg !136 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CC.Main.4d6ceefeb7f772f4(i32 %x, i32 %count), !dbg !119 -// CHECK:STDOUT: ret void, !dbg !120 +// CHECK:STDOUT: call void @_CC.Main.4d6ceefeb7f772f4(i32 %x, i32 %count), !dbg !143 +// CHECK:STDOUT: ret void, !dbg !144 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CD.Main.4d6ceefeb7f772f4(i32 %x, i32 %count) #0 !dbg !122 { +// CHECK:STDOUT: define linkonce_odr i32 @_CD.Main.4d6ceefeb7f772f4(i32 %x, i32 %count) #0 !dbg !146 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 4, !dbg !129 -// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then.loc49, label %if.else.loc49, !dbg !130 +// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 4, !dbg !153 +// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then.loc49, label %if.else.loc49, !dbg !154 // CHECK:STDOUT: // CHECK:STDOUT: if.then.loc49: ; preds = %entry -// CHECK:STDOUT: ret i32 %x, !dbg !132 +// CHECK:STDOUT: ret i32 %x, !dbg !156 // CHECK:STDOUT: // CHECK:STDOUT: if.else.loc49: ; preds = %entry -// CHECK:STDOUT: %Int.as.ModWith.impl.Op.call = srem i32 %count, 2, !dbg !133 -// CHECK:STDOUT: %Int.as.EqWith.impl.Equal.call = icmp eq i32 %Int.as.ModWith.impl.Op.call, 0, !dbg !133 -// CHECK:STDOUT: br i1 %Int.as.EqWith.impl.Equal.call, label %if.then.loc52, label %if.else.loc52, !dbg !134 +// CHECK:STDOUT: %Int.as.ModWith.impl.Op.call = srem i32 %count, 2, !dbg !157 +// CHECK:STDOUT: %Int.as.EqWith.impl.Equal.call = icmp eq i32 %Int.as.ModWith.impl.Op.call, 0, !dbg !157 +// CHECK:STDOUT: br i1 %Int.as.EqWith.impl.Equal.call, label %if.then.loc52, label %if.else.loc52, !dbg !158 // CHECK:STDOUT: // CHECK:STDOUT: if.then.loc52: ; preds = %if.else.loc49 -// CHECK:STDOUT: %E.call = call i32 @_CE.Main.4d6ceefeb7f772f4(i32 %x, i32 %count), !dbg !137 -// CHECK:STDOUT: ret i32 %E.call, !dbg !138 +// CHECK:STDOUT: %E.call = call i32 @_CE.Main.4d6ceefeb7f772f4(i32 %x, i32 %count), !dbg !161 +// CHECK:STDOUT: ret i32 %E.call, !dbg !162 // CHECK:STDOUT: // CHECK:STDOUT: if.else.loc52: ; preds = %if.else.loc49 -// CHECK:STDOUT: %F.call = call i32 @_CF.Main.4d6ceefeb7f772f4(i32 %x, i32 %count), !dbg !141 -// CHECK:STDOUT: ret i32 %F.call, !dbg !142 +// CHECK:STDOUT: %F.call = call i32 @_CF.Main.4d6ceefeb7f772f4(i32 %x, i32 %count), !dbg !165 +// CHECK:STDOUT: ret i32 %F.call, !dbg !166 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CB.Main.c5e4ba542a56b71f(double %x, i32 %count) #0 !dbg !144 { +// CHECK:STDOUT: define linkonce_odr void @_CB.Main.c5e4ba542a56b71f(double %x, i32 %count) #0 !dbg !168 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CC.Main.c5e4ba542a56b71f(double %x, i32 %count), !dbg !151 -// CHECK:STDOUT: ret void, !dbg !152 +// CHECK:STDOUT: call void @_CC.Main.c5e4ba542a56b71f(double %x, i32 %count), !dbg !175 +// CHECK:STDOUT: ret void, !dbg !176 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr double @_CD.Main.c5e4ba542a56b71f(double %x, i32 %count) #0 !dbg !154 { +// CHECK:STDOUT: define linkonce_odr double @_CD.Main.c5e4ba542a56b71f(double %x, i32 %count) #0 !dbg !178 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 4, !dbg !161 -// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then.loc49, label %if.else.loc49, !dbg !162 +// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 4, !dbg !185 +// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then.loc49, label %if.else.loc49, !dbg !186 // CHECK:STDOUT: // CHECK:STDOUT: if.then.loc49: ; preds = %entry -// CHECK:STDOUT: ret double %x, !dbg !164 +// CHECK:STDOUT: ret double %x, !dbg !188 // CHECK:STDOUT: // CHECK:STDOUT: if.else.loc49: ; preds = %entry -// CHECK:STDOUT: %Int.as.ModWith.impl.Op.call = srem i32 %count, 2, !dbg !165 -// CHECK:STDOUT: %Int.as.EqWith.impl.Equal.call = icmp eq i32 %Int.as.ModWith.impl.Op.call, 0, !dbg !165 -// CHECK:STDOUT: br i1 %Int.as.EqWith.impl.Equal.call, label %if.then.loc52, label %if.else.loc52, !dbg !166 +// CHECK:STDOUT: %Int.as.ModWith.impl.Op.call = srem i32 %count, 2, !dbg !189 +// CHECK:STDOUT: %Int.as.EqWith.impl.Equal.call = icmp eq i32 %Int.as.ModWith.impl.Op.call, 0, !dbg !189 +// CHECK:STDOUT: br i1 %Int.as.EqWith.impl.Equal.call, label %if.then.loc52, label %if.else.loc52, !dbg !190 // CHECK:STDOUT: // CHECK:STDOUT: if.then.loc52: ; preds = %if.else.loc49 -// CHECK:STDOUT: %E.call = call double @_CE.Main.c5e4ba542a56b71f(double %x, i32 %count), !dbg !169 -// CHECK:STDOUT: ret double %E.call, !dbg !170 +// CHECK:STDOUT: %E.call = call double @_CE.Main.c5e4ba542a56b71f(double %x, i32 %count), !dbg !193 +// CHECK:STDOUT: ret double %E.call, !dbg !194 // CHECK:STDOUT: // CHECK:STDOUT: if.else.loc52: ; preds = %if.else.loc49 -// CHECK:STDOUT: %F.call = call double @_CF.Main.c5e4ba542a56b71f(double %x, i32 %count), !dbg !173 -// CHECK:STDOUT: ret double %F.call, !dbg !174 +// CHECK:STDOUT: %F.call = call double @_CF.Main.c5e4ba542a56b71f(double %x, i32 %count), !dbg !197 +// CHECK:STDOUT: ret double %F.call, !dbg !198 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CB.Main.a76b78461416b4a8(ptr %x, i32 %count) #0 !dbg !176 { +// CHECK:STDOUT: define linkonce_odr void @_CB.Main.a76b78461416b4a8(ptr %x, i32 %count) #0 !dbg !200 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CC.Main.a76b78461416b4a8(ptr %x, i32 %count), !dbg !183 -// CHECK:STDOUT: ret void, !dbg !184 +// CHECK:STDOUT: call void @_CC.Main.a76b78461416b4a8(ptr %x, i32 %count), !dbg !207 +// CHECK:STDOUT: ret void, !dbg !208 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CD.Main.a76b78461416b4a8(ptr %x, i32 %count) #0 !dbg !186 { +// CHECK:STDOUT: define linkonce_odr ptr @_CD.Main.a76b78461416b4a8(ptr %x, i32 %count) #0 !dbg !210 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 4, !dbg !193 -// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then.loc49, label %if.else.loc49, !dbg !194 +// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 4, !dbg !217 +// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then.loc49, label %if.else.loc49, !dbg !218 // CHECK:STDOUT: // CHECK:STDOUT: if.then.loc49: ; preds = %entry -// CHECK:STDOUT: ret ptr %x, !dbg !196 +// CHECK:STDOUT: ret ptr %x, !dbg !220 // CHECK:STDOUT: // CHECK:STDOUT: if.else.loc49: ; preds = %entry -// CHECK:STDOUT: %Int.as.ModWith.impl.Op.call = srem i32 %count, 2, !dbg !197 -// CHECK:STDOUT: %Int.as.EqWith.impl.Equal.call = icmp eq i32 %Int.as.ModWith.impl.Op.call, 0, !dbg !197 -// CHECK:STDOUT: br i1 %Int.as.EqWith.impl.Equal.call, label %if.then.loc52, label %if.else.loc52, !dbg !198 +// CHECK:STDOUT: %Int.as.ModWith.impl.Op.call = srem i32 %count, 2, !dbg !221 +// CHECK:STDOUT: %Int.as.EqWith.impl.Equal.call = icmp eq i32 %Int.as.ModWith.impl.Op.call, 0, !dbg !221 +// CHECK:STDOUT: br i1 %Int.as.EqWith.impl.Equal.call, label %if.then.loc52, label %if.else.loc52, !dbg !222 // CHECK:STDOUT: // CHECK:STDOUT: if.then.loc52: ; preds = %if.else.loc49 -// CHECK:STDOUT: %E.call = call ptr @_CE.Main.a76b78461416b4a8(ptr %x, i32 %count), !dbg !201 -// CHECK:STDOUT: ret ptr %E.call, !dbg !202 +// CHECK:STDOUT: %E.call = call ptr @_CE.Main.a76b78461416b4a8(ptr %x, i32 %count), !dbg !225 +// CHECK:STDOUT: ret ptr %E.call, !dbg !226 // CHECK:STDOUT: // CHECK:STDOUT: if.else.loc52: ; preds = %if.else.loc49 -// CHECK:STDOUT: %F.call = call ptr @_CF.Main.a76b78461416b4a8(ptr %x, i32 %count), !dbg !205 -// CHECK:STDOUT: ret ptr %F.call, !dbg !206 +// CHECK:STDOUT: %F.call = call ptr @_CF.Main.a76b78461416b4a8(ptr %x, i32 %count), !dbg !229 +// CHECK:STDOUT: ret ptr %F.call, !dbg !230 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CC.Main.4d6ceefeb7f772f4(i32 %x, i32 %count) #0 !dbg !240 { +// CHECK:STDOUT: define linkonce_odr void @_CC.Main.4d6ceefeb7f772f4(i32 %x, i32 %count) #0 !dbg !264 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.OrderedWith.impl.LessOrEquivalent.call = icmp sle i32 %count, 2, !dbg !245 -// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.LessOrEquivalent.call, label %if.then, label %if.else, !dbg !246 +// CHECK:STDOUT: %Int.as.OrderedWith.impl.LessOrEquivalent.call = icmp sle i32 %count, 2, !dbg !269 +// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.LessOrEquivalent.call, label %if.then, label %if.else, !dbg !270 // CHECK:STDOUT: // CHECK:STDOUT: if.then: ; preds = %entry -// CHECK:STDOUT: %Print.call = call i32 (ptr, ...) @printf(ptr @printf.int.format, i32 %count), !dbg !248 -// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !250 -// CHECK:STDOUT: call void @_CB.Main.4d6ceefeb7f772f4(i32 %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !251 -// CHECK:STDOUT: br label %if.else, !dbg !252 +// CHECK:STDOUT: %Print.call = call i32 (ptr, ...) @printf(ptr @printf.int.format, i32 %count), !dbg !272 +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !274 +// CHECK:STDOUT: call void @_CB.Main.4d6ceefeb7f772f4(i32 %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !275 +// CHECK:STDOUT: br label %if.else, !dbg !276 // CHECK:STDOUT: // CHECK:STDOUT: if.else: ; preds = %if.then, %entry -// CHECK:STDOUT: ret void, !dbg !253 +// CHECK:STDOUT: ret void, !dbg !277 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CE.Main.4d6ceefeb7f772f4(i32 %x, i32 %count) #0 !dbg !255 { +// CHECK:STDOUT: define linkonce_odr i32 @_CE.Main.4d6ceefeb7f772f4(i32 %x, i32 %count) #0 !dbg !279 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %G.call = call i32 @_CG.Main.4d6ceefeb7f772f4(i32 %x, i32 %count), !dbg !264 -// CHECK:STDOUT: ret i32 %G.call, !dbg !265 +// CHECK:STDOUT: %G.call = call i32 @_CG.Main.4d6ceefeb7f772f4(i32 %x, i32 %count), !dbg !288 +// CHECK:STDOUT: ret i32 %G.call, !dbg !289 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CF.Main.4d6ceefeb7f772f4(i32 %x, i32 %count) #0 !dbg !267 { +// CHECK:STDOUT: define linkonce_odr i32 @_CF.Main.4d6ceefeb7f772f4(i32 %x, i32 %count) #0 !dbg !291 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %G.call = call i32 @_CG.Main.4d6ceefeb7f772f4(i32 %x, i32 %count), !dbg !276 -// CHECK:STDOUT: ret i32 %G.call, !dbg !277 +// CHECK:STDOUT: %G.call = call i32 @_CG.Main.4d6ceefeb7f772f4(i32 %x, i32 %count), !dbg !300 +// CHECK:STDOUT: ret i32 %G.call, !dbg !301 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CC.Main.c5e4ba542a56b71f(double %x, i32 %count) #0 !dbg !279 { +// CHECK:STDOUT: define linkonce_odr void @_CC.Main.c5e4ba542a56b71f(double %x, i32 %count) #0 !dbg !303 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.OrderedWith.impl.LessOrEquivalent.call = icmp sle i32 %count, 2, !dbg !284 -// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.LessOrEquivalent.call, label %if.then, label %if.else, !dbg !285 +// CHECK:STDOUT: %Int.as.OrderedWith.impl.LessOrEquivalent.call = icmp sle i32 %count, 2, !dbg !308 +// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.LessOrEquivalent.call, label %if.then, label %if.else, !dbg !309 // CHECK:STDOUT: // CHECK:STDOUT: if.then: ; preds = %entry -// CHECK:STDOUT: %Print.call = call i32 (ptr, ...) @printf(ptr @printf.int.format, i32 %count), !dbg !287 -// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !289 -// CHECK:STDOUT: call void @_CB.Main.c5e4ba542a56b71f(double %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !290 -// CHECK:STDOUT: br label %if.else, !dbg !291 +// CHECK:STDOUT: %Print.call = call i32 (ptr, ...) @printf(ptr @printf.int.format, i32 %count), !dbg !311 +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !313 +// CHECK:STDOUT: call void @_CB.Main.c5e4ba542a56b71f(double %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !314 +// CHECK:STDOUT: br label %if.else, !dbg !315 // CHECK:STDOUT: // CHECK:STDOUT: if.else: ; preds = %if.then, %entry -// CHECK:STDOUT: ret void, !dbg !292 +// CHECK:STDOUT: ret void, !dbg !316 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr double @_CE.Main.c5e4ba542a56b71f(double %x, i32 %count) #0 !dbg !294 { +// CHECK:STDOUT: define linkonce_odr double @_CE.Main.c5e4ba542a56b71f(double %x, i32 %count) #0 !dbg !318 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %G.call = call double @_CG.Main.c5e4ba542a56b71f(double %x, i32 %count), !dbg !303 -// CHECK:STDOUT: ret double %G.call, !dbg !304 +// CHECK:STDOUT: %G.call = call double @_CG.Main.c5e4ba542a56b71f(double %x, i32 %count), !dbg !327 +// CHECK:STDOUT: ret double %G.call, !dbg !328 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr double @_CF.Main.c5e4ba542a56b71f(double %x, i32 %count) #0 !dbg !306 { +// CHECK:STDOUT: define linkonce_odr double @_CF.Main.c5e4ba542a56b71f(double %x, i32 %count) #0 !dbg !330 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %G.call = call double @_CG.Main.c5e4ba542a56b71f(double %x, i32 %count), !dbg !315 -// CHECK:STDOUT: ret double %G.call, !dbg !316 +// CHECK:STDOUT: %G.call = call double @_CG.Main.c5e4ba542a56b71f(double %x, i32 %count), !dbg !339 +// CHECK:STDOUT: ret double %G.call, !dbg !340 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CC.Main.a76b78461416b4a8(ptr %x, i32 %count) #0 !dbg !318 { +// CHECK:STDOUT: define linkonce_odr void @_CC.Main.a76b78461416b4a8(ptr %x, i32 %count) #0 !dbg !342 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.OrderedWith.impl.LessOrEquivalent.call = icmp sle i32 %count, 2, !dbg !323 -// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.LessOrEquivalent.call, label %if.then, label %if.else, !dbg !324 +// CHECK:STDOUT: %Int.as.OrderedWith.impl.LessOrEquivalent.call = icmp sle i32 %count, 2, !dbg !347 +// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.LessOrEquivalent.call, label %if.then, label %if.else, !dbg !348 // CHECK:STDOUT: // CHECK:STDOUT: if.then: ; preds = %entry -// CHECK:STDOUT: %Print.call = call i32 (ptr, ...) @printf(ptr @printf.int.format, i32 %count), !dbg !326 -// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !328 -// CHECK:STDOUT: call void @_CB.Main.a76b78461416b4a8(ptr %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !329 -// CHECK:STDOUT: br label %if.else, !dbg !330 +// CHECK:STDOUT: %Print.call = call i32 (ptr, ...) @printf(ptr @printf.int.format, i32 %count), !dbg !350 +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !352 +// CHECK:STDOUT: call void @_CB.Main.a76b78461416b4a8(ptr %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !353 +// CHECK:STDOUT: br label %if.else, !dbg !354 // CHECK:STDOUT: // CHECK:STDOUT: if.else: ; preds = %if.then, %entry -// CHECK:STDOUT: ret void, !dbg !331 +// CHECK:STDOUT: ret void, !dbg !355 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CE.Main.a76b78461416b4a8(ptr %x, i32 %count) #0 !dbg !333 { +// CHECK:STDOUT: define linkonce_odr ptr @_CE.Main.a76b78461416b4a8(ptr %x, i32 %count) #0 !dbg !357 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %G.call = call ptr @_CG.Main.a76b78461416b4a8(ptr %x, i32 %count), !dbg !342 -// CHECK:STDOUT: ret ptr %G.call, !dbg !343 +// CHECK:STDOUT: %G.call = call ptr @_CG.Main.a76b78461416b4a8(ptr %x, i32 %count), !dbg !366 +// CHECK:STDOUT: ret ptr %G.call, !dbg !367 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CF.Main.a76b78461416b4a8(ptr %x, i32 %count) #0 !dbg !345 { +// CHECK:STDOUT: define linkonce_odr ptr @_CF.Main.a76b78461416b4a8(ptr %x, i32 %count) #0 !dbg !369 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %G.call = call ptr @_CG.Main.a76b78461416b4a8(ptr %x, i32 %count), !dbg !354 -// CHECK:STDOUT: ret ptr %G.call, !dbg !355 +// CHECK:STDOUT: %G.call = call ptr @_CG.Main.a76b78461416b4a8(ptr %x, i32 %count), !dbg !378 +// CHECK:STDOUT: ret ptr %G.call, !dbg !379 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare i32 @printf(ptr, ...) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CG.Main.4d6ceefeb7f772f4(i32 %x, i32 %count) #0 !dbg !396 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !404 -// CHECK:STDOUT: %D.call = call i32 @_CD.Main.4d6ceefeb7f772f4(i32 %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !405 -// CHECK:STDOUT: ret i32 %D.call, !dbg !406 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr double @_CG.Main.c5e4ba542a56b71f(double %x, i32 %count) #0 !dbg !408 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !416 -// CHECK:STDOUT: %D.call = call double @_CD.Main.c5e4ba542a56b71f(double %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !417 -// CHECK:STDOUT: ret double %D.call, !dbg !418 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CG.Main.a76b78461416b4a8(ptr %x, i32 %count) #0 !dbg !420 { +// CHECK:STDOUT: define linkonce_odr i32 @_CG.Main.4d6ceefeb7f772f4(i32 %x, i32 %count) #0 !dbg !420 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !428 -// CHECK:STDOUT: %D.call = call ptr @_CD.Main.a76b78461416b4a8(ptr %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !429 -// CHECK:STDOUT: ret ptr %D.call, !dbg !430 +// CHECK:STDOUT: %D.call = call i32 @_CD.Main.4d6ceefeb7f772f4(i32 %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !429 +// CHECK:STDOUT: ret i32 %D.call, !dbg !430 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr double @_CG.Main.c5e4ba542a56b71f(double %x, i32 %count) #0 !dbg !432 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !440 +// CHECK:STDOUT: %D.call = call double @_CD.Main.c5e4ba542a56b71f(double %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !441 +// CHECK:STDOUT: ret double %D.call, !dbg !442 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr ptr @_CG.Main.a76b78461416b4a8(ptr %x, i32 %count) #0 !dbg !444 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !452 +// CHECK:STDOUT: %D.call = call ptr @_CD.Main.a76b78461416b4a8(ptr %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !453 +// CHECK:STDOUT: ret ptr %D.call, !dbg !454 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -406,184 +446,208 @@ fn M() { // CHECK:STDOUT: !37 = !DILocation(line: 83, column: 5, scope: !14) // CHECK:STDOUT: !38 = !DILocation(line: 83, column: 3, scope: !14) // CHECK:STDOUT: !39 = !DILocation(line: 74, column: 1, scope: !14) -// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "Op", linkageName: "_COp.dc14d4dd21801791:core.Destroy.Core", scope: null, file: !4, line: 76, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !43) +// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.749b51755634ad17:core.Destroy.Core", scope: null, file: !4, line: 78, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !43) // CHECK:STDOUT: !41 = !DILocalVariable(arg: 1, scope: !40, type: !9) -// CHECK:STDOUT: !42 = !DILocation(line: 76, column: 3, scope: !40) +// CHECK:STDOUT: !42 = !DILocation(line: 78, column: 3, scope: !40) // CHECK:STDOUT: !43 = !{!41} -// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 75, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !47) -// CHECK:STDOUT: !45 = !DILocalVariable(arg: 1, scope: !44, type: !6) -// CHECK:STDOUT: !46 = !DILocation(line: 75, column: 3, scope: !44) +// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.d088c7eb746488be:core.Destroy.Core", scope: null, file: !4, line: 77, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !47) +// CHECK:STDOUT: !45 = !DILocalVariable(arg: 1, scope: !44, type: !9) +// CHECK:STDOUT: !46 = !DILocation(line: 77, column: 3, scope: !44) // CHECK:STDOUT: !47 = !{!45} -// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "A", linkageName: "_CA.Main.4d6ceefeb7f772f4", scope: null, file: !4, line: 32, type: !30, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !64) -// CHECK:STDOUT: !49 = !DILocalVariable(arg: 1, scope: !48, type: !6) -// CHECK:STDOUT: !50 = !DILocalVariable(arg: 2, scope: !48, type: !6) -// CHECK:STDOUT: !57 = !DILocation(line: 33, column: 3, scope: !48) -// CHECK:STDOUT: !58 = !{null, !6, !6} -// CHECK:STDOUT: !59 = !DISubroutineType(types: !58) -// CHECK:STDOUT: !62 = !DILocation(line: 34, column: 10, scope: !48) -// CHECK:STDOUT: !63 = !DILocation(line: 34, column: 3, scope: !48) -// CHECK:STDOUT: !64 = !{!49, !50} -// CHECK:STDOUT: !65 = distinct !DISubprogram(name: "A", linkageName: "_CA.Main.c5e4ba542a56b71f", scope: null, file: !4, line: 32, type: !34, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !81) -// CHECK:STDOUT: !66 = !DILocalVariable(arg: 1, scope: !65, type: !9) -// CHECK:STDOUT: !67 = !DILocalVariable(arg: 2, scope: !65, type: !6) -// CHECK:STDOUT: !74 = !DILocation(line: 33, column: 3, scope: !65) -// CHECK:STDOUT: !75 = !{null, !9, !6} -// CHECK:STDOUT: !76 = !DISubroutineType(types: !75) -// CHECK:STDOUT: !79 = !DILocation(line: 34, column: 10, scope: !65) -// CHECK:STDOUT: !80 = !DILocation(line: 34, column: 3, scope: !65) -// CHECK:STDOUT: !81 = !{!66, !67} -// CHECK:STDOUT: !82 = distinct !DISubprogram(name: "A", linkageName: "_CA.Main.a76b78461416b4a8", scope: null, file: !4, line: 32, type: !34, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !96) -// CHECK:STDOUT: !83 = !DILocalVariable(arg: 1, scope: !82, type: !9) -// CHECK:STDOUT: !84 = !DILocalVariable(arg: 2, scope: !82, type: !6) -// CHECK:STDOUT: !91 = !DILocation(line: 33, column: 3, scope: !82) -// CHECK:STDOUT: !94 = !DILocation(line: 34, column: 10, scope: !82) -// CHECK:STDOUT: !95 = !DILocation(line: 34, column: 3, scope: !82) -// CHECK:STDOUT: !96 = !{!83, !84} -// CHECK:STDOUT: !112 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.4d6ceefeb7f772f4", scope: null, file: !4, line: 37, type: !59, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !121) -// CHECK:STDOUT: !113 = !DILocalVariable(arg: 1, scope: !112, type: !6) -// CHECK:STDOUT: !114 = !DILocalVariable(arg: 2, scope: !112, type: !6) -// CHECK:STDOUT: !119 = !DILocation(line: 38, column: 3, scope: !112) -// CHECK:STDOUT: !120 = !DILocation(line: 37, column: 1, scope: !112) -// CHECK:STDOUT: !121 = !{!113, !114} -// CHECK:STDOUT: !122 = distinct !DISubprogram(name: "D", linkageName: "_CD.Main.4d6ceefeb7f772f4", scope: null, file: !4, line: 48, type: !30, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !143) -// CHECK:STDOUT: !123 = !DILocalVariable(arg: 1, scope: !122, type: !6) -// CHECK:STDOUT: !124 = !DILocalVariable(arg: 2, scope: !122, type: !6) -// CHECK:STDOUT: !129 = !DILocation(line: 49, column: 7, scope: !122) -// CHECK:STDOUT: !130 = !DILocation(line: 49, column: 6, scope: !122) -// CHECK:STDOUT: !132 = !DILocation(line: 50, column: 5, scope: !122) -// CHECK:STDOUT: !133 = !DILocation(line: 52, column: 7, scope: !122) -// CHECK:STDOUT: !134 = !DILocation(line: 52, column: 6, scope: !122) -// CHECK:STDOUT: !137 = !DILocation(line: 53, column: 12, scope: !122) -// CHECK:STDOUT: !138 = !DILocation(line: 53, column: 5, scope: !122) -// CHECK:STDOUT: !141 = !DILocation(line: 55, column: 12, scope: !122) -// CHECK:STDOUT: !142 = !DILocation(line: 55, column: 5, scope: !122) -// CHECK:STDOUT: !143 = !{!123, !124} -// CHECK:STDOUT: !144 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.c5e4ba542a56b71f", scope: null, file: !4, line: 37, type: !76, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !153) -// CHECK:STDOUT: !145 = !DILocalVariable(arg: 1, scope: !144, type: !9) -// CHECK:STDOUT: !146 = !DILocalVariable(arg: 2, scope: !144, type: !6) -// CHECK:STDOUT: !151 = !DILocation(line: 38, column: 3, scope: !144) -// CHECK:STDOUT: !152 = !DILocation(line: 37, column: 1, scope: !144) -// CHECK:STDOUT: !153 = !{!145, !146} -// CHECK:STDOUT: !154 = distinct !DISubprogram(name: "D", linkageName: "_CD.Main.c5e4ba542a56b71f", scope: null, file: !4, line: 48, type: !34, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !175) -// CHECK:STDOUT: !155 = !DILocalVariable(arg: 1, scope: !154, type: !9) -// CHECK:STDOUT: !156 = !DILocalVariable(arg: 2, scope: !154, type: !6) -// CHECK:STDOUT: !161 = !DILocation(line: 49, column: 7, scope: !154) -// CHECK:STDOUT: !162 = !DILocation(line: 49, column: 6, scope: !154) -// CHECK:STDOUT: !164 = !DILocation(line: 50, column: 5, scope: !154) -// CHECK:STDOUT: !165 = !DILocation(line: 52, column: 7, scope: !154) -// CHECK:STDOUT: !166 = !DILocation(line: 52, column: 6, scope: !154) -// CHECK:STDOUT: !169 = !DILocation(line: 53, column: 12, scope: !154) -// CHECK:STDOUT: !170 = !DILocation(line: 53, column: 5, scope: !154) -// CHECK:STDOUT: !173 = !DILocation(line: 55, column: 12, scope: !154) -// CHECK:STDOUT: !174 = !DILocation(line: 55, column: 5, scope: !154) -// CHECK:STDOUT: !175 = !{!155, !156} -// CHECK:STDOUT: !176 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.a76b78461416b4a8", scope: null, file: !4, line: 37, type: !76, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !185) -// CHECK:STDOUT: !177 = !DILocalVariable(arg: 1, scope: !176, type: !9) -// CHECK:STDOUT: !178 = !DILocalVariable(arg: 2, scope: !176, type: !6) -// CHECK:STDOUT: !183 = !DILocation(line: 38, column: 3, scope: !176) -// CHECK:STDOUT: !184 = !DILocation(line: 37, column: 1, scope: !176) -// CHECK:STDOUT: !185 = !{!177, !178} -// CHECK:STDOUT: !186 = distinct !DISubprogram(name: "D", linkageName: "_CD.Main.a76b78461416b4a8", scope: null, file: !4, line: 48, type: !34, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !207) -// CHECK:STDOUT: !187 = !DILocalVariable(arg: 1, scope: !186, type: !9) -// CHECK:STDOUT: !188 = !DILocalVariable(arg: 2, scope: !186, type: !6) -// CHECK:STDOUT: !193 = !DILocation(line: 49, column: 7, scope: !186) -// CHECK:STDOUT: !194 = !DILocation(line: 49, column: 6, scope: !186) -// CHECK:STDOUT: !196 = !DILocation(line: 50, column: 5, scope: !186) -// CHECK:STDOUT: !197 = !DILocation(line: 52, column: 7, scope: !186) -// CHECK:STDOUT: !198 = !DILocation(line: 52, column: 6, scope: !186) -// CHECK:STDOUT: !201 = !DILocation(line: 53, column: 12, scope: !186) -// CHECK:STDOUT: !202 = !DILocation(line: 53, column: 5, scope: !186) -// CHECK:STDOUT: !205 = !DILocation(line: 55, column: 12, scope: !186) -// CHECK:STDOUT: !206 = !DILocation(line: 55, column: 5, scope: !186) -// CHECK:STDOUT: !207 = !{!187, !188} -// CHECK:STDOUT: !240 = distinct !DISubprogram(name: "C", linkageName: "_CC.Main.4d6ceefeb7f772f4", scope: null, file: !4, line: 41, type: !59, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !254) -// CHECK:STDOUT: !241 = !DILocalVariable(arg: 1, scope: !240, type: !6) -// CHECK:STDOUT: !242 = !DILocalVariable(arg: 2, scope: !240, type: !6) -// CHECK:STDOUT: !245 = !DILocation(line: 42, column: 7, scope: !240) -// CHECK:STDOUT: !246 = !DILocation(line: 42, column: 6, scope: !240) -// CHECK:STDOUT: !248 = !DILocation(line: 43, column: 5, scope: !240) -// CHECK:STDOUT: !250 = !DILocation(line: 44, column: 10, scope: !240) -// CHECK:STDOUT: !251 = !DILocation(line: 44, column: 5, scope: !240) -// CHECK:STDOUT: !252 = !DILocation(line: 42, column: 3, scope: !240) -// CHECK:STDOUT: !253 = !DILocation(line: 41, column: 1, scope: !240) -// CHECK:STDOUT: !254 = !{!241, !242} -// CHECK:STDOUT: !255 = distinct !DISubprogram(name: "E", linkageName: "_CE.Main.4d6ceefeb7f772f4", scope: null, file: !4, line: 61, type: !30, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !266) -// CHECK:STDOUT: !256 = !DILocalVariable(arg: 1, scope: !255, type: !6) -// CHECK:STDOUT: !257 = !DILocalVariable(arg: 2, scope: !255, type: !6) -// CHECK:STDOUT: !264 = !DILocation(line: 62, column: 10, scope: !255) -// CHECK:STDOUT: !265 = !DILocation(line: 62, column: 3, scope: !255) -// CHECK:STDOUT: !266 = !{!256, !257} -// CHECK:STDOUT: !267 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.4d6ceefeb7f772f4", scope: null, file: !4, line: 65, type: !30, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !278) -// CHECK:STDOUT: !268 = !DILocalVariable(arg: 1, scope: !267, type: !6) -// CHECK:STDOUT: !269 = !DILocalVariable(arg: 2, scope: !267, type: !6) -// CHECK:STDOUT: !276 = !DILocation(line: 66, column: 10, scope: !267) -// CHECK:STDOUT: !277 = !DILocation(line: 66, column: 3, scope: !267) -// CHECK:STDOUT: !278 = !{!268, !269} -// CHECK:STDOUT: !279 = distinct !DISubprogram(name: "C", linkageName: "_CC.Main.c5e4ba542a56b71f", scope: null, file: !4, line: 41, type: !76, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !293) -// CHECK:STDOUT: !280 = !DILocalVariable(arg: 1, scope: !279, type: !9) +// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.7945ecba5c505fc0:core.Destroy.Core", scope: null, file: !4, line: 76, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !51) +// CHECK:STDOUT: !49 = !DILocalVariable(arg: 1, scope: !48, type: !9) +// CHECK:STDOUT: !50 = !DILocation(line: 76, column: 3, scope: !48) +// CHECK:STDOUT: !51 = !{!49} +// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.dc14d4dd21801791:core.Destroy.Core", scope: null, file: !4, line: 76, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !55) +// CHECK:STDOUT: !53 = !DILocalVariable(arg: 1, scope: !52, type: !9) +// CHECK:STDOUT: !54 = !DILocation(line: 76, column: 3, scope: !52) +// CHECK:STDOUT: !55 = !{!53} +// CHECK:STDOUT: !56 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.dc14d4dd21801791:core.Destroy.Core", scope: null, file: !4, line: 76, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !59) +// CHECK:STDOUT: !57 = !DILocalVariable(arg: 1, scope: !56, type: !9) +// CHECK:STDOUT: !58 = !DILocation(line: 76, column: 3, scope: !56) +// CHECK:STDOUT: !59 = !{!57} +// CHECK:STDOUT: !60 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !4, line: 75, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !63) +// CHECK:STDOUT: !61 = !DILocalVariable(arg: 1, scope: !60, type: !6) +// CHECK:STDOUT: !62 = !DILocation(line: 75, column: 3, scope: !60) +// CHECK:STDOUT: !63 = !{!61} +// CHECK:STDOUT: !64 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 75, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !67) +// CHECK:STDOUT: !65 = !DILocalVariable(arg: 1, scope: !64, type: !6) +// CHECK:STDOUT: !66 = !DILocation(line: 75, column: 3, scope: !64) +// CHECK:STDOUT: !67 = !{!65} +// CHECK:STDOUT: !68 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 75, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !71) +// CHECK:STDOUT: !69 = !DILocalVariable(arg: 1, scope: !68, type: !6) +// CHECK:STDOUT: !70 = !DILocation(line: 75, column: 3, scope: !68) +// CHECK:STDOUT: !71 = !{!69} +// CHECK:STDOUT: !72 = distinct !DISubprogram(name: "A", linkageName: "_CA.Main.4d6ceefeb7f772f4", scope: null, file: !4, line: 32, type: !30, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !88) +// CHECK:STDOUT: !73 = !DILocalVariable(arg: 1, scope: !72, type: !6) +// CHECK:STDOUT: !74 = !DILocalVariable(arg: 2, scope: !72, type: !6) +// CHECK:STDOUT: !81 = !DILocation(line: 33, column: 3, scope: !72) +// CHECK:STDOUT: !82 = !{null, !6, !6} +// CHECK:STDOUT: !83 = !DISubroutineType(types: !82) +// CHECK:STDOUT: !86 = !DILocation(line: 34, column: 10, scope: !72) +// CHECK:STDOUT: !87 = !DILocation(line: 34, column: 3, scope: !72) +// CHECK:STDOUT: !88 = !{!73, !74} +// CHECK:STDOUT: !89 = distinct !DISubprogram(name: "A", linkageName: "_CA.Main.c5e4ba542a56b71f", scope: null, file: !4, line: 32, type: !34, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !105) +// CHECK:STDOUT: !90 = !DILocalVariable(arg: 1, scope: !89, type: !9) +// CHECK:STDOUT: !91 = !DILocalVariable(arg: 2, scope: !89, type: !6) +// CHECK:STDOUT: !98 = !DILocation(line: 33, column: 3, scope: !89) +// CHECK:STDOUT: !99 = !{null, !9, !6} +// CHECK:STDOUT: !100 = !DISubroutineType(types: !99) +// CHECK:STDOUT: !103 = !DILocation(line: 34, column: 10, scope: !89) +// CHECK:STDOUT: !104 = !DILocation(line: 34, column: 3, scope: !89) +// CHECK:STDOUT: !105 = !{!90, !91} +// CHECK:STDOUT: !106 = distinct !DISubprogram(name: "A", linkageName: "_CA.Main.a76b78461416b4a8", scope: null, file: !4, line: 32, type: !34, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !120) +// CHECK:STDOUT: !107 = !DILocalVariable(arg: 1, scope: !106, type: !9) +// CHECK:STDOUT: !108 = !DILocalVariable(arg: 2, scope: !106, type: !6) +// CHECK:STDOUT: !115 = !DILocation(line: 33, column: 3, scope: !106) +// CHECK:STDOUT: !118 = !DILocation(line: 34, column: 10, scope: !106) +// CHECK:STDOUT: !119 = !DILocation(line: 34, column: 3, scope: !106) +// CHECK:STDOUT: !120 = !{!107, !108} +// CHECK:STDOUT: !136 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.4d6ceefeb7f772f4", scope: null, file: !4, line: 37, type: !83, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !145) +// CHECK:STDOUT: !137 = !DILocalVariable(arg: 1, scope: !136, type: !6) +// CHECK:STDOUT: !138 = !DILocalVariable(arg: 2, scope: !136, type: !6) +// CHECK:STDOUT: !143 = !DILocation(line: 38, column: 3, scope: !136) +// CHECK:STDOUT: !144 = !DILocation(line: 37, column: 1, scope: !136) +// CHECK:STDOUT: !145 = !{!137, !138} +// CHECK:STDOUT: !146 = distinct !DISubprogram(name: "D", linkageName: "_CD.Main.4d6ceefeb7f772f4", scope: null, file: !4, line: 48, type: !30, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !167) +// CHECK:STDOUT: !147 = !DILocalVariable(arg: 1, scope: !146, type: !6) +// CHECK:STDOUT: !148 = !DILocalVariable(arg: 2, scope: !146, type: !6) +// CHECK:STDOUT: !153 = !DILocation(line: 49, column: 7, scope: !146) +// CHECK:STDOUT: !154 = !DILocation(line: 49, column: 6, scope: !146) +// CHECK:STDOUT: !156 = !DILocation(line: 50, column: 5, scope: !146) +// CHECK:STDOUT: !157 = !DILocation(line: 52, column: 7, scope: !146) +// CHECK:STDOUT: !158 = !DILocation(line: 52, column: 6, scope: !146) +// CHECK:STDOUT: !161 = !DILocation(line: 53, column: 12, scope: !146) +// CHECK:STDOUT: !162 = !DILocation(line: 53, column: 5, scope: !146) +// CHECK:STDOUT: !165 = !DILocation(line: 55, column: 12, scope: !146) +// CHECK:STDOUT: !166 = !DILocation(line: 55, column: 5, scope: !146) +// CHECK:STDOUT: !167 = !{!147, !148} +// CHECK:STDOUT: !168 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.c5e4ba542a56b71f", scope: null, file: !4, line: 37, type: !100, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !177) +// CHECK:STDOUT: !169 = !DILocalVariable(arg: 1, scope: !168, type: !9) +// CHECK:STDOUT: !170 = !DILocalVariable(arg: 2, scope: !168, type: !6) +// CHECK:STDOUT: !175 = !DILocation(line: 38, column: 3, scope: !168) +// CHECK:STDOUT: !176 = !DILocation(line: 37, column: 1, scope: !168) +// CHECK:STDOUT: !177 = !{!169, !170} +// CHECK:STDOUT: !178 = distinct !DISubprogram(name: "D", linkageName: "_CD.Main.c5e4ba542a56b71f", scope: null, file: !4, line: 48, type: !34, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !199) +// CHECK:STDOUT: !179 = !DILocalVariable(arg: 1, scope: !178, type: !9) +// CHECK:STDOUT: !180 = !DILocalVariable(arg: 2, scope: !178, type: !6) +// CHECK:STDOUT: !185 = !DILocation(line: 49, column: 7, scope: !178) +// CHECK:STDOUT: !186 = !DILocation(line: 49, column: 6, scope: !178) +// CHECK:STDOUT: !188 = !DILocation(line: 50, column: 5, scope: !178) +// CHECK:STDOUT: !189 = !DILocation(line: 52, column: 7, scope: !178) +// CHECK:STDOUT: !190 = !DILocation(line: 52, column: 6, scope: !178) +// CHECK:STDOUT: !193 = !DILocation(line: 53, column: 12, scope: !178) +// CHECK:STDOUT: !194 = !DILocation(line: 53, column: 5, scope: !178) +// CHECK:STDOUT: !197 = !DILocation(line: 55, column: 12, scope: !178) +// CHECK:STDOUT: !198 = !DILocation(line: 55, column: 5, scope: !178) +// CHECK:STDOUT: !199 = !{!179, !180} +// CHECK:STDOUT: !200 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.a76b78461416b4a8", scope: null, file: !4, line: 37, type: !100, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !209) +// CHECK:STDOUT: !201 = !DILocalVariable(arg: 1, scope: !200, type: !9) +// CHECK:STDOUT: !202 = !DILocalVariable(arg: 2, scope: !200, type: !6) +// CHECK:STDOUT: !207 = !DILocation(line: 38, column: 3, scope: !200) +// CHECK:STDOUT: !208 = !DILocation(line: 37, column: 1, scope: !200) +// CHECK:STDOUT: !209 = !{!201, !202} +// CHECK:STDOUT: !210 = distinct !DISubprogram(name: "D", linkageName: "_CD.Main.a76b78461416b4a8", scope: null, file: !4, line: 48, type: !34, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !231) +// CHECK:STDOUT: !211 = !DILocalVariable(arg: 1, scope: !210, type: !9) +// CHECK:STDOUT: !212 = !DILocalVariable(arg: 2, scope: !210, type: !6) +// CHECK:STDOUT: !217 = !DILocation(line: 49, column: 7, scope: !210) +// CHECK:STDOUT: !218 = !DILocation(line: 49, column: 6, scope: !210) +// CHECK:STDOUT: !220 = !DILocation(line: 50, column: 5, scope: !210) +// CHECK:STDOUT: !221 = !DILocation(line: 52, column: 7, scope: !210) +// CHECK:STDOUT: !222 = !DILocation(line: 52, column: 6, scope: !210) +// CHECK:STDOUT: !225 = !DILocation(line: 53, column: 12, scope: !210) +// CHECK:STDOUT: !226 = !DILocation(line: 53, column: 5, scope: !210) +// CHECK:STDOUT: !229 = !DILocation(line: 55, column: 12, scope: !210) +// CHECK:STDOUT: !230 = !DILocation(line: 55, column: 5, scope: !210) +// CHECK:STDOUT: !231 = !{!211, !212} +// CHECK:STDOUT: !264 = distinct !DISubprogram(name: "C", linkageName: "_CC.Main.4d6ceefeb7f772f4", scope: null, file: !4, line: 41, type: !83, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !278) +// CHECK:STDOUT: !265 = !DILocalVariable(arg: 1, scope: !264, type: !6) +// CHECK:STDOUT: !266 = !DILocalVariable(arg: 2, scope: !264, type: !6) +// CHECK:STDOUT: !269 = !DILocation(line: 42, column: 7, scope: !264) +// CHECK:STDOUT: !270 = !DILocation(line: 42, column: 6, scope: !264) +// CHECK:STDOUT: !272 = !DILocation(line: 43, column: 5, scope: !264) +// CHECK:STDOUT: !274 = !DILocation(line: 44, column: 10, scope: !264) +// CHECK:STDOUT: !275 = !DILocation(line: 44, column: 5, scope: !264) +// CHECK:STDOUT: !276 = !DILocation(line: 42, column: 3, scope: !264) +// CHECK:STDOUT: !277 = !DILocation(line: 41, column: 1, scope: !264) +// CHECK:STDOUT: !278 = !{!265, !266} +// CHECK:STDOUT: !279 = distinct !DISubprogram(name: "E", linkageName: "_CE.Main.4d6ceefeb7f772f4", scope: null, file: !4, line: 61, type: !30, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !290) +// CHECK:STDOUT: !280 = !DILocalVariable(arg: 1, scope: !279, type: !6) // CHECK:STDOUT: !281 = !DILocalVariable(arg: 2, scope: !279, type: !6) -// CHECK:STDOUT: !284 = !DILocation(line: 42, column: 7, scope: !279) -// CHECK:STDOUT: !285 = !DILocation(line: 42, column: 6, scope: !279) -// CHECK:STDOUT: !287 = !DILocation(line: 43, column: 5, scope: !279) -// CHECK:STDOUT: !289 = !DILocation(line: 44, column: 10, scope: !279) -// CHECK:STDOUT: !290 = !DILocation(line: 44, column: 5, scope: !279) -// CHECK:STDOUT: !291 = !DILocation(line: 42, column: 3, scope: !279) -// CHECK:STDOUT: !292 = !DILocation(line: 41, column: 1, scope: !279) -// CHECK:STDOUT: !293 = !{!280, !281} -// CHECK:STDOUT: !294 = distinct !DISubprogram(name: "E", linkageName: "_CE.Main.c5e4ba542a56b71f", scope: null, file: !4, line: 61, type: !34, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !305) -// CHECK:STDOUT: !295 = !DILocalVariable(arg: 1, scope: !294, type: !9) -// CHECK:STDOUT: !296 = !DILocalVariable(arg: 2, scope: !294, type: !6) -// CHECK:STDOUT: !303 = !DILocation(line: 62, column: 10, scope: !294) -// CHECK:STDOUT: !304 = !DILocation(line: 62, column: 3, scope: !294) -// CHECK:STDOUT: !305 = !{!295, !296} -// CHECK:STDOUT: !306 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.c5e4ba542a56b71f", scope: null, file: !4, line: 65, type: !34, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !317) -// CHECK:STDOUT: !307 = !DILocalVariable(arg: 1, scope: !306, type: !9) -// CHECK:STDOUT: !308 = !DILocalVariable(arg: 2, scope: !306, type: !6) -// CHECK:STDOUT: !315 = !DILocation(line: 66, column: 10, scope: !306) -// CHECK:STDOUT: !316 = !DILocation(line: 66, column: 3, scope: !306) -// CHECK:STDOUT: !317 = !{!307, !308} -// CHECK:STDOUT: !318 = distinct !DISubprogram(name: "C", linkageName: "_CC.Main.a76b78461416b4a8", scope: null, file: !4, line: 41, type: !76, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !332) +// CHECK:STDOUT: !288 = !DILocation(line: 62, column: 10, scope: !279) +// CHECK:STDOUT: !289 = !DILocation(line: 62, column: 3, scope: !279) +// CHECK:STDOUT: !290 = !{!280, !281} +// CHECK:STDOUT: !291 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.4d6ceefeb7f772f4", scope: null, file: !4, line: 65, type: !30, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !302) +// CHECK:STDOUT: !292 = !DILocalVariable(arg: 1, scope: !291, type: !6) +// CHECK:STDOUT: !293 = !DILocalVariable(arg: 2, scope: !291, type: !6) +// CHECK:STDOUT: !300 = !DILocation(line: 66, column: 10, scope: !291) +// CHECK:STDOUT: !301 = !DILocation(line: 66, column: 3, scope: !291) +// CHECK:STDOUT: !302 = !{!292, !293} +// CHECK:STDOUT: !303 = distinct !DISubprogram(name: "C", linkageName: "_CC.Main.c5e4ba542a56b71f", scope: null, file: !4, line: 41, type: !100, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !317) +// CHECK:STDOUT: !304 = !DILocalVariable(arg: 1, scope: !303, type: !9) +// CHECK:STDOUT: !305 = !DILocalVariable(arg: 2, scope: !303, type: !6) +// CHECK:STDOUT: !308 = !DILocation(line: 42, column: 7, scope: !303) +// CHECK:STDOUT: !309 = !DILocation(line: 42, column: 6, scope: !303) +// CHECK:STDOUT: !311 = !DILocation(line: 43, column: 5, scope: !303) +// CHECK:STDOUT: !313 = !DILocation(line: 44, column: 10, scope: !303) +// CHECK:STDOUT: !314 = !DILocation(line: 44, column: 5, scope: !303) +// CHECK:STDOUT: !315 = !DILocation(line: 42, column: 3, scope: !303) +// CHECK:STDOUT: !316 = !DILocation(line: 41, column: 1, scope: !303) +// CHECK:STDOUT: !317 = !{!304, !305} +// CHECK:STDOUT: !318 = distinct !DISubprogram(name: "E", linkageName: "_CE.Main.c5e4ba542a56b71f", scope: null, file: !4, line: 61, type: !34, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !329) // CHECK:STDOUT: !319 = !DILocalVariable(arg: 1, scope: !318, type: !9) // CHECK:STDOUT: !320 = !DILocalVariable(arg: 2, scope: !318, type: !6) -// CHECK:STDOUT: !323 = !DILocation(line: 42, column: 7, scope: !318) -// CHECK:STDOUT: !324 = !DILocation(line: 42, column: 6, scope: !318) -// CHECK:STDOUT: !326 = !DILocation(line: 43, column: 5, scope: !318) -// CHECK:STDOUT: !328 = !DILocation(line: 44, column: 10, scope: !318) -// CHECK:STDOUT: !329 = !DILocation(line: 44, column: 5, scope: !318) -// CHECK:STDOUT: !330 = !DILocation(line: 42, column: 3, scope: !318) -// CHECK:STDOUT: !331 = !DILocation(line: 41, column: 1, scope: !318) -// CHECK:STDOUT: !332 = !{!319, !320} -// CHECK:STDOUT: !333 = distinct !DISubprogram(name: "E", linkageName: "_CE.Main.a76b78461416b4a8", scope: null, file: !4, line: 61, type: !34, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !344) -// CHECK:STDOUT: !334 = !DILocalVariable(arg: 1, scope: !333, type: !9) -// CHECK:STDOUT: !335 = !DILocalVariable(arg: 2, scope: !333, type: !6) -// CHECK:STDOUT: !342 = !DILocation(line: 62, column: 10, scope: !333) -// CHECK:STDOUT: !343 = !DILocation(line: 62, column: 3, scope: !333) -// CHECK:STDOUT: !344 = !{!334, !335} -// CHECK:STDOUT: !345 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.a76b78461416b4a8", scope: null, file: !4, line: 65, type: !34, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !356) -// CHECK:STDOUT: !346 = !DILocalVariable(arg: 1, scope: !345, type: !9) -// CHECK:STDOUT: !347 = !DILocalVariable(arg: 2, scope: !345, type: !6) -// CHECK:STDOUT: !354 = !DILocation(line: 66, column: 10, scope: !345) -// CHECK:STDOUT: !355 = !DILocation(line: 66, column: 3, scope: !345) -// CHECK:STDOUT: !356 = !{!346, !347} -// CHECK:STDOUT: !396 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.4d6ceefeb7f772f4", scope: null, file: !4, line: 69, type: !30, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !407) -// CHECK:STDOUT: !397 = !DILocalVariable(arg: 1, scope: !396, type: !6) -// CHECK:STDOUT: !398 = !DILocalVariable(arg: 2, scope: !396, type: !6) -// CHECK:STDOUT: !404 = !DILocation(line: 70, column: 15, scope: !396) -// CHECK:STDOUT: !405 = !DILocation(line: 70, column: 10, scope: !396) -// CHECK:STDOUT: !406 = !DILocation(line: 70, column: 3, scope: !396) -// CHECK:STDOUT: !407 = !{!397, !398} -// CHECK:STDOUT: !408 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.c5e4ba542a56b71f", scope: null, file: !4, line: 69, type: !34, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !419) -// CHECK:STDOUT: !409 = !DILocalVariable(arg: 1, scope: !408, type: !9) -// CHECK:STDOUT: !410 = !DILocalVariable(arg: 2, scope: !408, type: !6) -// CHECK:STDOUT: !416 = !DILocation(line: 70, column: 15, scope: !408) -// CHECK:STDOUT: !417 = !DILocation(line: 70, column: 10, scope: !408) -// CHECK:STDOUT: !418 = !DILocation(line: 70, column: 3, scope: !408) -// CHECK:STDOUT: !419 = !{!409, !410} -// CHECK:STDOUT: !420 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.a76b78461416b4a8", scope: null, file: !4, line: 69, type: !34, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !431) -// CHECK:STDOUT: !421 = !DILocalVariable(arg: 1, scope: !420, type: !9) +// CHECK:STDOUT: !327 = !DILocation(line: 62, column: 10, scope: !318) +// CHECK:STDOUT: !328 = !DILocation(line: 62, column: 3, scope: !318) +// CHECK:STDOUT: !329 = !{!319, !320} +// CHECK:STDOUT: !330 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.c5e4ba542a56b71f", scope: null, file: !4, line: 65, type: !34, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !341) +// CHECK:STDOUT: !331 = !DILocalVariable(arg: 1, scope: !330, type: !9) +// CHECK:STDOUT: !332 = !DILocalVariable(arg: 2, scope: !330, type: !6) +// CHECK:STDOUT: !339 = !DILocation(line: 66, column: 10, scope: !330) +// CHECK:STDOUT: !340 = !DILocation(line: 66, column: 3, scope: !330) +// CHECK:STDOUT: !341 = !{!331, !332} +// CHECK:STDOUT: !342 = distinct !DISubprogram(name: "C", linkageName: "_CC.Main.a76b78461416b4a8", scope: null, file: !4, line: 41, type: !100, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !356) +// CHECK:STDOUT: !343 = !DILocalVariable(arg: 1, scope: !342, type: !9) +// CHECK:STDOUT: !344 = !DILocalVariable(arg: 2, scope: !342, type: !6) +// CHECK:STDOUT: !347 = !DILocation(line: 42, column: 7, scope: !342) +// CHECK:STDOUT: !348 = !DILocation(line: 42, column: 6, scope: !342) +// CHECK:STDOUT: !350 = !DILocation(line: 43, column: 5, scope: !342) +// CHECK:STDOUT: !352 = !DILocation(line: 44, column: 10, scope: !342) +// CHECK:STDOUT: !353 = !DILocation(line: 44, column: 5, scope: !342) +// CHECK:STDOUT: !354 = !DILocation(line: 42, column: 3, scope: !342) +// CHECK:STDOUT: !355 = !DILocation(line: 41, column: 1, scope: !342) +// CHECK:STDOUT: !356 = !{!343, !344} +// CHECK:STDOUT: !357 = distinct !DISubprogram(name: "E", linkageName: "_CE.Main.a76b78461416b4a8", scope: null, file: !4, line: 61, type: !34, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !368) +// CHECK:STDOUT: !358 = !DILocalVariable(arg: 1, scope: !357, type: !9) +// CHECK:STDOUT: !359 = !DILocalVariable(arg: 2, scope: !357, type: !6) +// CHECK:STDOUT: !366 = !DILocation(line: 62, column: 10, scope: !357) +// CHECK:STDOUT: !367 = !DILocation(line: 62, column: 3, scope: !357) +// CHECK:STDOUT: !368 = !{!358, !359} +// CHECK:STDOUT: !369 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.a76b78461416b4a8", scope: null, file: !4, line: 65, type: !34, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !380) +// CHECK:STDOUT: !370 = !DILocalVariable(arg: 1, scope: !369, type: !9) +// CHECK:STDOUT: !371 = !DILocalVariable(arg: 2, scope: !369, type: !6) +// CHECK:STDOUT: !378 = !DILocation(line: 66, column: 10, scope: !369) +// CHECK:STDOUT: !379 = !DILocation(line: 66, column: 3, scope: !369) +// CHECK:STDOUT: !380 = !{!370, !371} +// CHECK:STDOUT: !420 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.4d6ceefeb7f772f4", scope: null, file: !4, line: 69, type: !30, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !431) +// CHECK:STDOUT: !421 = !DILocalVariable(arg: 1, scope: !420, type: !6) // CHECK:STDOUT: !422 = !DILocalVariable(arg: 2, scope: !420, type: !6) // CHECK:STDOUT: !428 = !DILocation(line: 70, column: 15, scope: !420) // CHECK:STDOUT: !429 = !DILocation(line: 70, column: 10, scope: !420) // CHECK:STDOUT: !430 = !DILocation(line: 70, column: 3, scope: !420) // CHECK:STDOUT: !431 = !{!421, !422} +// CHECK:STDOUT: !432 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.c5e4ba542a56b71f", scope: null, file: !4, line: 69, type: !34, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !443) +// CHECK:STDOUT: !433 = !DILocalVariable(arg: 1, scope: !432, type: !9) +// CHECK:STDOUT: !434 = !DILocalVariable(arg: 2, scope: !432, type: !6) +// CHECK:STDOUT: !440 = !DILocation(line: 70, column: 15, scope: !432) +// CHECK:STDOUT: !441 = !DILocation(line: 70, column: 10, scope: !432) +// CHECK:STDOUT: !442 = !DILocation(line: 70, column: 3, scope: !432) +// CHECK:STDOUT: !443 = !{!433, !434} +// CHECK:STDOUT: !444 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.a76b78461416b4a8", scope: null, file: !4, line: 69, type: !34, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !455) +// CHECK:STDOUT: !445 = !DILocalVariable(arg: 1, scope: !444, type: !9) +// CHECK:STDOUT: !446 = !DILocalVariable(arg: 2, scope: !444, type: !6) +// CHECK:STDOUT: !452 = !DILocation(line: 70, column: 15, scope: !444) +// CHECK:STDOUT: !453 = !DILocation(line: 70, column: 10, scope: !444) +// CHECK:STDOUT: !454 = !DILocation(line: 70, column: 3, scope: !444) +// CHECK:STDOUT: !455 = !{!445, !446} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/function/generic/call_specific_in_class.carbon b/toolchain/lower/testdata/function/generic/call_specific_in_class.carbon index 784e24c2ae95..6efb5db569be 100644 --- a/toolchain/lower/testdata/function/generic/call_specific_in_class.carbon +++ b/toolchain/lower/testdata/function/generic/call_specific_in_class.carbon @@ -51,153 +51,213 @@ fn M() { // CHECK:STDOUT: %type.26 = type {} // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !42 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %self) #0 !dbg !42 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !44 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CM.Main() #0 !dbg !46 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !46 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %ptr_i32.var = alloca ptr, align 8, !dbg !47 -// CHECK:STDOUT: %ptr_f64.var = alloca ptr, align 8, !dbg !53 -// CHECK:STDOUT: %ptr_i8.var = alloca ptr, align 8, !dbg !57 -// CHECK:STDOUT: %var_i32.var = alloca i32, align 4, !dbg !61 -// CHECK:STDOUT: %var_f64.var = alloca double, align 8, !dbg !67 -// CHECK:STDOUT: %_.var = alloca {}, align 1, !dbg !71 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %ptr_i32.var), !dbg !47 -// CHECK:STDOUT: store ptr poison, ptr %ptr_i32.var, align 8, !dbg !47 -// CHECK:STDOUT: %.loc34_5 = load ptr, ptr %ptr_i32.var, align 8, !dbg !49 -// CHECK:STDOUT: %F.call.loc34 = call ptr @_CF.Main.a76b78461416b4a8(ptr %.loc34_5), !dbg !50 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %ptr_f64.var), !dbg !53 -// CHECK:STDOUT: store ptr poison, ptr %ptr_f64.var, align 8, !dbg !53 -// CHECK:STDOUT: %.loc36_5 = load ptr, ptr %ptr_f64.var, align 8, !dbg !55 -// CHECK:STDOUT: %F.call.loc36 = call ptr @_CF.Main.a76b78461416b4a8(ptr %.loc36_5), !dbg !56 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %ptr_i8.var), !dbg !57 -// CHECK:STDOUT: store ptr poison, ptr %ptr_i8.var, align 8, !dbg !57 -// CHECK:STDOUT: %.loc38_5 = load ptr, ptr %ptr_i8.var, align 8, !dbg !59 -// CHECK:STDOUT: %F.call.loc38 = call ptr @_CF.Main.a76b78461416b4a8(ptr %.loc38_5), !dbg !60 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %var_i32.var), !dbg !61 -// CHECK:STDOUT: store i32 0, ptr %var_i32.var, align 4, !dbg !61 -// CHECK:STDOUT: %.loc40_5 = load i32, ptr %var_i32.var, align 4, !dbg !63 -// CHECK:STDOUT: %F.call.loc40 = call i32 @_CF.Main.4d6ceefeb7f772f4(i32 %.loc40_5), !dbg !64 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %var_f64.var), !dbg !67 -// CHECK:STDOUT: store double 0.000000e+00, ptr %var_f64.var, align 8, !dbg !67 -// CHECK:STDOUT: %.loc42_5 = load double, ptr %var_f64.var, align 8, !dbg !69 -// CHECK:STDOUT: %F.call.loc42 = call double @_CF.Main.c5e4ba542a56b71f(double %.loc42_5), !dbg !70 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !71 -// CHECK:STDOUT: %F.call.loc44 = call %type.26 @_CF.Main.c3359c2c217ad593(%type.26 zeroinitializer), !dbg !73 -// CHECK:STDOUT: call void @"_COp.08d9e38b928ba575:core.Destroy.Core"(ptr %_.var), !dbg !71 -// CHECK:STDOUT: call void @"_COp.dc14d4dd21801791:core.Destroy.Core"(ptr %var_f64.var), !dbg !67 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %var_i32.var), !dbg !61 -// CHECK:STDOUT: ret void, !dbg !74 +// CHECK:STDOUT: ret void, !dbg !48 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.dc14d4dd21801791:core.Destroy.Core"(ptr %self) #0 !dbg !75 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !50 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !77 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core"(ptr %self), !dbg !52 +// CHECK:STDOUT: ret void, !dbg !52 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !79 { +// CHECK:STDOUT: define void @_CM.Main() #0 !dbg !54 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !81 +// CHECK:STDOUT: %ptr_i32.var = alloca ptr, align 8, !dbg !55 +// CHECK:STDOUT: %ptr_f64.var = alloca ptr, align 8, !dbg !61 +// CHECK:STDOUT: %ptr_i8.var = alloca ptr, align 8, !dbg !65 +// CHECK:STDOUT: %var_i32.var = alloca i32, align 4, !dbg !69 +// CHECK:STDOUT: %var_f64.var = alloca double, align 8, !dbg !75 +// CHECK:STDOUT: %_.var = alloca {}, align 1, !dbg !79 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %ptr_i32.var), !dbg !55 +// CHECK:STDOUT: store ptr poison, ptr %ptr_i32.var, align 8, !dbg !55 +// CHECK:STDOUT: %.loc34_5 = load ptr, ptr %ptr_i32.var, align 8, !dbg !57 +// CHECK:STDOUT: %F.call.loc34 = call ptr @_CF.Main.a76b78461416b4a8(ptr %.loc34_5), !dbg !58 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %ptr_f64.var), !dbg !61 +// CHECK:STDOUT: store ptr poison, ptr %ptr_f64.var, align 8, !dbg !61 +// CHECK:STDOUT: %.loc36_5 = load ptr, ptr %ptr_f64.var, align 8, !dbg !63 +// CHECK:STDOUT: %F.call.loc36 = call ptr @_CF.Main.a76b78461416b4a8(ptr %.loc36_5), !dbg !64 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %ptr_i8.var), !dbg !65 +// CHECK:STDOUT: store ptr poison, ptr %ptr_i8.var, align 8, !dbg !65 +// CHECK:STDOUT: %.loc38_5 = load ptr, ptr %ptr_i8.var, align 8, !dbg !67 +// CHECK:STDOUT: %F.call.loc38 = call ptr @_CF.Main.a76b78461416b4a8(ptr %.loc38_5), !dbg !68 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %var_i32.var), !dbg !69 +// CHECK:STDOUT: store i32 0, ptr %var_i32.var, align 4, !dbg !69 +// CHECK:STDOUT: %.loc40_5 = load i32, ptr %var_i32.var, align 4, !dbg !71 +// CHECK:STDOUT: %F.call.loc40 = call i32 @_CF.Main.4d6ceefeb7f772f4(i32 %.loc40_5), !dbg !72 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %var_f64.var), !dbg !75 +// CHECK:STDOUT: store double 0.000000e+00, ptr %var_f64.var, align 8, !dbg !75 +// CHECK:STDOUT: %.loc42_5 = load double, ptr %var_f64.var, align 8, !dbg !77 +// CHECK:STDOUT: %F.call.loc42 = call double @_CF.Main.c5e4ba542a56b71f(double %.loc42_5), !dbg !78 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !79 +// CHECK:STDOUT: %F.call.loc44 = call %type.26 @_CF.Main.c3359c2c217ad593(%type.26 zeroinitializer), !dbg !81 +// CHECK:STDOUT: call void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr %_.var), !dbg !79 +// CHECK:STDOUT: call void @"_CSelfDestruct.dc14d4dd21801791:core.Destroy.Core"(ptr %var_f64.var), !dbg !75 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %var_i32.var), !dbg !69 +// CHECK:STDOUT: call void @"_CSelfDestruct.de57ff04fd84f9c8:core.Destroy.Core"(ptr %ptr_i8.var), !dbg !65 +// CHECK:STDOUT: call void @"_CSelfDestruct.749b51755634ad17:core.Destroy.Core"(ptr %ptr_f64.var), !dbg !61 +// CHECK:STDOUT: call void @"_CSelfDestruct.d088c7eb746488be:core.Destroy.Core"(ptr %ptr_i32.var), !dbg !55 +// CHECK:STDOUT: ret void, !dbg !82 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.7945ecba5c505fc0:core.Destroy.Core"(ptr %self) #0 !dbg !83 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !85 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.dc14d4dd21801791:core.Destroy.Core"(ptr %self) #0 !dbg !87 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !89 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.dc14d4dd21801791:core.Destroy.Core"(ptr %self) #0 !dbg !91 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.dc14d4dd21801791:core.Destroy.Core"(ptr %self), !dbg !93 +// CHECK:STDOUT: ret void, !dbg !93 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !95 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !97 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !99 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !101 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !103 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !105 +// CHECK:STDOUT: ret void, !dbg !105 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.de57ff04fd84f9c8:core.Destroy.Core"(ptr %self) #0 !dbg !107 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !109 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.749b51755634ad17:core.Destroy.Core"(ptr %self) #0 !dbg !111 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !113 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.d088c7eb746488be:core.Destroy.Core"(ptr %self) #0 !dbg !115 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !117 // 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 ptr @_CF.Main.a76b78461416b4a8(ptr %x) #0 !dbg !83 { +// CHECK:STDOUT: define linkonce_odr ptr @_CF.Main.a76b78461416b4a8(ptr %x) #0 !dbg !119 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %G.call = call ptr @_CG.Main.a76b78461416b4a8(ptr %x), !dbg !89 -// CHECK:STDOUT: ret ptr %G.call, !dbg !90 +// CHECK:STDOUT: %G.call = call ptr @_CG.Main.a76b78461416b4a8(ptr %x), !dbg !125 +// CHECK:STDOUT: ret ptr %G.call, !dbg !126 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CF.Main.4d6ceefeb7f772f4(i32 %x) #0 !dbg !110 { +// CHECK:STDOUT: define linkonce_odr i32 @_CF.Main.4d6ceefeb7f772f4(i32 %x) #0 !dbg !146 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %G.call = call i32 @_CG.Main.4d6ceefeb7f772f4(i32 %x), !dbg !116 -// CHECK:STDOUT: ret i32 %G.call, !dbg !117 +// CHECK:STDOUT: %G.call = call i32 @_CG.Main.4d6ceefeb7f772f4(i32 %x), !dbg !152 +// CHECK:STDOUT: ret i32 %G.call, !dbg !153 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr double @_CF.Main.c5e4ba542a56b71f(double %x) #0 !dbg !119 { +// CHECK:STDOUT: define linkonce_odr double @_CF.Main.c5e4ba542a56b71f(double %x) #0 !dbg !155 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %G.call = call double @_CG.Main.c5e4ba542a56b71f(double %x), !dbg !125 -// CHECK:STDOUT: ret double %G.call, !dbg !126 +// CHECK:STDOUT: %G.call = call double @_CG.Main.c5e4ba542a56b71f(double %x), !dbg !161 +// CHECK:STDOUT: ret double %G.call, !dbg !162 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr %type.26 @_CF.Main.c3359c2c217ad593(%type.26 %x) #0 !dbg !128 { +// CHECK:STDOUT: define linkonce_odr %type.26 @_CF.Main.c3359c2c217ad593(%type.26 %x) #0 !dbg !164 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %G.call = call %type.26 @_CG.Main.c3359c2c217ad593(%type.26 %x), !dbg !134 -// CHECK:STDOUT: ret %type.26 %G.call, !dbg !135 +// CHECK:STDOUT: %G.call = call %type.26 @_CG.Main.c3359c2c217ad593(%type.26 %x), !dbg !170 +// CHECK:STDOUT: ret %type.26 %G.call, !dbg !171 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CG.Main.a76b78461416b4a8(ptr %x) #0 !dbg !137 { +// CHECK:STDOUT: define linkonce_odr ptr @_CG.Main.a76b78461416b4a8(ptr %x) #0 !dbg !173 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %c.var = alloca {}, align 1, !dbg !142 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !142 -// CHECK:STDOUT: %C.Cfn.call = call ptr @_CCfn.C.Main.a76b78461416b4a8(ptr %c.var, ptr %x), !dbg !144 -// CHECK:STDOUT: call void @"_COp.08d9e38b928ba575:core.Destroy.Core"(ptr %c.var), !dbg !142 -// CHECK:STDOUT: ret ptr %C.Cfn.call, !dbg !148 +// CHECK:STDOUT: %c.var = alloca {}, align 1, !dbg !178 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !178 +// CHECK:STDOUT: %C.Cfn.call = call ptr @_CCfn.C.Main.a76b78461416b4a8(ptr %c.var, ptr %x), !dbg !180 +// CHECK:STDOUT: call void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr %c.var), !dbg !178 +// CHECK:STDOUT: ret ptr %C.Cfn.call, !dbg !184 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CG.Main.4d6ceefeb7f772f4(i32 %x) #0 !dbg !172 { +// CHECK:STDOUT: define linkonce_odr i32 @_CG.Main.4d6ceefeb7f772f4(i32 %x) #0 !dbg !208 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %c.var = alloca {}, align 1, !dbg !177 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !177 -// CHECK:STDOUT: %C.Cfn.call = call i32 @_CCfn.C.Main.4d6ceefeb7f772f4(ptr %c.var, i32 %x), !dbg !179 -// CHECK:STDOUT: call void @"_COp.08d9e38b928ba575:core.Destroy.Core"(ptr %c.var), !dbg !177 -// CHECK:STDOUT: ret i32 %C.Cfn.call, !dbg !183 +// CHECK:STDOUT: %c.var = alloca {}, align 1, !dbg !213 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !213 +// CHECK:STDOUT: %C.Cfn.call = call i32 @_CCfn.C.Main.4d6ceefeb7f772f4(ptr %c.var, i32 %x), !dbg !215 +// CHECK:STDOUT: call void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr %c.var), !dbg !213 +// CHECK:STDOUT: ret i32 %C.Cfn.call, !dbg !219 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr double @_CG.Main.c5e4ba542a56b71f(double %x) #0 !dbg !185 { +// CHECK:STDOUT: define linkonce_odr double @_CG.Main.c5e4ba542a56b71f(double %x) #0 !dbg !221 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %c.var = alloca {}, align 1, !dbg !190 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !190 -// CHECK:STDOUT: %C.Cfn.call = call double @_CCfn.C.Main.c5e4ba542a56b71f(ptr %c.var, double %x), !dbg !192 -// CHECK:STDOUT: call void @"_COp.08d9e38b928ba575:core.Destroy.Core"(ptr %c.var), !dbg !190 -// CHECK:STDOUT: ret double %C.Cfn.call, !dbg !194 +// CHECK:STDOUT: %c.var = alloca {}, align 1, !dbg !226 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !226 +// CHECK:STDOUT: %C.Cfn.call = call double @_CCfn.C.Main.c5e4ba542a56b71f(ptr %c.var, double %x), !dbg !228 +// CHECK:STDOUT: call void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr %c.var), !dbg !226 +// CHECK:STDOUT: ret double %C.Cfn.call, !dbg !230 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr %type.26 @_CG.Main.c3359c2c217ad593(%type.26 %x) #0 !dbg !196 { +// CHECK:STDOUT: define linkonce_odr %type.26 @_CG.Main.c3359c2c217ad593(%type.26 %x) #0 !dbg !232 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %c.var = alloca {}, align 1, !dbg !201 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !201 -// CHECK:STDOUT: %C.Cfn.call = call %type.26 @_CCfn.C.Main.c3359c2c217ad593(ptr %c.var, %type.26 %x), !dbg !203 -// CHECK:STDOUT: call void @"_COp.08d9e38b928ba575:core.Destroy.Core"(ptr %c.var), !dbg !201 -// CHECK:STDOUT: ret %type.26 %C.Cfn.call, !dbg !205 +// CHECK:STDOUT: %c.var = alloca {}, align 1, !dbg !237 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !237 +// CHECK:STDOUT: %C.Cfn.call = call %type.26 @_CCfn.C.Main.c3359c2c217ad593(ptr %c.var, %type.26 %x), !dbg !239 +// CHECK:STDOUT: call void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr %c.var), !dbg !237 +// CHECK:STDOUT: ret %type.26 %C.Cfn.call, !dbg !241 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CCfn.C.Main.a76b78461416b4a8(ptr %self, ptr %x) #0 !dbg !207 { +// CHECK:STDOUT: define linkonce_odr ptr @_CCfn.C.Main.a76b78461416b4a8(ptr %self, ptr %x) #0 !dbg !243 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret ptr %x, !dbg !215 +// CHECK:STDOUT: ret ptr %x, !dbg !251 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CCfn.C.Main.4d6ceefeb7f772f4(ptr %self, i32 %x) #0 !dbg !237 { +// CHECK:STDOUT: define linkonce_odr i32 @_CCfn.C.Main.4d6ceefeb7f772f4(ptr %self, i32 %x) #0 !dbg !273 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret i32 %x, !dbg !245 +// CHECK:STDOUT: ret i32 %x, !dbg !281 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr double @_CCfn.C.Main.c5e4ba542a56b71f(ptr %self, double %x) #0 !dbg !247 { +// CHECK:STDOUT: define linkonce_odr double @_CCfn.C.Main.c5e4ba542a56b71f(ptr %self, double %x) #0 !dbg !283 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret double %x, !dbg !255 +// CHECK:STDOUT: ret double %x, !dbg !291 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr %type.26 @_CCfn.C.Main.c3359c2c217ad593(ptr %self, %type.26 %x) #0 !dbg !257 { +// CHECK:STDOUT: define linkonce_odr %type.26 @_CCfn.C.Main.c3359c2c217ad593(ptr %self, %type.26 %x) #0 !dbg !293 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret %type.26 %x, !dbg !265 +// CHECK:STDOUT: ret %type.26 %x, !dbg !301 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -222,107 +282,143 @@ fn M() { // CHECK:STDOUT: !39 = !DISubroutineType(types: !38) // CHECK:STDOUT: !40 = !{null, !34} // CHECK:STDOUT: !41 = !DISubroutineType(types: !40) -// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "Op", linkageName: "_COp.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !32, line: 24, type: !37, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !45) +// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !32, line: 24, type: !37, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !45) // CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !42, type: !35) // CHECK:STDOUT: !44 = !DILocation(line: 24, column: 3, scope: !42) // CHECK:STDOUT: !45 = !{!43} -// CHECK:STDOUT: !46 = distinct !DISubprogram(name: "M", linkageName: "_CM.Main", scope: null, file: !32, line: 32, type: !39, spFlags: DISPFlagDefinition, unit: !33) -// CHECK:STDOUT: !47 = !DILocation(line: 33, column: 3, scope: !46) -// CHECK:STDOUT: !49 = !DILocation(line: 34, column: 5, scope: !46) -// CHECK:STDOUT: !50 = !DILocation(line: 34, column: 3, scope: !46) -// CHECK:STDOUT: !51 = !{!35, !35} -// CHECK:STDOUT: !52 = !DISubroutineType(types: !51) -// CHECK:STDOUT: !53 = !DILocation(line: 35, column: 3, scope: !46) -// CHECK:STDOUT: !55 = !DILocation(line: 36, column: 5, scope: !46) -// CHECK:STDOUT: !56 = !DILocation(line: 36, column: 3, scope: !46) -// CHECK:STDOUT: !57 = !DILocation(line: 37, column: 3, scope: !46) -// CHECK:STDOUT: !59 = !DILocation(line: 38, column: 5, scope: !46) -// CHECK:STDOUT: !60 = !DILocation(line: 38, column: 3, scope: !46) -// CHECK:STDOUT: !61 = !DILocation(line: 39, column: 3, scope: !46) -// CHECK:STDOUT: !63 = !DILocation(line: 40, column: 5, scope: !46) -// CHECK:STDOUT: !64 = !DILocation(line: 40, column: 3, scope: !46) -// CHECK:STDOUT: !65 = !{!34, !34} -// CHECK:STDOUT: !66 = !DISubroutineType(types: !65) -// CHECK:STDOUT: !67 = !DILocation(line: 41, column: 3, scope: !46) -// CHECK:STDOUT: !69 = !DILocation(line: 42, column: 5, scope: !46) -// CHECK:STDOUT: !70 = !DILocation(line: 42, column: 3, scope: !46) -// CHECK:STDOUT: !71 = !DILocation(line: 43, column: 3, scope: !46) -// CHECK:STDOUT: !73 = !DILocation(line: 44, column: 3, scope: !46) -// CHECK:STDOUT: !74 = !DILocation(line: 32, column: 1, scope: !46) -// CHECK:STDOUT: !75 = distinct !DISubprogram(name: "Op", linkageName: "_COp.dc14d4dd21801791:core.Destroy.Core", scope: null, file: !32, line: 41, type: !37, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !78) -// CHECK:STDOUT: !76 = !DILocalVariable(arg: 1, scope: !75, type: !35) -// CHECK:STDOUT: !77 = !DILocation(line: 41, column: 3, scope: !75) -// CHECK:STDOUT: !78 = !{!76} -// CHECK:STDOUT: !79 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !32, line: 39, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !82) -// CHECK:STDOUT: !80 = !DILocalVariable(arg: 1, scope: !79, type: !34) -// CHECK:STDOUT: !81 = !DILocation(line: 39, column: 3, scope: !79) -// CHECK:STDOUT: !82 = !{!80} -// CHECK:STDOUT: !83 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.a76b78461416b4a8", scope: null, file: !32, line: 28, type: !52, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !91) +// CHECK:STDOUT: !46 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !32, line: 24, type: !37, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !49) +// CHECK:STDOUT: !47 = !DILocalVariable(arg: 1, scope: !46, type: !35) +// CHECK:STDOUT: !48 = !DILocation(line: 24, column: 3, scope: !46) +// CHECK:STDOUT: !49 = !{!47} +// CHECK:STDOUT: !50 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !32, line: 24, type: !37, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !53) +// CHECK:STDOUT: !51 = !DILocalVariable(arg: 1, scope: !50, type: !35) +// CHECK:STDOUT: !52 = !DILocation(line: 24, column: 3, scope: !50) +// CHECK:STDOUT: !53 = !{!51} +// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "M", linkageName: "_CM.Main", scope: null, file: !32, line: 32, type: !39, spFlags: DISPFlagDefinition, unit: !33) +// CHECK:STDOUT: !55 = !DILocation(line: 33, column: 3, scope: !54) +// CHECK:STDOUT: !57 = !DILocation(line: 34, column: 5, scope: !54) +// CHECK:STDOUT: !58 = !DILocation(line: 34, column: 3, scope: !54) +// CHECK:STDOUT: !59 = !{!35, !35} +// CHECK:STDOUT: !60 = !DISubroutineType(types: !59) +// CHECK:STDOUT: !61 = !DILocation(line: 35, column: 3, scope: !54) +// CHECK:STDOUT: !63 = !DILocation(line: 36, column: 5, scope: !54) +// CHECK:STDOUT: !64 = !DILocation(line: 36, column: 3, scope: !54) +// CHECK:STDOUT: !65 = !DILocation(line: 37, column: 3, scope: !54) +// CHECK:STDOUT: !67 = !DILocation(line: 38, column: 5, scope: !54) +// CHECK:STDOUT: !68 = !DILocation(line: 38, column: 3, scope: !54) +// CHECK:STDOUT: !69 = !DILocation(line: 39, column: 3, scope: !54) +// CHECK:STDOUT: !71 = !DILocation(line: 40, column: 5, scope: !54) +// CHECK:STDOUT: !72 = !DILocation(line: 40, column: 3, scope: !54) +// CHECK:STDOUT: !73 = !{!34, !34} +// CHECK:STDOUT: !74 = !DISubroutineType(types: !73) +// CHECK:STDOUT: !75 = !DILocation(line: 41, column: 3, scope: !54) +// CHECK:STDOUT: !77 = !DILocation(line: 42, column: 5, scope: !54) +// CHECK:STDOUT: !78 = !DILocation(line: 42, column: 3, scope: !54) +// CHECK:STDOUT: !79 = !DILocation(line: 43, column: 3, scope: !54) +// CHECK:STDOUT: !81 = !DILocation(line: 44, column: 3, scope: !54) +// CHECK:STDOUT: !82 = !DILocation(line: 32, column: 1, scope: !54) +// CHECK:STDOUT: !83 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.7945ecba5c505fc0:core.Destroy.Core", scope: null, file: !32, line: 41, type: !37, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !86) // CHECK:STDOUT: !84 = !DILocalVariable(arg: 1, scope: !83, type: !35) -// CHECK:STDOUT: !89 = !DILocation(line: 29, column: 10, scope: !83) -// CHECK:STDOUT: !90 = !DILocation(line: 29, column: 3, scope: !83) -// CHECK:STDOUT: !91 = !{!84} -// CHECK:STDOUT: !110 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.4d6ceefeb7f772f4", scope: null, file: !32, line: 28, type: !66, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !118) -// CHECK:STDOUT: !111 = !DILocalVariable(arg: 1, scope: !110, type: !34) -// CHECK:STDOUT: !116 = !DILocation(line: 29, column: 10, scope: !110) -// CHECK:STDOUT: !117 = !DILocation(line: 29, column: 3, scope: !110) -// CHECK:STDOUT: !118 = !{!111} -// CHECK:STDOUT: !119 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.c5e4ba542a56b71f", scope: null, file: !32, line: 28, type: !52, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !127) +// CHECK:STDOUT: !85 = !DILocation(line: 41, column: 3, scope: !83) +// CHECK:STDOUT: !86 = !{!84} +// CHECK:STDOUT: !87 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.dc14d4dd21801791:core.Destroy.Core", scope: null, file: !32, line: 41, type: !37, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !90) +// CHECK:STDOUT: !88 = !DILocalVariable(arg: 1, scope: !87, type: !35) +// CHECK:STDOUT: !89 = !DILocation(line: 41, column: 3, scope: !87) +// CHECK:STDOUT: !90 = !{!88} +// CHECK:STDOUT: !91 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.dc14d4dd21801791:core.Destroy.Core", scope: null, file: !32, line: 41, type: !37, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !94) +// CHECK:STDOUT: !92 = !DILocalVariable(arg: 1, scope: !91, type: !35) +// CHECK:STDOUT: !93 = !DILocation(line: 41, column: 3, scope: !91) +// CHECK:STDOUT: !94 = !{!92} +// CHECK:STDOUT: !95 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !32, line: 39, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !98) +// CHECK:STDOUT: !96 = !DILocalVariable(arg: 1, scope: !95, type: !34) +// CHECK:STDOUT: !97 = !DILocation(line: 39, column: 3, scope: !95) +// CHECK:STDOUT: !98 = !{!96} +// CHECK:STDOUT: !99 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !32, line: 39, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !102) +// CHECK:STDOUT: !100 = !DILocalVariable(arg: 1, scope: !99, type: !34) +// CHECK:STDOUT: !101 = !DILocation(line: 39, column: 3, scope: !99) +// CHECK:STDOUT: !102 = !{!100} +// CHECK:STDOUT: !103 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !32, line: 39, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !106) +// CHECK:STDOUT: !104 = !DILocalVariable(arg: 1, scope: !103, type: !34) +// CHECK:STDOUT: !105 = !DILocation(line: 39, column: 3, scope: !103) +// CHECK:STDOUT: !106 = !{!104} +// CHECK:STDOUT: !107 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.de57ff04fd84f9c8:core.Destroy.Core", scope: null, file: !32, line: 37, type: !37, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !110) +// CHECK:STDOUT: !108 = !DILocalVariable(arg: 1, scope: !107, type: !35) +// CHECK:STDOUT: !109 = !DILocation(line: 37, column: 3, scope: !107) +// CHECK:STDOUT: !110 = !{!108} +// CHECK:STDOUT: !111 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.749b51755634ad17:core.Destroy.Core", scope: null, file: !32, line: 35, type: !37, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !114) +// CHECK:STDOUT: !112 = !DILocalVariable(arg: 1, scope: !111, type: !35) +// CHECK:STDOUT: !113 = !DILocation(line: 35, column: 3, scope: !111) +// CHECK:STDOUT: !114 = !{!112} +// CHECK:STDOUT: !115 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.d088c7eb746488be:core.Destroy.Core", scope: null, file: !32, line: 33, type: !37, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !118) +// CHECK:STDOUT: !116 = !DILocalVariable(arg: 1, scope: !115, type: !35) +// CHECK:STDOUT: !117 = !DILocation(line: 33, column: 3, scope: !115) +// CHECK:STDOUT: !118 = !{!116} +// CHECK:STDOUT: !119 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.a76b78461416b4a8", scope: null, file: !32, line: 28, type: !60, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !127) // CHECK:STDOUT: !120 = !DILocalVariable(arg: 1, scope: !119, type: !35) // CHECK:STDOUT: !125 = !DILocation(line: 29, column: 10, scope: !119) // CHECK:STDOUT: !126 = !DILocation(line: 29, column: 3, scope: !119) // CHECK:STDOUT: !127 = !{!120} -// CHECK:STDOUT: !128 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.c3359c2c217ad593", scope: null, file: !32, line: 28, type: !52, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !136) -// CHECK:STDOUT: !129 = !DILocalVariable(arg: 1, scope: !128, type: !35) -// CHECK:STDOUT: !134 = !DILocation(line: 29, column: 10, scope: !128) -// CHECK:STDOUT: !135 = !DILocation(line: 29, column: 3, scope: !128) -// CHECK:STDOUT: !136 = !{!129} -// CHECK:STDOUT: !137 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.a76b78461416b4a8", scope: null, file: !32, line: 23, type: !52, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !149) -// CHECK:STDOUT: !138 = !DILocalVariable(arg: 1, scope: !137, type: !35) -// CHECK:STDOUT: !142 = !DILocation(line: 24, column: 3, scope: !137) -// CHECK:STDOUT: !144 = !DILocation(line: 25, column: 10, scope: !137) -// CHECK:STDOUT: !146 = !{!35, !35, !35} -// CHECK:STDOUT: !147 = !DISubroutineType(types: !146) -// CHECK:STDOUT: !148 = !DILocation(line: 25, column: 3, scope: !137) -// CHECK:STDOUT: !149 = !{!138} -// CHECK:STDOUT: !172 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.4d6ceefeb7f772f4", scope: null, file: !32, line: 23, type: !66, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !184) -// CHECK:STDOUT: !173 = !DILocalVariable(arg: 1, scope: !172, type: !34) -// CHECK:STDOUT: !177 = !DILocation(line: 24, column: 3, scope: !172) -// CHECK:STDOUT: !179 = !DILocation(line: 25, column: 10, scope: !172) -// CHECK:STDOUT: !181 = !{!34, !35, !34} -// CHECK:STDOUT: !182 = !DISubroutineType(types: !181) -// CHECK:STDOUT: !183 = !DILocation(line: 25, column: 3, scope: !172) -// CHECK:STDOUT: !184 = !{!173} -// CHECK:STDOUT: !185 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.c5e4ba542a56b71f", scope: null, file: !32, line: 23, type: !52, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !195) -// CHECK:STDOUT: !186 = !DILocalVariable(arg: 1, scope: !185, type: !35) -// CHECK:STDOUT: !190 = !DILocation(line: 24, column: 3, scope: !185) -// CHECK:STDOUT: !192 = !DILocation(line: 25, column: 10, scope: !185) -// CHECK:STDOUT: !194 = !DILocation(line: 25, column: 3, scope: !185) -// CHECK:STDOUT: !195 = !{!186} -// CHECK:STDOUT: !196 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.c3359c2c217ad593", scope: null, file: !32, line: 23, type: !52, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !206) -// CHECK:STDOUT: !197 = !DILocalVariable(arg: 1, scope: !196, type: !35) -// CHECK:STDOUT: !201 = !DILocation(line: 24, column: 3, scope: !196) -// CHECK:STDOUT: !203 = !DILocation(line: 25, column: 10, scope: !196) -// CHECK:STDOUT: !205 = !DILocation(line: 25, column: 3, scope: !196) -// CHECK:STDOUT: !206 = !{!197} -// CHECK:STDOUT: !207 = distinct !DISubprogram(name: "Cfn", linkageName: "_CCfn.C.Main.a76b78461416b4a8", scope: null, file: !32, line: 18, type: !147, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !216) -// CHECK:STDOUT: !208 = !DILocalVariable(arg: 1, scope: !207, type: !35) -// CHECK:STDOUT: !209 = !DILocalVariable(arg: 2, scope: !207, type: !35) -// CHECK:STDOUT: !215 = !DILocation(line: 19, column: 5, scope: !207) -// CHECK:STDOUT: !216 = !{!208, !209} -// CHECK:STDOUT: !237 = distinct !DISubprogram(name: "Cfn", linkageName: "_CCfn.C.Main.4d6ceefeb7f772f4", scope: null, file: !32, line: 18, type: !182, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !246) -// CHECK:STDOUT: !238 = !DILocalVariable(arg: 1, scope: !237, type: !35) -// CHECK:STDOUT: !239 = !DILocalVariable(arg: 2, scope: !237, type: !34) -// CHECK:STDOUT: !245 = !DILocation(line: 19, column: 5, scope: !237) -// CHECK:STDOUT: !246 = !{!238, !239} -// CHECK:STDOUT: !247 = distinct !DISubprogram(name: "Cfn", linkageName: "_CCfn.C.Main.c5e4ba542a56b71f", scope: null, file: !32, line: 18, type: !147, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !256) -// CHECK:STDOUT: !248 = !DILocalVariable(arg: 1, scope: !247, type: !35) -// CHECK:STDOUT: !249 = !DILocalVariable(arg: 2, scope: !247, type: !35) -// CHECK:STDOUT: !255 = !DILocation(line: 19, column: 5, scope: !247) -// CHECK:STDOUT: !256 = !{!248, !249} -// CHECK:STDOUT: !257 = distinct !DISubprogram(name: "Cfn", linkageName: "_CCfn.C.Main.c3359c2c217ad593", scope: null, file: !32, line: 18, type: !147, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !266) -// CHECK:STDOUT: !258 = !DILocalVariable(arg: 1, scope: !257, type: !35) -// CHECK:STDOUT: !259 = !DILocalVariable(arg: 2, scope: !257, type: !35) -// CHECK:STDOUT: !265 = !DILocation(line: 19, column: 5, scope: !257) -// CHECK:STDOUT: !266 = !{!258, !259} +// CHECK:STDOUT: !146 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.4d6ceefeb7f772f4", scope: null, file: !32, line: 28, type: !74, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !154) +// CHECK:STDOUT: !147 = !DILocalVariable(arg: 1, scope: !146, type: !34) +// CHECK:STDOUT: !152 = !DILocation(line: 29, column: 10, scope: !146) +// CHECK:STDOUT: !153 = !DILocation(line: 29, column: 3, scope: !146) +// CHECK:STDOUT: !154 = !{!147} +// CHECK:STDOUT: !155 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.c5e4ba542a56b71f", scope: null, file: !32, line: 28, type: !60, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !163) +// CHECK:STDOUT: !156 = !DILocalVariable(arg: 1, scope: !155, type: !35) +// CHECK:STDOUT: !161 = !DILocation(line: 29, column: 10, scope: !155) +// CHECK:STDOUT: !162 = !DILocation(line: 29, column: 3, scope: !155) +// CHECK:STDOUT: !163 = !{!156} +// CHECK:STDOUT: !164 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.c3359c2c217ad593", scope: null, file: !32, line: 28, type: !60, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !172) +// CHECK:STDOUT: !165 = !DILocalVariable(arg: 1, scope: !164, type: !35) +// CHECK:STDOUT: !170 = !DILocation(line: 29, column: 10, scope: !164) +// CHECK:STDOUT: !171 = !DILocation(line: 29, column: 3, scope: !164) +// CHECK:STDOUT: !172 = !{!165} +// CHECK:STDOUT: !173 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.a76b78461416b4a8", scope: null, file: !32, line: 23, type: !60, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !185) +// CHECK:STDOUT: !174 = !DILocalVariable(arg: 1, scope: !173, type: !35) +// CHECK:STDOUT: !178 = !DILocation(line: 24, column: 3, scope: !173) +// CHECK:STDOUT: !180 = !DILocation(line: 25, column: 10, scope: !173) +// CHECK:STDOUT: !182 = !{!35, !35, !35} +// CHECK:STDOUT: !183 = !DISubroutineType(types: !182) +// CHECK:STDOUT: !184 = !DILocation(line: 25, column: 3, scope: !173) +// CHECK:STDOUT: !185 = !{!174} +// CHECK:STDOUT: !208 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.4d6ceefeb7f772f4", scope: null, file: !32, line: 23, type: !74, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !220) +// CHECK:STDOUT: !209 = !DILocalVariable(arg: 1, scope: !208, type: !34) +// CHECK:STDOUT: !213 = !DILocation(line: 24, column: 3, scope: !208) +// CHECK:STDOUT: !215 = !DILocation(line: 25, column: 10, scope: !208) +// CHECK:STDOUT: !217 = !{!34, !35, !34} +// CHECK:STDOUT: !218 = !DISubroutineType(types: !217) +// CHECK:STDOUT: !219 = !DILocation(line: 25, column: 3, scope: !208) +// CHECK:STDOUT: !220 = !{!209} +// CHECK:STDOUT: !221 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.c5e4ba542a56b71f", scope: null, file: !32, line: 23, type: !60, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !231) +// CHECK:STDOUT: !222 = !DILocalVariable(arg: 1, scope: !221, type: !35) +// CHECK:STDOUT: !226 = !DILocation(line: 24, column: 3, scope: !221) +// CHECK:STDOUT: !228 = !DILocation(line: 25, column: 10, scope: !221) +// CHECK:STDOUT: !230 = !DILocation(line: 25, column: 3, scope: !221) +// CHECK:STDOUT: !231 = !{!222} +// CHECK:STDOUT: !232 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.c3359c2c217ad593", scope: null, file: !32, line: 23, type: !60, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !242) +// CHECK:STDOUT: !233 = !DILocalVariable(arg: 1, scope: !232, type: !35) +// CHECK:STDOUT: !237 = !DILocation(line: 24, column: 3, scope: !232) +// CHECK:STDOUT: !239 = !DILocation(line: 25, column: 10, scope: !232) +// CHECK:STDOUT: !241 = !DILocation(line: 25, column: 3, scope: !232) +// CHECK:STDOUT: !242 = !{!233} +// CHECK:STDOUT: !243 = distinct !DISubprogram(name: "Cfn", linkageName: "_CCfn.C.Main.a76b78461416b4a8", scope: null, file: !32, line: 18, type: !183, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !252) +// CHECK:STDOUT: !244 = !DILocalVariable(arg: 1, scope: !243, type: !35) +// CHECK:STDOUT: !245 = !DILocalVariable(arg: 2, scope: !243, type: !35) +// CHECK:STDOUT: !251 = !DILocation(line: 19, column: 5, scope: !243) +// CHECK:STDOUT: !252 = !{!244, !245} +// CHECK:STDOUT: !273 = distinct !DISubprogram(name: "Cfn", linkageName: "_CCfn.C.Main.4d6ceefeb7f772f4", scope: null, file: !32, line: 18, type: !218, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !282) +// CHECK:STDOUT: !274 = !DILocalVariable(arg: 1, scope: !273, type: !35) +// CHECK:STDOUT: !275 = !DILocalVariable(arg: 2, scope: !273, type: !34) +// CHECK:STDOUT: !281 = !DILocation(line: 19, column: 5, scope: !273) +// CHECK:STDOUT: !282 = !{!274, !275} +// CHECK:STDOUT: !283 = distinct !DISubprogram(name: "Cfn", linkageName: "_CCfn.C.Main.c5e4ba542a56b71f", scope: null, file: !32, line: 18, type: !183, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !292) +// CHECK:STDOUT: !284 = !DILocalVariable(arg: 1, scope: !283, type: !35) +// CHECK:STDOUT: !285 = !DILocalVariable(arg: 2, scope: !283, type: !35) +// CHECK:STDOUT: !291 = !DILocation(line: 19, column: 5, scope: !283) +// CHECK:STDOUT: !292 = !{!284, !285} +// CHECK:STDOUT: !293 = distinct !DISubprogram(name: "Cfn", linkageName: "_CCfn.C.Main.c3359c2c217ad593", scope: null, file: !32, line: 18, type: !183, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !302) +// CHECK:STDOUT: !294 = !DILocalVariable(arg: 1, scope: !293, type: !35) +// CHECK:STDOUT: !295 = !DILocalVariable(arg: 2, scope: !293, type: !35) +// CHECK:STDOUT: !301 = !DILocation(line: 19, column: 5, scope: !293) +// CHECK:STDOUT: !302 = !{!294, !295} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/function/generic/import.carbon b/toolchain/lower/testdata/function/generic/import.carbon index f5caf30e4878..23e006a5ea6c 100644 --- a/toolchain/lower/testdata/function/generic/import.carbon +++ b/toolchain/lower/testdata/function/generic/import.carbon @@ -113,36 +113,56 @@ fn Call() -> i32 { // CHECK:STDOUT: source_filename = "use.carbon" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CCall.Main() #0 !dbg !35 { +// CHECK:STDOUT: define i32 @_CCall.Main() #0 !dbg !38 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %n.var = alloca i32, align 4, !dbg !38 -// CHECK:STDOUT: %p.var = alloca ptr, align 8, !dbg !40 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %n.var), !dbg !38 -// CHECK:STDOUT: store i32 0, ptr %n.var, align 4, !dbg !38 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %p.var), !dbg !40 -// CHECK:STDOUT: %DirectGeneric.call = call ptr @_CDirectGeneric.Main.84588f41d61dafba(ptr %n.var), !dbg !43 -// CHECK:STDOUT: store ptr %DirectGeneric.call, ptr %p.var, align 8, !dbg !40 -// CHECK:STDOUT: %.loc9_11 = load ptr, ptr %p.var, align 8, !dbg !48 -// CHECK:STDOUT: %.loc9_10.2 = load i32, ptr %.loc9_11, align 4, !dbg !49 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %n.var), !dbg !38 -// CHECK:STDOUT: ret i32 %.loc9_10.2, !dbg !50 +// CHECK:STDOUT: %n.var = alloca i32, align 4, !dbg !41 +// CHECK:STDOUT: %p.var = alloca ptr, align 8, !dbg !43 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %n.var), !dbg !41 +// CHECK:STDOUT: store i32 0, ptr %n.var, align 4, !dbg !41 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %p.var), !dbg !43 +// CHECK:STDOUT: %DirectGeneric.call = call ptr @_CDirectGeneric.Main.84588f41d61dafba(ptr %n.var), !dbg !46 +// CHECK:STDOUT: store ptr %DirectGeneric.call, ptr %p.var, align 8, !dbg !43 +// CHECK:STDOUT: %.loc9_11 = load ptr, ptr %p.var, align 8, !dbg !50 +// CHECK:STDOUT: %.loc9_10.2 = load i32, ptr %.loc9_11, align 4, !dbg !51 +// CHECK:STDOUT: call void @"_CSelfDestruct.d088c7eb746488be:core.Destroy.Core"(ptr %p.var), !dbg !43 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %n.var), !dbg !41 +// CHECK:STDOUT: ret i32 %.loc9_10.2, !dbg !52 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !51 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.d088c7eb746488be:core.Destroy.Core"(ptr %self) #0 !dbg !53 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !53 +// CHECK:STDOUT: ret void, !dbg !55 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !57 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !59 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !61 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !63 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !65 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !67 +// CHECK:STDOUT: ret void, !dbg !67 // 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 ptr @_CDirectGeneric.Main.84588f41d61dafba(ptr %y) #0 !dbg !55 { -// CHECK:STDOUT: call void @_CDirectDeclared.Main(), !dbg !60 -// CHECK:STDOUT: call void @_CDirectDefined.Main(), !dbg !61 -// CHECK:STDOUT: %1 = call ptr @_CIndirectGeneric.Main.84588f41d61dafba(ptr %y), !dbg !63 -// CHECK:STDOUT: ret ptr %1, !dbg !64 +// CHECK:STDOUT: define linkonce_odr ptr @_CDirectGeneric.Main.84588f41d61dafba(ptr %y) #0 !dbg !69 { +// CHECK:STDOUT: call void @_CDirectDeclared.Main(), !dbg !74 +// CHECK:STDOUT: call void @_CDirectDefined.Main(), !dbg !75 +// CHECK:STDOUT: %1 = call ptr @_CIndirectGeneric.Main.84588f41d61dafba(ptr %y), !dbg !77 +// CHECK:STDOUT: ret ptr %1, !dbg !78 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_CDirectDeclared.Main() @@ -150,10 +170,10 @@ fn Call() -> i32 { // CHECK:STDOUT: declare void @_CDirectDefined.Main() // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CIndirectGeneric.Main.84588f41d61dafba(ptr %x) #0 !dbg !66 { -// CHECK:STDOUT: call void @_CIndirectDeclared.Main(), !dbg !71 -// CHECK:STDOUT: call void @_CIndirectDefined.Main(), !dbg !72 -// CHECK:STDOUT: ret ptr %x, !dbg !74 +// CHECK:STDOUT: define linkonce_odr ptr @_CIndirectGeneric.Main.84588f41d61dafba(ptr %x) #0 !dbg !80 { +// CHECK:STDOUT: call void @_CIndirectDeclared.Main(), !dbg !85 +// CHECK:STDOUT: call void @_CIndirectDefined.Main(), !dbg !86 +// CHECK:STDOUT: ret ptr %x, !dbg !88 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_CIndirectDeclared.Main() @@ -178,33 +198,47 @@ fn Call() -> i32 { // CHECK:STDOUT: !30 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) // CHECK:STDOUT: !31 = !{!30} // CHECK:STDOUT: !32 = !DISubroutineType(types: !31) -// CHECK:STDOUT: !33 = !{null, !30} -// CHECK:STDOUT: !34 = !DISubroutineType(types: !33) -// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !28, line: 6, type: !32, spFlags: DISPFlagDefinition, unit: !29) -// CHECK:STDOUT: !38 = !DILocation(line: 7, column: 3, scope: !35) -// CHECK:STDOUT: !40 = !DILocation(line: 8, column: 3, scope: !35) -// CHECK:STDOUT: !43 = !DILocation(line: 8, column: 17, scope: !35) -// CHECK:STDOUT: !44 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !45 = !{!44, !44} -// CHECK:STDOUT: !46 = !DISubroutineType(types: !45) -// CHECK:STDOUT: !48 = !DILocation(line: 9, column: 11, scope: !35) -// CHECK:STDOUT: !49 = !DILocation(line: 9, column: 10, scope: !35) -// CHECK:STDOUT: !50 = !DILocation(line: 9, column: 3, scope: !35) -// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !28, line: 7, type: !34, spFlags: DISPFlagDefinition, unit: !29, retainedNodes: !54) -// CHECK:STDOUT: !52 = !DILocalVariable(arg: 1, scope: !51, type: !30) -// CHECK:STDOUT: !53 = !DILocation(line: 7, column: 3, scope: !51) -// CHECK:STDOUT: !54 = !{!52} -// CHECK:STDOUT: !55 = distinct !DISubprogram(name: "DirectGeneric", linkageName: "_CDirectGeneric.Main.84588f41d61dafba", scope: null, file: !24, line: 10, type: !46, spFlags: DISPFlagDefinition, unit: !29, retainedNodes: !65) -// CHECK:STDOUT: !56 = !DILocalVariable(arg: 1, scope: !55, type: !44) -// CHECK:STDOUT: !60 = !DILocation(line: 11, column: 3, scope: !55) -// CHECK:STDOUT: !61 = !DILocation(line: 12, column: 3, scope: !55) -// CHECK:STDOUT: !63 = !DILocation(line: 13, column: 10, scope: !55) -// CHECK:STDOUT: !64 = !DILocation(line: 13, column: 3, scope: !55) -// CHECK:STDOUT: !65 = !{!56} -// CHECK:STDOUT: !66 = distinct !DISubprogram(name: "IndirectGeneric", linkageName: "_CIndirectGeneric.Main.84588f41d61dafba", scope: null, file: !18, line: 8, type: !46, spFlags: DISPFlagDefinition, unit: !29, retainedNodes: !75) -// CHECK:STDOUT: !67 = !DILocalVariable(arg: 1, scope: !66, type: !44) -// CHECK:STDOUT: !71 = !DILocation(line: 9, column: 3, scope: !66) -// CHECK:STDOUT: !72 = !DILocation(line: 10, column: 3, scope: !66) -// CHECK:STDOUT: !74 = !DILocation(line: 11, column: 3, scope: !66) -// CHECK:STDOUT: !75 = !{!67} +// CHECK:STDOUT: !33 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !34 = !{null, !33} +// CHECK:STDOUT: !35 = !DISubroutineType(types: !34) +// CHECK:STDOUT: !36 = !{null, !30} +// CHECK:STDOUT: !37 = !DISubroutineType(types: !36) +// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !28, line: 6, type: !32, spFlags: DISPFlagDefinition, unit: !29) +// CHECK:STDOUT: !41 = !DILocation(line: 7, column: 3, scope: !38) +// CHECK:STDOUT: !43 = !DILocation(line: 8, column: 3, scope: !38) +// CHECK:STDOUT: !46 = !DILocation(line: 8, column: 17, scope: !38) +// CHECK:STDOUT: !47 = !{!33, !33} +// CHECK:STDOUT: !48 = !DISubroutineType(types: !47) +// CHECK:STDOUT: !50 = !DILocation(line: 9, column: 11, scope: !38) +// CHECK:STDOUT: !51 = !DILocation(line: 9, column: 10, scope: !38) +// CHECK:STDOUT: !52 = !DILocation(line: 9, column: 3, scope: !38) +// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.d088c7eb746488be:core.Destroy.Core", scope: null, file: !28, line: 8, type: !35, spFlags: DISPFlagDefinition, unit: !29, retainedNodes: !56) +// CHECK:STDOUT: !54 = !DILocalVariable(arg: 1, scope: !53, type: !33) +// CHECK:STDOUT: !55 = !DILocation(line: 8, column: 3, scope: !53) +// CHECK:STDOUT: !56 = !{!54} +// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !28, line: 7, type: !37, spFlags: DISPFlagDefinition, unit: !29, retainedNodes: !60) +// CHECK:STDOUT: !58 = !DILocalVariable(arg: 1, scope: !57, type: !30) +// CHECK:STDOUT: !59 = !DILocation(line: 7, column: 3, scope: !57) +// CHECK:STDOUT: !60 = !{!58} +// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !28, line: 7, type: !37, spFlags: DISPFlagDefinition, unit: !29, retainedNodes: !64) +// CHECK:STDOUT: !62 = !DILocalVariable(arg: 1, scope: !61, type: !30) +// CHECK:STDOUT: !63 = !DILocation(line: 7, column: 3, scope: !61) +// CHECK:STDOUT: !64 = !{!62} +// CHECK:STDOUT: !65 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !28, line: 7, type: !37, spFlags: DISPFlagDefinition, unit: !29, retainedNodes: !68) +// CHECK:STDOUT: !66 = !DILocalVariable(arg: 1, scope: !65, type: !30) +// CHECK:STDOUT: !67 = !DILocation(line: 7, column: 3, scope: !65) +// CHECK:STDOUT: !68 = !{!66} +// CHECK:STDOUT: !69 = distinct !DISubprogram(name: "DirectGeneric", linkageName: "_CDirectGeneric.Main.84588f41d61dafba", scope: null, file: !24, line: 10, type: !48, spFlags: DISPFlagDefinition, unit: !29, retainedNodes: !79) +// CHECK:STDOUT: !70 = !DILocalVariable(arg: 1, scope: !69, type: !33) +// CHECK:STDOUT: !74 = !DILocation(line: 11, column: 3, scope: !69) +// CHECK:STDOUT: !75 = !DILocation(line: 12, column: 3, scope: !69) +// CHECK:STDOUT: !77 = !DILocation(line: 13, column: 10, scope: !69) +// CHECK:STDOUT: !78 = !DILocation(line: 13, column: 3, scope: !69) +// CHECK:STDOUT: !79 = !{!70} +// CHECK:STDOUT: !80 = distinct !DISubprogram(name: "IndirectGeneric", linkageName: "_CIndirectGeneric.Main.84588f41d61dafba", scope: null, file: !18, line: 8, type: !48, spFlags: DISPFlagDefinition, unit: !29, retainedNodes: !89) +// CHECK:STDOUT: !81 = !DILocalVariable(arg: 1, scope: !80, type: !33) +// CHECK:STDOUT: !85 = !DILocation(line: 9, column: 3, scope: !80) +// CHECK:STDOUT: !86 = !DILocation(line: 10, column: 3, scope: !80) +// CHECK:STDOUT: !88 = !DILocation(line: 11, column: 3, scope: !80) +// CHECK:STDOUT: !89 = !{!81} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/function/generic/import_core_witness.carbon b/toolchain/lower/testdata/function/generic/import_core_witness.carbon index d1adc6bc2508..ba16ae2cf01b 100644 --- a/toolchain/lower/testdata/function/generic/import_core_witness.carbon +++ b/toolchain/lower/testdata/function/generic/import_core_witness.carbon @@ -33,11 +33,24 @@ fn Run() { // CHECK:STDOUT: source_filename = "lib.carbon" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !9 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !9 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !11 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !13 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !15 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !17 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !19 +// CHECK:STDOUT: ret void, !dbg !19 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!5} @@ -50,32 +63,44 @@ fn Run() { // CHECK:STDOUT: !6 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) // CHECK:STDOUT: !7 = !{null, !6} // CHECK:STDOUT: !8 = !DISubroutineType(types: !7) -// CHECK:STDOUT: !9 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 7, type: !8, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !12) +// CHECK:STDOUT: !9 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !4, line: 7, type: !8, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !12) // CHECK:STDOUT: !10 = !DILocalVariable(arg: 1, scope: !9, type: !6) // CHECK:STDOUT: !11 = !DILocation(line: 7, column: 3, scope: !9) // CHECK:STDOUT: !12 = !{!10} +// CHECK:STDOUT: !13 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 7, type: !8, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !16) +// CHECK:STDOUT: !14 = !DILocalVariable(arg: 1, scope: !13, type: !6) +// CHECK:STDOUT: !15 = !DILocation(line: 7, column: 3, scope: !13) +// CHECK:STDOUT: !16 = !{!14} +// CHECK:STDOUT: !17 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 7, type: !8, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !20) +// CHECK:STDOUT: !18 = !DILocalVariable(arg: 1, scope: !17, type: !6) +// CHECK:STDOUT: !19 = !DILocation(line: 7, column: 3, scope: !17) +// CHECK:STDOUT: !20 = !{!18} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'main.carbon' // CHECK:STDOUT: source_filename = "main.carbon" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @main() #0 !dbg !17 { +// CHECK:STDOUT: define i32 @main() #0 !dbg !25 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CF.Main.79e272ab3b2c3188(), !dbg !18 -// CHECK:STDOUT: ret i32 0, !dbg !21 +// CHECK:STDOUT: call void @_CF.Main.79e272ab3b2c3188(), !dbg !26 +// CHECK:STDOUT: ret i32 0, !dbg !29 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CF.Main.79e272ab3b2c3188() #0 !dbg !22 { -// CHECK:STDOUT: %1 = alloca i32, align 4, !dbg !23 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !23 -// CHECK:STDOUT: store i32 0, ptr %1, align 4, !dbg !23 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %1), !dbg !23 -// CHECK:STDOUT: ret void, !dbg !25 +// CHECK:STDOUT: define linkonce_odr void @_CF.Main.79e272ab3b2c3188() #0 !dbg !30 { +// CHECK:STDOUT: %1 = alloca i32, align 4, !dbg !31 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !31 +// CHECK:STDOUT: store i32 0, ptr %1, align 4, !dbg !31 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %1), !dbg !31 +// CHECK:STDOUT: ret void, !dbg !33 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: declare void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr) +// CHECK:STDOUT: declare void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr) +// CHECK:STDOUT: +// CHECK:STDOUT: declare void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr) +// CHECK:STDOUT: +// CHECK:STDOUT: declare void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr) // 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 @@ -83,23 +108,23 @@ fn Run() { // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!14} +// CHECK:STDOUT: !llvm.dbg.cu = !{!22} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !4 = !DIFile(filename: "lib.carbon", directory: "") // CHECK:STDOUT: !6 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !13 = !DIFile(filename: "main.carbon", directory: "") -// CHECK:STDOUT: !14 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !13, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !15 = !{!6} -// CHECK:STDOUT: !16 = !DISubroutineType(types: !15) -// CHECK:STDOUT: !17 = distinct !DISubprogram(name: "Run", linkageName: "main", scope: null, file: !13, line: 4, type: !16, spFlags: DISPFlagDefinition, unit: !14) -// CHECK:STDOUT: !18 = !DILocation(line: 5, column: 3, scope: !17) -// CHECK:STDOUT: !19 = !{null} -// CHECK:STDOUT: !20 = !DISubroutineType(types: !19) -// CHECK:STDOUT: !21 = !DILocation(line: 4, column: 1, scope: !17) -// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.79e272ab3b2c3188", scope: null, file: !4, line: 4, type: !20, spFlags: DISPFlagDefinition, unit: !14) -// CHECK:STDOUT: !23 = !DILocation(line: 7, column: 3, scope: !22) -// CHECK:STDOUT: !25 = !DILocation(line: 4, column: 1, scope: !22) +// CHECK:STDOUT: !21 = !DIFile(filename: "main.carbon", directory: "") +// CHECK:STDOUT: !22 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !21, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !23 = !{!6} +// CHECK:STDOUT: !24 = !DISubroutineType(types: !23) +// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "Run", linkageName: "main", scope: null, file: !21, line: 4, type: !24, spFlags: DISPFlagDefinition, unit: !22) +// CHECK:STDOUT: !26 = !DILocation(line: 5, column: 3, scope: !25) +// CHECK:STDOUT: !27 = !{null} +// CHECK:STDOUT: !28 = !DISubroutineType(types: !27) +// CHECK:STDOUT: !29 = !DILocation(line: 4, column: 1, scope: !25) +// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.79e272ab3b2c3188", scope: null, file: !4, line: 4, type: !28, spFlags: DISPFlagDefinition, unit: !22) +// CHECK:STDOUT: !31 = !DILocation(line: 7, column: 3, scope: !30) +// CHECK:STDOUT: !33 = !DILocation(line: 4, column: 1, scope: !30) // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/function/generic/import_unused_def.carbon b/toolchain/lower/testdata/function/generic/import_unused_def.carbon index 55ebe223c9d9..33ff807f044c 100644 --- a/toolchain/lower/testdata/function/generic/import_unused_def.carbon +++ b/toolchain/lower/testdata/function/generic/import_unused_def.carbon @@ -51,17 +51,37 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !34 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !34 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !36 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.ed1ef26650163b11:core.Destroy.Core"(ptr %self) #0 !dbg !38 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !38 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !40 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !42 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !44 +// CHECK:STDOUT: ret void, !dbg !44 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.ed1ef26650163b11:core.Destroy.Core"(ptr %self) #0 !dbg !46 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !48 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.ed1ef26650163b11:core.Destroy.Core"(ptr %self) #0 !dbg !50 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.ed1ef26650163b11:core.Destroy.Core"(ptr %self), !dbg !52 +// CHECK:STDOUT: ret void, !dbg !52 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!19} @@ -80,43 +100,61 @@ fn Main() { // CHECK:STDOUT: !26 = !DILocalVariable(arg: 1, scope: !25, type: !20) // CHECK:STDOUT: !32 = !DILocation(line: 13, column: 5, scope: !25) // CHECK:STDOUT: !33 = !{!26} -// CHECK:STDOUT: !34 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 18, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !37) +// CHECK:STDOUT: !34 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !18, line: 18, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !37) // CHECK:STDOUT: !35 = !DILocalVariable(arg: 1, scope: !34, type: !20) // CHECK:STDOUT: !36 = !DILocation(line: 18, column: 3, scope: !34) // CHECK:STDOUT: !37 = !{!35} -// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "Op", linkageName: "_COp.ed1ef26650163b11:core.Destroy.Core", scope: null, file: !18, line: 18, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !41) +// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 18, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !41) // CHECK:STDOUT: !39 = !DILocalVariable(arg: 1, scope: !38, type: !20) // CHECK:STDOUT: !40 = !DILocation(line: 18, column: 3, scope: !38) // CHECK:STDOUT: !41 = !{!39} +// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 18, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !45) +// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !42, type: !20) +// CHECK:STDOUT: !44 = !DILocation(line: 18, column: 3, scope: !42) +// CHECK:STDOUT: !45 = !{!43} +// CHECK:STDOUT: !46 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.ed1ef26650163b11:core.Destroy.Core", scope: null, file: !18, line: 18, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !49) +// CHECK:STDOUT: !47 = !DILocalVariable(arg: 1, scope: !46, type: !20) +// CHECK:STDOUT: !48 = !DILocation(line: 18, column: 3, scope: !46) +// CHECK:STDOUT: !49 = !{!47} +// CHECK:STDOUT: !50 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.ed1ef26650163b11:core.Destroy.Core", scope: null, file: !18, line: 18, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !53) +// CHECK:STDOUT: !51 = !DILocalVariable(arg: 1, scope: !50, type: !20) +// CHECK:STDOUT: !52 = !DILocation(line: 18, column: 3, scope: !50) +// CHECK:STDOUT: !53 = !{!51} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'b.carbon' // CHECK:STDOUT: source_filename = "b.carbon" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CMain.Main() #0 !dbg !46 { +// CHECK:STDOUT: define void @_CMain.Main() #0 !dbg !58 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %GenericF.call = call i32 @_CGenericF.Main.084a2801e0f5d754({} zeroinitializer), !dbg !47 -// CHECK:STDOUT: ret void, !dbg !51 +// CHECK:STDOUT: %GenericF.call = call i32 @_CGenericF.Main.084a2801e0f5d754({} zeroinitializer), !dbg !59 +// CHECK:STDOUT: ret void, !dbg !63 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CGenericF.Main.084a2801e0f5d754({} %x) #0 !dbg !52 { -// CHECK:STDOUT: %1 = alloca i32, align 4, !dbg !57 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !57 -// CHECK:STDOUT: %2 = call i32 @"_COp.Foo.Main:Copy.Core"(i32 0), !dbg !58 -// CHECK:STDOUT: store i32 %2, ptr %1, align 4, !dbg !57 -// CHECK:STDOUT: %3 = load i32, ptr %1, align 4, !dbg !60 -// CHECK:STDOUT: %4 = call i32 @"_COp.Foo.Main:Copy.Core"(i32 %3), !dbg !60 -// CHECK:STDOUT: call void @"_COp.ed1ef26650163b11:core.Destroy.Core"(ptr %1), !dbg !57 -// CHECK:STDOUT: ret i32 %4, !dbg !61 +// CHECK:STDOUT: define linkonce_odr i32 @_CGenericF.Main.084a2801e0f5d754({} %x) #0 !dbg !64 { +// CHECK:STDOUT: %1 = alloca i32, align 4, !dbg !69 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !69 +// CHECK:STDOUT: %2 = call i32 @"_COp.Foo.Main:Copy.Core"(i32 0), !dbg !70 +// CHECK:STDOUT: store i32 %2, ptr %1, align 4, !dbg !69 +// CHECK:STDOUT: %3 = load i32, ptr %1, align 4, !dbg !72 +// CHECK:STDOUT: %4 = call i32 @"_COp.Foo.Main:Copy.Core"(i32 %3), !dbg !72 +// CHECK:STDOUT: call void @"_CSelfDestruct.ed1ef26650163b11:core.Destroy.Core"(ptr %1), !dbg !69 +// CHECK:STDOUT: ret i32 %4, !dbg !73 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare i32 @"_COp.Foo.Main:Copy.Core"(i32) // CHECK:STDOUT: -// CHECK:STDOUT: declare void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr) +// CHECK:STDOUT: declare void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr) // CHECK:STDOUT: -// CHECK:STDOUT: declare void @"_COp.ed1ef26650163b11:core.Destroy.Core"(ptr) +// CHECK:STDOUT: declare void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr) +// CHECK:STDOUT: +// CHECK:STDOUT: declare void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr) +// CHECK:STDOUT: +// CHECK:STDOUT: declare void @"_CSubobjectDestroy.ed1ef26650163b11:core.Destroy.Core"(ptr) +// CHECK:STDOUT: +// CHECK:STDOUT: declare void @"_CSelfDestruct.ed1ef26650163b11:core.Destroy.Core"(ptr) // 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 @@ -127,28 +165,28 @@ fn Main() { // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!43} +// CHECK:STDOUT: !llvm.dbg.cu = !{!55} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !18 = !DIFile(filename: "a.carbon", directory: "") // CHECK:STDOUT: !20 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !42 = !DIFile(filename: "b.carbon", directory: "") -// CHECK:STDOUT: !43 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !42, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !44 = !{null} -// CHECK:STDOUT: !45 = !DISubroutineType(types: !44) -// CHECK:STDOUT: !46 = distinct !DISubprogram(name: "Main", linkageName: "_CMain.Main", scope: null, file: !42, line: 4, type: !45, spFlags: DISPFlagDefinition, unit: !43) -// CHECK:STDOUT: !47 = !DILocation(line: 5, column: 3, scope: !46) -// CHECK:STDOUT: !48 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !49 = !{!20, !48} -// CHECK:STDOUT: !50 = !DISubroutineType(types: !49) -// CHECK:STDOUT: !51 = !DILocation(line: 4, column: 1, scope: !46) -// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "GenericF", linkageName: "_CGenericF.Main.084a2801e0f5d754", scope: null, file: !18, line: 17, type: !50, spFlags: DISPFlagDefinition, unit: !43, retainedNodes: !62) -// CHECK:STDOUT: !53 = !DILocalVariable(arg: 1, scope: !52, type: !48) -// CHECK:STDOUT: !57 = !DILocation(line: 18, column: 3, scope: !52) -// CHECK:STDOUT: !58 = !DILocation(line: 18, column: 16, scope: !52) -// CHECK:STDOUT: !60 = !DILocation(line: 19, column: 10, scope: !52) -// CHECK:STDOUT: !61 = !DILocation(line: 19, column: 3, scope: !52) -// CHECK:STDOUT: !62 = !{!53} +// CHECK:STDOUT: !54 = !DIFile(filename: "b.carbon", directory: "") +// CHECK:STDOUT: !55 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !54, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !56 = !{null} +// CHECK:STDOUT: !57 = !DISubroutineType(types: !56) +// CHECK:STDOUT: !58 = distinct !DISubprogram(name: "Main", linkageName: "_CMain.Main", scope: null, file: !54, line: 4, type: !57, spFlags: DISPFlagDefinition, unit: !55) +// CHECK:STDOUT: !59 = !DILocation(line: 5, column: 3, scope: !58) +// CHECK:STDOUT: !60 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !61 = !{!20, !60} +// CHECK:STDOUT: !62 = !DISubroutineType(types: !61) +// CHECK:STDOUT: !63 = !DILocation(line: 4, column: 1, scope: !58) +// CHECK:STDOUT: !64 = distinct !DISubprogram(name: "GenericF", linkageName: "_CGenericF.Main.084a2801e0f5d754", scope: null, file: !18, line: 17, type: !62, spFlags: DISPFlagDefinition, unit: !55, retainedNodes: !74) +// CHECK:STDOUT: !65 = !DILocalVariable(arg: 1, scope: !64, type: !60) +// CHECK:STDOUT: !69 = !DILocation(line: 18, column: 3, scope: !64) +// CHECK:STDOUT: !70 = !DILocation(line: 18, column: 16, scope: !64) +// CHECK:STDOUT: !72 = !DILocation(line: 19, column: 10, scope: !64) +// CHECK:STDOUT: !73 = !DILocation(line: 19, column: 3, scope: !64) +// CHECK:STDOUT: !74 = !{!65} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/function/generic/reverse_canonical.carbon b/toolchain/lower/testdata/function/generic/reverse_canonical.carbon index 0e8ea601b88c..8a5a6f2ea601 100644 --- a/toolchain/lower/testdata/function/generic/reverse_canonical.carbon +++ b/toolchain/lower/testdata/function/generic/reverse_canonical.carbon @@ -52,119 +52,152 @@ fn Main() { // CHECK:STDOUT: source_filename = "reverse_canonical.carbon" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CMain.Main() #0 !dbg !20 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cc2eb235f3a2109b:core.Destroy.Core"(ptr %self) #0 !dbg !23 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %x.var = alloca i1, align 1, !dbg !21 -// CHECK:STDOUT: %y.var = alloca ptr, align 8, !dbg !23 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %x.var), !dbg !21 -// CHECK:STDOUT: store i8 poison, ptr %x.var, align 1, !dbg !21 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %y.var), !dbg !23 -// CHECK:STDOUT: store ptr poison, ptr %y.var, align 8, !dbg !23 -// CHECK:STDOUT: %.loc47_9 = load i8, ptr %x.var, align 1, !dbg !25 -// CHECK:STDOUT: %.loc47_91 = trunc i8 %.loc47_9 to i1, !dbg !25 -// CHECK:STDOUT: %.loc47_12 = load i8, ptr %x.var, align 1, !dbg !26 -// CHECK:STDOUT: %.loc47_122 = trunc i8 %.loc47_12 to i1, !dbg !26 -// CHECK:STDOUT: %.loc47_15 = load ptr, ptr %y.var, align 8, !dbg !27 -// CHECK:STDOUT: call void @_Cfirst.Main.36f5e0b0ce09cb9a(i1 %.loc47_91, i1 %.loc47_122, ptr %.loc47_15), !dbg !28 -// CHECK:STDOUT: ret void, !dbg !32 +// CHECK:STDOUT: ret void, !dbg !25 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.146e3bb0985f5a0c:core.Destroy.Core"(ptr %self) #0 !dbg !27 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !29 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CMain.Main() #0 !dbg !31 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %x.var = alloca i1, align 1, !dbg !32 +// CHECK:STDOUT: %y.var = alloca ptr, align 8, !dbg !34 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %x.var), !dbg !32 +// CHECK:STDOUT: store i8 poison, ptr %x.var, align 1, !dbg !32 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %y.var), !dbg !34 +// CHECK:STDOUT: store ptr poison, ptr %y.var, align 8, !dbg !34 +// CHECK:STDOUT: %.loc47_9 = load i8, ptr %x.var, align 1, !dbg !36 +// CHECK:STDOUT: %.loc47_91 = trunc i8 %.loc47_9 to i1, !dbg !36 +// CHECK:STDOUT: %.loc47_12 = load i8, ptr %x.var, align 1, !dbg !37 +// CHECK:STDOUT: %.loc47_122 = trunc i8 %.loc47_12 to i1, !dbg !37 +// CHECK:STDOUT: %.loc47_15 = load ptr, ptr %y.var, align 8, !dbg !38 +// CHECK:STDOUT: call void @_Cfirst.Main.36f5e0b0ce09cb9a(i1 %.loc47_91, i1 %.loc47_122, ptr %.loc47_15), !dbg !39 +// CHECK:STDOUT: call void @"_CSelfDestruct.bb2383e5e4785e19:core.Destroy.Core"(ptr %y.var), !dbg !34 +// CHECK:STDOUT: call void @"_CSelfDestruct.48e0adf639fe7af4:core.Destroy.Core"(ptr %x.var), !dbg !32 +// CHECK:STDOUT: ret void, !dbg !42 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.bb2383e5e4785e19:core.Destroy.Core"(ptr %self) #0 !dbg !43 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !45 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.48e0adf639fe7af4:core.Destroy.Core"(ptr %self) #0 !dbg !47 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !49 // 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 @_Cfirst.Main.36f5e0b0ce09cb9a(i1 %arg1, i1 %arg2, ptr %arg3) #0 !dbg !33 { +// CHECK:STDOUT: define linkonce_odr void @_Cfirst.Main.36f5e0b0ce09cb9a(i1 %arg1, i1 %arg2, ptr %arg3) #0 !dbg !51 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %local_name.var = alloca ptr, align 8, !dbg !40 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %local_name.var), !dbg !40 -// CHECK:STDOUT: store ptr poison, ptr %local_name.var, align 8, !dbg !40 -// CHECK:STDOUT: %.loc23 = load ptr, ptr %local_name.var, align 8, !dbg !44 -// CHECK:STDOUT: call void @_Csecond.Main.0f29a29bf45af723(i1 %arg2, i1 %arg2, ptr %.loc23), !dbg !45 -// CHECK:STDOUT: ret void, !dbg !46 +// CHECK:STDOUT: %local_name.var = alloca ptr, align 8, !dbg !58 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %local_name.var), !dbg !58 +// CHECK:STDOUT: store ptr poison, ptr %local_name.var, align 8, !dbg !58 +// CHECK:STDOUT: %.loc23 = load ptr, ptr %local_name.var, align 8, !dbg !62 +// CHECK:STDOUT: call void @_Csecond.Main.0f29a29bf45af723(i1 %arg2, i1 %arg2, ptr %.loc23), !dbg !63 +// CHECK:STDOUT: call void @"_CSelfDestruct.cc2eb235f3a2109b:core.Destroy.Core"(ptr %local_name.var), !dbg !58 +// CHECK:STDOUT: ret void, !dbg !64 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_Csecond.Main.0f29a29bf45af723(i1 %arg1, i1 %arg2, ptr %arg3) #0 !dbg !48 { +// CHECK:STDOUT: define linkonce_odr void @_Csecond.Main.0f29a29bf45af723(i1 %arg1, i1 %arg2, ptr %arg3) #0 !dbg !66 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %local_name.var = alloca ptr, align 8, !dbg !55 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %local_name.var), !dbg !55 -// CHECK:STDOUT: store ptr poison, ptr %local_name.var, align 8, !dbg !55 -// CHECK:STDOUT: call void @_Cfirst.Main.81f1c9de445b895c(ptr %arg3, ptr %arg3, i1 %arg1), !dbg !60 -// CHECK:STDOUT: %.loc30 = load ptr, ptr %local_name.var, align 8, !dbg !63 -// CHECK:STDOUT: call void @_Cthird.Main.0f29a29bf45af723(i1 %arg2, i1 %arg2, ptr %.loc30), !dbg !64 -// CHECK:STDOUT: ret void, !dbg !65 +// CHECK:STDOUT: %local_name.var = alloca ptr, align 8, !dbg !73 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %local_name.var), !dbg !73 +// CHECK:STDOUT: store ptr poison, ptr %local_name.var, align 8, !dbg !73 +// CHECK:STDOUT: call void @_Cfirst.Main.81f1c9de445b895c(ptr %arg3, ptr %arg3, i1 %arg1), !dbg !78 +// CHECK:STDOUT: %.loc30 = load ptr, ptr %local_name.var, align 8, !dbg !81 +// CHECK:STDOUT: call void @_Cthird.Main.0f29a29bf45af723(i1 %arg2, i1 %arg2, ptr %.loc30), !dbg !82 +// CHECK:STDOUT: call void @"_CSelfDestruct.cc2eb235f3a2109b:core.Destroy.Core"(ptr %local_name.var), !dbg !73 +// CHECK:STDOUT: ret void, !dbg !83 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_Cfirst.Main.81f1c9de445b895c(ptr %arg1, ptr %arg2, i1 %arg3) #0 !dbg !67 { +// CHECK:STDOUT: define linkonce_odr void @_Cfirst.Main.81f1c9de445b895c(ptr %arg1, ptr %arg2, i1 %arg3) #0 !dbg !85 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %local_name.var = alloca ptr, align 8, !dbg !74 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %local_name.var), !dbg !74 -// CHECK:STDOUT: store ptr poison, ptr %local_name.var, align 8, !dbg !74 -// CHECK:STDOUT: %.loc23 = load ptr, ptr %local_name.var, align 8, !dbg !78 -// CHECK:STDOUT: call void @_Csecond.Main.e1ce67f3c23ab61f(ptr %arg2, ptr %arg2, ptr %.loc23), !dbg !79 -// CHECK:STDOUT: ret void, !dbg !80 +// CHECK:STDOUT: %local_name.var = alloca ptr, align 8, !dbg !92 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %local_name.var), !dbg !92 +// CHECK:STDOUT: store ptr poison, ptr %local_name.var, align 8, !dbg !92 +// CHECK:STDOUT: %.loc23 = load ptr, ptr %local_name.var, align 8, !dbg !96 +// CHECK:STDOUT: call void @_Csecond.Main.e1ce67f3c23ab61f(ptr %arg2, ptr %arg2, ptr %.loc23), !dbg !97 +// CHECK:STDOUT: call void @"_CSelfDestruct.cc2eb235f3a2109b:core.Destroy.Core"(ptr %local_name.var), !dbg !92 +// CHECK:STDOUT: ret void, !dbg !98 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_Cthird.Main.0f29a29bf45af723(i1 %arg1, i1 %arg2, ptr %arg3) #0 !dbg !82 { +// CHECK:STDOUT: define linkonce_odr void @_Cthird.Main.0f29a29bf45af723(i1 %arg1, i1 %arg2, ptr %arg3) #0 !dbg !100 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %local_name.var = alloca ptr, align 8, !dbg !89 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %local_name.var), !dbg !89 -// CHECK:STDOUT: store ptr poison, ptr %local_name.var, align 8, !dbg !89 -// CHECK:STDOUT: %.loc36_10 = load ptr, ptr %local_name.var, align 8, !dbg !91 -// CHECK:STDOUT: %.loc36_22 = load ptr, ptr %local_name.var, align 8, !dbg !92 -// CHECK:STDOUT: call void @_Cfourth.Main.c6787c0e2572c86c(ptr %.loc36_10, ptr %.loc36_22, i1 %arg1), !dbg !94 -// CHECK:STDOUT: call void @_Cfourth.Main.c6787c0e2572c86c(ptr %arg3, ptr %arg3, i1 %arg2), !dbg !98 -// CHECK:STDOUT: ret void, !dbg !99 +// CHECK:STDOUT: %local_name.var = alloca ptr, align 8, !dbg !107 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %local_name.var), !dbg !107 +// CHECK:STDOUT: store ptr poison, ptr %local_name.var, align 8, !dbg !107 +// CHECK:STDOUT: %.loc36_10 = load ptr, ptr %local_name.var, align 8, !dbg !109 +// CHECK:STDOUT: %.loc36_22 = load ptr, ptr %local_name.var, align 8, !dbg !110 +// CHECK:STDOUT: call void @_Cfourth.Main.c6787c0e2572c86c(ptr %.loc36_10, ptr %.loc36_22, i1 %arg1), !dbg !112 +// CHECK:STDOUT: call void @_Cfourth.Main.c6787c0e2572c86c(ptr %arg3, ptr %arg3, i1 %arg2), !dbg !116 +// CHECK:STDOUT: call void @"_CSelfDestruct.146e3bb0985f5a0c:core.Destroy.Core"(ptr %local_name.var), !dbg !107 +// CHECK:STDOUT: ret void, !dbg !117 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_Csecond.Main.e1ce67f3c23ab61f(ptr %arg1, ptr %arg2, ptr %arg3) #0 !dbg !101 { +// CHECK:STDOUT: define linkonce_odr void @_Csecond.Main.e1ce67f3c23ab61f(ptr %arg1, ptr %arg2, ptr %arg3) #0 !dbg !119 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %local_name.var = alloca ptr, align 8, !dbg !108 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %local_name.var), !dbg !108 -// CHECK:STDOUT: store ptr poison, ptr %local_name.var, align 8, !dbg !108 -// CHECK:STDOUT: call void @_Cfirst.Main.e1ce67f3c23ab61f(ptr %arg3, ptr %arg3, ptr %arg1), !dbg !113 -// CHECK:STDOUT: %.loc30 = load ptr, ptr %local_name.var, align 8, !dbg !116 -// CHECK:STDOUT: call void @_Cthird.Main.e1ce67f3c23ab61f(ptr %arg2, ptr %arg2, ptr %.loc30), !dbg !117 -// CHECK:STDOUT: ret void, !dbg !118 +// CHECK:STDOUT: %local_name.var = alloca ptr, align 8, !dbg !126 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %local_name.var), !dbg !126 +// CHECK:STDOUT: store ptr poison, ptr %local_name.var, align 8, !dbg !126 +// CHECK:STDOUT: call void @_Cfirst.Main.e1ce67f3c23ab61f(ptr %arg3, ptr %arg3, ptr %arg1), !dbg !131 +// CHECK:STDOUT: %.loc30 = load ptr, ptr %local_name.var, align 8, !dbg !134 +// CHECK:STDOUT: call void @_Cthird.Main.e1ce67f3c23ab61f(ptr %arg2, ptr %arg2, ptr %.loc30), !dbg !135 +// CHECK:STDOUT: call void @"_CSelfDestruct.cc2eb235f3a2109b:core.Destroy.Core"(ptr %local_name.var), !dbg !126 +// CHECK:STDOUT: ret void, !dbg !136 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_Cfourth.Main.c6787c0e2572c86c(ptr %arg1, ptr %arg2, i1 %arg3) #0 !dbg !120 { +// CHECK:STDOUT: define linkonce_odr void @_Cfourth.Main.c6787c0e2572c86c(ptr %arg1, ptr %arg2, i1 %arg3) #0 !dbg !138 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !127 +// CHECK:STDOUT: ret void, !dbg !145 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_Cfirst.Main.e1ce67f3c23ab61f(ptr %arg1, ptr %arg2, ptr %arg3) #0 !dbg !138 { +// CHECK:STDOUT: define linkonce_odr void @_Cfirst.Main.e1ce67f3c23ab61f(ptr %arg1, ptr %arg2, ptr %arg3) #0 !dbg !156 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %local_name.var = alloca ptr, align 8, !dbg !145 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %local_name.var), !dbg !145 -// CHECK:STDOUT: store ptr poison, ptr %local_name.var, align 8, !dbg !145 -// CHECK:STDOUT: %.loc23 = load ptr, ptr %local_name.var, align 8, !dbg !149 -// CHECK:STDOUT: call void @_Csecond.Main.e1ce67f3c23ab61f(ptr %arg2, ptr %arg2, ptr %.loc23), !dbg !150 -// CHECK:STDOUT: ret void, !dbg !151 +// CHECK:STDOUT: %local_name.var = alloca ptr, align 8, !dbg !163 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %local_name.var), !dbg !163 +// CHECK:STDOUT: store ptr poison, ptr %local_name.var, align 8, !dbg !163 +// CHECK:STDOUT: %.loc23 = load ptr, ptr %local_name.var, align 8, !dbg !167 +// CHECK:STDOUT: call void @_Csecond.Main.e1ce67f3c23ab61f(ptr %arg2, ptr %arg2, ptr %.loc23), !dbg !168 +// CHECK:STDOUT: call void @"_CSelfDestruct.cc2eb235f3a2109b:core.Destroy.Core"(ptr %local_name.var), !dbg !163 +// CHECK:STDOUT: ret void, !dbg !169 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_Cthird.Main.e1ce67f3c23ab61f(ptr %arg1, ptr %arg2, ptr %arg3) #0 !dbg !153 { +// CHECK:STDOUT: define linkonce_odr void @_Cthird.Main.e1ce67f3c23ab61f(ptr %arg1, ptr %arg2, ptr %arg3) #0 !dbg !171 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %local_name.var = alloca ptr, align 8, !dbg !160 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %local_name.var), !dbg !160 -// CHECK:STDOUT: store ptr poison, ptr %local_name.var, align 8, !dbg !160 -// CHECK:STDOUT: %.loc36_10 = load ptr, ptr %local_name.var, align 8, !dbg !162 -// CHECK:STDOUT: %.loc36_22 = load ptr, ptr %local_name.var, align 8, !dbg !163 -// CHECK:STDOUT: call void @_Cfourth.Main.901b24db5c2cfe42(ptr %.loc36_10, ptr %.loc36_22, ptr %arg1), !dbg !165 -// CHECK:STDOUT: call void @_Cfourth.Main.901b24db5c2cfe42(ptr %arg3, ptr %arg3, ptr %arg2), !dbg !169 -// CHECK:STDOUT: ret void, !dbg !170 +// CHECK:STDOUT: %local_name.var = alloca ptr, align 8, !dbg !178 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %local_name.var), !dbg !178 +// CHECK:STDOUT: store ptr poison, ptr %local_name.var, align 8, !dbg !178 +// CHECK:STDOUT: %.loc36_10 = load ptr, ptr %local_name.var, align 8, !dbg !180 +// CHECK:STDOUT: %.loc36_22 = load ptr, ptr %local_name.var, align 8, !dbg !181 +// CHECK:STDOUT: call void @_Cfourth.Main.901b24db5c2cfe42(ptr %.loc36_10, ptr %.loc36_22, ptr %arg1), !dbg !183 +// CHECK:STDOUT: call void @_Cfourth.Main.901b24db5c2cfe42(ptr %arg3, ptr %arg3, ptr %arg2), !dbg !187 +// CHECK:STDOUT: call void @"_CSelfDestruct.146e3bb0985f5a0c:core.Destroy.Core"(ptr %local_name.var), !dbg !178 +// CHECK:STDOUT: ret void, !dbg !188 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_Cfourth.Main.901b24db5c2cfe42(ptr %arg1, ptr %arg2, ptr %arg3) #0 !dbg !172 { +// CHECK:STDOUT: define linkonce_odr void @_Cfourth.Main.901b24db5c2cfe42(ptr %arg1, ptr %arg2, ptr %arg3) #0 !dbg !190 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !179 +// CHECK:STDOUT: ret void, !dbg !197 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -182,98 +215,116 @@ fn Main() { // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !16 = !DIFile(filename: "reverse_canonical.carbon", directory: "") // CHECK:STDOUT: !17 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !16, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !18 = !{null} -// CHECK:STDOUT: !19 = !DISubroutineType(types: !18) -// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "Main", linkageName: "_CMain.Main", scope: null, file: !16, line: 43, type: !19, spFlags: DISPFlagDefinition, unit: !17) -// CHECK:STDOUT: !21 = !DILocation(line: 44, column: 3, scope: !20) -// CHECK:STDOUT: !23 = !DILocation(line: 45, column: 3, scope: !20) -// CHECK:STDOUT: !25 = !DILocation(line: 47, column: 9, scope: !20) -// CHECK:STDOUT: !26 = !DILocation(line: 47, column: 12, scope: !20) -// CHECK:STDOUT: !27 = !DILocation(line: 47, column: 15, scope: !20) -// CHECK:STDOUT: !28 = !DILocation(line: 47, column: 3, scope: !20) -// CHECK:STDOUT: !29 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !30 = !{null, !29, !29, !29} -// CHECK:STDOUT: !31 = !DISubroutineType(types: !30) -// CHECK:STDOUT: !32 = !DILocation(line: 43, column: 1, scope: !20) -// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "first", linkageName: "_Cfirst.Main.36f5e0b0ce09cb9a", scope: null, file: !16, line: 20, type: !31, spFlags: DISPFlagDefinition, unit: !17, retainedNodes: !47) -// CHECK:STDOUT: !34 = !DILocalVariable(arg: 1, scope: !33, type: !29) -// CHECK:STDOUT: !35 = !DILocalVariable(arg: 2, scope: !33, type: !29) -// CHECK:STDOUT: !36 = !DILocalVariable(arg: 3, scope: !33, type: !29) -// CHECK:STDOUT: !40 = !DILocation(line: 21, column: 3, scope: !33) -// CHECK:STDOUT: !44 = !DILocation(line: 23, column: 22, scope: !33) -// CHECK:STDOUT: !45 = !DILocation(line: 23, column: 3, scope: !33) -// CHECK:STDOUT: !46 = !DILocation(line: 20, column: 1, scope: !33) -// CHECK:STDOUT: !47 = !{!34, !35, !36} -// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "second", linkageName: "_Csecond.Main.0f29a29bf45af723", scope: null, file: !16, line: 26, type: !31, spFlags: DISPFlagDefinition, unit: !17, retainedNodes: !66) -// CHECK:STDOUT: !49 = !DILocalVariable(arg: 1, scope: !48, type: !29) -// CHECK:STDOUT: !50 = !DILocalVariable(arg: 2, scope: !48, type: !29) -// CHECK:STDOUT: !51 = !DILocalVariable(arg: 3, scope: !48, type: !29) -// CHECK:STDOUT: !55 = !DILocation(line: 27, column: 3, scope: !48) -// CHECK:STDOUT: !60 = !DILocation(line: 29, column: 3, scope: !48) -// CHECK:STDOUT: !63 = !DILocation(line: 30, column: 21, scope: !48) -// CHECK:STDOUT: !64 = !DILocation(line: 30, column: 3, scope: !48) -// CHECK:STDOUT: !65 = !DILocation(line: 26, column: 1, scope: !48) -// CHECK:STDOUT: !66 = !{!49, !50, !51} -// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "first", linkageName: "_Cfirst.Main.81f1c9de445b895c", scope: null, file: !16, line: 20, type: !31, spFlags: DISPFlagDefinition, unit: !17, retainedNodes: !81) -// CHECK:STDOUT: !68 = !DILocalVariable(arg: 1, scope: !67, type: !29) -// CHECK:STDOUT: !69 = !DILocalVariable(arg: 2, scope: !67, type: !29) -// CHECK:STDOUT: !70 = !DILocalVariable(arg: 3, scope: !67, type: !29) -// CHECK:STDOUT: !74 = !DILocation(line: 21, column: 3, scope: !67) -// CHECK:STDOUT: !78 = !DILocation(line: 23, column: 22, scope: !67) -// CHECK:STDOUT: !79 = !DILocation(line: 23, column: 3, scope: !67) -// CHECK:STDOUT: !80 = !DILocation(line: 20, column: 1, scope: !67) -// CHECK:STDOUT: !81 = !{!68, !69, !70} -// CHECK:STDOUT: !82 = distinct !DISubprogram(name: "third", linkageName: "_Cthird.Main.0f29a29bf45af723", scope: null, file: !16, line: 33, type: !31, spFlags: DISPFlagDefinition, unit: !17, retainedNodes: !100) -// CHECK:STDOUT: !83 = !DILocalVariable(arg: 1, scope: !82, type: !29) -// CHECK:STDOUT: !84 = !DILocalVariable(arg: 2, scope: !82, type: !29) -// CHECK:STDOUT: !85 = !DILocalVariable(arg: 3, scope: !82, type: !29) -// CHECK:STDOUT: !89 = !DILocation(line: 34, column: 3, scope: !82) -// CHECK:STDOUT: !91 = !DILocation(line: 36, column: 10, scope: !82) -// CHECK:STDOUT: !92 = !DILocation(line: 36, column: 22, scope: !82) -// CHECK:STDOUT: !94 = !DILocation(line: 36, column: 3, scope: !82) -// CHECK:STDOUT: !98 = !DILocation(line: 37, column: 3, scope: !82) -// CHECK:STDOUT: !99 = !DILocation(line: 33, column: 1, scope: !82) -// CHECK:STDOUT: !100 = !{!83, !84, !85} -// CHECK:STDOUT: !101 = distinct !DISubprogram(name: "second", linkageName: "_Csecond.Main.e1ce67f3c23ab61f", scope: null, file: !16, line: 26, type: !31, spFlags: DISPFlagDefinition, unit: !17, retainedNodes: !119) -// CHECK:STDOUT: !102 = !DILocalVariable(arg: 1, scope: !101, type: !29) -// CHECK:STDOUT: !103 = !DILocalVariable(arg: 2, scope: !101, type: !29) -// CHECK:STDOUT: !104 = !DILocalVariable(arg: 3, scope: !101, type: !29) -// CHECK:STDOUT: !108 = !DILocation(line: 27, column: 3, scope: !101) -// CHECK:STDOUT: !113 = !DILocation(line: 29, column: 3, scope: !101) -// CHECK:STDOUT: !116 = !DILocation(line: 30, column: 21, scope: !101) -// CHECK:STDOUT: !117 = !DILocation(line: 30, column: 3, scope: !101) -// CHECK:STDOUT: !118 = !DILocation(line: 26, column: 1, scope: !101) -// CHECK:STDOUT: !119 = !{!102, !103, !104} -// CHECK:STDOUT: !120 = distinct !DISubprogram(name: "fourth", linkageName: "_Cfourth.Main.c6787c0e2572c86c", scope: null, file: !16, line: 40, type: !31, spFlags: DISPFlagDefinition, unit: !17, retainedNodes: !128) -// CHECK:STDOUT: !121 = !DILocalVariable(arg: 1, scope: !120, type: !29) -// CHECK:STDOUT: !122 = !DILocalVariable(arg: 2, scope: !120, type: !29) -// CHECK:STDOUT: !123 = !DILocalVariable(arg: 3, scope: !120, type: !29) -// CHECK:STDOUT: !127 = !DILocation(line: 40, column: 1, scope: !120) -// CHECK:STDOUT: !128 = !{!121, !122, !123} -// CHECK:STDOUT: !138 = distinct !DISubprogram(name: "first", linkageName: "_Cfirst.Main.e1ce67f3c23ab61f", scope: null, file: !16, line: 20, type: !31, spFlags: DISPFlagDefinition, unit: !17, retainedNodes: !152) -// CHECK:STDOUT: !139 = !DILocalVariable(arg: 1, scope: !138, type: !29) -// CHECK:STDOUT: !140 = !DILocalVariable(arg: 2, scope: !138, type: !29) -// CHECK:STDOUT: !141 = !DILocalVariable(arg: 3, scope: !138, type: !29) -// CHECK:STDOUT: !145 = !DILocation(line: 21, column: 3, scope: !138) -// CHECK:STDOUT: !149 = !DILocation(line: 23, column: 22, scope: !138) -// CHECK:STDOUT: !150 = !DILocation(line: 23, column: 3, scope: !138) -// CHECK:STDOUT: !151 = !DILocation(line: 20, column: 1, scope: !138) -// CHECK:STDOUT: !152 = !{!139, !140, !141} -// CHECK:STDOUT: !153 = distinct !DISubprogram(name: "third", linkageName: "_Cthird.Main.e1ce67f3c23ab61f", scope: null, file: !16, line: 33, type: !31, spFlags: DISPFlagDefinition, unit: !17, retainedNodes: !171) -// CHECK:STDOUT: !154 = !DILocalVariable(arg: 1, scope: !153, type: !29) -// CHECK:STDOUT: !155 = !DILocalVariable(arg: 2, scope: !153, type: !29) -// CHECK:STDOUT: !156 = !DILocalVariable(arg: 3, scope: !153, type: !29) -// CHECK:STDOUT: !160 = !DILocation(line: 34, column: 3, scope: !153) -// CHECK:STDOUT: !162 = !DILocation(line: 36, column: 10, scope: !153) -// CHECK:STDOUT: !163 = !DILocation(line: 36, column: 22, scope: !153) -// CHECK:STDOUT: !165 = !DILocation(line: 36, column: 3, scope: !153) -// CHECK:STDOUT: !169 = !DILocation(line: 37, column: 3, scope: !153) -// CHECK:STDOUT: !170 = !DILocation(line: 33, column: 1, scope: !153) -// CHECK:STDOUT: !171 = !{!154, !155, !156} -// CHECK:STDOUT: !172 = distinct !DISubprogram(name: "fourth", linkageName: "_Cfourth.Main.901b24db5c2cfe42", scope: null, file: !16, line: 40, type: !31, spFlags: DISPFlagDefinition, unit: !17, retainedNodes: !180) -// CHECK:STDOUT: !173 = !DILocalVariable(arg: 1, scope: !172, type: !29) -// CHECK:STDOUT: !174 = !DILocalVariable(arg: 2, scope: !172, type: !29) -// CHECK:STDOUT: !175 = !DILocalVariable(arg: 3, scope: !172, type: !29) -// CHECK:STDOUT: !179 = !DILocation(line: 40, column: 1, scope: !172) -// CHECK:STDOUT: !180 = !{!173, !174, !175} +// CHECK:STDOUT: !18 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !19 = !{null, !18} +// CHECK:STDOUT: !20 = !DISubroutineType(types: !19) +// CHECK:STDOUT: !21 = !{null} +// CHECK:STDOUT: !22 = !DISubroutineType(types: !21) +// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cc2eb235f3a2109b:core.Destroy.Core", scope: null, file: !16, line: 21, type: !20, spFlags: DISPFlagDefinition, unit: !17, retainedNodes: !26) +// CHECK:STDOUT: !24 = !DILocalVariable(arg: 1, scope: !23, type: !18) +// CHECK:STDOUT: !25 = !DILocation(line: 21, column: 3, scope: !23) +// CHECK:STDOUT: !26 = !{!24} +// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.146e3bb0985f5a0c:core.Destroy.Core", scope: null, file: !16, line: 34, type: !20, spFlags: DISPFlagDefinition, unit: !17, retainedNodes: !30) +// CHECK:STDOUT: !28 = !DILocalVariable(arg: 1, scope: !27, type: !18) +// CHECK:STDOUT: !29 = !DILocation(line: 34, column: 3, scope: !27) +// CHECK:STDOUT: !30 = !{!28} +// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "Main", linkageName: "_CMain.Main", scope: null, file: !16, line: 43, type: !22, spFlags: DISPFlagDefinition, unit: !17) +// CHECK:STDOUT: !32 = !DILocation(line: 44, column: 3, scope: !31) +// CHECK:STDOUT: !34 = !DILocation(line: 45, column: 3, scope: !31) +// CHECK:STDOUT: !36 = !DILocation(line: 47, column: 9, scope: !31) +// CHECK:STDOUT: !37 = !DILocation(line: 47, column: 12, scope: !31) +// CHECK:STDOUT: !38 = !DILocation(line: 47, column: 15, scope: !31) +// CHECK:STDOUT: !39 = !DILocation(line: 47, column: 3, scope: !31) +// CHECK:STDOUT: !40 = !{null, !18, !18, !18} +// CHECK:STDOUT: !41 = !DISubroutineType(types: !40) +// CHECK:STDOUT: !42 = !DILocation(line: 43, column: 1, scope: !31) +// CHECK:STDOUT: !43 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.bb2383e5e4785e19:core.Destroy.Core", scope: null, file: !16, line: 45, type: !20, spFlags: DISPFlagDefinition, unit: !17, retainedNodes: !46) +// CHECK:STDOUT: !44 = !DILocalVariable(arg: 1, scope: !43, type: !18) +// CHECK:STDOUT: !45 = !DILocation(line: 45, column: 3, scope: !43) +// CHECK:STDOUT: !46 = !{!44} +// CHECK:STDOUT: !47 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.48e0adf639fe7af4:core.Destroy.Core", scope: null, file: !16, line: 44, type: !20, spFlags: DISPFlagDefinition, unit: !17, retainedNodes: !50) +// CHECK:STDOUT: !48 = !DILocalVariable(arg: 1, scope: !47, type: !18) +// CHECK:STDOUT: !49 = !DILocation(line: 44, column: 3, scope: !47) +// CHECK:STDOUT: !50 = !{!48} +// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "first", linkageName: "_Cfirst.Main.36f5e0b0ce09cb9a", scope: null, file: !16, line: 20, type: !41, spFlags: DISPFlagDefinition, unit: !17, retainedNodes: !65) +// CHECK:STDOUT: !52 = !DILocalVariable(arg: 1, scope: !51, type: !18) +// CHECK:STDOUT: !53 = !DILocalVariable(arg: 2, scope: !51, type: !18) +// CHECK:STDOUT: !54 = !DILocalVariable(arg: 3, scope: !51, type: !18) +// CHECK:STDOUT: !58 = !DILocation(line: 21, column: 3, scope: !51) +// CHECK:STDOUT: !62 = !DILocation(line: 23, column: 22, scope: !51) +// CHECK:STDOUT: !63 = !DILocation(line: 23, column: 3, scope: !51) +// CHECK:STDOUT: !64 = !DILocation(line: 20, column: 1, scope: !51) +// CHECK:STDOUT: !65 = !{!52, !53, !54} +// CHECK:STDOUT: !66 = distinct !DISubprogram(name: "second", linkageName: "_Csecond.Main.0f29a29bf45af723", scope: null, file: !16, line: 26, type: !41, spFlags: DISPFlagDefinition, unit: !17, retainedNodes: !84) +// CHECK:STDOUT: !67 = !DILocalVariable(arg: 1, scope: !66, type: !18) +// CHECK:STDOUT: !68 = !DILocalVariable(arg: 2, scope: !66, type: !18) +// CHECK:STDOUT: !69 = !DILocalVariable(arg: 3, scope: !66, type: !18) +// CHECK:STDOUT: !73 = !DILocation(line: 27, column: 3, scope: !66) +// CHECK:STDOUT: !78 = !DILocation(line: 29, column: 3, scope: !66) +// CHECK:STDOUT: !81 = !DILocation(line: 30, column: 21, scope: !66) +// CHECK:STDOUT: !82 = !DILocation(line: 30, column: 3, scope: !66) +// CHECK:STDOUT: !83 = !DILocation(line: 26, column: 1, scope: !66) +// CHECK:STDOUT: !84 = !{!67, !68, !69} +// CHECK:STDOUT: !85 = distinct !DISubprogram(name: "first", linkageName: "_Cfirst.Main.81f1c9de445b895c", scope: null, file: !16, line: 20, type: !41, spFlags: DISPFlagDefinition, unit: !17, retainedNodes: !99) +// CHECK:STDOUT: !86 = !DILocalVariable(arg: 1, scope: !85, type: !18) +// CHECK:STDOUT: !87 = !DILocalVariable(arg: 2, scope: !85, type: !18) +// CHECK:STDOUT: !88 = !DILocalVariable(arg: 3, scope: !85, type: !18) +// CHECK:STDOUT: !92 = !DILocation(line: 21, column: 3, scope: !85) +// CHECK:STDOUT: !96 = !DILocation(line: 23, column: 22, scope: !85) +// CHECK:STDOUT: !97 = !DILocation(line: 23, column: 3, scope: !85) +// CHECK:STDOUT: !98 = !DILocation(line: 20, column: 1, scope: !85) +// CHECK:STDOUT: !99 = !{!86, !87, !88} +// CHECK:STDOUT: !100 = distinct !DISubprogram(name: "third", linkageName: "_Cthird.Main.0f29a29bf45af723", scope: null, file: !16, line: 33, type: !41, spFlags: DISPFlagDefinition, unit: !17, retainedNodes: !118) +// CHECK:STDOUT: !101 = !DILocalVariable(arg: 1, scope: !100, type: !18) +// CHECK:STDOUT: !102 = !DILocalVariable(arg: 2, scope: !100, type: !18) +// CHECK:STDOUT: !103 = !DILocalVariable(arg: 3, scope: !100, type: !18) +// CHECK:STDOUT: !107 = !DILocation(line: 34, column: 3, scope: !100) +// CHECK:STDOUT: !109 = !DILocation(line: 36, column: 10, scope: !100) +// CHECK:STDOUT: !110 = !DILocation(line: 36, column: 22, scope: !100) +// CHECK:STDOUT: !112 = !DILocation(line: 36, column: 3, scope: !100) +// CHECK:STDOUT: !116 = !DILocation(line: 37, column: 3, scope: !100) +// CHECK:STDOUT: !117 = !DILocation(line: 33, column: 1, scope: !100) +// CHECK:STDOUT: !118 = !{!101, !102, !103} +// CHECK:STDOUT: !119 = distinct !DISubprogram(name: "second", linkageName: "_Csecond.Main.e1ce67f3c23ab61f", scope: null, file: !16, line: 26, type: !41, spFlags: DISPFlagDefinition, unit: !17, retainedNodes: !137) +// CHECK:STDOUT: !120 = !DILocalVariable(arg: 1, scope: !119, type: !18) +// CHECK:STDOUT: !121 = !DILocalVariable(arg: 2, scope: !119, type: !18) +// CHECK:STDOUT: !122 = !DILocalVariable(arg: 3, scope: !119, type: !18) +// CHECK:STDOUT: !126 = !DILocation(line: 27, column: 3, scope: !119) +// CHECK:STDOUT: !131 = !DILocation(line: 29, column: 3, scope: !119) +// CHECK:STDOUT: !134 = !DILocation(line: 30, column: 21, scope: !119) +// CHECK:STDOUT: !135 = !DILocation(line: 30, column: 3, scope: !119) +// CHECK:STDOUT: !136 = !DILocation(line: 26, column: 1, scope: !119) +// CHECK:STDOUT: !137 = !{!120, !121, !122} +// CHECK:STDOUT: !138 = distinct !DISubprogram(name: "fourth", linkageName: "_Cfourth.Main.c6787c0e2572c86c", scope: null, file: !16, line: 40, type: !41, spFlags: DISPFlagDefinition, unit: !17, retainedNodes: !146) +// CHECK:STDOUT: !139 = !DILocalVariable(arg: 1, scope: !138, type: !18) +// CHECK:STDOUT: !140 = !DILocalVariable(arg: 2, scope: !138, type: !18) +// CHECK:STDOUT: !141 = !DILocalVariable(arg: 3, scope: !138, type: !18) +// CHECK:STDOUT: !145 = !DILocation(line: 40, column: 1, scope: !138) +// CHECK:STDOUT: !146 = !{!139, !140, !141} +// CHECK:STDOUT: !156 = distinct !DISubprogram(name: "first", linkageName: "_Cfirst.Main.e1ce67f3c23ab61f", scope: null, file: !16, line: 20, type: !41, spFlags: DISPFlagDefinition, unit: !17, retainedNodes: !170) +// CHECK:STDOUT: !157 = !DILocalVariable(arg: 1, scope: !156, type: !18) +// CHECK:STDOUT: !158 = !DILocalVariable(arg: 2, scope: !156, type: !18) +// CHECK:STDOUT: !159 = !DILocalVariable(arg: 3, scope: !156, type: !18) +// CHECK:STDOUT: !163 = !DILocation(line: 21, column: 3, scope: !156) +// CHECK:STDOUT: !167 = !DILocation(line: 23, column: 22, scope: !156) +// CHECK:STDOUT: !168 = !DILocation(line: 23, column: 3, scope: !156) +// CHECK:STDOUT: !169 = !DILocation(line: 20, column: 1, scope: !156) +// CHECK:STDOUT: !170 = !{!157, !158, !159} +// CHECK:STDOUT: !171 = distinct !DISubprogram(name: "third", linkageName: "_Cthird.Main.e1ce67f3c23ab61f", scope: null, file: !16, line: 33, type: !41, spFlags: DISPFlagDefinition, unit: !17, retainedNodes: !189) +// CHECK:STDOUT: !172 = !DILocalVariable(arg: 1, scope: !171, type: !18) +// CHECK:STDOUT: !173 = !DILocalVariable(arg: 2, scope: !171, type: !18) +// CHECK:STDOUT: !174 = !DILocalVariable(arg: 3, scope: !171, type: !18) +// CHECK:STDOUT: !178 = !DILocation(line: 34, column: 3, scope: !171) +// CHECK:STDOUT: !180 = !DILocation(line: 36, column: 10, scope: !171) +// CHECK:STDOUT: !181 = !DILocation(line: 36, column: 22, scope: !171) +// CHECK:STDOUT: !183 = !DILocation(line: 36, column: 3, scope: !171) +// CHECK:STDOUT: !187 = !DILocation(line: 37, column: 3, scope: !171) +// CHECK:STDOUT: !188 = !DILocation(line: 33, column: 1, scope: !171) +// CHECK:STDOUT: !189 = !{!172, !173, !174} +// CHECK:STDOUT: !190 = distinct !DISubprogram(name: "fourth", linkageName: "_Cfourth.Main.901b24db5c2cfe42", scope: null, file: !16, line: 40, type: !41, spFlags: DISPFlagDefinition, unit: !17, retainedNodes: !198) +// CHECK:STDOUT: !191 = !DILocalVariable(arg: 1, scope: !190, type: !18) +// CHECK:STDOUT: !192 = !DILocalVariable(arg: 2, scope: !190, type: !18) +// CHECK:STDOUT: !193 = !DILocalVariable(arg: 3, scope: !190, type: !18) +// CHECK:STDOUT: !197 = !DILocation(line: 40, column: 1, scope: !190) +// CHECK:STDOUT: !198 = !{!191, !192, !193} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/function/generic/self_canonical.carbon b/toolchain/lower/testdata/function/generic/self_canonical.carbon index 63de4825e065..1418faa60e6a 100644 --- a/toolchain/lower/testdata/function/generic/self_canonical.carbon +++ b/toolchain/lower/testdata/function/generic/self_canonical.carbon @@ -87,84 +87,130 @@ fn Main_method_no_template () { // CHECK:STDOUT: source_filename = "self_canonical.carbon" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CMain_method_no_template.Main() #0 !dbg !18 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.73ffa1ae01557cf1:core.Destroy.Core"(ptr %self) #0 !dbg !21 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %local1.var = alloca ptr, align 8, !dbg !19 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %local1.var), !dbg !19 -// CHECK:STDOUT: store ptr poison, ptr %local1.var, align 8, !dbg !19 -// CHECK:STDOUT: %.loc82 = load ptr, ptr %local1.var, align 8, !dbg !21 -// CHECK:STDOUT: call void @_Cfirst_function.Main.ee57965601b4d646(ptr %.loc82), !dbg !22 -// CHECK:STDOUT: ret void, !dbg !26 +// CHECK:STDOUT: ret void, !dbg !23 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.28258e58291017cc:core.Destroy.Core"(ptr %self) #0 !dbg !25 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !27 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.a247f3a5f241fa11:core.Destroy.Core"(ptr %self) #0 !dbg !29 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !31 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.22bdc7946a052e71:core.Destroy.Core"(ptr %self) #0 !dbg !33 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !35 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.680a5c6f7a3d0796:core.Destroy.Core"(ptr %self) #0 !dbg !37 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !39 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CMain_method_no_template.Main() #0 !dbg !41 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %local1.var = alloca ptr, align 8, !dbg !42 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %local1.var), !dbg !42 +// CHECK:STDOUT: store ptr poison, ptr %local1.var, align 8, !dbg !42 +// CHECK:STDOUT: %.loc82 = load ptr, ptr %local1.var, align 8, !dbg !44 +// CHECK:STDOUT: call void @_Cfirst_function.Main.ee57965601b4d646(ptr %.loc82), !dbg !45 +// CHECK:STDOUT: call void @"_CSelfDestruct.a79cf9479d679a84:core.Destroy.Core"(ptr %local1.var), !dbg !42 +// CHECK:STDOUT: ret void, !dbg !46 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.a79cf9479d679a84:core.Destroy.Core"(ptr %self) #0 !dbg !47 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !49 // 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 @_Cfourth_function.Main.4da09b2222fc2513(ptr %arg) #0 !dbg !168 { +// CHECK:STDOUT: define linkonce_odr void @_Cfourth_function.Main.4da09b2222fc2513(ptr %arg) #0 !dbg !192 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %local1.var = alloca ptr, align 8, !dbg !171 -// CHECK:STDOUT: %local2.var = alloca ptr, align 8, !dbg !173 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %local1.var), !dbg !171 -// CHECK:STDOUT: store ptr poison, ptr %local1.var, align 8, !dbg !171 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %local2.var), !dbg !173 -// CHECK:STDOUT: store ptr poison, ptr %local2.var, align 8, !dbg !173 -// CHECK:STDOUT: %.loc53 = load ptr, ptr %local1.var, align 8, !dbg !175 -// CHECK:STDOUT: call void @_Cfirst_function.Main.ee57965601b4d646(ptr %.loc53), !dbg !176 -// CHECK:STDOUT: %.loc54 = load ptr, ptr %local2.var, align 8, !dbg !177 -// CHECK:STDOUT: call void @_Cfirst_function.Main.ee57965601b4d646(ptr %.loc54), !dbg !178 -// CHECK:STDOUT: ret void, !dbg !179 +// CHECK:STDOUT: %local1.var = alloca ptr, align 8, !dbg !195 +// CHECK:STDOUT: %local2.var = alloca ptr, align 8, !dbg !197 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %local1.var), !dbg !195 +// CHECK:STDOUT: store ptr poison, ptr %local1.var, align 8, !dbg !195 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %local2.var), !dbg !197 +// CHECK:STDOUT: store ptr poison, ptr %local2.var, align 8, !dbg !197 +// CHECK:STDOUT: %.loc53 = load ptr, ptr %local1.var, align 8, !dbg !199 +// CHECK:STDOUT: call void @_Cfirst_function.Main.ee57965601b4d646(ptr %.loc53), !dbg !200 +// CHECK:STDOUT: %.loc54 = load ptr, ptr %local2.var, align 8, !dbg !201 +// CHECK:STDOUT: call void @_Cfirst_function.Main.ee57965601b4d646(ptr %.loc54), !dbg !202 +// CHECK:STDOUT: call void @"_CSelfDestruct.28258e58291017cc:core.Destroy.Core"(ptr %local2.var), !dbg !197 +// CHECK:STDOUT: call void @"_CSelfDestruct.a247f3a5f241fa11:core.Destroy.Core"(ptr %local1.var), !dbg !195 +// CHECK:STDOUT: ret void, !dbg !203 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_Cfirst_function.Main.ee57965601b4d646(ptr %arg) #0 !dbg !219 { +// CHECK:STDOUT: define linkonce_odr void @_Cfirst_function.Main.ee57965601b4d646(ptr %arg) #0 !dbg !243 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %local1.var = alloca ptr, align 8, !dbg !222 -// CHECK:STDOUT: %local2.var = alloca ptr, align 8, !dbg !224 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %local1.var), !dbg !222 -// CHECK:STDOUT: store ptr poison, ptr %local1.var, align 8, !dbg !222 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %local2.var), !dbg !224 -// CHECK:STDOUT: store ptr poison, ptr %local2.var, align 8, !dbg !224 -// CHECK:STDOUT: %.loc61_19 = load ptr, ptr %local2.var, align 8, !dbg !226 -// CHECK:STDOUT: %.loc61_27 = load ptr, ptr %local1.var, align 8, !dbg !227 -// CHECK:STDOUT: call void @_Csecond_function.Main.efd9fcdf727c9de5(ptr %.loc61_19, ptr %.loc61_27, ptr %arg), !dbg !229 -// CHECK:STDOUT: ret void, !dbg !230 +// CHECK:STDOUT: %local1.var = alloca ptr, align 8, !dbg !246 +// CHECK:STDOUT: %local2.var = alloca ptr, align 8, !dbg !248 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %local1.var), !dbg !246 +// CHECK:STDOUT: store ptr poison, ptr %local1.var, align 8, !dbg !246 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %local2.var), !dbg !248 +// CHECK:STDOUT: store ptr poison, ptr %local2.var, align 8, !dbg !248 +// CHECK:STDOUT: %.loc61_19 = load ptr, ptr %local2.var, align 8, !dbg !250 +// CHECK:STDOUT: %.loc61_27 = load ptr, ptr %local1.var, align 8, !dbg !251 +// CHECK:STDOUT: call void @_Csecond_function.Main.efd9fcdf727c9de5(ptr %.loc61_19, ptr %.loc61_27, ptr %arg), !dbg !253 +// CHECK:STDOUT: call void @"_CSelfDestruct.22bdc7946a052e71:core.Destroy.Core"(ptr %local2.var), !dbg !248 +// CHECK:STDOUT: call void @"_CSelfDestruct.680a5c6f7a3d0796:core.Destroy.Core"(ptr %local1.var), !dbg !246 +// CHECK:STDOUT: ret void, !dbg !254 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_Csecond_function.Main.efd9fcdf727c9de5(ptr %arg1, ptr %arg2, ptr %arg3) #0 !dbg !245 { +// CHECK:STDOUT: define linkonce_odr void @_Csecond_function.Main.efd9fcdf727c9de5(ptr %arg1, ptr %arg2, ptr %arg3) #0 !dbg !269 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %local1.var = alloca ptr, align 8, !dbg !252 -// CHECK:STDOUT: %local2.var = alloca ptr, align 8, !dbg !254 -// CHECK:STDOUT: %local3.var = alloca ptr, align 8, !dbg !256 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %local1.var), !dbg !252 -// CHECK:STDOUT: store ptr poison, ptr %local1.var, align 8, !dbg !252 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %local2.var), !dbg !254 -// CHECK:STDOUT: store ptr poison, ptr %local2.var, align 8, !dbg !254 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %local3.var), !dbg !256 -// CHECK:STDOUT: store ptr poison, ptr %local3.var, align 8, !dbg !256 -// CHECK:STDOUT: %.loc75_25 = load ptr, ptr %local3.var, align 8, !dbg !259 -// CHECK:STDOUT: %.loc75_33 = load ptr, ptr %local2.var, align 8, !dbg !260 -// CHECK:STDOUT: call void @_Csecond_function.Main.efd9fcdf727c9de5(ptr %arg3, ptr %.loc75_25, ptr %.loc75_33), !dbg !261 -// CHECK:STDOUT: %.loc76 = load ptr, ptr %local1.var, align 8, !dbg !262 -// CHECK:STDOUT: call void @_Cthird_function.Main.1c39a3b349bf66b6(ptr %.loc76, ptr %arg3, ptr %arg1), !dbg !265 -// CHECK:STDOUT: ret void, !dbg !266 +// CHECK:STDOUT: %local1.var = alloca ptr, align 8, !dbg !276 +// CHECK:STDOUT: %local2.var = alloca ptr, align 8, !dbg !278 +// CHECK:STDOUT: %local3.var = alloca ptr, align 8, !dbg !280 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %local1.var), !dbg !276 +// CHECK:STDOUT: store ptr poison, ptr %local1.var, align 8, !dbg !276 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %local2.var), !dbg !278 +// CHECK:STDOUT: store ptr poison, ptr %local2.var, align 8, !dbg !278 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %local3.var), !dbg !280 +// CHECK:STDOUT: store ptr poison, ptr %local3.var, align 8, !dbg !280 +// CHECK:STDOUT: %.loc75_25 = load ptr, ptr %local3.var, align 8, !dbg !283 +// CHECK:STDOUT: %.loc75_33 = load ptr, ptr %local2.var, align 8, !dbg !284 +// CHECK:STDOUT: call void @_Csecond_function.Main.efd9fcdf727c9de5(ptr %arg3, ptr %.loc75_25, ptr %.loc75_33), !dbg !285 +// CHECK:STDOUT: %.loc76 = load ptr, ptr %local1.var, align 8, !dbg !286 +// CHECK:STDOUT: call void @_Cthird_function.Main.1c39a3b349bf66b6(ptr %.loc76, ptr %arg3, ptr %arg1), !dbg !289 +// CHECK:STDOUT: call void @"_CSelfDestruct.73ffa1ae01557cf1:core.Destroy.Core"(ptr %local3.var), !dbg !280 +// CHECK:STDOUT: call void @"_CSelfDestruct.680a5c6f7a3d0796:core.Destroy.Core"(ptr %local2.var), !dbg !278 +// CHECK:STDOUT: call void @"_CSelfDestruct.22bdc7946a052e71:core.Destroy.Core"(ptr %local1.var), !dbg !276 +// CHECK:STDOUT: ret void, !dbg !290 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_Cthird_function.Main.1c39a3b349bf66b6(ptr %arg1, ptr %arg2, ptr %arg3) #0 !dbg !314 { +// CHECK:STDOUT: define linkonce_odr void @_Cthird_function.Main.1c39a3b349bf66b6(ptr %arg1, ptr %arg2, ptr %arg3) #0 !dbg !338 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %local1.var = alloca ptr, align 8, !dbg !321 -// CHECK:STDOUT: %local2.var = alloca ptr, align 8, !dbg !323 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %local1.var), !dbg !321 -// CHECK:STDOUT: store ptr poison, ptr %local1.var, align 8, !dbg !321 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %local2.var), !dbg !323 -// CHECK:STDOUT: store ptr poison, ptr %local2.var, align 8, !dbg !323 -// CHECK:STDOUT: %.loc39 = load ptr, ptr %local2.var, align 8, !dbg !327 -// CHECK:STDOUT: call void @_Cthird_function.Main.1c39a3b349bf66b6(ptr %arg1, ptr %arg2, ptr %.loc39), !dbg !328 -// CHECK:STDOUT: %.loc40 = load ptr, ptr %local1.var, align 8, !dbg !329 -// CHECK:STDOUT: call void @_Cfourth_function.Main.4da09b2222fc2513(ptr %.loc40), !dbg !330 -// CHECK:STDOUT: ret void, !dbg !331 +// CHECK:STDOUT: %local1.var = alloca ptr, align 8, !dbg !345 +// CHECK:STDOUT: %local2.var = alloca ptr, align 8, !dbg !347 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %local1.var), !dbg !345 +// CHECK:STDOUT: store ptr poison, ptr %local1.var, align 8, !dbg !345 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %local2.var), !dbg !347 +// CHECK:STDOUT: store ptr poison, ptr %local2.var, align 8, !dbg !347 +// CHECK:STDOUT: %.loc39 = load ptr, ptr %local2.var, align 8, !dbg !351 +// CHECK:STDOUT: call void @_Cthird_function.Main.1c39a3b349bf66b6(ptr %arg1, ptr %arg2, ptr %.loc39), !dbg !352 +// CHECK:STDOUT: %.loc40 = load ptr, ptr %local1.var, align 8, !dbg !353 +// CHECK:STDOUT: call void @_Cfourth_function.Main.4da09b2222fc2513(ptr %.loc40), !dbg !354 +// CHECK:STDOUT: call void @"_CSelfDestruct.73ffa1ae01557cf1:core.Destroy.Core"(ptr %local2.var), !dbg !347 +// CHECK:STDOUT: call void @"_CSelfDestruct.73ffa1ae01557cf1:core.Destroy.Core"(ptr %local1.var), !dbg !345 +// CHECK:STDOUT: ret void, !dbg !355 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -180,61 +226,85 @@ fn Main_method_no_template () { // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !14 = !DIFile(filename: "self_canonical.carbon", directory: "") // CHECK:STDOUT: !15 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !14, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !16 = !{null} -// CHECK:STDOUT: !17 = !DISubroutineType(types: !16) -// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "Main_method_no_template", linkageName: "_CMain_method_no_template.Main", scope: null, file: !14, line: 79, type: !17, spFlags: DISPFlagDefinition, unit: !15) -// CHECK:STDOUT: !19 = !DILocation(line: 80, column: 3, scope: !18) -// CHECK:STDOUT: !21 = !DILocation(line: 82, column: 18, scope: !18) -// CHECK:STDOUT: !22 = !DILocation(line: 82, column: 3, scope: !18) -// CHECK:STDOUT: !23 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !24 = !{null, !23} -// CHECK:STDOUT: !25 = !DISubroutineType(types: !24) -// CHECK:STDOUT: !26 = !DILocation(line: 79, column: 1, scope: !18) -// CHECK:STDOUT: !38 = !{null, !23, !23, !23} -// CHECK:STDOUT: !39 = !DISubroutineType(types: !38) -// CHECK:STDOUT: !168 = distinct !DISubprogram(name: "fourth_function", linkageName: "_Cfourth_function.Main.4da09b2222fc2513", scope: null, file: !14, line: 49, type: !25, spFlags: DISPFlagDefinition, unit: !15, retainedNodes: !180) -// CHECK:STDOUT: !169 = !DILocalVariable(arg: 1, scope: !168, type: !23) -// CHECK:STDOUT: !171 = !DILocation(line: 50, column: 3, scope: !168) -// CHECK:STDOUT: !173 = !DILocation(line: 51, column: 3, scope: !168) -// CHECK:STDOUT: !175 = !DILocation(line: 53, column: 18, scope: !168) -// CHECK:STDOUT: !176 = !DILocation(line: 53, column: 3, scope: !168) -// CHECK:STDOUT: !177 = !DILocation(line: 54, column: 18, scope: !168) -// CHECK:STDOUT: !178 = !DILocation(line: 54, column: 3, scope: !168) -// CHECK:STDOUT: !179 = !DILocation(line: 49, column: 1, scope: !168) -// CHECK:STDOUT: !180 = !{!169} -// CHECK:STDOUT: !219 = distinct !DISubprogram(name: "first_function", linkageName: "_Cfirst_function.Main.ee57965601b4d646", scope: null, file: !14, line: 57, type: !25, spFlags: DISPFlagDefinition, unit: !15, retainedNodes: !231) -// CHECK:STDOUT: !220 = !DILocalVariable(arg: 1, scope: !219, type: !23) -// CHECK:STDOUT: !222 = !DILocation(line: 58, column: 3, scope: !219) -// CHECK:STDOUT: !224 = !DILocation(line: 59, column: 3, scope: !219) -// CHECK:STDOUT: !226 = !DILocation(line: 61, column: 19, scope: !219) -// CHECK:STDOUT: !227 = !DILocation(line: 61, column: 27, scope: !219) -// CHECK:STDOUT: !229 = !DILocation(line: 61, column: 3, scope: !219) -// CHECK:STDOUT: !230 = !DILocation(line: 57, column: 1, scope: !219) -// CHECK:STDOUT: !231 = !{!220} -// CHECK:STDOUT: !245 = distinct !DISubprogram(name: "second_function", linkageName: "_Csecond_function.Main.efd9fcdf727c9de5", scope: null, file: !14, line: 70, type: !39, spFlags: DISPFlagDefinition, unit: !15, retainedNodes: !267) -// CHECK:STDOUT: !246 = !DILocalVariable(arg: 1, scope: !245, type: !23) -// CHECK:STDOUT: !247 = !DILocalVariable(arg: 2, scope: !245, type: !23) -// CHECK:STDOUT: !248 = !DILocalVariable(arg: 3, scope: !245, type: !23) -// CHECK:STDOUT: !252 = !DILocation(line: 71, column: 3, scope: !245) -// CHECK:STDOUT: !254 = !DILocation(line: 72, column: 3, scope: !245) -// CHECK:STDOUT: !256 = !DILocation(line: 73, column: 3, scope: !245) -// CHECK:STDOUT: !259 = !DILocation(line: 75, column: 25, scope: !245) -// CHECK:STDOUT: !260 = !DILocation(line: 75, column: 33, scope: !245) -// CHECK:STDOUT: !261 = !DILocation(line: 75, column: 3, scope: !245) -// CHECK:STDOUT: !262 = !DILocation(line: 76, column: 18, scope: !245) -// CHECK:STDOUT: !265 = !DILocation(line: 76, column: 3, scope: !245) -// CHECK:STDOUT: !266 = !DILocation(line: 70, column: 1, scope: !245) -// CHECK:STDOUT: !267 = !{!246, !247, !248} -// CHECK:STDOUT: !314 = distinct !DISubprogram(name: "third_function", linkageName: "_Cthird_function.Main.1c39a3b349bf66b6", scope: null, file: !14, line: 35, type: !39, spFlags: DISPFlagDefinition, unit: !15, retainedNodes: !332) -// CHECK:STDOUT: !315 = !DILocalVariable(arg: 1, scope: !314, type: !23) -// CHECK:STDOUT: !316 = !DILocalVariable(arg: 2, scope: !314, type: !23) -// CHECK:STDOUT: !317 = !DILocalVariable(arg: 3, scope: !314, type: !23) -// CHECK:STDOUT: !321 = !DILocation(line: 36, column: 3, scope: !314) -// CHECK:STDOUT: !323 = !DILocation(line: 37, column: 3, scope: !314) -// CHECK:STDOUT: !327 = !DILocation(line: 39, column: 30, scope: !314) -// CHECK:STDOUT: !328 = !DILocation(line: 39, column: 3, scope: !314) -// CHECK:STDOUT: !329 = !DILocation(line: 40, column: 19, scope: !314) -// CHECK:STDOUT: !330 = !DILocation(line: 40, column: 3, scope: !314) -// CHECK:STDOUT: !331 = !DILocation(line: 35, column: 1, scope: !314) -// CHECK:STDOUT: !332 = !{!315, !316, !317} +// CHECK:STDOUT: !16 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !17 = !{null, !16} +// CHECK:STDOUT: !18 = !DISubroutineType(types: !17) +// CHECK:STDOUT: !19 = !{null} +// CHECK:STDOUT: !20 = !DISubroutineType(types: !19) +// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.73ffa1ae01557cf1:core.Destroy.Core", scope: null, file: !14, line: 37, type: !18, spFlags: DISPFlagDefinition, unit: !15, retainedNodes: !24) +// CHECK:STDOUT: !22 = !DILocalVariable(arg: 1, scope: !21, type: !16) +// CHECK:STDOUT: !23 = !DILocation(line: 37, column: 3, scope: !21) +// CHECK:STDOUT: !24 = !{!22} +// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.28258e58291017cc:core.Destroy.Core", scope: null, file: !14, line: 44, type: !18, spFlags: DISPFlagDefinition, unit: !15, retainedNodes: !28) +// CHECK:STDOUT: !26 = !DILocalVariable(arg: 1, scope: !25, type: !16) +// CHECK:STDOUT: !27 = !DILocation(line: 44, column: 3, scope: !25) +// CHECK:STDOUT: !28 = !{!26} +// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.a247f3a5f241fa11:core.Destroy.Core", scope: null, file: !14, line: 50, type: !18, spFlags: DISPFlagDefinition, unit: !15, retainedNodes: !32) +// CHECK:STDOUT: !30 = !DILocalVariable(arg: 1, scope: !29, type: !16) +// CHECK:STDOUT: !31 = !DILocation(line: 50, column: 3, scope: !29) +// CHECK:STDOUT: !32 = !{!30} +// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.22bdc7946a052e71:core.Destroy.Core", scope: null, file: !14, line: 59, type: !18, spFlags: DISPFlagDefinition, unit: !15, retainedNodes: !36) +// CHECK:STDOUT: !34 = !DILocalVariable(arg: 1, scope: !33, type: !16) +// CHECK:STDOUT: !35 = !DILocation(line: 59, column: 3, scope: !33) +// CHECK:STDOUT: !36 = !{!34} +// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.680a5c6f7a3d0796:core.Destroy.Core", scope: null, file: !14, line: 58, type: !18, spFlags: DISPFlagDefinition, unit: !15, retainedNodes: !40) +// CHECK:STDOUT: !38 = !DILocalVariable(arg: 1, scope: !37, type: !16) +// CHECK:STDOUT: !39 = !DILocation(line: 58, column: 3, scope: !37) +// CHECK:STDOUT: !40 = !{!38} +// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "Main_method_no_template", linkageName: "_CMain_method_no_template.Main", scope: null, file: !14, line: 79, type: !20, spFlags: DISPFlagDefinition, unit: !15) +// CHECK:STDOUT: !42 = !DILocation(line: 80, column: 3, scope: !41) +// CHECK:STDOUT: !44 = !DILocation(line: 82, column: 18, scope: !41) +// CHECK:STDOUT: !45 = !DILocation(line: 82, column: 3, scope: !41) +// CHECK:STDOUT: !46 = !DILocation(line: 79, column: 1, scope: !41) +// CHECK:STDOUT: !47 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.a79cf9479d679a84:core.Destroy.Core", scope: null, file: !14, line: 80, type: !18, spFlags: DISPFlagDefinition, unit: !15, retainedNodes: !50) +// CHECK:STDOUT: !48 = !DILocalVariable(arg: 1, scope: !47, type: !16) +// CHECK:STDOUT: !49 = !DILocation(line: 80, column: 3, scope: !47) +// CHECK:STDOUT: !50 = !{!48} +// CHECK:STDOUT: !62 = !{null, !16, !16, !16} +// CHECK:STDOUT: !63 = !DISubroutineType(types: !62) +// CHECK:STDOUT: !192 = distinct !DISubprogram(name: "fourth_function", linkageName: "_Cfourth_function.Main.4da09b2222fc2513", scope: null, file: !14, line: 49, type: !18, spFlags: DISPFlagDefinition, unit: !15, retainedNodes: !204) +// CHECK:STDOUT: !193 = !DILocalVariable(arg: 1, scope: !192, type: !16) +// CHECK:STDOUT: !195 = !DILocation(line: 50, column: 3, scope: !192) +// CHECK:STDOUT: !197 = !DILocation(line: 51, column: 3, scope: !192) +// CHECK:STDOUT: !199 = !DILocation(line: 53, column: 18, scope: !192) +// CHECK:STDOUT: !200 = !DILocation(line: 53, column: 3, scope: !192) +// CHECK:STDOUT: !201 = !DILocation(line: 54, column: 18, scope: !192) +// CHECK:STDOUT: !202 = !DILocation(line: 54, column: 3, scope: !192) +// CHECK:STDOUT: !203 = !DILocation(line: 49, column: 1, scope: !192) +// CHECK:STDOUT: !204 = !{!193} +// CHECK:STDOUT: !243 = distinct !DISubprogram(name: "first_function", linkageName: "_Cfirst_function.Main.ee57965601b4d646", scope: null, file: !14, line: 57, type: !18, spFlags: DISPFlagDefinition, unit: !15, retainedNodes: !255) +// CHECK:STDOUT: !244 = !DILocalVariable(arg: 1, scope: !243, type: !16) +// CHECK:STDOUT: !246 = !DILocation(line: 58, column: 3, scope: !243) +// CHECK:STDOUT: !248 = !DILocation(line: 59, column: 3, scope: !243) +// CHECK:STDOUT: !250 = !DILocation(line: 61, column: 19, scope: !243) +// CHECK:STDOUT: !251 = !DILocation(line: 61, column: 27, scope: !243) +// CHECK:STDOUT: !253 = !DILocation(line: 61, column: 3, scope: !243) +// CHECK:STDOUT: !254 = !DILocation(line: 57, column: 1, scope: !243) +// CHECK:STDOUT: !255 = !{!244} +// CHECK:STDOUT: !269 = distinct !DISubprogram(name: "second_function", linkageName: "_Csecond_function.Main.efd9fcdf727c9de5", scope: null, file: !14, line: 70, type: !63, spFlags: DISPFlagDefinition, unit: !15, retainedNodes: !291) +// CHECK:STDOUT: !270 = !DILocalVariable(arg: 1, scope: !269, type: !16) +// CHECK:STDOUT: !271 = !DILocalVariable(arg: 2, scope: !269, type: !16) +// CHECK:STDOUT: !272 = !DILocalVariable(arg: 3, scope: !269, type: !16) +// CHECK:STDOUT: !276 = !DILocation(line: 71, column: 3, scope: !269) +// CHECK:STDOUT: !278 = !DILocation(line: 72, column: 3, scope: !269) +// CHECK:STDOUT: !280 = !DILocation(line: 73, column: 3, scope: !269) +// CHECK:STDOUT: !283 = !DILocation(line: 75, column: 25, scope: !269) +// CHECK:STDOUT: !284 = !DILocation(line: 75, column: 33, scope: !269) +// CHECK:STDOUT: !285 = !DILocation(line: 75, column: 3, scope: !269) +// CHECK:STDOUT: !286 = !DILocation(line: 76, column: 18, scope: !269) +// CHECK:STDOUT: !289 = !DILocation(line: 76, column: 3, scope: !269) +// CHECK:STDOUT: !290 = !DILocation(line: 70, column: 1, scope: !269) +// CHECK:STDOUT: !291 = !{!270, !271, !272} +// CHECK:STDOUT: !338 = distinct !DISubprogram(name: "third_function", linkageName: "_Cthird_function.Main.1c39a3b349bf66b6", scope: null, file: !14, line: 35, type: !63, spFlags: DISPFlagDefinition, unit: !15, retainedNodes: !356) +// CHECK:STDOUT: !339 = !DILocalVariable(arg: 1, scope: !338, type: !16) +// CHECK:STDOUT: !340 = !DILocalVariable(arg: 2, scope: !338, type: !16) +// CHECK:STDOUT: !341 = !DILocalVariable(arg: 3, scope: !338, type: !16) +// CHECK:STDOUT: !345 = !DILocation(line: 36, column: 3, scope: !338) +// CHECK:STDOUT: !347 = !DILocation(line: 37, column: 3, scope: !338) +// CHECK:STDOUT: !351 = !DILocation(line: 39, column: 30, scope: !338) +// CHECK:STDOUT: !352 = !DILocation(line: 39, column: 3, scope: !338) +// CHECK:STDOUT: !353 = !DILocation(line: 40, column: 19, scope: !338) +// CHECK:STDOUT: !354 = !DILocation(line: 40, column: 3, scope: !338) +// CHECK:STDOUT: !355 = !DILocation(line: 35, column: 1, scope: !338) +// CHECK:STDOUT: !356 = !{!339, !340, !341} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/function/generic/type_representation.carbon b/toolchain/lower/testdata/function/generic/type_representation.carbon index 094c5db8f413..f3a2b589cc80 100644 --- a/toolchain/lower/testdata/function/generic/type_representation.carbon +++ b/toolchain/lower/testdata/function/generic/type_representation.carbon @@ -87,169 +87,217 @@ fn F_nested_tuple(a: ((i32, i32), X)) -> ((i32, i32), X) { // CHECK:STDOUT: ; Function Attrs: nounwind // CHECK:STDOUT: define i32 @_CF_i32.Main(i32 %a) #0 !dbg !40 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %F.call = call i32 @_CF.Main.f93d238dac954dee(i32 %a), !dbg !46 +// CHECK:STDOUT: %F.call = call i32 @_CF.Main.804fd121057d1d93(i32 %a), !dbg !46 // CHECK:STDOUT: ret i32 %F.call, !dbg !47 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !49 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !49 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !51 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @"_COp.X.Main:Copy.Main"(ptr sret({ i32, i32 }) %return, ptr %self) #0 !dbg !53 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !53 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc38_24.1.a = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 0, !dbg !58 -// CHECK:STDOUT: %.loc38_24.2 = load i32, ptr %.loc38_24.1.a, align 4, !dbg !58 -// CHECK:STDOUT: %.loc38_37.1.b = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 1, !dbg !59 -// CHECK:STDOUT: %.loc38_37.2 = load i32, ptr %.loc38_37.1.b, align 4, !dbg !59 -// CHECK:STDOUT: %.loc38_39.2.a = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 0, !dbg !60 -// CHECK:STDOUT: store i32 %.loc38_24.2, ptr %.loc38_39.2.a, align 4, !dbg !60 -// CHECK:STDOUT: %.loc38_39.4.b = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 1, !dbg !60 -// CHECK:STDOUT: store i32 %.loc38_37.2, ptr %.loc38_39.4.b, align 4, !dbg !60 -// CHECK:STDOUT: ret void, !dbg !61 +// CHECK:STDOUT: ret void, !dbg !55 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF_X.Main(ptr sret({ i32, i32 }) %return, ptr %a) #0 !dbg !63 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !57 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CF.Main.5edf9c632b3db7a5(ptr %return, ptr %a), !dbg !69 -// CHECK:STDOUT: ret void, !dbg !70 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !59 +// CHECK:STDOUT: ret void, !dbg !59 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.b4c762864cd9a02b:core.Destroy.Core"(ptr %self) #0 !dbg !72 { +// CHECK:STDOUT: define void @"_COp.X.Main:Copy.Main"(ptr sret({ i32, i32 }) %return, ptr %self) #0 !dbg !61 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !74 +// CHECK:STDOUT: %.loc38_24.1.a = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 0, !dbg !66 +// CHECK:STDOUT: %.loc38_24.2 = load i32, ptr %.loc38_24.1.a, align 4, !dbg !66 +// CHECK:STDOUT: %.loc38_37.1.b = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 1, !dbg !67 +// CHECK:STDOUT: %.loc38_37.2 = load i32, ptr %.loc38_37.1.b, align 4, !dbg !67 +// CHECK:STDOUT: %.loc38_39.2.a = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 0, !dbg !68 +// CHECK:STDOUT: store i32 %.loc38_24.2, ptr %.loc38_39.2.a, align 4, !dbg !68 +// CHECK:STDOUT: %.loc38_39.4.b = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 1, !dbg !68 +// CHECK:STDOUT: store i32 %.loc38_37.2, ptr %.loc38_39.4.b, align 4, !dbg !68 +// CHECK:STDOUT: ret void, !dbg !69 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.8b0bf151036f045a:core.Destroy.Core"(ptr %self) #0 !dbg !76 { +// CHECK:STDOUT: define void @_CF_X.Main(ptr sret({ i32, i32 }) %return, ptr %a) #0 !dbg !71 { // CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @_CF.Main.9d368fc2e01d20c2(ptr %return, ptr %a), !dbg !77 // CHECK:STDOUT: ret void, !dbg !78 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @"_COp.61ea2aba74ab3bf1:Copy.Main"() #0 !dbg !80 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.b4c762864cd9a02b:core.Destroy.Core"(ptr %self) #0 !dbg !80 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !84 +// CHECK:STDOUT: ret void, !dbg !82 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF_empty_tuple.Main() #0 !dbg !85 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.b4c762864cd9a02b:core.Destroy.Core"(ptr %self) #0 !dbg !84 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CF.Main.437db137e54a21c0(), !dbg !90 -// CHECK:STDOUT: ret void, !dbg !91 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.b4c762864cd9a02b:core.Destroy.Core"(ptr %self), !dbg !86 +// CHECK:STDOUT: ret void, !dbg !86 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @"_COp.e554695bf635d9c1:Copy.Main"(ptr sret({ i32, i32 }) %return, ptr %self) #0 !dbg !92 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.8b0bf151036f045a:core.Destroy.Core"(ptr %self) #0 !dbg !88 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %tuple.elem0.loc59_12.1.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 0, !dbg !97 -// CHECK:STDOUT: %tuple.elem0.loc59_12.1.tuple.elem.load = load i32, ptr %tuple.elem0.loc59_12.1.tuple.elem, align 4, !dbg !97 -// CHECK:STDOUT: %tuple.elem0.loc59_12.2.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 0, !dbg !97 -// CHECK:STDOUT: store i32 %tuple.elem0.loc59_12.1.tuple.elem.load, ptr %tuple.elem0.loc59_12.2.tuple.elem, align 4, !dbg !97 -// CHECK:STDOUT: %tuple.elem1.loc59_12.1.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 1, !dbg !97 -// CHECK:STDOUT: %tuple.elem1.loc59_12.1.tuple.elem.load = load i32, ptr %tuple.elem1.loc59_12.1.tuple.elem, align 4, !dbg !97 -// CHECK:STDOUT: %tuple.elem1.loc59_12.2.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 1, !dbg !97 -// CHECK:STDOUT: store i32 %tuple.elem1.loc59_12.1.tuple.elem.load, ptr %tuple.elem1.loc59_12.2.tuple.elem, align 4, !dbg !97 -// CHECK:STDOUT: ret void, !dbg !98 +// CHECK:STDOUT: ret void, !dbg !90 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF_two_tuple.Main(ptr sret({ i32, i32 }) %return, ptr %a) #0 !dbg !100 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.8b0bf151036f045a:core.Destroy.Core"(ptr %self) #0 !dbg !92 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CF.Main.b069b9e27a2f3b24(ptr %return, ptr %a), !dbg !106 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.8b0bf151036f045a:core.Destroy.Core"(ptr %self), !dbg !94 +// CHECK:STDOUT: ret void, !dbg !94 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @"_COp.61ea2aba74ab3bf1:Copy.Main"() #0 !dbg !96 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !100 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CF_empty_tuple.Main() #0 !dbg !101 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @_CF.Main.a5d0440dfa027ffe(), !dbg !106 // CHECK:STDOUT: ret void, !dbg !107 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.e554695bf635d9c1:core.Destroy.Core"(ptr %self) #0 !dbg !109 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.61ea2aba74ab3bf1:core.Destroy.Core"(ptr %self) #0 !dbg !108 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !111 +// CHECK:STDOUT: ret void, !dbg !110 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @"_COp.ae1e3622d7875d32:Copy.Main"(ptr sret({ { i32, i32 }, { i32, i32 } }) %return, ptr %self) #0 !dbg !113 { +// CHECK:STDOUT: define void @"_COp.e554695bf635d9c1:Copy.Main"(ptr sret({ i32, i32 }) %return, ptr %self) #0 !dbg !112 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %tuple.elem0.loc69_17.tuple.elem = getelementptr inbounds nuw { ptr, ptr }, ptr %self, i32 0, i32 0, !dbg !118 -// CHECK:STDOUT: %tuple.elem0.loc69_17.tuple.elem.load = load ptr, ptr %tuple.elem0.loc69_17.tuple.elem, align 8, !dbg !118 -// CHECK:STDOUT: %tuple.elem0.loc69_51.tuple.elem = getelementptr inbounds nuw { { i32, i32 }, { i32, i32 } }, ptr %return, i32 0, i32 0, !dbg !119 -// CHECK:STDOUT: call void @"_COp.e554695bf635d9c1:Copy.Main"(ptr %tuple.elem0.loc69_51.tuple.elem, ptr %tuple.elem0.loc69_17.tuple.elem.load), !dbg !118 -// CHECK:STDOUT: %tuple.elem1.loc69_37.tuple.elem = getelementptr inbounds nuw { ptr, ptr }, ptr %self, i32 0, i32 1, !dbg !120 -// CHECK:STDOUT: %tuple.elem1.loc69_37.tuple.elem.load = load ptr, ptr %tuple.elem1.loc69_37.tuple.elem, align 8, !dbg !120 -// CHECK:STDOUT: %tuple.elem1.loc69_51.tuple.elem = getelementptr inbounds nuw { { i32, i32 }, { i32, i32 } }, ptr %return, i32 0, i32 1, !dbg !119 -// CHECK:STDOUT: call void @"_COp.X.Main:Copy.Main"(ptr %tuple.elem1.loc69_51.tuple.elem, ptr %tuple.elem1.loc69_37.tuple.elem.load), !dbg !120 -// CHECK:STDOUT: ret void, !dbg !121 +// CHECK:STDOUT: %tuple.elem0.loc59_12.1.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 0, !dbg !117 +// CHECK:STDOUT: %tuple.elem0.loc59_12.1.tuple.elem.load = load i32, ptr %tuple.elem0.loc59_12.1.tuple.elem, align 4, !dbg !117 +// CHECK:STDOUT: %tuple.elem0.loc59_12.2.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 0, !dbg !117 +// CHECK:STDOUT: store i32 %tuple.elem0.loc59_12.1.tuple.elem.load, ptr %tuple.elem0.loc59_12.2.tuple.elem, align 4, !dbg !117 +// CHECK:STDOUT: %tuple.elem1.loc59_12.1.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 1, !dbg !117 +// CHECK:STDOUT: %tuple.elem1.loc59_12.1.tuple.elem.load = load i32, ptr %tuple.elem1.loc59_12.1.tuple.elem, align 4, !dbg !117 +// CHECK:STDOUT: %tuple.elem1.loc59_12.2.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 1, !dbg !117 +// CHECK:STDOUT: store i32 %tuple.elem1.loc59_12.1.tuple.elem.load, ptr %tuple.elem1.loc59_12.2.tuple.elem, align 4, !dbg !117 +// CHECK:STDOUT: ret void, !dbg !118 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF_nested_tuple.Main(ptr sret({ { i32, i32 }, { i32, i32 } }) %return, ptr %a) #0 !dbg !123 { +// CHECK:STDOUT: define void @_CF_two_tuple.Main(ptr sret({ i32, i32 }) %return, ptr %a) #0 !dbg !120 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CF.Main.f320bf07a6b502ca(ptr %return, ptr %a), !dbg !129 -// CHECK:STDOUT: ret void, !dbg !130 +// CHECK:STDOUT: call void @_CF.Main.25802053f9465fe8(ptr %return, ptr %a), !dbg !126 +// CHECK:STDOUT: ret void, !dbg !127 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.ae1e3622d7875d32:core.Destroy.Core"(ptr %self) #0 !dbg !132 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.e554695bf635d9c1:core.Destroy.Core"(ptr %self) #0 !dbg !129 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !134 +// CHECK:STDOUT: ret void, !dbg !131 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CF.Main.f93d238dac954dee(i32 %a) #0 !dbg !136 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.e554695bf635d9c1:core.Destroy.Core"(ptr %self) #0 !dbg !133 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca i32, align 4, !dbg !141 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !141 -// CHECK:STDOUT: %Copy.WithSelf.Op.call.loc18 = call i32 @"_COp.Int.be1e879c1ad406d8.Core:Copy.Main"(i32 %a), !dbg !142 -// CHECK:STDOUT: store i32 %Copy.WithSelf.Op.call.loc18, ptr %_.var, align 4, !dbg !141 -// CHECK:STDOUT: %Copy.WithSelf.Op.call.loc19 = call i32 @"_COp.Int.be1e879c1ad406d8.Core:Copy.Main"(i32 %a), !dbg !144 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %_.var), !dbg !141 -// CHECK:STDOUT: ret i32 %Copy.WithSelf.Op.call.loc19, !dbg !145 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.e554695bf635d9c1:core.Destroy.Core"(ptr %self), !dbg !135 +// CHECK:STDOUT: ret void, !dbg !135 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CF.Main.5edf9c632b3db7a5(ptr sret({ i32, i32 }) %return, ptr %a) #0 !dbg !147 { +// CHECK:STDOUT: define void @"_COp.ae1e3622d7875d32:Copy.Main"(ptr sret({ { i32, i32 }, { i32, i32 } }) %return, ptr %self) #0 !dbg !137 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca { i32, i32 }, align 4, !dbg !152 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !152 -// CHECK:STDOUT: call void @"_COp.X.Main:Copy.Main"(ptr %_.var, ptr %a), !dbg !153 -// CHECK:STDOUT: call void @"_COp.X.Main:Copy.Main"(ptr %return, ptr %a), !dbg !155 -// CHECK:STDOUT: call void @"_COp.8b0bf151036f045a:core.Destroy.Core"(ptr %_.var), !dbg !152 -// CHECK:STDOUT: ret void, !dbg !156 +// CHECK:STDOUT: %tuple.elem0.loc69_17.tuple.elem = getelementptr inbounds nuw { ptr, ptr }, ptr %self, i32 0, i32 0, !dbg !142 +// CHECK:STDOUT: %tuple.elem0.loc69_17.tuple.elem.load = load ptr, ptr %tuple.elem0.loc69_17.tuple.elem, align 8, !dbg !142 +// CHECK:STDOUT: %tuple.elem0.loc69_51.tuple.elem = getelementptr inbounds nuw { { i32, i32 }, { i32, i32 } }, ptr %return, i32 0, i32 0, !dbg !143 +// CHECK:STDOUT: call void @"_COp.e554695bf635d9c1:Copy.Main"(ptr %tuple.elem0.loc69_51.tuple.elem, ptr %tuple.elem0.loc69_17.tuple.elem.load), !dbg !142 +// CHECK:STDOUT: %tuple.elem1.loc69_37.tuple.elem = getelementptr inbounds nuw { ptr, ptr }, ptr %self, i32 0, i32 1, !dbg !144 +// CHECK:STDOUT: %tuple.elem1.loc69_37.tuple.elem.load = load ptr, ptr %tuple.elem1.loc69_37.tuple.elem, align 8, !dbg !144 +// CHECK:STDOUT: %tuple.elem1.loc69_51.tuple.elem = getelementptr inbounds nuw { { i32, i32 }, { i32, i32 } }, ptr %return, i32 0, i32 1, !dbg !143 +// CHECK:STDOUT: call void @"_COp.X.Main:Copy.Main"(ptr %tuple.elem1.loc69_51.tuple.elem, ptr %tuple.elem1.loc69_37.tuple.elem.load), !dbg !144 +// CHECK:STDOUT: ret void, !dbg !145 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CF.Main.437db137e54a21c0() #0 !dbg !158 { +// CHECK:STDOUT: define void @_CF_nested_tuple.Main(ptr sret({ { i32, i32 }, { i32, i32 } }) %return, ptr %a) #0 !dbg !147 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca {}, align 1, !dbg !162 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !162 -// CHECK:STDOUT: call void @"_COp.61ea2aba74ab3bf1:Copy.Main"(), !dbg !163 -// CHECK:STDOUT: call void @"_COp.61ea2aba74ab3bf1:Copy.Main"(), !dbg !165 -// CHECK:STDOUT: ret void, !dbg !166 +// CHECK:STDOUT: call void @_CF.Main.f37d80e656707351(ptr %return, ptr %a), !dbg !153 +// CHECK:STDOUT: ret void, !dbg !154 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CF.Main.b069b9e27a2f3b24(ptr sret({ i32, i32 }) %return, ptr %a) #0 !dbg !167 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.ae1e3622d7875d32:core.Destroy.Core"(ptr %self) #0 !dbg !156 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca { i32, i32 }, align 4, !dbg !172 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !172 -// CHECK:STDOUT: call void @"_COp.e554695bf635d9c1:Copy.Main"(ptr %_.var, ptr %a), !dbg !173 -// CHECK:STDOUT: call void @"_COp.e554695bf635d9c1:Copy.Main"(ptr %return, ptr %a), !dbg !175 -// CHECK:STDOUT: call void @"_COp.e554695bf635d9c1:core.Destroy.Core"(ptr %_.var), !dbg !172 -// CHECK:STDOUT: ret void, !dbg !176 +// CHECK:STDOUT: ret void, !dbg !158 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CF.Main.f320bf07a6b502ca(ptr sret({ { i32, i32 }, { i32, i32 } }) %return, ptr %a) #0 !dbg !178 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.ae1e3622d7875d32:core.Destroy.Core"(ptr %self) #0 !dbg !160 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca { { i32, i32 }, { i32, i32 } }, align 4, !dbg !183 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !183 -// CHECK:STDOUT: call void @"_COp.ae1e3622d7875d32:Copy.Main"(ptr %_.var, ptr %a), !dbg !184 -// CHECK:STDOUT: call void @"_COp.ae1e3622d7875d32:Copy.Main"(ptr %return, ptr %a), !dbg !186 -// CHECK:STDOUT: call void @"_COp.ae1e3622d7875d32:core.Destroy.Core"(ptr %_.var), !dbg !183 -// CHECK:STDOUT: ret void, !dbg !187 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.ae1e3622d7875d32:core.Destroy.Core"(ptr %self), !dbg !162 +// CHECK:STDOUT: ret void, !dbg !162 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr i32 @_CF.Main.804fd121057d1d93(i32 %a) #0 !dbg !164 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %_.var = alloca i32, align 4, !dbg !169 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !169 +// CHECK:STDOUT: %Copy.WithSelf.Op.call.loc18 = call i32 @"_COp.Int.be1e879c1ad406d8.Core:Copy.Main"(i32 %a), !dbg !170 +// CHECK:STDOUT: store i32 %Copy.WithSelf.Op.call.loc18, ptr %_.var, align 4, !dbg !169 +// CHECK:STDOUT: %Copy.WithSelf.Op.call.loc19 = call i32 @"_COp.Int.be1e879c1ad406d8.Core:Copy.Main"(i32 %a), !dbg !172 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %_.var), !dbg !169 +// CHECK:STDOUT: ret i32 %Copy.WithSelf.Op.call.loc19, !dbg !173 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @_CF.Main.9d368fc2e01d20c2(ptr sret({ i32, i32 }) %return, ptr %a) #0 !dbg !175 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %_.var = alloca { i32, i32 }, align 4, !dbg !180 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !180 +// CHECK:STDOUT: call void @"_COp.X.Main:Copy.Main"(ptr %_.var, ptr %a), !dbg !181 +// CHECK:STDOUT: call void @"_COp.X.Main:Copy.Main"(ptr %return, ptr %a), !dbg !183 +// CHECK:STDOUT: call void @"_CSelfDestruct.8b0bf151036f045a:core.Destroy.Core"(ptr %_.var), !dbg !180 +// CHECK:STDOUT: ret void, !dbg !184 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @_CF.Main.a5d0440dfa027ffe() #0 !dbg !186 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %_.var = alloca {}, align 1, !dbg !190 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !190 +// CHECK:STDOUT: call void @"_COp.61ea2aba74ab3bf1:Copy.Main"(), !dbg !191 +// CHECK:STDOUT: call void @"_COp.61ea2aba74ab3bf1:Copy.Main"(), !dbg !193 +// CHECK:STDOUT: call void @"_CSelfDestruct.61ea2aba74ab3bf1:core.Destroy.Core"(ptr %_.var), !dbg !190 +// CHECK:STDOUT: ret void, !dbg !194 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @_CF.Main.25802053f9465fe8(ptr sret({ i32, i32 }) %return, ptr %a) #0 !dbg !195 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %_.var = alloca { i32, i32 }, align 4, !dbg !200 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !200 +// CHECK:STDOUT: call void @"_COp.e554695bf635d9c1:Copy.Main"(ptr %_.var, ptr %a), !dbg !201 +// CHECK:STDOUT: call void @"_COp.e554695bf635d9c1:Copy.Main"(ptr %return, ptr %a), !dbg !203 +// CHECK:STDOUT: call void @"_CSelfDestruct.e554695bf635d9c1:core.Destroy.Core"(ptr %_.var), !dbg !200 +// CHECK:STDOUT: ret void, !dbg !204 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @_CF.Main.f37d80e656707351(ptr sret({ { i32, i32 }, { i32, i32 } }) %return, ptr %a) #0 !dbg !206 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %_.var = alloca { { i32, i32 }, { i32, i32 } }, align 4, !dbg !211 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !211 +// CHECK:STDOUT: call void @"_COp.ae1e3622d7875d32:Copy.Main"(ptr %_.var, ptr %a), !dbg !212 +// CHECK:STDOUT: call void @"_COp.ae1e3622d7875d32:Copy.Main"(ptr %return, ptr %a), !dbg !214 +// CHECK:STDOUT: call void @"_CSelfDestruct.ae1e3622d7875d32:core.Destroy.Core"(ptr %_.var), !dbg !211 +// CHECK:STDOUT: ret void, !dbg !215 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -289,96 +337,124 @@ fn F_nested_tuple(a: ((i32, i32), X)) -> ((i32, i32), X) { // CHECK:STDOUT: !46 = !DILocation(line: 29, column: 10, scope: !40) // CHECK:STDOUT: !47 = !DILocation(line: 29, column: 3, scope: !40) // CHECK:STDOUT: !48 = !{!41} -// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 29, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !52) +// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !18, line: 29, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !52) // CHECK:STDOUT: !50 = !DILocalVariable(arg: 1, scope: !49, type: !20) // CHECK:STDOUT: !51 = !DILocation(line: 29, column: 10, scope: !49) // CHECK:STDOUT: !52 = !{!50} -// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "Op", linkageName: "_COp.X.Main:Copy.Main", scope: null, file: !18, line: 37, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !62) -// CHECK:STDOUT: !54 = !DILocalVariable(arg: 1, scope: !53, type: !25) -// CHECK:STDOUT: !58 = !DILocation(line: 38, column: 20, scope: !53) -// CHECK:STDOUT: !59 = !DILocation(line: 38, column: 33, scope: !53) -// CHECK:STDOUT: !60 = !DILocation(line: 38, column: 14, scope: !53) -// CHECK:STDOUT: !61 = !DILocation(line: 38, column: 7, scope: !53) -// CHECK:STDOUT: !62 = !{!54} -// CHECK:STDOUT: !63 = distinct !DISubprogram(name: "F_X", linkageName: "_CF_X.Main", scope: null, file: !18, line: 43, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !71) -// CHECK:STDOUT: !64 = !DILocalVariable(arg: 1, scope: !63, type: !25) -// CHECK:STDOUT: !69 = !DILocation(line: 44, column: 10, scope: !63) -// CHECK:STDOUT: !70 = !DILocation(line: 44, column: 3, scope: !63) -// CHECK:STDOUT: !71 = !{!64} -// CHECK:STDOUT: !72 = distinct !DISubprogram(name: "Op", linkageName: "_COp.b4c762864cd9a02b:core.Destroy.Core", scope: null, file: !18, line: 44, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !75) -// CHECK:STDOUT: !73 = !DILocalVariable(arg: 1, scope: !72, type: !25) -// CHECK:STDOUT: !74 = !DILocation(line: 44, column: 10, scope: !72) -// CHECK:STDOUT: !75 = !{!73} -// CHECK:STDOUT: !76 = distinct !DISubprogram(name: "Op", linkageName: "_COp.8b0bf151036f045a:core.Destroy.Core", scope: null, file: !18, line: 44, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !79) -// CHECK:STDOUT: !77 = !DILocalVariable(arg: 1, scope: !76, type: !25) -// CHECK:STDOUT: !78 = !DILocation(line: 44, column: 10, scope: !76) -// CHECK:STDOUT: !79 = !{!77} -// CHECK:STDOUT: !80 = distinct !DISubprogram(name: "Op", linkageName: "_COp.61ea2aba74ab3bf1:Copy.Main", scope: null, file: !18, line: 48, type: !31, spFlags: DISPFlagDefinition, unit: !19) -// CHECK:STDOUT: !84 = !DILocation(line: 49, column: 5, scope: !80) -// CHECK:STDOUT: !85 = distinct !DISubprogram(name: "F_empty_tuple", linkageName: "_CF_empty_tuple.Main", scope: null, file: !18, line: 53, type: !31, spFlags: DISPFlagDefinition, unit: !19) -// CHECK:STDOUT: !90 = !DILocation(line: 54, column: 10, scope: !85) -// CHECK:STDOUT: !91 = !DILocation(line: 54, column: 3, scope: !85) -// CHECK:STDOUT: !92 = distinct !DISubprogram(name: "Op", linkageName: "_COp.e554695bf635d9c1:Copy.Main", scope: null, file: !18, line: 58, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !99) +// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 29, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !56) +// CHECK:STDOUT: !54 = !DILocalVariable(arg: 1, scope: !53, type: !20) +// CHECK:STDOUT: !55 = !DILocation(line: 29, column: 10, scope: !53) +// CHECK:STDOUT: !56 = !{!54} +// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 29, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !60) +// CHECK:STDOUT: !58 = !DILocalVariable(arg: 1, scope: !57, type: !20) +// CHECK:STDOUT: !59 = !DILocation(line: 29, column: 10, scope: !57) +// CHECK:STDOUT: !60 = !{!58} +// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "Op", linkageName: "_COp.X.Main:Copy.Main", scope: null, file: !18, line: 37, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !70) +// CHECK:STDOUT: !62 = !DILocalVariable(arg: 1, scope: !61, type: !25) +// CHECK:STDOUT: !66 = !DILocation(line: 38, column: 20, scope: !61) +// CHECK:STDOUT: !67 = !DILocation(line: 38, column: 33, scope: !61) +// CHECK:STDOUT: !68 = !DILocation(line: 38, column: 14, scope: !61) +// CHECK:STDOUT: !69 = !DILocation(line: 38, column: 7, scope: !61) +// CHECK:STDOUT: !70 = !{!62} +// CHECK:STDOUT: !71 = distinct !DISubprogram(name: "F_X", linkageName: "_CF_X.Main", scope: null, file: !18, line: 43, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !79) +// CHECK:STDOUT: !72 = !DILocalVariable(arg: 1, scope: !71, type: !25) +// CHECK:STDOUT: !77 = !DILocation(line: 44, column: 10, scope: !71) +// CHECK:STDOUT: !78 = !DILocation(line: 44, column: 3, scope: !71) +// CHECK:STDOUT: !79 = !{!72} +// CHECK:STDOUT: !80 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.b4c762864cd9a02b:core.Destroy.Core", scope: null, file: !18, line: 44, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !83) +// CHECK:STDOUT: !81 = !DILocalVariable(arg: 1, scope: !80, type: !25) +// CHECK:STDOUT: !82 = !DILocation(line: 44, column: 10, scope: !80) +// CHECK:STDOUT: !83 = !{!81} +// CHECK:STDOUT: !84 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.b4c762864cd9a02b:core.Destroy.Core", scope: null, file: !18, line: 44, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !87) +// CHECK:STDOUT: !85 = !DILocalVariable(arg: 1, scope: !84, type: !25) +// CHECK:STDOUT: !86 = !DILocation(line: 44, column: 10, scope: !84) +// CHECK:STDOUT: !87 = !{!85} +// CHECK:STDOUT: !88 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.8b0bf151036f045a:core.Destroy.Core", scope: null, file: !18, line: 44, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !91) +// CHECK:STDOUT: !89 = !DILocalVariable(arg: 1, scope: !88, type: !25) +// CHECK:STDOUT: !90 = !DILocation(line: 44, column: 10, scope: !88) +// CHECK:STDOUT: !91 = !{!89} +// CHECK:STDOUT: !92 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.8b0bf151036f045a:core.Destroy.Core", scope: null, file: !18, line: 44, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !95) // CHECK:STDOUT: !93 = !DILocalVariable(arg: 1, scope: !92, type: !25) -// CHECK:STDOUT: !97 = !DILocation(line: 59, column: 12, scope: !92) -// CHECK:STDOUT: !98 = !DILocation(line: 59, column: 5, scope: !92) -// CHECK:STDOUT: !99 = !{!93} -// CHECK:STDOUT: !100 = distinct !DISubprogram(name: "F_two_tuple", linkageName: "_CF_two_tuple.Main", scope: null, file: !18, line: 63, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !108) -// CHECK:STDOUT: !101 = !DILocalVariable(arg: 1, scope: !100, type: !25) -// CHECK:STDOUT: !106 = !DILocation(line: 64, column: 10, scope: !100) -// CHECK:STDOUT: !107 = !DILocation(line: 64, column: 3, scope: !100) -// CHECK:STDOUT: !108 = !{!101} -// CHECK:STDOUT: !109 = distinct !DISubprogram(name: "Op", linkageName: "_COp.e554695bf635d9c1:core.Destroy.Core", scope: null, file: !18, line: 64, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !112) -// CHECK:STDOUT: !110 = !DILocalVariable(arg: 1, scope: !109, type: !25) -// CHECK:STDOUT: !111 = !DILocation(line: 64, column: 10, scope: !109) -// CHECK:STDOUT: !112 = !{!110} -// CHECK:STDOUT: !113 = distinct !DISubprogram(name: "Op", linkageName: "_COp.ae1e3622d7875d32:Copy.Main", scope: null, file: !18, line: 68, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !122) -// CHECK:STDOUT: !114 = !DILocalVariable(arg: 1, scope: !113, type: !25) -// CHECK:STDOUT: !118 = !DILocation(line: 69, column: 13, scope: !113) -// CHECK:STDOUT: !119 = !DILocation(line: 69, column: 12, scope: !113) -// CHECK:STDOUT: !120 = !DILocation(line: 69, column: 33, scope: !113) -// CHECK:STDOUT: !121 = !DILocation(line: 69, column: 5, scope: !113) -// CHECK:STDOUT: !122 = !{!114} -// CHECK:STDOUT: !123 = distinct !DISubprogram(name: "F_nested_tuple", linkageName: "_CF_nested_tuple.Main", scope: null, file: !18, line: 73, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !131) -// CHECK:STDOUT: !124 = !DILocalVariable(arg: 1, scope: !123, type: !25) -// CHECK:STDOUT: !129 = !DILocation(line: 74, column: 10, scope: !123) -// CHECK:STDOUT: !130 = !DILocation(line: 74, column: 3, scope: !123) -// CHECK:STDOUT: !131 = !{!124} -// CHECK:STDOUT: !132 = distinct !DISubprogram(name: "Op", linkageName: "_COp.ae1e3622d7875d32:core.Destroy.Core", scope: null, file: !18, line: 74, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !135) -// CHECK:STDOUT: !133 = !DILocalVariable(arg: 1, scope: !132, type: !25) -// CHECK:STDOUT: !134 = !DILocation(line: 74, column: 10, scope: !132) -// CHECK:STDOUT: !135 = !{!133} -// CHECK:STDOUT: !136 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.f93d238dac954dee", scope: null, file: !18, line: 17, type: !22, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !146) -// CHECK:STDOUT: !137 = !DILocalVariable(arg: 1, scope: !136, type: !20) -// CHECK:STDOUT: !141 = !DILocation(line: 18, column: 3, scope: !136) -// CHECK:STDOUT: !142 = !DILocation(line: 18, column: 14, scope: !136) -// CHECK:STDOUT: !144 = !DILocation(line: 19, column: 10, scope: !136) -// CHECK:STDOUT: !145 = !DILocation(line: 19, column: 3, scope: !136) -// CHECK:STDOUT: !146 = !{!137} -// CHECK:STDOUT: !147 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.5edf9c632b3db7a5", scope: null, file: !18, line: 17, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !157) +// CHECK:STDOUT: !94 = !DILocation(line: 44, column: 10, scope: !92) +// CHECK:STDOUT: !95 = !{!93} +// CHECK:STDOUT: !96 = distinct !DISubprogram(name: "Op", linkageName: "_COp.61ea2aba74ab3bf1:Copy.Main", scope: null, file: !18, line: 48, type: !31, spFlags: DISPFlagDefinition, unit: !19) +// CHECK:STDOUT: !100 = !DILocation(line: 49, column: 5, scope: !96) +// CHECK:STDOUT: !101 = distinct !DISubprogram(name: "F_empty_tuple", linkageName: "_CF_empty_tuple.Main", scope: null, file: !18, line: 53, type: !31, spFlags: DISPFlagDefinition, unit: !19) +// CHECK:STDOUT: !106 = !DILocation(line: 54, column: 10, scope: !101) +// CHECK:STDOUT: !107 = !DILocation(line: 54, column: 3, scope: !101) +// CHECK:STDOUT: !108 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.61ea2aba74ab3bf1:core.Destroy.Core", scope: null, file: !18, line: 54, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !111) +// CHECK:STDOUT: !109 = !DILocalVariable(arg: 1, scope: !108, type: !25) +// CHECK:STDOUT: !110 = !DILocation(line: 54, column: 10, scope: !108) +// CHECK:STDOUT: !111 = !{!109} +// CHECK:STDOUT: !112 = distinct !DISubprogram(name: "Op", linkageName: "_COp.e554695bf635d9c1:Copy.Main", scope: null, file: !18, line: 58, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !119) +// CHECK:STDOUT: !113 = !DILocalVariable(arg: 1, scope: !112, type: !25) +// CHECK:STDOUT: !117 = !DILocation(line: 59, column: 12, scope: !112) +// CHECK:STDOUT: !118 = !DILocation(line: 59, column: 5, scope: !112) +// CHECK:STDOUT: !119 = !{!113} +// CHECK:STDOUT: !120 = distinct !DISubprogram(name: "F_two_tuple", linkageName: "_CF_two_tuple.Main", scope: null, file: !18, line: 63, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !128) +// CHECK:STDOUT: !121 = !DILocalVariable(arg: 1, scope: !120, type: !25) +// CHECK:STDOUT: !126 = !DILocation(line: 64, column: 10, scope: !120) +// CHECK:STDOUT: !127 = !DILocation(line: 64, column: 3, scope: !120) +// CHECK:STDOUT: !128 = !{!121} +// CHECK:STDOUT: !129 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.e554695bf635d9c1:core.Destroy.Core", scope: null, file: !18, line: 64, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !132) +// CHECK:STDOUT: !130 = !DILocalVariable(arg: 1, scope: !129, type: !25) +// CHECK:STDOUT: !131 = !DILocation(line: 64, column: 10, scope: !129) +// CHECK:STDOUT: !132 = !{!130} +// CHECK:STDOUT: !133 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.e554695bf635d9c1:core.Destroy.Core", scope: null, file: !18, line: 64, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !136) +// CHECK:STDOUT: !134 = !DILocalVariable(arg: 1, scope: !133, type: !25) +// CHECK:STDOUT: !135 = !DILocation(line: 64, column: 10, scope: !133) +// CHECK:STDOUT: !136 = !{!134} +// CHECK:STDOUT: !137 = distinct !DISubprogram(name: "Op", linkageName: "_COp.ae1e3622d7875d32:Copy.Main", scope: null, file: !18, line: 68, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !146) +// CHECK:STDOUT: !138 = !DILocalVariable(arg: 1, scope: !137, type: !25) +// CHECK:STDOUT: !142 = !DILocation(line: 69, column: 13, scope: !137) +// CHECK:STDOUT: !143 = !DILocation(line: 69, column: 12, scope: !137) +// CHECK:STDOUT: !144 = !DILocation(line: 69, column: 33, scope: !137) +// CHECK:STDOUT: !145 = !DILocation(line: 69, column: 5, scope: !137) +// CHECK:STDOUT: !146 = !{!138} +// CHECK:STDOUT: !147 = distinct !DISubprogram(name: "F_nested_tuple", linkageName: "_CF_nested_tuple.Main", scope: null, file: !18, line: 73, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !155) // CHECK:STDOUT: !148 = !DILocalVariable(arg: 1, scope: !147, type: !25) -// CHECK:STDOUT: !152 = !DILocation(line: 18, column: 3, scope: !147) -// CHECK:STDOUT: !153 = !DILocation(line: 18, column: 14, scope: !147) -// CHECK:STDOUT: !155 = !DILocation(line: 19, column: 10, scope: !147) -// CHECK:STDOUT: !156 = !DILocation(line: 19, column: 3, scope: !147) -// CHECK:STDOUT: !157 = !{!148} -// CHECK:STDOUT: !158 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.437db137e54a21c0", scope: null, file: !18, line: 17, type: !31, spFlags: DISPFlagDefinition, unit: !19) -// CHECK:STDOUT: !162 = !DILocation(line: 18, column: 3, scope: !158) -// CHECK:STDOUT: !163 = !DILocation(line: 18, column: 14, scope: !158) -// CHECK:STDOUT: !165 = !DILocation(line: 19, column: 10, scope: !158) -// CHECK:STDOUT: !166 = !DILocation(line: 19, column: 3, scope: !158) -// CHECK:STDOUT: !167 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.b069b9e27a2f3b24", scope: null, file: !18, line: 17, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !177) -// CHECK:STDOUT: !168 = !DILocalVariable(arg: 1, scope: !167, type: !25) -// CHECK:STDOUT: !172 = !DILocation(line: 18, column: 3, scope: !167) -// CHECK:STDOUT: !173 = !DILocation(line: 18, column: 14, scope: !167) -// CHECK:STDOUT: !175 = !DILocation(line: 19, column: 10, scope: !167) -// CHECK:STDOUT: !176 = !DILocation(line: 19, column: 3, scope: !167) -// CHECK:STDOUT: !177 = !{!168} -// CHECK:STDOUT: !178 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.f320bf07a6b502ca", scope: null, file: !18, line: 17, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !188) -// CHECK:STDOUT: !179 = !DILocalVariable(arg: 1, scope: !178, type: !25) -// CHECK:STDOUT: !183 = !DILocation(line: 18, column: 3, scope: !178) -// CHECK:STDOUT: !184 = !DILocation(line: 18, column: 14, scope: !178) -// CHECK:STDOUT: !186 = !DILocation(line: 19, column: 10, scope: !178) -// CHECK:STDOUT: !187 = !DILocation(line: 19, column: 3, scope: !178) -// CHECK:STDOUT: !188 = !{!179} +// CHECK:STDOUT: !153 = !DILocation(line: 74, column: 10, scope: !147) +// CHECK:STDOUT: !154 = !DILocation(line: 74, column: 3, scope: !147) +// CHECK:STDOUT: !155 = !{!148} +// CHECK:STDOUT: !156 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.ae1e3622d7875d32:core.Destroy.Core", scope: null, file: !18, line: 74, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !159) +// CHECK:STDOUT: !157 = !DILocalVariable(arg: 1, scope: !156, type: !25) +// CHECK:STDOUT: !158 = !DILocation(line: 74, column: 10, scope: !156) +// CHECK:STDOUT: !159 = !{!157} +// CHECK:STDOUT: !160 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.ae1e3622d7875d32:core.Destroy.Core", scope: null, file: !18, line: 74, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !163) +// CHECK:STDOUT: !161 = !DILocalVariable(arg: 1, scope: !160, type: !25) +// CHECK:STDOUT: !162 = !DILocation(line: 74, column: 10, scope: !160) +// CHECK:STDOUT: !163 = !{!161} +// CHECK:STDOUT: !164 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.804fd121057d1d93", scope: null, file: !18, line: 17, type: !22, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !174) +// CHECK:STDOUT: !165 = !DILocalVariable(arg: 1, scope: !164, type: !20) +// CHECK:STDOUT: !169 = !DILocation(line: 18, column: 3, scope: !164) +// CHECK:STDOUT: !170 = !DILocation(line: 18, column: 14, scope: !164) +// CHECK:STDOUT: !172 = !DILocation(line: 19, column: 10, scope: !164) +// CHECK:STDOUT: !173 = !DILocation(line: 19, column: 3, scope: !164) +// CHECK:STDOUT: !174 = !{!165} +// CHECK:STDOUT: !175 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.9d368fc2e01d20c2", scope: null, file: !18, line: 17, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !185) +// CHECK:STDOUT: !176 = !DILocalVariable(arg: 1, scope: !175, type: !25) +// CHECK:STDOUT: !180 = !DILocation(line: 18, column: 3, scope: !175) +// CHECK:STDOUT: !181 = !DILocation(line: 18, column: 14, scope: !175) +// CHECK:STDOUT: !183 = !DILocation(line: 19, column: 10, scope: !175) +// CHECK:STDOUT: !184 = !DILocation(line: 19, column: 3, scope: !175) +// CHECK:STDOUT: !185 = !{!176} +// CHECK:STDOUT: !186 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.a5d0440dfa027ffe", scope: null, file: !18, line: 17, type: !31, spFlags: DISPFlagDefinition, unit: !19) +// CHECK:STDOUT: !190 = !DILocation(line: 18, column: 3, scope: !186) +// CHECK:STDOUT: !191 = !DILocation(line: 18, column: 14, scope: !186) +// CHECK:STDOUT: !193 = !DILocation(line: 19, column: 10, scope: !186) +// CHECK:STDOUT: !194 = !DILocation(line: 19, column: 3, scope: !186) +// CHECK:STDOUT: !195 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.25802053f9465fe8", scope: null, file: !18, line: 17, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !205) +// CHECK:STDOUT: !196 = !DILocalVariable(arg: 1, scope: !195, type: !25) +// CHECK:STDOUT: !200 = !DILocation(line: 18, column: 3, scope: !195) +// CHECK:STDOUT: !201 = !DILocation(line: 18, column: 14, scope: !195) +// CHECK:STDOUT: !203 = !DILocation(line: 19, column: 10, scope: !195) +// CHECK:STDOUT: !204 = !DILocation(line: 19, column: 3, scope: !195) +// CHECK:STDOUT: !205 = !{!196} +// CHECK:STDOUT: !206 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.f37d80e656707351", scope: null, file: !18, line: 17, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !216) +// CHECK:STDOUT: !207 = !DILocalVariable(arg: 1, scope: !206, type: !25) +// CHECK:STDOUT: !211 = !DILocation(line: 18, column: 3, scope: !206) +// CHECK:STDOUT: !212 = !DILocation(line: 18, column: 14, scope: !206) +// CHECK:STDOUT: !214 = !DILocation(line: 19, column: 10, scope: !206) +// CHECK:STDOUT: !215 = !DILocation(line: 19, column: 3, scope: !206) +// CHECK:STDOUT: !216 = !{!207} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/impl/impl.carbon b/toolchain/lower/testdata/impl/impl.carbon index dea6f7a0a327..d201c0f076f9 100644 --- a/toolchain/lower/testdata/impl/impl.carbon +++ b/toolchain/lower/testdata/impl/impl.carbon @@ -156,23 +156,43 @@ impl C(B) as I { // CHECK:STDOUT: call void @"_CF.C.Main:I.bd4fb75a414fe858.Main"(ptr %a.var, ptr %x), !dbg !68 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %b.var), !dbg !70 // CHECK:STDOUT: call void @"_CF.C.Main:I.a6a60dfee2d7d273.Main"(ptr %b.var, ptr %y), !dbg !71 -// CHECK:STDOUT: call void @"_COp.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %b.var), !dbg !70 -// CHECK:STDOUT: call void @"_COp.5a23cc09585c55d2:core.Destroy.Core"(ptr %a.var), !dbg !67 +// CHECK:STDOUT: call void @"_CSelfDestruct.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %b.var), !dbg !70 +// CHECK:STDOUT: call void @"_CSelfDestruct.5a23cc09585c55d2:core.Destroy.Core"(ptr %a.var), !dbg !67 // CHECK:STDOUT: ret void, !dbg !73 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %self) #0 !dbg !75 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %self) #0 !dbg !75 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !77 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.5a23cc09585c55d2:core.Destroy.Core"(ptr %self) #0 !dbg !79 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %self) #0 !dbg !79 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !81 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %self) #0 !dbg !83 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %self), !dbg !85 +// CHECK:STDOUT: ret void, !dbg !85 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.5a23cc09585c55d2:core.Destroy.Core"(ptr %self) #0 !dbg !87 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !89 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.5a23cc09585c55d2:core.Destroy.Core"(ptr %self) #0 !dbg !91 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.5a23cc09585c55d2:core.Destroy.Core"(ptr %self), !dbg !93 +// CHECK:STDOUT: ret void, !dbg !93 +// 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: @@ -217,44 +237,56 @@ impl C(B) as I { // CHECK:STDOUT: !71 = !DILocation(line: 22, column: 21, scope: !62) // CHECK:STDOUT: !73 = !DILocation(line: 20, column: 1, scope: !62) // CHECK:STDOUT: !74 = !{!63, !64} -// CHECK:STDOUT: !75 = distinct !DISubprogram(name: "Op", linkageName: "_COp.8c4b83ecd900f1ea:core.Destroy.Core", scope: null, file: !40, line: 22, type: !47, spFlags: DISPFlagDefinition, unit: !41, retainedNodes: !78) +// CHECK:STDOUT: !75 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !40, line: 22, type: !47, spFlags: DISPFlagDefinition, unit: !41, retainedNodes: !78) // CHECK:STDOUT: !76 = !DILocalVariable(arg: 1, scope: !75, type: !21) // CHECK:STDOUT: !77 = !DILocation(line: 22, column: 3, scope: !75) // CHECK:STDOUT: !78 = !{!76} -// CHECK:STDOUT: !79 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5a23cc09585c55d2:core.Destroy.Core", scope: null, file: !40, line: 21, type: !47, spFlags: DISPFlagDefinition, unit: !41, retainedNodes: !82) +// CHECK:STDOUT: !79 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.8c4b83ecd900f1ea:core.Destroy.Core", scope: null, file: !40, line: 22, type: !47, spFlags: DISPFlagDefinition, unit: !41, retainedNodes: !82) // CHECK:STDOUT: !80 = !DILocalVariable(arg: 1, scope: !79, type: !21) -// CHECK:STDOUT: !81 = !DILocation(line: 21, column: 3, scope: !79) +// CHECK:STDOUT: !81 = !DILocation(line: 22, column: 3, scope: !79) // CHECK:STDOUT: !82 = !{!80} +// CHECK:STDOUT: !83 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.8c4b83ecd900f1ea:core.Destroy.Core", scope: null, file: !40, line: 22, type: !47, spFlags: DISPFlagDefinition, unit: !41, retainedNodes: !86) +// CHECK:STDOUT: !84 = !DILocalVariable(arg: 1, scope: !83, type: !21) +// CHECK:STDOUT: !85 = !DILocation(line: 22, column: 3, scope: !83) +// CHECK:STDOUT: !86 = !{!84} +// CHECK:STDOUT: !87 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.5a23cc09585c55d2:core.Destroy.Core", scope: null, file: !40, line: 21, type: !47, spFlags: DISPFlagDefinition, unit: !41, retainedNodes: !90) +// CHECK:STDOUT: !88 = !DILocalVariable(arg: 1, scope: !87, type: !21) +// CHECK:STDOUT: !89 = !DILocation(line: 21, column: 3, scope: !87) +// CHECK:STDOUT: !90 = !{!88} +// CHECK:STDOUT: !91 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.5a23cc09585c55d2:core.Destroy.Core", scope: null, file: !40, line: 21, type: !47, spFlags: DISPFlagDefinition, unit: !41, retainedNodes: !94) +// CHECK:STDOUT: !92 = !DILocalVariable(arg: 1, scope: !91, type: !21) +// CHECK:STDOUT: !93 = !DILocation(line: 21, column: 3, scope: !91) +// CHECK:STDOUT: !94 = !{!92} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'generic_class_impls.carbon' // CHECK:STDOUT: source_filename = "generic_class_impls.carbon" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @"_CF.C.bd4fb75a414fe858.Main:I.Main"() #0 !dbg !87 { +// CHECK:STDOUT: define void @"_CF.C.bd4fb75a414fe858.Main:I.Main"() #0 !dbg !99 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !88 +// CHECK:STDOUT: ret void, !dbg !100 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @"_CF.C.a6a60dfee2d7d273.Main:I.Main"() #0 !dbg !89 { +// CHECK:STDOUT: define void @"_CF.C.a6a60dfee2d7d273.Main:I.Main"() #0 !dbg !101 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !90 +// CHECK:STDOUT: ret void, !dbg !102 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!84} +// CHECK:STDOUT: !llvm.dbg.cu = !{!96} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !83 = !DIFile(filename: "generic_class_impls.carbon", directory: "") -// CHECK:STDOUT: !84 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !83, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !85 = !{null} -// CHECK:STDOUT: !86 = !DISubroutineType(types: !85) -// CHECK:STDOUT: !87 = distinct !DISubprogram(name: "F", linkageName: "_CF.C.bd4fb75a414fe858.Main:I.Main", scope: null, file: !83, line: 14, type: !86, spFlags: DISPFlagDefinition, unit: !84) -// CHECK:STDOUT: !88 = !DILocation(line: 14, column: 3, scope: !87) -// CHECK:STDOUT: !89 = distinct !DISubprogram(name: "F", linkageName: "_CF.C.a6a60dfee2d7d273.Main:I.Main", scope: null, file: !83, line: 18, type: !86, spFlags: DISPFlagDefinition, unit: !84) -// CHECK:STDOUT: !90 = !DILocation(line: 18, column: 3, scope: !89) +// CHECK:STDOUT: !95 = !DIFile(filename: "generic_class_impls.carbon", directory: "") +// CHECK:STDOUT: !96 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !95, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !97 = !{null} +// CHECK:STDOUT: !98 = !DISubroutineType(types: !97) +// CHECK:STDOUT: !99 = distinct !DISubprogram(name: "F", linkageName: "_CF.C.bd4fb75a414fe858.Main:I.Main", scope: null, file: !95, line: 14, type: !98, spFlags: DISPFlagDefinition, unit: !96) +// CHECK:STDOUT: !100 = !DILocation(line: 14, column: 3, scope: !99) +// CHECK:STDOUT: !101 = distinct !DISubprogram(name: "F", linkageName: "_CF.C.a6a60dfee2d7d273.Main:I.Main", scope: null, file: !95, line: 18, type: !98, spFlags: DISPFlagDefinition, unit: !96) +// CHECK:STDOUT: !102 = !DILocation(line: 18, column: 3, scope: !101) // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/impl/import_facet.carbon b/toolchain/lower/testdata/impl/import_facet.carbon index 2a84ef8e7226..acf292148fe6 100644 --- a/toolchain/lower/testdata/impl/import_facet.carbon +++ b/toolchain/lower/testdata/impl/import_facet.carbon @@ -92,7 +92,7 @@ fn F(d: D(i32)) -> i32* { // CHECK:STDOUT: ; ModuleID = 'd.carbon' // CHECK:STDOUT: source_filename = "d.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: @C.val.564.anon = internal constant {} zeroinitializer +// CHECK:STDOUT: @C.val.207.anon = internal constant {} zeroinitializer // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind // CHECK:STDOUT: define ptr @_CF.Main(ptr %d) #0 !dbg !17 { @@ -100,33 +100,53 @@ fn F(d: D(i32)) -> i32* { // CHECK:STDOUT: %.loc5_21.1.temp = alloca {}, align 1, !dbg !22 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc5_21.1.temp), !dbg !22 // CHECK:STDOUT: call void @"_CGetI.D.eb057aa32837c84e.Main:I.Main.84588f41d61dafba"(ptr %.loc5_21.1.temp, ptr %d), !dbg !22 -// CHECK:STDOUT: %C.GetC.call = call ptr @_CGetC.C.Main.4a10e8a81ade3744(ptr %.loc5_21.1.temp), !dbg !22 -// CHECK:STDOUT: call void @"_COp.f71821293eb4cf2f:core.Destroy.Core"(ptr %.loc5_21.1.temp), !dbg !22 +// CHECK:STDOUT: %C.GetC.call = call ptr @_CGetC.C.Main.aac7339a58c49d52(ptr %.loc5_21.1.temp), !dbg !22 +// CHECK:STDOUT: call void @"_CSelfDestruct.14de9dd8f7d35649:core.Destroy.Core"(ptr %.loc5_21.1.temp), !dbg !22 // CHECK:STDOUT: ret ptr %C.GetC.call, !dbg !23 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f71821293eb4cf2f:core.Destroy.Core"(ptr %self) #0 !dbg !25 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.d088c7eb746488be:core.Destroy.Core"(ptr %self) #0 !dbg !25 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !27 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %self) #0 !dbg !29 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !31 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.14de9dd8f7d35649:core.Destroy.Core"(ptr %self) #0 !dbg !33 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !35 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.14de9dd8f7d35649:core.Destroy.Core"(ptr %self) #0 !dbg !37 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.14de9dd8f7d35649:core.Destroy.Core"(ptr %self), !dbg !39 +// CHECK:STDOUT: ret void, !dbg !39 +// 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 @"_CGetI.D.eb057aa32837c84e.Main:I.Main.84588f41d61dafba"(ptr sret({}) %return, ptr %self) #0 !dbg !29 { -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %return, ptr align 1 @C.val.564.anon, i64 0, i1 false), !dbg !34 -// CHECK:STDOUT: ret void, !dbg !34 +// CHECK:STDOUT: define linkonce_odr void @"_CGetI.D.eb057aa32837c84e.Main:I.Main.84588f41d61dafba"(ptr sret({}) %return, ptr %self) #0 !dbg !41 { +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %return, ptr align 1 @C.val.207.anon, i64 0, i1 false), !dbg !46 +// CHECK:STDOUT: ret void, !dbg !46 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CGetC.C.Main.4a10e8a81ade3744(ptr %self) #0 !dbg !36 { -// CHECK:STDOUT: %1 = alloca ptr, align 8, !dbg !41 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !41 -// CHECK:STDOUT: store ptr poison, ptr %1, align 8, !dbg !41 -// CHECK:STDOUT: %2 = load ptr, ptr %1, align 8, !dbg !43 -// CHECK:STDOUT: ret ptr %2, !dbg !44 +// CHECK:STDOUT: define linkonce_odr ptr @_CGetC.C.Main.aac7339a58c49d52(ptr %self) #0 !dbg !48 { +// CHECK:STDOUT: %1 = alloca ptr, align 8, !dbg !53 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !53 +// CHECK:STDOUT: store ptr poison, ptr %1, align 8, !dbg !53 +// CHECK:STDOUT: %2 = load ptr, ptr %1, align 8, !dbg !55 +// CHECK:STDOUT: call void @"_CSelfDestruct.d088c7eb746488be:core.Destroy.Core"(ptr %1), !dbg !53 +// CHECK:STDOUT: ret ptr %2, !dbg !56 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -154,18 +174,30 @@ fn F(d: D(i32)) -> i32* { // CHECK:STDOUT: !22 = !DILocation(line: 5, column: 10, scope: !17) // CHECK:STDOUT: !23 = !DILocation(line: 5, column: 3, scope: !17) // CHECK:STDOUT: !24 = !{!18} -// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f71821293eb4cf2f:core.Destroy.Core", scope: null, file: !10, line: 5, type: !16, spFlags: DISPFlagDefinition, unit: !11, retainedNodes: !28) +// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.d088c7eb746488be:core.Destroy.Core", scope: null, file: !8, line: 5, type: !16, spFlags: DISPFlagDefinition, unit: !11, retainedNodes: !28) // CHECK:STDOUT: !26 = !DILocalVariable(arg: 1, scope: !25, type: !12) -// CHECK:STDOUT: !27 = !DILocation(line: 5, column: 10, scope: !25) +// CHECK:STDOUT: !27 = !DILocation(line: 5, column: 24, scope: !25) // CHECK:STDOUT: !28 = !{!26} -// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "GetI", linkageName: "_CGetI.D.eb057aa32837c84e.Main:I.Main.84588f41d61dafba", scope: null, file: !8, line: 6, type: !14, spFlags: DISPFlagDefinition, unit: !11, retainedNodes: !35) +// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !10, line: 5, type: !16, spFlags: DISPFlagDefinition, unit: !11, retainedNodes: !32) // CHECK:STDOUT: !30 = !DILocalVariable(arg: 1, scope: !29, type: !12) -// CHECK:STDOUT: !34 = !DILocation(line: 7, column: 7, scope: !29) -// CHECK:STDOUT: !35 = !{!30} -// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "GetC", linkageName: "_CGetC.C.Main.4a10e8a81ade3744", scope: null, file: !4, line: 4, type: !14, spFlags: DISPFlagDefinition, unit: !11, retainedNodes: !45) -// CHECK:STDOUT: !37 = !DILocalVariable(arg: 1, scope: !36, type: !12) -// CHECK:STDOUT: !41 = !DILocation(line: 5, column: 5, scope: !36) -// CHECK:STDOUT: !43 = !DILocation(line: 6, column: 12, scope: !36) -// CHECK:STDOUT: !44 = !DILocation(line: 6, column: 5, scope: !36) -// CHECK:STDOUT: !45 = !{!37} +// CHECK:STDOUT: !31 = !DILocation(line: 5, column: 10, scope: !29) +// CHECK:STDOUT: !32 = !{!30} +// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.14de9dd8f7d35649:core.Destroy.Core", scope: null, file: !10, line: 5, type: !16, spFlags: DISPFlagDefinition, unit: !11, retainedNodes: !36) +// CHECK:STDOUT: !34 = !DILocalVariable(arg: 1, scope: !33, type: !12) +// CHECK:STDOUT: !35 = !DILocation(line: 5, column: 10, scope: !33) +// CHECK:STDOUT: !36 = !{!34} +// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.14de9dd8f7d35649:core.Destroy.Core", scope: null, file: !10, line: 5, type: !16, spFlags: DISPFlagDefinition, unit: !11, retainedNodes: !40) +// CHECK:STDOUT: !38 = !DILocalVariable(arg: 1, scope: !37, type: !12) +// CHECK:STDOUT: !39 = !DILocation(line: 5, column: 10, scope: !37) +// CHECK:STDOUT: !40 = !{!38} +// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "GetI", linkageName: "_CGetI.D.eb057aa32837c84e.Main:I.Main.84588f41d61dafba", scope: null, file: !8, line: 6, type: !14, spFlags: DISPFlagDefinition, unit: !11, retainedNodes: !47) +// CHECK:STDOUT: !42 = !DILocalVariable(arg: 1, scope: !41, type: !12) +// CHECK:STDOUT: !46 = !DILocation(line: 7, column: 7, scope: !41) +// CHECK:STDOUT: !47 = !{!42} +// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "GetC", linkageName: "_CGetC.C.Main.aac7339a58c49d52", scope: null, file: !4, line: 4, type: !14, spFlags: DISPFlagDefinition, unit: !11, retainedNodes: !57) +// CHECK:STDOUT: !49 = !DILocalVariable(arg: 1, scope: !48, type: !12) +// CHECK:STDOUT: !53 = !DILocation(line: 5, column: 5, scope: !48) +// CHECK:STDOUT: !55 = !DILocation(line: 6, column: 12, scope: !48) +// CHECK:STDOUT: !56 = !DILocation(line: 6, column: 5, scope: !48) +// CHECK:STDOUT: !57 = !{!49} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/impl/import_thunk.carbon b/toolchain/lower/testdata/impl/import_thunk.carbon index e04e747a8b18..982183afc879 100644 --- a/toolchain/lower/testdata/impl/import_thunk.carbon +++ b/toolchain/lower/testdata/impl/import_thunk.carbon @@ -110,34 +110,61 @@ fn Test(a: A) -> C { // 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 @"_CConvert.B.Main:ImplicitAs.9522ff908e97e267.Core"(ptr %return, ptr %.loc20_19.1.temp), !dbg !58 -// CHECK:STDOUT: call void @"_COp.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %.loc20_19.1.temp), !dbg !58 -// CHECK:STDOUT: call void @"_COp.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %.4.temp), !dbg !57 +// 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: ret void, !dbg !58 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !60 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !60 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !62 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.0bfe8bb35a2876b2:core.Destroy.Core"(ptr %self) #0 !dbg !64 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !64 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !66 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %self) #0 !dbg !68 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !68 { // CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !70 // CHECK:STDOUT: ret void, !dbg !70 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.0bfe8bb35a2876b2:core.Destroy.Core"(ptr %self) #0 !dbg !72 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !74 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.0bfe8bb35a2876b2:core.Destroy.Core"(ptr %self) #0 !dbg !76 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.0bfe8bb35a2876b2:core.Destroy.Core"(ptr %self), !dbg !78 +// CHECK:STDOUT: ret void, !dbg !78 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %self) #0 !dbg !80 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !82 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %self) #0 !dbg !84 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %self), !dbg !86 +// CHECK:STDOUT: ret void, !dbg !86 +// 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)) #2 // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives -// CHECK:STDOUT: uselistorder ptr @"_COp.8c4b83ecd900f1ea:core.Destroy.Core", { 1, 0 } +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.8c4b83ecd900f1ea:core.Destroy.Core", { 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -182,38 +209,54 @@ fn Test(a: A) -> C { // 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: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 20, type: !25, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !63) +// CHECK:STDOUT: !60 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !18, line: 20, type: !25, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !63) // CHECK:STDOUT: !61 = !DILocalVariable(arg: 1, scope: !60, type: !20) // CHECK:STDOUT: !62 = !DILocation(line: 20, column: 3, scope: !60) // CHECK:STDOUT: !63 = !{!61} -// CHECK:STDOUT: !64 = distinct !DISubprogram(name: "Op", linkageName: "_COp.0bfe8bb35a2876b2:core.Destroy.Core", scope: null, file: !18, line: 20, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !67) -// CHECK:STDOUT: !65 = !DILocalVariable(arg: 1, scope: !64, type: !21) +// CHECK:STDOUT: !64 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 20, type: !25, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !67) +// CHECK:STDOUT: !65 = !DILocalVariable(arg: 1, scope: !64, type: !20) // CHECK:STDOUT: !66 = !DILocation(line: 20, column: 3, scope: !64) // CHECK:STDOUT: !67 = !{!65} -// CHECK:STDOUT: !68 = distinct !DISubprogram(name: "Op", linkageName: "_COp.8c4b83ecd900f1ea:core.Destroy.Core", scope: null, file: !18, line: 20, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !71) -// CHECK:STDOUT: !69 = !DILocalVariable(arg: 1, scope: !68, type: !21) +// CHECK:STDOUT: !68 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 20, type: !25, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !71) +// CHECK:STDOUT: !69 = !DILocalVariable(arg: 1, scope: !68, type: !20) // CHECK:STDOUT: !70 = !DILocation(line: 20, column: 3, scope: !68) // CHECK:STDOUT: !71 = !{!69} +// CHECK:STDOUT: !72 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.0bfe8bb35a2876b2:core.Destroy.Core", scope: null, file: !18, line: 20, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !75) +// CHECK:STDOUT: !73 = !DILocalVariable(arg: 1, scope: !72, type: !21) +// CHECK:STDOUT: !74 = !DILocation(line: 20, column: 3, scope: !72) +// CHECK:STDOUT: !75 = !{!73} +// CHECK:STDOUT: !76 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.0bfe8bb35a2876b2:core.Destroy.Core", scope: null, file: !18, line: 20, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !79) +// CHECK:STDOUT: !77 = !DILocalVariable(arg: 1, scope: !76, type: !21) +// CHECK:STDOUT: !78 = !DILocation(line: 20, column: 3, scope: !76) +// CHECK:STDOUT: !79 = !{!77} +// CHECK:STDOUT: !80 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.8c4b83ecd900f1ea:core.Destroy.Core", scope: null, file: !18, line: 20, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !83) +// CHECK:STDOUT: !81 = !DILocalVariable(arg: 1, scope: !80, type: !21) +// CHECK:STDOUT: !82 = !DILocation(line: 20, column: 3, scope: !80) +// CHECK:STDOUT: !83 = !{!81} +// CHECK:STDOUT: !84 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.8c4b83ecd900f1ea:core.Destroy.Core", scope: null, file: !18, line: 20, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !87) +// CHECK:STDOUT: !85 = !DILocalVariable(arg: 1, scope: !84, type: !21) +// CHECK:STDOUT: !86 = !DILocation(line: 20, column: 3, scope: !84) +// CHECK:STDOUT: !87 = !{!85} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'call_thunk.carbon' // CHECK:STDOUT: source_filename = "call_thunk.carbon" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CTest.Main(ptr sret({ i32 }) %return, ptr %a) #0 !dbg !74 { +// CHECK:STDOUT: define void @_CTest.Main(ptr sret({ i32 }) %return, ptr %a) #0 !dbg !90 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc7_20.1.temp = alloca { i32 }, align 4, !dbg !80 -// CHECK:STDOUT: %.loc7_20.2.temp = alloca { i32 }, align 4, !dbg !80 -// CHECK:STDOUT: %.loc7_19.1.temp = alloca { i32 }, align 4, !dbg !79 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_20.1.temp), !dbg !80 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_20.2.temp), !dbg !80 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_19.1.temp), !dbg !79 -// CHECK:STDOUT: call void @"_CConvert.A.Main:ImplicitAs.a6a60dfee2d7d273.Core"(ptr %.loc7_19.1.temp, ptr %a), !dbg !79 -// CHECK:STDOUT: call void @"_CF.61ea2aba74ab3bf1:I.Main"(ptr %.loc7_20.2.temp, ptr %.loc7_19.1.temp), !dbg !80 -// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.9522ff908e97e267.Core"(ptr %return, ptr %.loc7_20.2.temp), !dbg !81 -// CHECK:STDOUT: call void @"_COp.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %.loc7_20.2.temp), !dbg !80 -// CHECK:STDOUT: call void @"_COp.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %.loc7_19.1.temp), !dbg !79 -// CHECK:STDOUT: ret void, !dbg !81 +// CHECK:STDOUT: %.loc7_20.1.temp = alloca { i32 }, align 4, !dbg !96 +// CHECK:STDOUT: %.loc7_20.2.temp = alloca { i32 }, align 4, !dbg !96 +// CHECK:STDOUT: %.loc7_19.1.temp = alloca { i32 }, align 4, !dbg !95 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_20.1.temp), !dbg !96 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_20.2.temp), !dbg !96 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_19.1.temp), !dbg !95 +// CHECK:STDOUT: call void @"_CConvert.A.Main:ImplicitAs.a6a60dfee2d7d273.Core"(ptr %.loc7_19.1.temp, ptr %a), !dbg !95 +// CHECK:STDOUT: call void @"_CF.61ea2aba74ab3bf1:I.Main"(ptr %.loc7_20.2.temp, ptr %.loc7_19.1.temp), !dbg !96 +// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.9522ff908e97e267.Core"(ptr %return, ptr %.loc7_20.2.temp), !dbg !97 +// CHECK:STDOUT: call void @"_CSelfDestruct.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %.loc7_20.2.temp), !dbg !96 +// CHECK:STDOUT: call void @"_CSelfDestruct.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %.loc7_19.1.temp), !dbg !95 +// CHECK:STDOUT: ret void, !dbg !97 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @"_CF:thunk:I.f5faeaa774ca256e.Main:61ea2aba74ab3bf1:I.Main"(ptr sret({ i32 }), ptr) @@ -225,34 +268,61 @@ fn Test(a: A) -> C { // CHECK:STDOUT: declare void @"_CConvert.B.Main:ImplicitAs.9522ff908e97e267.Core"(ptr sret({ i32 }), ptr) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !83 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !99 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !85 +// CHECK:STDOUT: ret void, !dbg !101 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.0bfe8bb35a2876b2:core.Destroy.Core"(ptr %self) #0 !dbg !87 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !103 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !89 +// CHECK:STDOUT: ret void, !dbg !105 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %self) #0 !dbg !91 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !107 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !93 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !109 +// CHECK:STDOUT: ret void, !dbg !109 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.0bfe8bb35a2876b2:core.Destroy.Core"(ptr %self) #0 !dbg !111 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !113 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.0bfe8bb35a2876b2:core.Destroy.Core"(ptr %self) #0 !dbg !115 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.0bfe8bb35a2876b2:core.Destroy.Core"(ptr %self), !dbg !117 +// CHECK:STDOUT: ret void, !dbg !117 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %self) #0 !dbg !119 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !121 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %self) #0 !dbg !123 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %self), !dbg !125 +// CHECK:STDOUT: ret void, !dbg !125 // 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: ; uselistorder directives -// CHECK:STDOUT: uselistorder ptr @"_COp.8c4b83ecd900f1ea:core.Destroy.Core", { 1, 0 } +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.8c4b83ecd900f1ea:core.Destroy.Core", { 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 2, 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!73} +// CHECK:STDOUT: !llvm.dbg.cu = !{!89} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} @@ -265,54 +335,70 @@ fn Test(a: A) -> C { // CHECK:STDOUT: !25 = !DISubroutineType(types: !24) // CHECK:STDOUT: !26 = !{null, !21} // CHECK:STDOUT: !27 = !DISubroutineType(types: !26) -// CHECK:STDOUT: !72 = !DIFile(filename: "call_thunk.carbon", directory: "") -// CHECK:STDOUT: !73 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !72, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !74 = distinct !DISubprogram(name: "Test", linkageName: "_CTest.Main", scope: null, file: !72, line: 6, type: !23, spFlags: DISPFlagDefinition, unit: !73, retainedNodes: !82) -// CHECK:STDOUT: !75 = !DILocalVariable(arg: 1, scope: !74, type: !21) -// CHECK:STDOUT: !79 = !DILocation(line: 7, column: 19, scope: !74) -// CHECK:STDOUT: !80 = !DILocation(line: 7, column: 10, scope: !74) -// CHECK:STDOUT: !81 = !DILocation(line: 7, column: 3, scope: !74) -// CHECK:STDOUT: !82 = !{!75} -// CHECK:STDOUT: !83 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !72, line: 7, type: !25, spFlags: DISPFlagDefinition, unit: !73, retainedNodes: !86) -// CHECK:STDOUT: !84 = !DILocalVariable(arg: 1, scope: !83, type: !20) -// CHECK:STDOUT: !85 = !DILocation(line: 7, column: 10, scope: !83) -// CHECK:STDOUT: !86 = !{!84} -// CHECK:STDOUT: !87 = distinct !DISubprogram(name: "Op", linkageName: "_COp.0bfe8bb35a2876b2:core.Destroy.Core", scope: null, file: !72, line: 7, type: !27, spFlags: DISPFlagDefinition, unit: !73, retainedNodes: !90) -// CHECK:STDOUT: !88 = !DILocalVariable(arg: 1, scope: !87, type: !21) -// CHECK:STDOUT: !89 = !DILocation(line: 7, column: 10, scope: !87) -// CHECK:STDOUT: !90 = !{!88} -// CHECK:STDOUT: !91 = distinct !DISubprogram(name: "Op", linkageName: "_COp.8c4b83ecd900f1ea:core.Destroy.Core", scope: null, file: !72, line: 7, type: !27, spFlags: DISPFlagDefinition, unit: !73, retainedNodes: !94) -// CHECK:STDOUT: !92 = !DILocalVariable(arg: 1, scope: !91, type: !21) -// CHECK:STDOUT: !93 = !DILocation(line: 7, column: 10, scope: !91) -// CHECK:STDOUT: !94 = !{!92} +// CHECK:STDOUT: !88 = !DIFile(filename: "call_thunk.carbon", directory: "") +// CHECK:STDOUT: !89 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !88, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !90 = distinct !DISubprogram(name: "Test", linkageName: "_CTest.Main", scope: null, file: !88, line: 6, type: !23, spFlags: DISPFlagDefinition, unit: !89, retainedNodes: !98) +// CHECK:STDOUT: !91 = !DILocalVariable(arg: 1, scope: !90, type: !21) +// CHECK:STDOUT: !95 = !DILocation(line: 7, column: 19, scope: !90) +// CHECK:STDOUT: !96 = !DILocation(line: 7, column: 10, scope: !90) +// CHECK:STDOUT: !97 = !DILocation(line: 7, column: 3, scope: !90) +// CHECK:STDOUT: !98 = !{!91} +// CHECK:STDOUT: !99 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !88, line: 7, type: !25, spFlags: DISPFlagDefinition, unit: !89, retainedNodes: !102) +// CHECK:STDOUT: !100 = !DILocalVariable(arg: 1, scope: !99, type: !20) +// CHECK:STDOUT: !101 = !DILocation(line: 7, column: 10, scope: !99) +// CHECK:STDOUT: !102 = !{!100} +// CHECK:STDOUT: !103 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !88, line: 7, type: !25, spFlags: DISPFlagDefinition, unit: !89, retainedNodes: !106) +// CHECK:STDOUT: !104 = !DILocalVariable(arg: 1, scope: !103, type: !20) +// CHECK:STDOUT: !105 = !DILocation(line: 7, column: 10, scope: !103) +// CHECK:STDOUT: !106 = !{!104} +// CHECK:STDOUT: !107 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !88, line: 7, type: !25, spFlags: DISPFlagDefinition, unit: !89, retainedNodes: !110) +// CHECK:STDOUT: !108 = !DILocalVariable(arg: 1, scope: !107, type: !20) +// CHECK:STDOUT: !109 = !DILocation(line: 7, column: 10, scope: !107) +// CHECK:STDOUT: !110 = !{!108} +// CHECK:STDOUT: !111 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.0bfe8bb35a2876b2:core.Destroy.Core", scope: null, file: !88, line: 7, type: !27, spFlags: DISPFlagDefinition, unit: !89, retainedNodes: !114) +// CHECK:STDOUT: !112 = !DILocalVariable(arg: 1, scope: !111, type: !21) +// CHECK:STDOUT: !113 = !DILocation(line: 7, column: 10, scope: !111) +// CHECK:STDOUT: !114 = !{!112} +// CHECK:STDOUT: !115 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.0bfe8bb35a2876b2:core.Destroy.Core", scope: null, file: !88, line: 7, type: !27, spFlags: DISPFlagDefinition, unit: !89, retainedNodes: !118) +// CHECK:STDOUT: !116 = !DILocalVariable(arg: 1, scope: !115, type: !21) +// CHECK:STDOUT: !117 = !DILocation(line: 7, column: 10, scope: !115) +// CHECK:STDOUT: !118 = !{!116} +// CHECK:STDOUT: !119 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.8c4b83ecd900f1ea:core.Destroy.Core", scope: null, file: !88, line: 7, type: !27, spFlags: DISPFlagDefinition, unit: !89, retainedNodes: !122) +// CHECK:STDOUT: !120 = !DILocalVariable(arg: 1, scope: !119, type: !21) +// CHECK:STDOUT: !121 = !DILocation(line: 7, column: 10, scope: !119) +// CHECK:STDOUT: !122 = !{!120} +// CHECK:STDOUT: !123 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.8c4b83ecd900f1ea:core.Destroy.Core", scope: null, file: !88, line: 7, type: !27, spFlags: DISPFlagDefinition, unit: !89, retainedNodes: !126) +// CHECK:STDOUT: !124 = !DILocalVariable(arg: 1, scope: !123, type: !21) +// CHECK:STDOUT: !125 = !DILocation(line: 7, column: 10, scope: !123) +// CHECK:STDOUT: !126 = !{!124} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'thunk_for_imported_interface.carbon' // CHECK:STDOUT: source_filename = "thunk_for_imported_interface.carbon" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @"_CF.X.Main:I.Main"(ptr sret({ i32 }) %return, ptr %b) #0 !dbg !97 { +// CHECK:STDOUT: define void @"_CF.X.Main:I.Main"(ptr sret({ i32 }) %return, ptr %b) #0 !dbg !129 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc9_35.1.b = getelementptr inbounds nuw { i32 }, ptr %b, i32 0, i32 0, !dbg !102 -// CHECK:STDOUT: %.loc9_35.2 = load i32, ptr %.loc9_35.1.b, align 4, !dbg !102 -// CHECK:STDOUT: %.loc9_37.2.b = getelementptr inbounds nuw { i32 }, ptr %return, i32 0, i32 0, !dbg !103 -// CHECK:STDOUT: store i32 %.loc9_35.2, ptr %.loc9_37.2.b, align 4, !dbg !103 -// CHECK:STDOUT: ret void, !dbg !104 +// CHECK:STDOUT: %.loc9_35.1.b = getelementptr inbounds nuw { i32 }, ptr %b, i32 0, i32 0, !dbg !134 +// CHECK:STDOUT: %.loc9_35.2 = load i32, ptr %.loc9_35.1.b, align 4, !dbg !134 +// CHECK:STDOUT: %.loc9_37.2.b = getelementptr inbounds nuw { i32 }, ptr %return, i32 0, i32 0, !dbg !135 +// CHECK:STDOUT: store i32 %.loc9_35.2, ptr %.loc9_37.2.b, align 4, !dbg !135 +// CHECK:STDOUT: ret void, !dbg !136 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr void @"_CF:thunk:I.d0cc85b6c89517e3.Main:X.Main:I.Main"(ptr sret({ i32 }) %return, ptr %a) #1 !dbg !106 { +// CHECK:STDOUT: define weak_odr void @"_CF:thunk:I.d0cc85b6c89517e3.Main:X.Main:I.Main"(ptr sret({ i32 }) %return, ptr %a) #1 !dbg !138 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc9_19.1.temp = alloca { i32 }, align 4, !dbg !109 -// CHECK:STDOUT: %.4.temp = alloca { i32 }, align 4, !dbg !108 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_19.1.temp), !dbg !109 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.4.temp), !dbg !108 -// CHECK:STDOUT: call void @"_CConvert.A.Main:ImplicitAs.a6a60dfee2d7d273.Core"(ptr %.4.temp, ptr %a), !dbg !108 -// CHECK:STDOUT: call void @"_CF.X.Main:I.Main"(ptr %.loc9_19.1.temp, ptr %.4.temp), !dbg !109 -// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.9522ff908e97e267.Core"(ptr %return, ptr %.loc9_19.1.temp), !dbg !109 -// CHECK:STDOUT: call void @"_COp.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %.loc9_19.1.temp), !dbg !109 -// CHECK:STDOUT: call void @"_COp.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %.4.temp), !dbg !108 -// CHECK:STDOUT: ret void, !dbg !109 +// CHECK:STDOUT: %.loc9_19.1.temp = alloca { i32 }, align 4, !dbg !141 +// CHECK:STDOUT: %.4.temp = alloca { i32 }, align 4, !dbg !140 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_19.1.temp), !dbg !141 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.4.temp), !dbg !140 +// CHECK:STDOUT: call void @"_CConvert.A.Main:ImplicitAs.a6a60dfee2d7d273.Core"(ptr %.4.temp, ptr %a), !dbg !140 +// CHECK:STDOUT: call void @"_CF.X.Main:I.Main"(ptr %.loc9_19.1.temp, ptr %.4.temp), !dbg !141 +// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.9522ff908e97e267.Core"(ptr %return, ptr %.loc9_19.1.temp), !dbg !141 +// CHECK:STDOUT: call void @"_CSelfDestruct.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %.loc9_19.1.temp), !dbg !141 +// CHECK:STDOUT: call void @"_CSelfDestruct.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %.4.temp), !dbg !140 +// CHECK:STDOUT: ret void, !dbg !141 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @"_CConvert.A.Main:ImplicitAs.a6a60dfee2d7d273.Core"(ptr sret({ i32 }), ptr) @@ -320,35 +406,62 @@ fn Test(a: A) -> C { // CHECK:STDOUT: declare void @"_CConvert.B.Main:ImplicitAs.9522ff908e97e267.Core"(ptr sret({ i32 }), ptr) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !111 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !143 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !113 +// CHECK:STDOUT: ret void, !dbg !145 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.0bfe8bb35a2876b2:core.Destroy.Core"(ptr %self) #0 !dbg !115 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !147 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !117 +// CHECK:STDOUT: ret void, !dbg !149 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %self) #0 !dbg !119 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !151 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !121 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !153 +// CHECK:STDOUT: ret void, !dbg !153 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.0bfe8bb35a2876b2:core.Destroy.Core"(ptr %self) #0 !dbg !155 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !157 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.0bfe8bb35a2876b2:core.Destroy.Core"(ptr %self) #0 !dbg !159 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.0bfe8bb35a2876b2:core.Destroy.Core"(ptr %self), !dbg !161 +// CHECK:STDOUT: ret void, !dbg !161 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %self) #0 !dbg !163 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !165 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %self) #0 !dbg !167 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %self), !dbg !169 +// CHECK:STDOUT: ret void, !dbg !169 // 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)) #2 // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives -// CHECK:STDOUT: uselistorder ptr @"_COp.8c4b83ecd900f1ea:core.Destroy.Core", { 1, 0 } +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.8c4b83ecd900f1ea:core.Destroy.Core", { 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { alwaysinline nounwind } // CHECK:STDOUT: attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!96} +// CHECK:STDOUT: !llvm.dbg.cu = !{!128} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} @@ -361,51 +474,67 @@ fn Test(a: A) -> C { // CHECK:STDOUT: !25 = !DISubroutineType(types: !24) // CHECK:STDOUT: !26 = !{null, !21} // CHECK:STDOUT: !27 = !DISubroutineType(types: !26) -// CHECK:STDOUT: !95 = !DIFile(filename: "thunk_for_imported_interface.carbon", directory: "") -// CHECK:STDOUT: !96 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !95, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !97 = distinct !DISubprogram(name: "F", linkageName: "_CF.X.Main:I.Main", scope: null, file: !95, line: 9, type: !23, spFlags: DISPFlagDefinition, unit: !96, retainedNodes: !105) -// CHECK:STDOUT: !98 = !DILocalVariable(arg: 1, scope: !97, type: !21) -// CHECK:STDOUT: !102 = !DILocation(line: 9, column: 34, scope: !97) -// CHECK:STDOUT: !103 = !DILocation(line: 9, column: 28, scope: !97) -// CHECK:STDOUT: !104 = !DILocation(line: 9, column: 21, scope: !97) -// CHECK:STDOUT: !105 = !{!98} -// CHECK:STDOUT: !106 = distinct !DISubprogram(name: "F", linkageName: "_CF:thunk:I.d0cc85b6c89517e3.Main:X.Main:I.Main", scope: null, file: !95, line: 9, type: !23, spFlags: DISPFlagDefinition, unit: !96, retainedNodes: !110) -// CHECK:STDOUT: !107 = !DILocalVariable(arg: 1, scope: !106, type: !21) -// CHECK:STDOUT: !108 = !DILocation(line: 0, scope: !106) -// CHECK:STDOUT: !109 = !DILocation(line: 9, column: 3, scope: !106) -// CHECK:STDOUT: !110 = !{!107} -// CHECK:STDOUT: !111 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !95, line: 9, type: !25, spFlags: DISPFlagDefinition, unit: !96, retainedNodes: !114) -// CHECK:STDOUT: !112 = !DILocalVariable(arg: 1, scope: !111, type: !20) -// CHECK:STDOUT: !113 = !DILocation(line: 9, column: 3, scope: !111) -// CHECK:STDOUT: !114 = !{!112} -// CHECK:STDOUT: !115 = distinct !DISubprogram(name: "Op", linkageName: "_COp.0bfe8bb35a2876b2:core.Destroy.Core", scope: null, file: !95, line: 9, type: !27, spFlags: DISPFlagDefinition, unit: !96, retainedNodes: !118) -// CHECK:STDOUT: !116 = !DILocalVariable(arg: 1, scope: !115, type: !21) -// CHECK:STDOUT: !117 = !DILocation(line: 9, column: 3, scope: !115) -// CHECK:STDOUT: !118 = !{!116} -// CHECK:STDOUT: !119 = distinct !DISubprogram(name: "Op", linkageName: "_COp.8c4b83ecd900f1ea:core.Destroy.Core", scope: null, file: !95, line: 9, type: !27, spFlags: DISPFlagDefinition, unit: !96, retainedNodes: !122) -// CHECK:STDOUT: !120 = !DILocalVariable(arg: 1, scope: !119, type: !21) -// CHECK:STDOUT: !121 = !DILocation(line: 9, column: 3, scope: !119) -// CHECK:STDOUT: !122 = !{!120} +// CHECK:STDOUT: !127 = !DIFile(filename: "thunk_for_imported_interface.carbon", directory: "") +// CHECK:STDOUT: !128 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !127, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !129 = distinct !DISubprogram(name: "F", linkageName: "_CF.X.Main:I.Main", scope: null, file: !127, line: 9, type: !23, spFlags: DISPFlagDefinition, unit: !128, retainedNodes: !137) +// CHECK:STDOUT: !130 = !DILocalVariable(arg: 1, scope: !129, type: !21) +// CHECK:STDOUT: !134 = !DILocation(line: 9, column: 34, scope: !129) +// CHECK:STDOUT: !135 = !DILocation(line: 9, column: 28, scope: !129) +// CHECK:STDOUT: !136 = !DILocation(line: 9, column: 21, scope: !129) +// CHECK:STDOUT: !137 = !{!130} +// CHECK:STDOUT: !138 = distinct !DISubprogram(name: "F", linkageName: "_CF:thunk:I.d0cc85b6c89517e3.Main:X.Main:I.Main", scope: null, file: !127, line: 9, type: !23, spFlags: DISPFlagDefinition, unit: !128, retainedNodes: !142) +// CHECK:STDOUT: !139 = !DILocalVariable(arg: 1, scope: !138, type: !21) +// CHECK:STDOUT: !140 = !DILocation(line: 0, scope: !138) +// CHECK:STDOUT: !141 = !DILocation(line: 9, column: 3, scope: !138) +// CHECK:STDOUT: !142 = !{!139} +// CHECK:STDOUT: !143 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !127, line: 9, type: !25, spFlags: DISPFlagDefinition, unit: !128, retainedNodes: !146) +// CHECK:STDOUT: !144 = !DILocalVariable(arg: 1, scope: !143, type: !20) +// CHECK:STDOUT: !145 = !DILocation(line: 9, column: 3, scope: !143) +// CHECK:STDOUT: !146 = !{!144} +// CHECK:STDOUT: !147 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !127, line: 9, type: !25, spFlags: DISPFlagDefinition, unit: !128, retainedNodes: !150) +// CHECK:STDOUT: !148 = !DILocalVariable(arg: 1, scope: !147, type: !20) +// CHECK:STDOUT: !149 = !DILocation(line: 9, column: 3, scope: !147) +// CHECK:STDOUT: !150 = !{!148} +// CHECK:STDOUT: !151 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !127, line: 9, type: !25, spFlags: DISPFlagDefinition, unit: !128, retainedNodes: !154) +// CHECK:STDOUT: !152 = !DILocalVariable(arg: 1, scope: !151, type: !20) +// CHECK:STDOUT: !153 = !DILocation(line: 9, column: 3, scope: !151) +// CHECK:STDOUT: !154 = !{!152} +// CHECK:STDOUT: !155 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.0bfe8bb35a2876b2:core.Destroy.Core", scope: null, file: !127, line: 9, type: !27, spFlags: DISPFlagDefinition, unit: !128, retainedNodes: !158) +// CHECK:STDOUT: !156 = !DILocalVariable(arg: 1, scope: !155, type: !21) +// CHECK:STDOUT: !157 = !DILocation(line: 9, column: 3, scope: !155) +// CHECK:STDOUT: !158 = !{!156} +// CHECK:STDOUT: !159 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.0bfe8bb35a2876b2:core.Destroy.Core", scope: null, file: !127, line: 9, type: !27, spFlags: DISPFlagDefinition, unit: !128, retainedNodes: !162) +// CHECK:STDOUT: !160 = !DILocalVariable(arg: 1, scope: !159, type: !21) +// CHECK:STDOUT: !161 = !DILocation(line: 9, column: 3, scope: !159) +// CHECK:STDOUT: !162 = !{!160} +// CHECK:STDOUT: !163 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.8c4b83ecd900f1ea:core.Destroy.Core", scope: null, file: !127, line: 9, type: !27, spFlags: DISPFlagDefinition, unit: !128, retainedNodes: !166) +// CHECK:STDOUT: !164 = !DILocalVariable(arg: 1, scope: !163, type: !21) +// CHECK:STDOUT: !165 = !DILocation(line: 9, column: 3, scope: !163) +// CHECK:STDOUT: !166 = !{!164} +// CHECK:STDOUT: !167 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.8c4b83ecd900f1ea:core.Destroy.Core", scope: null, file: !127, line: 9, type: !27, spFlags: DISPFlagDefinition, unit: !128, retainedNodes: !170) +// CHECK:STDOUT: !168 = !DILocalVariable(arg: 1, scope: !167, type: !21) +// CHECK:STDOUT: !169 = !DILocation(line: 9, column: 3, scope: !167) +// CHECK:STDOUT: !170 = !{!168} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'call_thunk_for_imported_interface.carbon' // CHECK:STDOUT: source_filename = "call_thunk_for_imported_interface.carbon" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CTest.Main(ptr sret({ i32 }) %return, ptr %a) #0 !dbg !125 { +// CHECK:STDOUT: define void @_CTest.Main(ptr sret({ i32 }) %return, ptr %a) #0 !dbg !173 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc8_19.1.temp = alloca { i32 }, align 4, !dbg !131 -// CHECK:STDOUT: %.loc8_19.2.temp = alloca { i32 }, align 4, !dbg !131 -// CHECK:STDOUT: %.loc8_18.1.temp = alloca { i32 }, align 4, !dbg !130 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc8_19.1.temp), !dbg !131 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc8_19.2.temp), !dbg !131 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc8_18.1.temp), !dbg !130 -// CHECK:STDOUT: call void @"_CConvert.A.Main:ImplicitAs.a6a60dfee2d7d273.Core"(ptr %.loc8_18.1.temp, ptr %a), !dbg !130 -// CHECK:STDOUT: call void @"_CF.X.Main:I.Main"(ptr %.loc8_19.2.temp, ptr %.loc8_18.1.temp), !dbg !131 -// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.9522ff908e97e267.Core"(ptr %return, ptr %.loc8_19.2.temp), !dbg !132 -// CHECK:STDOUT: call void @"_COp.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %.loc8_19.2.temp), !dbg !131 -// CHECK:STDOUT: call void @"_COp.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %.loc8_18.1.temp), !dbg !130 -// CHECK:STDOUT: ret void, !dbg !132 +// CHECK:STDOUT: %.loc8_19.1.temp = alloca { i32 }, align 4, !dbg !179 +// CHECK:STDOUT: %.loc8_19.2.temp = alloca { i32 }, align 4, !dbg !179 +// CHECK:STDOUT: %.loc8_18.1.temp = alloca { i32 }, align 4, !dbg !178 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc8_19.1.temp), !dbg !179 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc8_19.2.temp), !dbg !179 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc8_18.1.temp), !dbg !178 +// CHECK:STDOUT: call void @"_CConvert.A.Main:ImplicitAs.a6a60dfee2d7d273.Core"(ptr %.loc8_18.1.temp, ptr %a), !dbg !178 +// CHECK:STDOUT: call void @"_CF.X.Main:I.Main"(ptr %.loc8_19.2.temp, ptr %.loc8_18.1.temp), !dbg !179 +// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.9522ff908e97e267.Core"(ptr %return, ptr %.loc8_19.2.temp), !dbg !180 +// CHECK:STDOUT: call void @"_CSelfDestruct.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %.loc8_19.2.temp), !dbg !179 +// CHECK:STDOUT: call void @"_CSelfDestruct.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %.loc8_18.1.temp), !dbg !178 +// CHECK:STDOUT: ret void, !dbg !180 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @"_CF:thunk:I.4980a17f6b368c72.Main:X.Main:I.Main"(ptr sret({ i32 }), ptr) @@ -417,34 +546,61 @@ fn Test(a: A) -> C { // CHECK:STDOUT: declare void @"_CConvert.B.Main:ImplicitAs.9522ff908e97e267.Core"(ptr sret({ i32 }), ptr) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !134 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !182 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !136 +// CHECK:STDOUT: ret void, !dbg !184 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.0bfe8bb35a2876b2:core.Destroy.Core"(ptr %self) #0 !dbg !138 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !186 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !140 +// CHECK:STDOUT: ret void, !dbg !188 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %self) #0 !dbg !142 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !190 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !144 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !192 +// CHECK:STDOUT: ret void, !dbg !192 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.0bfe8bb35a2876b2:core.Destroy.Core"(ptr %self) #0 !dbg !194 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !196 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.0bfe8bb35a2876b2:core.Destroy.Core"(ptr %self) #0 !dbg !198 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.0bfe8bb35a2876b2:core.Destroy.Core"(ptr %self), !dbg !200 +// CHECK:STDOUT: ret void, !dbg !200 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %self) #0 !dbg !202 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !204 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %self) #0 !dbg !206 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %self), !dbg !208 +// CHECK:STDOUT: ret void, !dbg !208 // 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: ; uselistorder directives -// CHECK:STDOUT: uselistorder ptr @"_COp.8c4b83ecd900f1ea:core.Destroy.Core", { 1, 0 } +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.8c4b83ecd900f1ea:core.Destroy.Core", { 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 2, 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!124} +// CHECK:STDOUT: !llvm.dbg.cu = !{!172} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} @@ -457,24 +613,40 @@ fn Test(a: A) -> C { // CHECK:STDOUT: !25 = !DISubroutineType(types: !24) // CHECK:STDOUT: !26 = !{null, !21} // CHECK:STDOUT: !27 = !DISubroutineType(types: !26) -// CHECK:STDOUT: !123 = !DIFile(filename: "call_thunk_for_imported_interface.carbon", directory: "") -// CHECK:STDOUT: !124 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !123, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !125 = distinct !DISubprogram(name: "Test", linkageName: "_CTest.Main", scope: null, file: !123, line: 7, type: !23, spFlags: DISPFlagDefinition, unit: !124, retainedNodes: !133) -// CHECK:STDOUT: !126 = !DILocalVariable(arg: 1, scope: !125, type: !21) -// CHECK:STDOUT: !130 = !DILocation(line: 8, column: 18, scope: !125) -// CHECK:STDOUT: !131 = !DILocation(line: 8, column: 10, scope: !125) -// CHECK:STDOUT: !132 = !DILocation(line: 8, column: 3, scope: !125) -// CHECK:STDOUT: !133 = !{!126} -// CHECK:STDOUT: !134 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !123, line: 8, type: !25, spFlags: DISPFlagDefinition, unit: !124, retainedNodes: !137) -// CHECK:STDOUT: !135 = !DILocalVariable(arg: 1, scope: !134, type: !20) -// CHECK:STDOUT: !136 = !DILocation(line: 8, column: 10, scope: !134) -// CHECK:STDOUT: !137 = !{!135} -// CHECK:STDOUT: !138 = distinct !DISubprogram(name: "Op", linkageName: "_COp.0bfe8bb35a2876b2:core.Destroy.Core", scope: null, file: !123, line: 8, type: !27, spFlags: DISPFlagDefinition, unit: !124, retainedNodes: !141) -// CHECK:STDOUT: !139 = !DILocalVariable(arg: 1, scope: !138, type: !21) -// CHECK:STDOUT: !140 = !DILocation(line: 8, column: 10, scope: !138) -// CHECK:STDOUT: !141 = !{!139} -// CHECK:STDOUT: !142 = distinct !DISubprogram(name: "Op", linkageName: "_COp.8c4b83ecd900f1ea:core.Destroy.Core", scope: null, file: !123, line: 8, type: !27, spFlags: DISPFlagDefinition, unit: !124, retainedNodes: !145) -// CHECK:STDOUT: !143 = !DILocalVariable(arg: 1, scope: !142, type: !21) -// CHECK:STDOUT: !144 = !DILocation(line: 8, column: 10, scope: !142) -// CHECK:STDOUT: !145 = !{!143} +// CHECK:STDOUT: !171 = !DIFile(filename: "call_thunk_for_imported_interface.carbon", directory: "") +// CHECK:STDOUT: !172 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !171, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !173 = distinct !DISubprogram(name: "Test", linkageName: "_CTest.Main", scope: null, file: !171, line: 7, type: !23, spFlags: DISPFlagDefinition, unit: !172, retainedNodes: !181) +// CHECK:STDOUT: !174 = !DILocalVariable(arg: 1, scope: !173, type: !21) +// CHECK:STDOUT: !178 = !DILocation(line: 8, column: 18, scope: !173) +// CHECK:STDOUT: !179 = !DILocation(line: 8, column: 10, scope: !173) +// CHECK:STDOUT: !180 = !DILocation(line: 8, column: 3, scope: !173) +// CHECK:STDOUT: !181 = !{!174} +// CHECK:STDOUT: !182 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !171, line: 8, type: !25, spFlags: DISPFlagDefinition, unit: !172, retainedNodes: !185) +// CHECK:STDOUT: !183 = !DILocalVariable(arg: 1, scope: !182, type: !20) +// CHECK:STDOUT: !184 = !DILocation(line: 8, column: 10, scope: !182) +// CHECK:STDOUT: !185 = !{!183} +// CHECK:STDOUT: !186 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !171, line: 8, type: !25, spFlags: DISPFlagDefinition, unit: !172, retainedNodes: !189) +// CHECK:STDOUT: !187 = !DILocalVariable(arg: 1, scope: !186, type: !20) +// CHECK:STDOUT: !188 = !DILocation(line: 8, column: 10, scope: !186) +// CHECK:STDOUT: !189 = !{!187} +// CHECK:STDOUT: !190 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !171, line: 8, type: !25, spFlags: DISPFlagDefinition, unit: !172, retainedNodes: !193) +// CHECK:STDOUT: !191 = !DILocalVariable(arg: 1, scope: !190, type: !20) +// CHECK:STDOUT: !192 = !DILocation(line: 8, column: 10, scope: !190) +// CHECK:STDOUT: !193 = !{!191} +// CHECK:STDOUT: !194 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.0bfe8bb35a2876b2:core.Destroy.Core", scope: null, file: !171, line: 8, type: !27, spFlags: DISPFlagDefinition, unit: !172, retainedNodes: !197) +// CHECK:STDOUT: !195 = !DILocalVariable(arg: 1, scope: !194, type: !21) +// CHECK:STDOUT: !196 = !DILocation(line: 8, column: 10, scope: !194) +// CHECK:STDOUT: !197 = !{!195} +// CHECK:STDOUT: !198 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.0bfe8bb35a2876b2:core.Destroy.Core", scope: null, file: !171, line: 8, type: !27, spFlags: DISPFlagDefinition, unit: !172, retainedNodes: !201) +// CHECK:STDOUT: !199 = !DILocalVariable(arg: 1, scope: !198, type: !21) +// CHECK:STDOUT: !200 = !DILocation(line: 8, column: 10, scope: !198) +// CHECK:STDOUT: !201 = !{!199} +// CHECK:STDOUT: !202 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.8c4b83ecd900f1ea:core.Destroy.Core", scope: null, file: !171, line: 8, type: !27, spFlags: DISPFlagDefinition, unit: !172, retainedNodes: !205) +// CHECK:STDOUT: !203 = !DILocalVariable(arg: 1, scope: !202, type: !21) +// CHECK:STDOUT: !204 = !DILocation(line: 8, column: 10, scope: !202) +// CHECK:STDOUT: !205 = !{!203} +// CHECK:STDOUT: !206 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.8c4b83ecd900f1ea:core.Destroy.Core", scope: null, file: !171, line: 8, type: !27, spFlags: DISPFlagDefinition, unit: !172, retainedNodes: !209) +// CHECK:STDOUT: !207 = !DILocalVariable(arg: 1, scope: !206, type: !21) +// CHECK:STDOUT: !208 = !DILocation(line: 8, column: 10, scope: !206) +// CHECK:STDOUT: !209 = !{!207} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/impl/thunk.carbon b/toolchain/lower/testdata/impl/thunk.carbon index 245dc04e8272..aa94e7ccbce6 100644 --- a/toolchain/lower/testdata/impl/thunk.carbon +++ b/toolchain/lower/testdata/impl/thunk.carbon @@ -114,51 +114,78 @@ fn CallCallGeneric(c: C(()), b: B) -> A { // 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 @"_CConvert.B.Main:ImplicitAs.9522ff908e97e267.Core"(ptr %return, ptr %.loc20_19.1.temp), !dbg !58 -// CHECK:STDOUT: call void @"_COp.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %.loc20_19.1.temp), !dbg !58 -// CHECK:STDOUT: call void @"_COp.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %.4.temp), !dbg !57 +// 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: ret void, !dbg !58 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !60 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !60 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !62 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.0bfe8bb35a2876b2:core.Destroy.Core"(ptr %self) #0 !dbg !64 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !64 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !66 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %self) #0 !dbg !68 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !68 { // CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !70 // CHECK:STDOUT: ret void, !dbg !70 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CTest.Main(ptr sret({ i32 }) %return, ptr %a) #0 !dbg !72 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.0bfe8bb35a2876b2:core.Destroy.Core"(ptr %self) #0 !dbg !72 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc24_20.1.temp = alloca { i32 }, align 4, !dbg !78 -// CHECK:STDOUT: %.loc24_20.2.temp = alloca { i32 }, align 4, !dbg !78 -// CHECK:STDOUT: %.loc24_19.1.temp = alloca { i32 }, align 4, !dbg !77 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc24_20.1.temp), !dbg !78 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc24_20.2.temp), !dbg !78 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc24_19.1.temp), !dbg !77 -// CHECK:STDOUT: call void @"_CConvert.A.Main:ImplicitAs.a6a60dfee2d7d273.Core"(ptr %.loc24_19.1.temp, ptr %a), !dbg !77 -// CHECK:STDOUT: call void @"_CF.61ea2aba74ab3bf1:I.Main"(ptr %.loc24_20.2.temp, ptr %.loc24_19.1.temp), !dbg !78 -// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.9522ff908e97e267.Core"(ptr %return, ptr %.loc24_20.2.temp), !dbg !79 -// CHECK:STDOUT: call void @"_COp.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %.loc24_20.2.temp), !dbg !78 -// CHECK:STDOUT: call void @"_COp.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %.loc24_19.1.temp), !dbg !77 -// CHECK:STDOUT: ret void, !dbg !79 +// CHECK:STDOUT: ret void, !dbg !74 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.0bfe8bb35a2876b2:core.Destroy.Core"(ptr %self) #0 !dbg !76 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.0bfe8bb35a2876b2:core.Destroy.Core"(ptr %self), !dbg !78 +// CHECK:STDOUT: ret void, !dbg !78 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %self) #0 !dbg !80 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !82 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %self) #0 !dbg !84 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %self), !dbg !86 +// CHECK:STDOUT: ret void, !dbg !86 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CTest.Main(ptr sret({ i32 }) %return, ptr %a) #0 !dbg !88 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %.loc24_20.1.temp = alloca { i32 }, align 4, !dbg !94 +// CHECK:STDOUT: %.loc24_20.2.temp = alloca { i32 }, align 4, !dbg !94 +// CHECK:STDOUT: %.loc24_19.1.temp = alloca { i32 }, align 4, !dbg !93 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc24_20.1.temp), !dbg !94 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc24_20.2.temp), !dbg !94 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc24_19.1.temp), !dbg !93 +// CHECK:STDOUT: call void @"_CConvert.A.Main:ImplicitAs.a6a60dfee2d7d273.Core"(ptr %.loc24_19.1.temp, ptr %a), !dbg !93 +// CHECK:STDOUT: call void @"_CF.61ea2aba74ab3bf1:I.Main"(ptr %.loc24_20.2.temp, ptr %.loc24_19.1.temp), !dbg !94 +// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.9522ff908e97e267.Core"(ptr %return, ptr %.loc24_20.2.temp), !dbg !95 +// CHECK:STDOUT: call void @"_CSelfDestruct.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %.loc24_20.2.temp), !dbg !94 +// CHECK:STDOUT: call void @"_CSelfDestruct.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %.loc24_19.1.temp), !dbg !93 +// CHECK:STDOUT: ret void, !dbg !95 // 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)) #2 // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives -// CHECK:STDOUT: uselistorder ptr @"_COp.8c4b83ecd900f1ea:core.Destroy.Core", { 0, 1, 3, 2 } +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.8c4b83ecd900f1ea:core.Destroy.Core", { 0, 1, 3, 2 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 4, 3, 2, 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -203,24 +230,40 @@ fn CallCallGeneric(c: C(()), b: B) -> A { // 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: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 20, type: !25, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !63) +// CHECK:STDOUT: !60 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !18, line: 20, type: !25, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !63) // CHECK:STDOUT: !61 = !DILocalVariable(arg: 1, scope: !60, type: !20) // CHECK:STDOUT: !62 = !DILocation(line: 20, column: 3, scope: !60) // CHECK:STDOUT: !63 = !{!61} -// CHECK:STDOUT: !64 = distinct !DISubprogram(name: "Op", linkageName: "_COp.0bfe8bb35a2876b2:core.Destroy.Core", scope: null, file: !18, line: 20, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !67) -// CHECK:STDOUT: !65 = !DILocalVariable(arg: 1, scope: !64, type: !21) +// CHECK:STDOUT: !64 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 20, type: !25, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !67) +// CHECK:STDOUT: !65 = !DILocalVariable(arg: 1, scope: !64, type: !20) // CHECK:STDOUT: !66 = !DILocation(line: 20, column: 3, scope: !64) // CHECK:STDOUT: !67 = !{!65} -// CHECK:STDOUT: !68 = distinct !DISubprogram(name: "Op", linkageName: "_COp.8c4b83ecd900f1ea:core.Destroy.Core", scope: null, file: !18, line: 20, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !71) -// CHECK:STDOUT: !69 = !DILocalVariable(arg: 1, scope: !68, type: !21) +// CHECK:STDOUT: !68 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 20, type: !25, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !71) +// CHECK:STDOUT: !69 = !DILocalVariable(arg: 1, scope: !68, type: !20) // CHECK:STDOUT: !70 = !DILocation(line: 20, column: 3, scope: !68) // CHECK:STDOUT: !71 = !{!69} -// CHECK:STDOUT: !72 = distinct !DISubprogram(name: "Test", linkageName: "_CTest.Main", scope: null, file: !18, line: 23, type: !23, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !80) +// CHECK:STDOUT: !72 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.0bfe8bb35a2876b2:core.Destroy.Core", scope: null, file: !18, line: 20, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !75) // CHECK:STDOUT: !73 = !DILocalVariable(arg: 1, scope: !72, type: !21) -// CHECK:STDOUT: !77 = !DILocation(line: 24, column: 19, scope: !72) -// CHECK:STDOUT: !78 = !DILocation(line: 24, column: 10, scope: !72) -// CHECK:STDOUT: !79 = !DILocation(line: 24, column: 3, scope: !72) -// CHECK:STDOUT: !80 = !{!73} +// CHECK:STDOUT: !74 = !DILocation(line: 20, column: 3, scope: !72) +// CHECK:STDOUT: !75 = !{!73} +// CHECK:STDOUT: !76 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.0bfe8bb35a2876b2:core.Destroy.Core", scope: null, file: !18, line: 20, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !79) +// CHECK:STDOUT: !77 = !DILocalVariable(arg: 1, scope: !76, type: !21) +// CHECK:STDOUT: !78 = !DILocation(line: 20, column: 3, scope: !76) +// CHECK:STDOUT: !79 = !{!77} +// CHECK:STDOUT: !80 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.8c4b83ecd900f1ea:core.Destroy.Core", scope: null, file: !18, line: 20, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !83) +// CHECK:STDOUT: !81 = !DILocalVariable(arg: 1, scope: !80, type: !21) +// CHECK:STDOUT: !82 = !DILocation(line: 20, column: 3, scope: !80) +// CHECK:STDOUT: !83 = !{!81} +// CHECK:STDOUT: !84 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.8c4b83ecd900f1ea:core.Destroy.Core", scope: null, file: !18, line: 20, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !87) +// CHECK:STDOUT: !85 = !DILocalVariable(arg: 1, scope: !84, type: !21) +// CHECK:STDOUT: !86 = !DILocation(line: 20, column: 3, scope: !84) +// CHECK:STDOUT: !87 = !{!85} +// CHECK:STDOUT: !88 = distinct !DISubprogram(name: "Test", linkageName: "_CTest.Main", scope: null, file: !18, line: 23, type: !23, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !96) +// CHECK:STDOUT: !89 = !DILocalVariable(arg: 1, scope: !88, type: !21) +// CHECK:STDOUT: !93 = !DILocation(line: 24, column: 19, scope: !88) +// CHECK:STDOUT: !94 = !DILocation(line: 24, column: 10, scope: !88) +// CHECK:STDOUT: !95 = !DILocation(line: 24, column: 3, scope: !88) +// CHECK:STDOUT: !96 = !{!89} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'generic_thunk.carbon' @@ -230,46 +273,66 @@ fn CallCallGeneric(c: C(()), b: B) -> A { // CHECK:STDOUT: @B.val.loc18_43 = 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 !85 { +// CHECK:STDOUT: define void @"_CConvert.B.Main:ImplicitAs.bd4fb75a414fe858.Core"(ptr sret({}) %return, ptr %self) #0 !dbg !101 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %return, ptr align 1 @A.val.loc7_45, i64 0, i1 false), !dbg !90 -// CHECK:STDOUT: ret void, !dbg !90 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %return, ptr align 1 @A.val.loc7_45, i64 0, i1 false), !dbg !106 +// CHECK:STDOUT: ret void, !dbg !106 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %self) #0 !dbg !92 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %self) #0 !dbg !108 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !94 +// CHECK:STDOUT: ret void, !dbg !110 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.5a23cc09585c55d2:core.Destroy.Core"(ptr %self) #0 !dbg !96 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %self) #0 !dbg !112 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !98 +// CHECK:STDOUT: ret void, !dbg !114 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CCall.Main(ptr sret({}) %return, ptr %c, ptr %b) #0 !dbg !100 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %self) #0 !dbg !116 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc22_23.1.temp = alloca {}, align 1, !dbg !107 -// CHECK:STDOUT: %.loc22_23.3.temp = alloca {}, align 1, !dbg !107 -// CHECK:STDOUT: %.loc22_22.1.temp = alloca {}, align 1, !dbg !108 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc22_23.1.temp), !dbg !107 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc22_23.3.temp), !dbg !107 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc22_22.1.temp), !dbg !108 -// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.bd4fb75a414fe858.Core"(ptr %.loc22_22.1.temp, ptr %b), !dbg !108 -// CHECK:STDOUT: call void @"_CF.C.eb057aa32837c84e.Main:I.eb057aa32837c84e.Main.e43630e9a6c38c3f"(ptr %.loc22_23.3.temp, ptr %c, ptr %.loc22_22.1.temp), !dbg !107 -// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.bd4fb75a414fe858.Core"(ptr %return, ptr %.loc22_23.3.temp), !dbg !109 -// CHECK:STDOUT: call void @"_COp.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %.loc22_23.3.temp), !dbg !107 -// CHECK:STDOUT: call void @"_COp.5a23cc09585c55d2:core.Destroy.Core"(ptr %.loc22_22.1.temp), !dbg !108 -// CHECK:STDOUT: ret void, !dbg !109 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %self), !dbg !118 +// CHECK:STDOUT: ret void, !dbg !118 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CCallCallGeneric.Main(ptr sret({}) %return, ptr %c, ptr %b) #0 !dbg !111 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.5a23cc09585c55d2:core.Destroy.Core"(ptr %self) #0 !dbg !120 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CCallGeneric.Main.8a681e94b982e379(ptr %return, ptr %c, ptr %b), !dbg !120 -// CHECK:STDOUT: ret void, !dbg !121 +// CHECK:STDOUT: ret void, !dbg !122 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.5a23cc09585c55d2:core.Destroy.Core"(ptr %self) #0 !dbg !124 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.5a23cc09585c55d2:core.Destroy.Core"(ptr %self), !dbg !126 +// CHECK:STDOUT: ret void, !dbg !126 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CCall.Main(ptr sret({}) %return, ptr %c, ptr %b) #0 !dbg !128 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %.loc22_23.1.temp = alloca {}, align 1, !dbg !135 +// CHECK:STDOUT: %.loc22_23.3.temp = alloca {}, align 1, !dbg !135 +// CHECK:STDOUT: %.loc22_22.1.temp = alloca {}, align 1, !dbg !136 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc22_23.1.temp), !dbg !135 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc22_23.3.temp), !dbg !135 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc22_22.1.temp), !dbg !136 +// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.bd4fb75a414fe858.Core"(ptr %.loc22_22.1.temp, ptr %b), !dbg !136 +// CHECK:STDOUT: call void @"_CF.C.eb057aa32837c84e.Main:I.eb057aa32837c84e.Main.e43630e9a6c38c3f"(ptr %.loc22_23.3.temp, ptr %c, ptr %.loc22_22.1.temp), !dbg !135 +// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.bd4fb75a414fe858.Core"(ptr %return, ptr %.loc22_23.3.temp), !dbg !137 +// CHECK:STDOUT: call void @"_CSelfDestruct.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %.loc22_23.3.temp), !dbg !135 +// CHECK:STDOUT: call void @"_CSelfDestruct.5a23cc09585c55d2:core.Destroy.Core"(ptr %.loc22_22.1.temp), !dbg !136 +// CHECK:STDOUT: ret void, !dbg !137 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CCallCallGeneric.Main(ptr sret({}) %return, ptr %c, ptr %b) #0 !dbg !139 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @_CCallGeneric.Main.8a681e94b982e379(ptr %return, ptr %c, ptr %b), !dbg !148 +// CHECK:STDOUT: ret void, !dbg !149 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -279,32 +342,32 @@ fn CallCallGeneric(c: C(()), b: B) -> A { // 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 @"_CF.C.eb057aa32837c84e.Main:I.eb057aa32837c84e.Main.e43630e9a6c38c3f"(ptr sret({}) %return, ptr %self, ptr %_) #0 !dbg !123 { +// CHECK:STDOUT: define linkonce_odr void @"_CF.C.eb057aa32837c84e.Main:I.eb057aa32837c84e.Main.e43630e9a6c38c3f"(ptr sret({}) %return, ptr %self, ptr %_) #0 !dbg !151 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %return, ptr align 1 @B.val.loc18_43, i64 0, i1 false), !dbg !130 -// CHECK:STDOUT: ret void, !dbg !130 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %return, ptr align 1 @B.val.loc18_43, i64 0, i1 false), !dbg !158 +// CHECK:STDOUT: ret void, !dbg !158 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CCallGeneric.Main.8a681e94b982e379(ptr sret({}) %return, ptr %c, ptr %b) #0 !dbg !132 { +// CHECK:STDOUT: define linkonce_odr void @_CCallGeneric.Main.8a681e94b982e379(ptr sret({}) %return, ptr %c, ptr %b) #0 !dbg !160 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @"_CF:thunk:I.eca2102529696f40.Main:C.eb057aa32837c84e.Main:I.eb057aa32837c84e.Main.e43630e9a6c38c3f"(ptr %return, ptr %c, ptr %b), !dbg !139 -// CHECK:STDOUT: ret void, !dbg !141 +// CHECK:STDOUT: call void @"_CF:thunk:I.eca2102529696f40.Main:C.eb057aa32837c84e.Main:I.eb057aa32837c84e.Main.e43630e9a6c38c3f"(ptr %return, ptr %c, ptr %b), !dbg !167 +// CHECK:STDOUT: ret void, !dbg !169 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CF:thunk:I.eca2102529696f40.Main:C.eb057aa32837c84e.Main:I.eb057aa32837c84e.Main.e43630e9a6c38c3f"(ptr sret({}) %return, ptr %self, ptr %x) #2 !dbg !143 { +// CHECK:STDOUT: define linkonce_odr void @"_CF:thunk:I.eca2102529696f40.Main:C.eb057aa32837c84e.Main:I.eb057aa32837c84e.Main.e43630e9a6c38c3f"(ptr sret({}) %return, ptr %self, ptr %x) #2 !dbg !171 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc18_32.2.temp = alloca {}, align 1, !dbg !147 -// CHECK:STDOUT: %.6.temp = alloca {}, align 1, !dbg !146 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_32.2.temp), !dbg !147 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.6.temp), !dbg !146 -// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.bd4fb75a414fe858.Core"(ptr %.6.temp, ptr %x), !dbg !146 -// CHECK:STDOUT: call void @"_CF.C.eb057aa32837c84e.Main:I.eb057aa32837c84e.Main.e43630e9a6c38c3f"(ptr %.loc18_32.2.temp, ptr %self, ptr %.6.temp), !dbg !147 -// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.bd4fb75a414fe858.Core"(ptr %return, ptr %.loc18_32.2.temp), !dbg !147 -// CHECK:STDOUT: call void @"_COp.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %.loc18_32.2.temp), !dbg !147 -// CHECK:STDOUT: call void @"_COp.5a23cc09585c55d2:core.Destroy.Core"(ptr %.6.temp), !dbg !146 -// CHECK:STDOUT: ret void, !dbg !147 +// CHECK:STDOUT: %.loc18_32.2.temp = alloca {}, align 1, !dbg !175 +// CHECK:STDOUT: %.6.temp = alloca {}, align 1, !dbg !174 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_32.2.temp), !dbg !175 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.6.temp), !dbg !174 +// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.bd4fb75a414fe858.Core"(ptr %.6.temp, ptr %x), !dbg !174 +// CHECK:STDOUT: call void @"_CF.C.eb057aa32837c84e.Main:I.eb057aa32837c84e.Main.e43630e9a6c38c3f"(ptr %.loc18_32.2.temp, ptr %self, ptr %.6.temp), !dbg !175 +// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.bd4fb75a414fe858.Core"(ptr %return, ptr %.loc18_32.2.temp), !dbg !175 +// CHECK:STDOUT: call void @"_CSelfDestruct.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %.loc18_32.2.temp), !dbg !175 +// CHECK:STDOUT: call void @"_CSelfDestruct.5a23cc09585c55d2:core.Destroy.Core"(ptr %.6.temp), !dbg !174 +// CHECK:STDOUT: ret void, !dbg !175 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -314,7 +377,7 @@ fn CallCallGeneric(c: C(()), b: B) -> A { // CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: attributes #2 = { alwaysinline nounwind } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!82} +// CHECK:STDOUT: !llvm.dbg.cu = !{!98} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} @@ -324,50 +387,62 @@ fn CallCallGeneric(c: C(()), b: B) -> A { // CHECK:STDOUT: !23 = !DISubroutineType(types: !22) // CHECK:STDOUT: !26 = !{null, !21} // CHECK:STDOUT: !27 = !DISubroutineType(types: !26) -// CHECK:STDOUT: !81 = !DIFile(filename: "generic_thunk.carbon", directory: "") -// CHECK:STDOUT: !82 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !81, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !83 = !{!21, !21, !21} -// CHECK:STDOUT: !84 = !DISubroutineType(types: !83) -// CHECK:STDOUT: !85 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.B.Main:ImplicitAs.bd4fb75a414fe858.Core", scope: null, file: !81, line: 7, type: !23, spFlags: DISPFlagDefinition, unit: !82, retainedNodes: !91) -// CHECK:STDOUT: !86 = !DILocalVariable(arg: 1, scope: !85, type: !21) -// CHECK:STDOUT: !90 = !DILocation(line: 7, column: 36, scope: !85) -// CHECK:STDOUT: !91 = !{!86} -// CHECK:STDOUT: !92 = distinct !DISubprogram(name: "Op", linkageName: "_COp.8c4b83ecd900f1ea:core.Destroy.Core", scope: null, file: !81, line: 18, type: !27, spFlags: DISPFlagDefinition, unit: !82, retainedNodes: !95) -// CHECK:STDOUT: !93 = !DILocalVariable(arg: 1, scope: !92, type: !21) -// CHECK:STDOUT: !94 = !DILocation(line: 18, column: 3, scope: !92) -// CHECK:STDOUT: !95 = !{!93} -// CHECK:STDOUT: !96 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5a23cc09585c55d2:core.Destroy.Core", scope: null, file: !81, type: !27, spFlags: DISPFlagDefinition, unit: !82, retainedNodes: !99) -// CHECK:STDOUT: !97 = !DILocalVariable(arg: 1, scope: !96, type: !21) -// CHECK:STDOUT: !98 = !DILocation(line: 0, scope: !96) -// CHECK:STDOUT: !99 = !{!97} -// CHECK:STDOUT: !100 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !81, line: 21, type: !84, spFlags: DISPFlagDefinition, unit: !82, retainedNodes: !110) -// CHECK:STDOUT: !101 = !DILocalVariable(arg: 1, scope: !100, type: !21) -// CHECK:STDOUT: !102 = !DILocalVariable(arg: 2, scope: !100, type: !21) -// CHECK:STDOUT: !107 = !DILocation(line: 22, column: 10, scope: !100) -// CHECK:STDOUT: !108 = !DILocation(line: 22, column: 22, scope: !100) -// CHECK:STDOUT: !109 = !DILocation(line: 22, column: 3, scope: !100) -// CHECK:STDOUT: !110 = !{!101, !102} -// CHECK:STDOUT: !111 = distinct !DISubprogram(name: "CallCallGeneric", linkageName: "_CCallCallGeneric.Main", scope: null, file: !81, line: 29, type: !84, spFlags: DISPFlagDefinition, unit: !82, retainedNodes: !122) -// CHECK:STDOUT: !112 = !DILocalVariable(arg: 1, scope: !111, type: !21) -// CHECK:STDOUT: !113 = !DILocalVariable(arg: 2, scope: !111, type: !21) -// CHECK:STDOUT: !120 = !DILocation(line: 30, column: 10, scope: !111) -// CHECK:STDOUT: !121 = !DILocation(line: 30, column: 3, scope: !111) -// CHECK:STDOUT: !122 = !{!112, !113} -// CHECK:STDOUT: !123 = distinct !DISubprogram(name: "F", linkageName: "_CF.C.eb057aa32837c84e.Main:I.eb057aa32837c84e.Main.e43630e9a6c38c3f", scope: null, file: !81, line: 18, type: !84, spFlags: DISPFlagDefinition, unit: !82, retainedNodes: !131) -// CHECK:STDOUT: !124 = !DILocalVariable(arg: 1, scope: !123, type: !21) -// CHECK:STDOUT: !125 = !DILocalVariable(arg: 2, scope: !123, type: !21) -// CHECK:STDOUT: !130 = !DILocation(line: 18, column: 34, scope: !123) -// CHECK:STDOUT: !131 = !{!124, !125} -// CHECK:STDOUT: !132 = distinct !DISubprogram(name: "CallGeneric", linkageName: "_CCallGeneric.Main.8a681e94b982e379", scope: null, file: !81, line: 25, type: !84, spFlags: DISPFlagDefinition, unit: !82, retainedNodes: !142) -// CHECK:STDOUT: !133 = !DILocalVariable(arg: 1, scope: !132, type: !21) -// CHECK:STDOUT: !134 = !DILocalVariable(arg: 2, scope: !132, type: !21) -// CHECK:STDOUT: !139 = !DILocation(line: 26, column: 10, scope: !132) -// CHECK:STDOUT: !141 = !DILocation(line: 26, column: 3, scope: !132) -// CHECK:STDOUT: !142 = !{!133, !134} -// CHECK:STDOUT: !143 = distinct !DISubprogram(name: "F", linkageName: "_CF:thunk:I.eca2102529696f40.Main:C.eb057aa32837c84e.Main:I.eb057aa32837c84e.Main.e43630e9a6c38c3f", scope: null, file: !81, line: 18, type: !84, spFlags: DISPFlagDefinition, unit: !82, retainedNodes: !148) -// CHECK:STDOUT: !144 = !DILocalVariable(arg: 1, scope: !143, type: !21) -// CHECK:STDOUT: !145 = !DILocalVariable(arg: 2, scope: !143, type: !21) -// CHECK:STDOUT: !146 = !DILocation(line: 0, scope: !143) -// CHECK:STDOUT: !147 = !DILocation(line: 18, column: 3, scope: !143) -// CHECK:STDOUT: !148 = !{!144, !145} +// CHECK:STDOUT: !97 = !DIFile(filename: "generic_thunk.carbon", directory: "") +// CHECK:STDOUT: !98 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !97, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !99 = !{!21, !21, !21} +// CHECK:STDOUT: !100 = !DISubroutineType(types: !99) +// CHECK:STDOUT: !101 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.B.Main:ImplicitAs.bd4fb75a414fe858.Core", scope: null, file: !97, line: 7, type: !23, spFlags: DISPFlagDefinition, unit: !98, retainedNodes: !107) +// CHECK:STDOUT: !102 = !DILocalVariable(arg: 1, scope: !101, type: !21) +// CHECK:STDOUT: !106 = !DILocation(line: 7, column: 36, scope: !101) +// CHECK:STDOUT: !107 = !{!102} +// CHECK:STDOUT: !108 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !97, line: 18, type: !27, spFlags: DISPFlagDefinition, unit: !98, retainedNodes: !111) +// CHECK:STDOUT: !109 = !DILocalVariable(arg: 1, scope: !108, type: !21) +// CHECK:STDOUT: !110 = !DILocation(line: 18, column: 3, scope: !108) +// CHECK:STDOUT: !111 = !{!109} +// CHECK:STDOUT: !112 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.8c4b83ecd900f1ea:core.Destroy.Core", scope: null, file: !97, line: 18, type: !27, spFlags: DISPFlagDefinition, unit: !98, retainedNodes: !115) +// CHECK:STDOUT: !113 = !DILocalVariable(arg: 1, scope: !112, type: !21) +// CHECK:STDOUT: !114 = !DILocation(line: 18, column: 3, scope: !112) +// CHECK:STDOUT: !115 = !{!113} +// CHECK:STDOUT: !116 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.8c4b83ecd900f1ea:core.Destroy.Core", scope: null, file: !97, line: 18, type: !27, spFlags: DISPFlagDefinition, unit: !98, retainedNodes: !119) +// CHECK:STDOUT: !117 = !DILocalVariable(arg: 1, scope: !116, type: !21) +// CHECK:STDOUT: !118 = !DILocation(line: 18, column: 3, scope: !116) +// CHECK:STDOUT: !119 = !{!117} +// CHECK:STDOUT: !120 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.5a23cc09585c55d2:core.Destroy.Core", scope: null, file: !97, type: !27, spFlags: DISPFlagDefinition, unit: !98, retainedNodes: !123) +// CHECK:STDOUT: !121 = !DILocalVariable(arg: 1, scope: !120, type: !21) +// CHECK:STDOUT: !122 = !DILocation(line: 0, scope: !120) +// CHECK:STDOUT: !123 = !{!121} +// CHECK:STDOUT: !124 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.5a23cc09585c55d2:core.Destroy.Core", scope: null, file: !97, type: !27, spFlags: DISPFlagDefinition, unit: !98, retainedNodes: !127) +// CHECK:STDOUT: !125 = !DILocalVariable(arg: 1, scope: !124, type: !21) +// CHECK:STDOUT: !126 = !DILocation(line: 0, scope: !124) +// CHECK:STDOUT: !127 = !{!125} +// CHECK:STDOUT: !128 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !97, line: 21, type: !100, spFlags: DISPFlagDefinition, unit: !98, retainedNodes: !138) +// CHECK:STDOUT: !129 = !DILocalVariable(arg: 1, scope: !128, type: !21) +// CHECK:STDOUT: !130 = !DILocalVariable(arg: 2, scope: !128, type: !21) +// CHECK:STDOUT: !135 = !DILocation(line: 22, column: 10, scope: !128) +// CHECK:STDOUT: !136 = !DILocation(line: 22, column: 22, scope: !128) +// CHECK:STDOUT: !137 = !DILocation(line: 22, column: 3, scope: !128) +// CHECK:STDOUT: !138 = !{!129, !130} +// CHECK:STDOUT: !139 = distinct !DISubprogram(name: "CallCallGeneric", linkageName: "_CCallCallGeneric.Main", scope: null, file: !97, line: 29, type: !100, spFlags: DISPFlagDefinition, unit: !98, retainedNodes: !150) +// CHECK:STDOUT: !140 = !DILocalVariable(arg: 1, scope: !139, type: !21) +// CHECK:STDOUT: !141 = !DILocalVariable(arg: 2, scope: !139, type: !21) +// CHECK:STDOUT: !148 = !DILocation(line: 30, column: 10, scope: !139) +// CHECK:STDOUT: !149 = !DILocation(line: 30, column: 3, scope: !139) +// CHECK:STDOUT: !150 = !{!140, !141} +// CHECK:STDOUT: !151 = distinct !DISubprogram(name: "F", linkageName: "_CF.C.eb057aa32837c84e.Main:I.eb057aa32837c84e.Main.e43630e9a6c38c3f", scope: null, file: !97, line: 18, type: !100, spFlags: DISPFlagDefinition, unit: !98, retainedNodes: !159) +// CHECK:STDOUT: !152 = !DILocalVariable(arg: 1, scope: !151, type: !21) +// CHECK:STDOUT: !153 = !DILocalVariable(arg: 2, scope: !151, type: !21) +// CHECK:STDOUT: !158 = !DILocation(line: 18, column: 34, scope: !151) +// CHECK:STDOUT: !159 = !{!152, !153} +// CHECK:STDOUT: !160 = distinct !DISubprogram(name: "CallGeneric", linkageName: "_CCallGeneric.Main.8a681e94b982e379", scope: null, file: !97, line: 25, type: !100, spFlags: DISPFlagDefinition, unit: !98, retainedNodes: !170) +// CHECK:STDOUT: !161 = !DILocalVariable(arg: 1, scope: !160, type: !21) +// CHECK:STDOUT: !162 = !DILocalVariable(arg: 2, scope: !160, type: !21) +// CHECK:STDOUT: !167 = !DILocation(line: 26, column: 10, scope: !160) +// CHECK:STDOUT: !169 = !DILocation(line: 26, column: 3, scope: !160) +// CHECK:STDOUT: !170 = !{!161, !162} +// CHECK:STDOUT: !171 = distinct !DISubprogram(name: "F", linkageName: "_CF:thunk:I.eca2102529696f40.Main:C.eb057aa32837c84e.Main:I.eb057aa32837c84e.Main.e43630e9a6c38c3f", scope: null, file: !97, line: 18, type: !100, spFlags: DISPFlagDefinition, unit: !98, retainedNodes: !176) +// CHECK:STDOUT: !172 = !DILocalVariable(arg: 1, scope: !171, type: !21) +// CHECK:STDOUT: !173 = !DILocalVariable(arg: 2, scope: !171, type: !21) +// CHECK:STDOUT: !174 = !DILocation(line: 0, scope: !171) +// CHECK:STDOUT: !175 = !DILocation(line: 18, column: 3, scope: !171) +// CHECK:STDOUT: !176 = !{!172, !173} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/index/array_element_access.carbon b/toolchain/lower/testdata/index/array_element_access.carbon index 042a5dd60ee0..bf66209aab6a 100644 --- a/toolchain/lower/testdata/index/array_element_access.carbon +++ b/toolchain/lower/testdata/index/array_element_access.carbon @@ -78,33 +78,60 @@ fn Run() { // CHECK:STDOUT: %.loc20_21.1.array.index = getelementptr inbounds [2 x i32], ptr %.loc20_18.1.temp, i32 0, i32 1, !dbg !51 // CHECK:STDOUT: %.loc20_21.2 = load i32, ptr %.loc20_21.1.array.index, align 4, !dbg !51 // CHECK:STDOUT: store i32 %.loc20_21.2, ptr %_.var.loc20, align 4, !dbg !50 -// CHECK:STDOUT: call void @"_COp.8014ee1b1a984df0:core.Destroy.Core"(ptr %.loc20_18.1.temp), !dbg !51 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %_.var.loc20), !dbg !50 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %_.var.loc19), !dbg !46 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %b.var), !dbg !44 -// CHECK:STDOUT: call void @"_COp.e554695bf635d9c1:core.Destroy.Core"(ptr %.loc17_28.1.temp), !dbg !42 -// CHECK:STDOUT: call void @"_COp.8014ee1b1a984df0:core.Destroy.Core"(ptr %a.var), !dbg !41 +// CHECK:STDOUT: call void @"_CSelfDestruct.8014ee1b1a984df0:core.Destroy.Core"(ptr %.loc20_18.1.temp), !dbg !51 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %_.var.loc20), !dbg !50 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %_.var.loc19), !dbg !46 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %b.var), !dbg !44 +// CHECK:STDOUT: call void @"_CSelfDestruct.e554695bf635d9c1:core.Destroy.Core"(ptr %.loc17_28.1.temp), !dbg !42 +// CHECK:STDOUT: call void @"_CSelfDestruct.8014ee1b1a984df0:core.Destroy.Core"(ptr %a.var), !dbg !41 // CHECK:STDOUT: ret i32 0, !dbg !53 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !54 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !54 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !56 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.8014ee1b1a984df0:core.Destroy.Core"(ptr %self) #0 !dbg !58 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !58 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !60 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.e554695bf635d9c1:core.Destroy.Core"(ptr %self) #0 !dbg !62 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !62 { // CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !64 // CHECK:STDOUT: ret void, !dbg !64 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.8014ee1b1a984df0:core.Destroy.Core"(ptr %self) #0 !dbg !66 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !68 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.8014ee1b1a984df0:core.Destroy.Core"(ptr %self) #0 !dbg !70 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.8014ee1b1a984df0:core.Destroy.Core"(ptr %self), !dbg !72 +// CHECK:STDOUT: ret void, !dbg !72 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.e554695bf635d9c1:core.Destroy.Core"(ptr %self) #0 !dbg !74 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !76 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.e554695bf635d9c1:core.Destroy.Core"(ptr %self) #0 !dbg !78 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.e554695bf635d9c1:core.Destroy.Core"(ptr %self), !dbg !80 +// CHECK:STDOUT: ret void, !dbg !80 +// 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: @@ -112,8 +139,8 @@ fn Run() { // CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #1 // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives -// CHECK:STDOUT: uselistorder ptr @"_COp.f58524831c37807e:core.Destroy.Core", { 2, 1, 0 } -// CHECK:STDOUT: uselistorder ptr @"_COp.8014ee1b1a984df0:core.Destroy.Core", { 1, 0 } +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core", { 2, 1, 0 } +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.8014ee1b1a984df0:core.Destroy.Core", { 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.memcpy.p0.p0.i64, { 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 5, 4, 3, 2, 1, 0 } // CHECK:STDOUT: @@ -153,16 +180,32 @@ fn Run() { // CHECK:STDOUT: !50 = !DILocation(line: 20, column: 3, scope: !40) // CHECK:STDOUT: !51 = !DILocation(line: 20, column: 16, scope: !40) // CHECK:STDOUT: !53 = !DILocation(line: 16, column: 1, scope: !40) -// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 20, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !57) +// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !18, line: 20, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !57) // CHECK:STDOUT: !55 = !DILocalVariable(arg: 1, scope: !54, type: !20) // CHECK:STDOUT: !56 = !DILocation(line: 20, column: 16, scope: !54) // CHECK:STDOUT: !57 = !{!55} -// CHECK:STDOUT: !58 = distinct !DISubprogram(name: "Op", linkageName: "_COp.8014ee1b1a984df0:core.Destroy.Core", scope: null, file: !18, line: 20, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !61) -// CHECK:STDOUT: !59 = !DILocalVariable(arg: 1, scope: !58, type: !21) +// CHECK:STDOUT: !58 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 20, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !61) +// CHECK:STDOUT: !59 = !DILocalVariable(arg: 1, scope: !58, type: !20) // CHECK:STDOUT: !60 = !DILocation(line: 20, column: 16, scope: !58) // CHECK:STDOUT: !61 = !{!59} -// CHECK:STDOUT: !62 = distinct !DISubprogram(name: "Op", linkageName: "_COp.e554695bf635d9c1:core.Destroy.Core", scope: null, file: !18, line: 17, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !65) -// CHECK:STDOUT: !63 = !DILocalVariable(arg: 1, scope: !62, type: !21) -// CHECK:STDOUT: !64 = !DILocation(line: 17, column: 26, scope: !62) +// CHECK:STDOUT: !62 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 20, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !65) +// CHECK:STDOUT: !63 = !DILocalVariable(arg: 1, scope: !62, type: !20) +// CHECK:STDOUT: !64 = !DILocation(line: 20, column: 16, scope: !62) // CHECK:STDOUT: !65 = !{!63} +// CHECK:STDOUT: !66 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.8014ee1b1a984df0:core.Destroy.Core", scope: null, file: !18, line: 20, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !69) +// CHECK:STDOUT: !67 = !DILocalVariable(arg: 1, scope: !66, type: !21) +// CHECK:STDOUT: !68 = !DILocation(line: 20, column: 16, scope: !66) +// CHECK:STDOUT: !69 = !{!67} +// CHECK:STDOUT: !70 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.8014ee1b1a984df0:core.Destroy.Core", scope: null, file: !18, line: 20, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !73) +// CHECK:STDOUT: !71 = !DILocalVariable(arg: 1, scope: !70, type: !21) +// CHECK:STDOUT: !72 = !DILocation(line: 20, column: 16, scope: !70) +// CHECK:STDOUT: !73 = !{!71} +// CHECK:STDOUT: !74 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.e554695bf635d9c1:core.Destroy.Core", scope: null, file: !18, line: 17, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !77) +// CHECK:STDOUT: !75 = !DILocalVariable(arg: 1, scope: !74, type: !21) +// CHECK:STDOUT: !76 = !DILocation(line: 17, column: 26, scope: !74) +// CHECK:STDOUT: !77 = !{!75} +// CHECK:STDOUT: !78 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.e554695bf635d9c1:core.Destroy.Core", scope: null, file: !18, line: 17, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !81) +// CHECK:STDOUT: !79 = !DILocalVariable(arg: 1, scope: !78, type: !21) +// CHECK:STDOUT: !80 = !DILocation(line: 17, column: 26, scope: !78) +// CHECK:STDOUT: !81 = !{!79} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interface/modifiers.carbon b/toolchain/lower/testdata/interface/modifiers.carbon index bf544cbdc695..def5b6c8cb89 100644 --- a/toolchain/lower/testdata/interface/modifiers.carbon +++ b/toolchain/lower/testdata/interface/modifiers.carbon @@ -239,36 +239,49 @@ fn F() { // CHECK:STDOUT: %.loc10_15.2.temp = alloca {}, align 1, !dbg !39 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc10_15.2.temp), !dbg !39 // CHECK:STDOUT: call void @_CCallMethod.Main.805a971dc5455081(ptr @C.val.loc10_15.6), !dbg !43 -// CHECK:STDOUT: call void @"_COp.08d9e38b928ba575:core.Destroy.Core"(ptr @C.val), !dbg !39 +// CHECK:STDOUT: call void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr @C.val), !dbg !39 // CHECK:STDOUT: ret void, !dbg !44 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !45 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %self) #0 !dbg !45 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !47 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !49 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !51 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !53 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core"(ptr %self), !dbg !55 +// CHECK:STDOUT: ret void, !dbg !55 +// 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 @_CCallMethod.Main.805a971dc5455081(ptr %t) #0 !dbg !49 { -// CHECK:STDOUT: call void @_CM.DefaultMethod.Main.805a971dc5455081(ptr %t), !dbg !52 -// CHECK:STDOUT: ret void, !dbg !53 +// CHECK:STDOUT: define linkonce_odr void @_CCallMethod.Main.805a971dc5455081(ptr %t) #0 !dbg !57 { +// CHECK:STDOUT: call void @_CM.DefaultMethod.Main.805a971dc5455081(ptr %t), !dbg !60 +// CHECK:STDOUT: ret void, !dbg !61 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_CHello.Main() // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CM.DefaultMethod.Main.805a971dc5455081(ptr %self) #0 !dbg !55 { -// CHECK:STDOUT: call void @_CWorld.Main.9522ff908e97e267(ptr %self), !dbg !59 -// CHECK:STDOUT: ret void, !dbg !60 +// CHECK:STDOUT: define linkonce_odr void @_CM.DefaultMethod.Main.805a971dc5455081(ptr %self) #0 !dbg !63 { +// CHECK:STDOUT: call void @_CWorld.Main.9522ff908e97e267(ptr %self), !dbg !67 +// CHECK:STDOUT: ret void, !dbg !68 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CWorld.Main.9522ff908e97e267(ptr %t) #0 !dbg !62 { -// CHECK:STDOUT: ret void, !dbg !65 +// CHECK:STDOUT: define linkonce_odr void @_CWorld.Main.9522ff908e97e267(ptr %t) #0 !dbg !70 { +// CHECK:STDOUT: ret void, !dbg !73 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -291,24 +304,32 @@ fn F() { // CHECK:STDOUT: !39 = !DILocation(line: 10, column: 14, scope: !38) // CHECK:STDOUT: !43 = !DILocation(line: 11, column: 3, scope: !38) // CHECK:STDOUT: !44 = !DILocation(line: 9, column: 1, scope: !38) -// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "Op", linkageName: "_COp.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !33, line: 10, type: !37, spFlags: DISPFlagDefinition, unit: !34, retainedNodes: !48) +// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !33, line: 10, type: !37, spFlags: DISPFlagDefinition, unit: !34, retainedNodes: !48) // CHECK:STDOUT: !46 = !DILocalVariable(arg: 1, scope: !45, type: !35) // CHECK:STDOUT: !47 = !DILocation(line: 10, column: 14, scope: !45) // CHECK:STDOUT: !48 = !{!46} -// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "CallMethod", linkageName: "_CCallMethod.Main.805a971dc5455081", scope: null, file: !14, line: 20, type: !37, spFlags: DISPFlagDefinition, unit: !34, retainedNodes: !54) +// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !33, line: 10, type: !37, spFlags: DISPFlagDefinition, unit: !34, retainedNodes: !52) // CHECK:STDOUT: !50 = !DILocalVariable(arg: 1, scope: !49, type: !35) -// CHECK:STDOUT: !52 = !DILocation(line: 21, column: 3, scope: !49) -// CHECK:STDOUT: !53 = !DILocation(line: 20, column: 1, scope: !49) -// CHECK:STDOUT: !54 = !{!50} -// CHECK:STDOUT: !55 = distinct !DISubprogram(name: "M", linkageName: "_CM.DefaultMethod.Main.805a971dc5455081", scope: null, file: !14, line: 13, type: !37, spFlags: DISPFlagDefinition, unit: !34, retainedNodes: !61) -// CHECK:STDOUT: !56 = !DILocalVariable(arg: 1, scope: !55, type: !35) -// CHECK:STDOUT: !59 = !DILocation(line: 13, column: 24, scope: !55) -// CHECK:STDOUT: !60 = !DILocation(line: 13, column: 3, scope: !55) -// CHECK:STDOUT: !61 = !{!56} -// CHECK:STDOUT: !62 = distinct !DISubprogram(name: "World", linkageName: "_CWorld.Main.9522ff908e97e267", scope: null, file: !14, line: 10, type: !37, spFlags: DISPFlagDefinition, unit: !34, retainedNodes: !66) -// CHECK:STDOUT: !63 = !DILocalVariable(arg: 1, scope: !62, type: !35) -// CHECK:STDOUT: !65 = !DILocation(line: 10, column: 1, scope: !62) -// CHECK:STDOUT: !66 = !{!63} +// CHECK:STDOUT: !51 = !DILocation(line: 10, column: 14, scope: !49) +// CHECK:STDOUT: !52 = !{!50} +// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !33, line: 10, type: !37, spFlags: DISPFlagDefinition, unit: !34, retainedNodes: !56) +// CHECK:STDOUT: !54 = !DILocalVariable(arg: 1, scope: !53, type: !35) +// CHECK:STDOUT: !55 = !DILocation(line: 10, column: 14, scope: !53) +// CHECK:STDOUT: !56 = !{!54} +// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "CallMethod", linkageName: "_CCallMethod.Main.805a971dc5455081", scope: null, file: !14, line: 20, type: !37, spFlags: DISPFlagDefinition, unit: !34, retainedNodes: !62) +// CHECK:STDOUT: !58 = !DILocalVariable(arg: 1, scope: !57, type: !35) +// CHECK:STDOUT: !60 = !DILocation(line: 21, column: 3, scope: !57) +// CHECK:STDOUT: !61 = !DILocation(line: 20, column: 1, scope: !57) +// CHECK:STDOUT: !62 = !{!58} +// CHECK:STDOUT: !63 = distinct !DISubprogram(name: "M", linkageName: "_CM.DefaultMethod.Main.805a971dc5455081", scope: null, file: !14, line: 13, type: !37, spFlags: DISPFlagDefinition, unit: !34, retainedNodes: !69) +// CHECK:STDOUT: !64 = !DILocalVariable(arg: 1, scope: !63, type: !35) +// CHECK:STDOUT: !67 = !DILocation(line: 13, column: 24, scope: !63) +// CHECK:STDOUT: !68 = !DILocation(line: 13, column: 3, scope: !63) +// CHECK:STDOUT: !69 = !{!64} +// CHECK:STDOUT: !70 = distinct !DISubprogram(name: "World", linkageName: "_CWorld.Main.9522ff908e97e267", scope: null, file: !14, line: 10, type: !37, spFlags: DISPFlagDefinition, unit: !34, retainedNodes: !74) +// CHECK:STDOUT: !71 = !DILocalVariable(arg: 1, scope: !70, type: !35) +// CHECK:STDOUT: !73 = !DILocation(line: 10, column: 1, scope: !70) +// CHECK:STDOUT: !74 = !{!71} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'default_function_overridden.carbon' @@ -318,41 +339,54 @@ fn F() { // CHECK:STDOUT: @C.val.loc9_23.6 = internal constant {} zeroinitializer // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CClone.C.Main(ptr %other) #0 !dbg !69 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !72 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @"_CF.C.Main:DefaultFn.Main"() #0 !dbg !74 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc9_23.2.temp = alloca {}, align 1, !dbg !75 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_23.2.temp), !dbg !75 -// CHECK:STDOUT: call void @_CClone.C.Main(ptr @C.val.loc9_23.6), !dbg !76 -// CHECK:STDOUT: call void @"_COp.08d9e38b928ba575:core.Destroy.Core"(ptr @C.val), !dbg !75 -// CHECK:STDOUT: ret void, !dbg !77 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !78 { +// CHECK:STDOUT: define void @_CClone.C.Main(ptr %other) #0 !dbg !77 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !80 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !82 { +// CHECK:STDOUT: define void @"_CF.C.Main:DefaultFn.Main"() #0 !dbg !82 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CCallFn.Main.794e85173e977a8b(), !dbg !83 -// CHECK:STDOUT: ret void, !dbg !84 +// CHECK:STDOUT: %.loc9_23.2.temp = alloca {}, align 1, !dbg !83 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_23.2.temp), !dbg !83 +// CHECK:STDOUT: call void @_CClone.C.Main(ptr @C.val.loc9_23.6), !dbg !84 +// CHECK:STDOUT: call void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr @C.val), !dbg !83 +// CHECK:STDOUT: ret void, !dbg !85 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %self) #0 !dbg !86 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !88 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !90 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !92 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !94 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core"(ptr %self), !dbg !96 +// CHECK:STDOUT: ret void, !dbg !96 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !98 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @_CCallFn.Main.794e85173e977a8b(), !dbg !99 +// CHECK:STDOUT: ret void, !dbg !100 // 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 @_CCallFn.Main.794e85173e977a8b() #0 !dbg !85 { -// CHECK:STDOUT: call void @"_CF.C.Main:DefaultFn.Main"(), !dbg !86 -// CHECK:STDOUT: ret void, !dbg !87 +// CHECK:STDOUT: define linkonce_odr void @_CCallFn.Main.794e85173e977a8b() #0 !dbg !101 { +// CHECK:STDOUT: call void @"_CF.C.Main:DefaultFn.Main"(), !dbg !102 +// CHECK:STDOUT: ret void, !dbg !103 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_CHello.Main() @@ -360,7 +394,7 @@ fn F() { // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!68} +// CHECK:STDOUT: !llvm.dbg.cu = !{!76} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} @@ -371,26 +405,34 @@ fn F() { // CHECK:STDOUT: !35 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) // CHECK:STDOUT: !36 = !{null, !35} // CHECK:STDOUT: !37 = !DISubroutineType(types: !36) -// CHECK:STDOUT: !67 = !DIFile(filename: "default_function_overridden.carbon", directory: "") -// CHECK:STDOUT: !68 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !67, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !69 = distinct !DISubprogram(name: "Clone", linkageName: "_CClone.C.Main", scope: null, file: !67, line: 6, type: !37, spFlags: DISPFlagDefinition, unit: !68, retainedNodes: !73) -// CHECK:STDOUT: !70 = !DILocalVariable(arg: 1, scope: !69, type: !35) -// CHECK:STDOUT: !72 = !DILocation(line: 6, column: 3, scope: !69) -// CHECK:STDOUT: !73 = !{!70} -// CHECK:STDOUT: !74 = distinct !DISubprogram(name: "F", linkageName: "_CF.C.Main:DefaultFn.Main", scope: null, file: !67, line: 9, type: !17, spFlags: DISPFlagDefinition, unit: !68) -// CHECK:STDOUT: !75 = !DILocation(line: 9, column: 22, scope: !74) -// CHECK:STDOUT: !76 = !DILocation(line: 9, column: 14, scope: !74) -// CHECK:STDOUT: !77 = !DILocation(line: 9, column: 5, scope: !74) -// CHECK:STDOUT: !78 = distinct !DISubprogram(name: "Op", linkageName: "_COp.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !67, line: 9, type: !37, spFlags: DISPFlagDefinition, unit: !68, retainedNodes: !81) -// CHECK:STDOUT: !79 = !DILocalVariable(arg: 1, scope: !78, type: !35) -// CHECK:STDOUT: !80 = !DILocation(line: 9, column: 22, scope: !78) -// CHECK:STDOUT: !81 = !{!79} -// CHECK:STDOUT: !82 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !67, line: 13, type: !17, spFlags: DISPFlagDefinition, unit: !68) -// CHECK:STDOUT: !83 = !DILocation(line: 14, column: 3, scope: !82) -// CHECK:STDOUT: !84 = !DILocation(line: 13, column: 1, scope: !82) -// CHECK:STDOUT: !85 = distinct !DISubprogram(name: "CallFn", linkageName: "_CCallFn.Main.794e85173e977a8b", scope: null, file: !14, line: 16, type: !17, spFlags: DISPFlagDefinition, unit: !68) -// CHECK:STDOUT: !86 = !DILocation(line: 17, column: 3, scope: !85) -// CHECK:STDOUT: !87 = !DILocation(line: 16, column: 1, scope: !85) +// CHECK:STDOUT: !75 = !DIFile(filename: "default_function_overridden.carbon", directory: "") +// CHECK:STDOUT: !76 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !75, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !77 = distinct !DISubprogram(name: "Clone", linkageName: "_CClone.C.Main", scope: null, file: !75, line: 6, type: !37, spFlags: DISPFlagDefinition, unit: !76, retainedNodes: !81) +// CHECK:STDOUT: !78 = !DILocalVariable(arg: 1, scope: !77, type: !35) +// CHECK:STDOUT: !80 = !DILocation(line: 6, column: 3, scope: !77) +// CHECK:STDOUT: !81 = !{!78} +// CHECK:STDOUT: !82 = distinct !DISubprogram(name: "F", linkageName: "_CF.C.Main:DefaultFn.Main", scope: null, file: !75, line: 9, type: !17, spFlags: DISPFlagDefinition, unit: !76) +// CHECK:STDOUT: !83 = !DILocation(line: 9, column: 22, scope: !82) +// CHECK:STDOUT: !84 = !DILocation(line: 9, column: 14, scope: !82) +// CHECK:STDOUT: !85 = !DILocation(line: 9, column: 5, scope: !82) +// CHECK:STDOUT: !86 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !75, line: 9, type: !37, spFlags: DISPFlagDefinition, unit: !76, retainedNodes: !89) +// CHECK:STDOUT: !87 = !DILocalVariable(arg: 1, scope: !86, type: !35) +// CHECK:STDOUT: !88 = !DILocation(line: 9, column: 22, scope: !86) +// CHECK:STDOUT: !89 = !{!87} +// CHECK:STDOUT: !90 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !75, line: 9, type: !37, spFlags: DISPFlagDefinition, unit: !76, retainedNodes: !93) +// CHECK:STDOUT: !91 = !DILocalVariable(arg: 1, scope: !90, type: !35) +// CHECK:STDOUT: !92 = !DILocation(line: 9, column: 22, scope: !90) +// CHECK:STDOUT: !93 = !{!91} +// CHECK:STDOUT: !94 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !75, line: 9, type: !37, spFlags: DISPFlagDefinition, unit: !76, retainedNodes: !97) +// CHECK:STDOUT: !95 = !DILocalVariable(arg: 1, scope: !94, type: !35) +// CHECK:STDOUT: !96 = !DILocation(line: 9, column: 22, scope: !94) +// CHECK:STDOUT: !97 = !{!95} +// CHECK:STDOUT: !98 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !75, line: 13, type: !17, spFlags: DISPFlagDefinition, unit: !76) +// CHECK:STDOUT: !99 = !DILocation(line: 14, column: 3, scope: !98) +// CHECK:STDOUT: !100 = !DILocation(line: 13, column: 1, scope: !98) +// CHECK:STDOUT: !101 = distinct !DISubprogram(name: "CallFn", linkageName: "_CCallFn.Main.794e85173e977a8b", scope: null, file: !14, line: 16, type: !17, spFlags: DISPFlagDefinition, unit: !76) +// CHECK:STDOUT: !102 = !DILocation(line: 17, column: 3, scope: !101) +// CHECK:STDOUT: !103 = !DILocation(line: 16, column: 1, scope: !101) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'default_method_overridden.carbon' @@ -400,41 +442,54 @@ fn F() { // CHECK:STDOUT: @C.val.loc14_15.6 = internal constant {} zeroinitializer // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CCopy.C.Main(ptr %self) #0 !dbg !90 { +// CHECK:STDOUT: define void @_CCopy.C.Main(ptr %self) #0 !dbg !106 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !93 +// CHECK:STDOUT: ret void, !dbg !109 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @"_CM.C.Main:DefaultMethod.Main"(ptr %self) #0 !dbg !95 { +// CHECK:STDOUT: define void @"_CM.C.Main:DefaultMethod.Main"(ptr %self) #0 !dbg !111 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CCopy.C.Main(ptr %self), !dbg !98 -// CHECK:STDOUT: ret void, !dbg !99 +// CHECK:STDOUT: call void @_CCopy.C.Main(ptr %self), !dbg !114 +// CHECK:STDOUT: ret void, !dbg !115 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !101 { +// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !117 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc14_15.2.temp = alloca {}, align 1, !dbg !102 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc14_15.2.temp), !dbg !102 -// CHECK:STDOUT: call void @_CCallMethod.Main.805a971dc5455081(ptr @C.val.loc14_15.6), !dbg !106 -// CHECK:STDOUT: call void @"_COp.08d9e38b928ba575:core.Destroy.Core"(ptr @C.val), !dbg !102 -// CHECK:STDOUT: ret void, !dbg !107 +// CHECK:STDOUT: %.loc14_15.2.temp = alloca {}, align 1, !dbg !118 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc14_15.2.temp), !dbg !118 +// CHECK:STDOUT: call void @_CCallMethod.Main.805a971dc5455081(ptr @C.val.loc14_15.6), !dbg !122 +// CHECK:STDOUT: call void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr @C.val), !dbg !118 +// CHECK:STDOUT: ret void, !dbg !123 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !108 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %self) #0 !dbg !124 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !110 +// CHECK:STDOUT: ret void, !dbg !126 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !128 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !130 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !132 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core"(ptr %self), !dbg !134 +// CHECK:STDOUT: ret void, !dbg !134 // 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 @_CCallMethod.Main.805a971dc5455081(ptr %t) #0 !dbg !112 { -// CHECK:STDOUT: call void @"_CM.C.Main:DefaultMethod.Main"(ptr %t), !dbg !115 -// CHECK:STDOUT: ret void, !dbg !116 +// CHECK:STDOUT: define linkonce_odr void @_CCallMethod.Main.805a971dc5455081(ptr %t) #0 !dbg !136 { +// CHECK:STDOUT: call void @"_CM.C.Main:DefaultMethod.Main"(ptr %t), !dbg !139 +// CHECK:STDOUT: ret void, !dbg !140 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_CHello.Main() @@ -442,7 +497,7 @@ fn F() { // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!89} +// CHECK:STDOUT: !llvm.dbg.cu = !{!105} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} @@ -453,56 +508,64 @@ fn F() { // CHECK:STDOUT: !35 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) // CHECK:STDOUT: !36 = !{null, !35} // CHECK:STDOUT: !37 = !DISubroutineType(types: !36) -// CHECK:STDOUT: !88 = !DIFile(filename: "default_method_overridden.carbon", directory: "") -// CHECK:STDOUT: !89 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !88, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !90 = distinct !DISubprogram(name: "Copy", linkageName: "_CCopy.C.Main", scope: null, file: !88, line: 6, type: !37, spFlags: DISPFlagDefinition, unit: !89, retainedNodes: !94) -// CHECK:STDOUT: !91 = !DILocalVariable(arg: 1, scope: !90, type: !35) -// CHECK:STDOUT: !93 = !DILocation(line: 6, column: 3, scope: !90) -// CHECK:STDOUT: !94 = !{!91} -// CHECK:STDOUT: !95 = distinct !DISubprogram(name: "M", linkageName: "_CM.C.Main:DefaultMethod.Main", scope: null, file: !88, line: 9, type: !37, spFlags: DISPFlagDefinition, unit: !89, retainedNodes: !100) -// CHECK:STDOUT: !96 = !DILocalVariable(arg: 1, scope: !95, type: !35) -// CHECK:STDOUT: !98 = !DILocation(line: 9, column: 18, scope: !95) -// CHECK:STDOUT: !99 = !DILocation(line: 9, column: 5, scope: !95) -// CHECK:STDOUT: !100 = !{!96} -// CHECK:STDOUT: !101 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !88, line: 13, type: !17, spFlags: DISPFlagDefinition, unit: !89) -// CHECK:STDOUT: !102 = !DILocation(line: 14, column: 14, scope: !101) -// CHECK:STDOUT: !106 = !DILocation(line: 15, column: 3, scope: !101) -// CHECK:STDOUT: !107 = !DILocation(line: 13, column: 1, scope: !101) -// CHECK:STDOUT: !108 = distinct !DISubprogram(name: "Op", linkageName: "_COp.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !88, line: 14, type: !37, spFlags: DISPFlagDefinition, unit: !89, retainedNodes: !111) -// CHECK:STDOUT: !109 = !DILocalVariable(arg: 1, scope: !108, type: !35) -// CHECK:STDOUT: !110 = !DILocation(line: 14, column: 14, scope: !108) -// CHECK:STDOUT: !111 = !{!109} -// CHECK:STDOUT: !112 = distinct !DISubprogram(name: "CallMethod", linkageName: "_CCallMethod.Main.805a971dc5455081", scope: null, file: !14, line: 20, type: !37, spFlags: DISPFlagDefinition, unit: !89, retainedNodes: !117) -// CHECK:STDOUT: !113 = !DILocalVariable(arg: 1, scope: !112, type: !35) -// CHECK:STDOUT: !115 = !DILocation(line: 21, column: 3, scope: !112) -// CHECK:STDOUT: !116 = !DILocation(line: 20, column: 1, scope: !112) -// CHECK:STDOUT: !117 = !{!113} +// CHECK:STDOUT: !104 = !DIFile(filename: "default_method_overridden.carbon", directory: "") +// CHECK:STDOUT: !105 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !104, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !106 = distinct !DISubprogram(name: "Copy", linkageName: "_CCopy.C.Main", scope: null, file: !104, line: 6, type: !37, spFlags: DISPFlagDefinition, unit: !105, retainedNodes: !110) +// CHECK:STDOUT: !107 = !DILocalVariable(arg: 1, scope: !106, type: !35) +// CHECK:STDOUT: !109 = !DILocation(line: 6, column: 3, scope: !106) +// CHECK:STDOUT: !110 = !{!107} +// CHECK:STDOUT: !111 = distinct !DISubprogram(name: "M", linkageName: "_CM.C.Main:DefaultMethod.Main", scope: null, file: !104, line: 9, type: !37, spFlags: DISPFlagDefinition, unit: !105, retainedNodes: !116) +// CHECK:STDOUT: !112 = !DILocalVariable(arg: 1, scope: !111, type: !35) +// CHECK:STDOUT: !114 = !DILocation(line: 9, column: 18, scope: !111) +// CHECK:STDOUT: !115 = !DILocation(line: 9, column: 5, scope: !111) +// CHECK:STDOUT: !116 = !{!112} +// CHECK:STDOUT: !117 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !104, line: 13, type: !17, spFlags: DISPFlagDefinition, unit: !105) +// CHECK:STDOUT: !118 = !DILocation(line: 14, column: 14, scope: !117) +// CHECK:STDOUT: !122 = !DILocation(line: 15, column: 3, scope: !117) +// CHECK:STDOUT: !123 = !DILocation(line: 13, column: 1, scope: !117) +// CHECK:STDOUT: !124 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !104, line: 14, type: !37, spFlags: DISPFlagDefinition, unit: !105, retainedNodes: !127) +// CHECK:STDOUT: !125 = !DILocalVariable(arg: 1, scope: !124, type: !35) +// CHECK:STDOUT: !126 = !DILocation(line: 14, column: 14, scope: !124) +// CHECK:STDOUT: !127 = !{!125} +// CHECK:STDOUT: !128 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !104, line: 14, type: !37, spFlags: DISPFlagDefinition, unit: !105, retainedNodes: !131) +// CHECK:STDOUT: !129 = !DILocalVariable(arg: 1, scope: !128, type: !35) +// CHECK:STDOUT: !130 = !DILocation(line: 14, column: 14, scope: !128) +// CHECK:STDOUT: !131 = !{!129} +// CHECK:STDOUT: !132 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !104, line: 14, type: !37, spFlags: DISPFlagDefinition, unit: !105, retainedNodes: !135) +// CHECK:STDOUT: !133 = !DILocalVariable(arg: 1, scope: !132, type: !35) +// CHECK:STDOUT: !134 = !DILocation(line: 14, column: 14, scope: !132) +// CHECK:STDOUT: !135 = !{!133} +// CHECK:STDOUT: !136 = distinct !DISubprogram(name: "CallMethod", linkageName: "_CCallMethod.Main.805a971dc5455081", scope: null, file: !14, line: 20, type: !37, spFlags: DISPFlagDefinition, unit: !105, retainedNodes: !141) +// CHECK:STDOUT: !137 = !DILocalVariable(arg: 1, scope: !136, type: !35) +// CHECK:STDOUT: !139 = !DILocation(line: 21, column: 3, scope: !136) +// CHECK:STDOUT: !140 = !DILocation(line: 20, column: 1, scope: !136) +// CHECK:STDOUT: !141 = !{!137} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'final_function.carbon' // CHECK:STDOUT: source_filename = "final_function.carbon" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !120 { +// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !144 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CCallFn.Main.e342d6e8ff5d87ae(), !dbg !121 -// CHECK:STDOUT: ret void, !dbg !122 +// CHECK:STDOUT: call void @_CCallFn.Main.e342d6e8ff5d87ae(), !dbg !145 +// CHECK:STDOUT: ret void, !dbg !146 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CCallFn.Main.e342d6e8ff5d87ae() #0 !dbg !123 { -// CHECK:STDOUT: call void @_CF.FinalFn.Main.e342d6e8ff5d87ae(), !dbg !124 -// CHECK:STDOUT: ret void, !dbg !125 +// CHECK:STDOUT: define linkonce_odr void @_CCallFn.Main.e342d6e8ff5d87ae() #0 !dbg !147 { +// CHECK:STDOUT: call void @_CF.FinalFn.Main.e342d6e8ff5d87ae(), !dbg !148 +// CHECK:STDOUT: ret void, !dbg !149 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CF.FinalFn.Main.e342d6e8ff5d87ae() #0 !dbg !126 { -// CHECK:STDOUT: ret void, !dbg !127 +// CHECK:STDOUT: define linkonce_odr void @_CF.FinalFn.Main.e342d6e8ff5d87ae() #0 !dbg !150 { +// CHECK:STDOUT: ret void, !dbg !151 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!119} +// CHECK:STDOUT: !llvm.dbg.cu = !{!143} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} @@ -510,16 +573,16 @@ fn F() { // CHECK:STDOUT: !16 = !{null} // CHECK:STDOUT: !17 = !DISubroutineType(types: !16) // CHECK:STDOUT: !20 = !DIFile(filename: "final_interfaces.carbon", directory: "") -// CHECK:STDOUT: !118 = !DIFile(filename: "final_function.carbon", directory: "") -// CHECK:STDOUT: !119 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !118, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !120 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !118, line: 9, type: !17, spFlags: DISPFlagDefinition, unit: !119) -// CHECK:STDOUT: !121 = !DILocation(line: 10, column: 3, scope: !120) -// CHECK:STDOUT: !122 = !DILocation(line: 9, column: 1, scope: !120) -// CHECK:STDOUT: !123 = distinct !DISubprogram(name: "CallFn", linkageName: "_CCallFn.Main.e342d6e8ff5d87ae", scope: null, file: !20, line: 12, type: !17, spFlags: DISPFlagDefinition, unit: !119) -// CHECK:STDOUT: !124 = !DILocation(line: 13, column: 3, scope: !123) -// CHECK:STDOUT: !125 = !DILocation(line: 12, column: 1, scope: !123) -// CHECK:STDOUT: !126 = distinct !DISubprogram(name: "F", linkageName: "_CF.FinalFn.Main.e342d6e8ff5d87ae", scope: null, file: !20, line: 5, type: !17, spFlags: DISPFlagDefinition, unit: !119) -// CHECK:STDOUT: !127 = !DILocation(line: 5, column: 3, scope: !126) +// CHECK:STDOUT: !142 = !DIFile(filename: "final_function.carbon", directory: "") +// CHECK:STDOUT: !143 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !142, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !144 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !142, line: 9, type: !17, spFlags: DISPFlagDefinition, unit: !143) +// CHECK:STDOUT: !145 = !DILocation(line: 10, column: 3, scope: !144) +// CHECK:STDOUT: !146 = !DILocation(line: 9, column: 1, scope: !144) +// CHECK:STDOUT: !147 = distinct !DISubprogram(name: "CallFn", linkageName: "_CCallFn.Main.e342d6e8ff5d87ae", scope: null, file: !20, line: 12, type: !17, spFlags: DISPFlagDefinition, unit: !143) +// CHECK:STDOUT: !148 = !DILocation(line: 13, column: 3, scope: !147) +// CHECK:STDOUT: !149 = !DILocation(line: 12, column: 1, scope: !147) +// CHECK:STDOUT: !150 = distinct !DISubprogram(name: "F", linkageName: "_CF.FinalFn.Main.e342d6e8ff5d87ae", scope: null, file: !20, line: 5, type: !17, spFlags: DISPFlagDefinition, unit: !143) +// CHECK:STDOUT: !151 = !DILocation(line: 5, column: 3, scope: !150) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'final_method.carbon' @@ -529,39 +592,52 @@ fn F() { // CHECK:STDOUT: @C.val.loc10_15.6 = internal constant {} zeroinitializer // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !130 { +// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !154 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc10_15.2.temp = alloca {}, align 1, !dbg !131 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc10_15.2.temp), !dbg !131 -// CHECK:STDOUT: call void @_CCallMethod.Main.96e0ef8a617a6362(ptr @C.val.loc10_15.6), !dbg !135 -// CHECK:STDOUT: call void @"_COp.08d9e38b928ba575:core.Destroy.Core"(ptr @C.val), !dbg !131 -// CHECK:STDOUT: ret void, !dbg !136 +// CHECK:STDOUT: %.loc10_15.2.temp = alloca {}, align 1, !dbg !155 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc10_15.2.temp), !dbg !155 +// CHECK:STDOUT: call void @_CCallMethod.Main.96e0ef8a617a6362(ptr @C.val.loc10_15.6), !dbg !159 +// CHECK:STDOUT: call void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr @C.val), !dbg !155 +// CHECK:STDOUT: ret void, !dbg !160 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !137 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %self) #0 !dbg !161 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !139 +// CHECK:STDOUT: ret void, !dbg !163 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !165 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !167 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !169 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core"(ptr %self), !dbg !171 +// CHECK:STDOUT: ret void, !dbg !171 // 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 @_CCallMethod.Main.96e0ef8a617a6362(ptr %t) #0 !dbg !141 { -// CHECK:STDOUT: call void @_CM.FinalMethod.Main.96e0ef8a617a6362(ptr %t), !dbg !144 -// CHECK:STDOUT: ret void, !dbg !145 +// CHECK:STDOUT: define linkonce_odr void @_CCallMethod.Main.96e0ef8a617a6362(ptr %t) #0 !dbg !173 { +// CHECK:STDOUT: call void @_CM.FinalMethod.Main.96e0ef8a617a6362(ptr %t), !dbg !176 +// CHECK:STDOUT: ret void, !dbg !177 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CM.FinalMethod.Main.96e0ef8a617a6362(ptr %self) #0 !dbg !147 { -// CHECK:STDOUT: ret void, !dbg !150 +// CHECK:STDOUT: define linkonce_odr void @_CM.FinalMethod.Main.96e0ef8a617a6362(ptr %self) #0 !dbg !179 { +// CHECK:STDOUT: ret void, !dbg !182 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!129} +// CHECK:STDOUT: !llvm.dbg.cu = !{!153} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} @@ -572,23 +648,31 @@ fn F() { // CHECK:STDOUT: !35 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) // CHECK:STDOUT: !36 = !{null, !35} // CHECK:STDOUT: !37 = !DISubroutineType(types: !36) -// CHECK:STDOUT: !128 = !DIFile(filename: "final_method.carbon", directory: "") -// CHECK:STDOUT: !129 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !128, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !130 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !128, line: 9, type: !17, spFlags: DISPFlagDefinition, unit: !129) -// CHECK:STDOUT: !131 = !DILocation(line: 10, column: 14, scope: !130) -// CHECK:STDOUT: !135 = !DILocation(line: 11, column: 3, scope: !130) -// CHECK:STDOUT: !136 = !DILocation(line: 9, column: 1, scope: !130) -// CHECK:STDOUT: !137 = distinct !DISubprogram(name: "Op", linkageName: "_COp.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !128, line: 10, type: !37, spFlags: DISPFlagDefinition, unit: !129, retainedNodes: !140) -// CHECK:STDOUT: !138 = !DILocalVariable(arg: 1, scope: !137, type: !35) -// CHECK:STDOUT: !139 = !DILocation(line: 10, column: 14, scope: !137) -// CHECK:STDOUT: !140 = !{!138} -// CHECK:STDOUT: !141 = distinct !DISubprogram(name: "CallMethod", linkageName: "_CCallMethod.Main.96e0ef8a617a6362", scope: null, file: !20, line: 16, type: !37, spFlags: DISPFlagDefinition, unit: !129, retainedNodes: !146) -// CHECK:STDOUT: !142 = !DILocalVariable(arg: 1, scope: !141, type: !35) -// CHECK:STDOUT: !144 = !DILocation(line: 17, column: 3, scope: !141) -// CHECK:STDOUT: !145 = !DILocation(line: 16, column: 1, scope: !141) -// CHECK:STDOUT: !146 = !{!142} -// CHECK:STDOUT: !147 = distinct !DISubprogram(name: "M", linkageName: "_CM.FinalMethod.Main.96e0ef8a617a6362", scope: null, file: !20, line: 9, type: !37, spFlags: DISPFlagDefinition, unit: !129, retainedNodes: !151) -// CHECK:STDOUT: !148 = !DILocalVariable(arg: 1, scope: !147, type: !35) -// CHECK:STDOUT: !150 = !DILocation(line: 9, column: 3, scope: !147) -// CHECK:STDOUT: !151 = !{!148} +// CHECK:STDOUT: !152 = !DIFile(filename: "final_method.carbon", directory: "") +// CHECK:STDOUT: !153 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !152, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !154 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !152, line: 9, type: !17, spFlags: DISPFlagDefinition, unit: !153) +// CHECK:STDOUT: !155 = !DILocation(line: 10, column: 14, scope: !154) +// CHECK:STDOUT: !159 = !DILocation(line: 11, column: 3, scope: !154) +// CHECK:STDOUT: !160 = !DILocation(line: 9, column: 1, scope: !154) +// CHECK:STDOUT: !161 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !152, line: 10, type: !37, spFlags: DISPFlagDefinition, unit: !153, retainedNodes: !164) +// CHECK:STDOUT: !162 = !DILocalVariable(arg: 1, scope: !161, type: !35) +// CHECK:STDOUT: !163 = !DILocation(line: 10, column: 14, scope: !161) +// CHECK:STDOUT: !164 = !{!162} +// CHECK:STDOUT: !165 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !152, line: 10, type: !37, spFlags: DISPFlagDefinition, unit: !153, retainedNodes: !168) +// CHECK:STDOUT: !166 = !DILocalVariable(arg: 1, scope: !165, type: !35) +// CHECK:STDOUT: !167 = !DILocation(line: 10, column: 14, scope: !165) +// CHECK:STDOUT: !168 = !{!166} +// CHECK:STDOUT: !169 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !152, line: 10, type: !37, spFlags: DISPFlagDefinition, unit: !153, retainedNodes: !172) +// CHECK:STDOUT: !170 = !DILocalVariable(arg: 1, scope: !169, type: !35) +// CHECK:STDOUT: !171 = !DILocation(line: 10, column: 14, scope: !169) +// CHECK:STDOUT: !172 = !{!170} +// CHECK:STDOUT: !173 = distinct !DISubprogram(name: "CallMethod", linkageName: "_CCallMethod.Main.96e0ef8a617a6362", scope: null, file: !20, line: 16, type: !37, spFlags: DISPFlagDefinition, unit: !153, retainedNodes: !178) +// CHECK:STDOUT: !174 = !DILocalVariable(arg: 1, scope: !173, type: !35) +// CHECK:STDOUT: !176 = !DILocation(line: 17, column: 3, scope: !173) +// CHECK:STDOUT: !177 = !DILocation(line: 16, column: 1, scope: !173) +// CHECK:STDOUT: !178 = !{!174} +// CHECK:STDOUT: !179 = distinct !DISubprogram(name: "M", linkageName: "_CM.FinalMethod.Main.96e0ef8a617a6362", scope: null, file: !20, line: 9, type: !37, spFlags: DISPFlagDefinition, unit: !153, retainedNodes: !183) +// CHECK:STDOUT: !180 = !DILocalVariable(arg: 1, scope: !179, type: !35) +// CHECK:STDOUT: !182 = !DILocation(line: 9, column: 3, scope: !179) +// CHECK:STDOUT: !183 = !{!180} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/class/export/class.carbon b/toolchain/lower/testdata/interop/cpp/class/export/class.carbon index ce5152743f21..a8450da53c1c 100644 --- a/toolchain/lower/testdata/interop/cpp/class/export/class.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/export/class.carbon @@ -185,7 +185,7 @@ fn G() { // CHECK:STDOUT: define internal void @_ZN6CarbonL11CallLayoutAEPNS_7LayoutAE(ptr noundef %0) #2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !108 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !144 // CHECK:STDOUT: call void @_CCallLayoutA__carbon_thunk.Main(ptr noundef nonnull align 8 dereferenceable(8) %.addr) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -194,7 +194,7 @@ fn G() { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN6Carbon7LayoutAD2Ev(ptr noundef nonnull align 8 dead_on_return(12) dereferenceable(12) %this) unnamed_addr #3 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !108 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !144 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: call void @"_C__destroy_thunk:thunk.LayoutA.Main"(ptr noundef nonnull align 8 dereferenceable(12) %this1) // CHECK:STDOUT: ret void @@ -218,7 +218,7 @@ fn G() { // CHECK:STDOUT: define internal void @_ZN6CarbonL11CallLayoutBEPNS_7LayoutBE(ptr noundef %0) #2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !110 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !146 // CHECK:STDOUT: call void @_CCallLayoutB__carbon_thunk.Main(ptr noundef nonnull align 8 dereferenceable(8) %.addr) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -227,7 +227,7 @@ fn G() { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN6Carbon7LayoutBD2Ev(ptr noundef nonnull align 8 dead_on_return(16) dereferenceable(16) %this) unnamed_addr #3 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !110 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !146 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: call void @"_C__destroy_thunk:thunk.LayoutB.Main"(ptr noundef nonnull align 8 dereferenceable(16) %this1) // CHECK:STDOUT: %a = getelementptr inbounds nuw %"class.Carbon::LayoutB", ptr %this1, i32 0, i32 0 @@ -251,7 +251,7 @@ fn G() { // CHECK:STDOUT: define internal void @_ZN6CarbonL11CallLayoutCEPNS_7LayoutCE(ptr noundef %0) #2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !112 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !148 // CHECK:STDOUT: call void @_CCallLayoutC__carbon_thunk.Main(ptr noundef nonnull align 8 dereferenceable(8) %.addr) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -260,7 +260,7 @@ fn G() { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN6Carbon7LayoutCD2Ev(ptr noundef nonnull align 8 dead_on_return(16) dereferenceable(16) %this) unnamed_addr #3 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !112 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !148 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: call void @"_C__destroy_thunk:thunk.LayoutC.Main"(ptr noundef nonnull align 8 dereferenceable(16) %this1) // CHECK:STDOUT: call void @_ZN6Carbon7LayoutAD2Ev(ptr noundef nonnull align 8 dead_on_return(12) dereferenceable(12) %this1) #5 @@ -276,90 +276,151 @@ fn G() { // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind // CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.LayoutA.Main"(ptr %self) #4 !dbg !55 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @"_COp.5a318796badc8ab7:core.Destroy.Core"(ptr %self), !dbg !57 +// CHECK:STDOUT: call void @"_CSelfDestruct.5a318796badc8ab7:core.Destroy.Core"(ptr %self), !dbg !57 // CHECK:STDOUT: ret void, !dbg !57 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #5 !dbg !59 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.d088c7eb746488be:core.Destroy.Core"(ptr %self) #5 !dbg !59 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !61 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.63f0d36eb067b612:core.Destroy.Core"(ptr %self) #5 !dbg !63 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #5 !dbg !63 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !65 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.5a318796badc8ab7:core.Destroy.Core"(ptr %self) #5 !dbg !67 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #5 !dbg !67 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !69 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CCallLayoutA__carbon_thunk.Main(ptr %_) #5 !dbg !71 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #5 !dbg !71 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc21 = load ptr, ptr %_, align 8, !dbg !73 -// CHECK:STDOUT: call void @_CCallLayoutA.Main(ptr %.loc21), !dbg !73 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !73 // CHECK:STDOUT: ret void, !dbg !73 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.LayoutB.Main"(ptr %self) #4 !dbg !75 { +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.63f0d36eb067b612:core.Destroy.Core"(ptr %self) #5 !dbg !75 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @"_COp.98b9397038fd95a2:core.Destroy.Core"(ptr %self), !dbg !77 // CHECK:STDOUT: ret void, !dbg !77 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.680fc8e588bd03e0:core.Destroy.Core"(ptr %self) #5 !dbg !79 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.63f0d36eb067b612:core.Destroy.Core"(ptr %self) #5 !dbg !79 { // CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.63f0d36eb067b612:core.Destroy.Core"(ptr %self), !dbg !81 // CHECK:STDOUT: ret void, !dbg !81 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.98b9397038fd95a2:core.Destroy.Core"(ptr %self) #5 !dbg !83 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.5a318796badc8ab7:core.Destroy.Core"(ptr %self) #5 !dbg !83 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !85 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CCallLayoutB__carbon_thunk.Main(ptr %_) #5 !dbg !87 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.5a318796badc8ab7:core.Destroy.Core"(ptr %self) #5 !dbg !87 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc22 = load ptr, ptr %_, align 8, !dbg !89 -// CHECK:STDOUT: call void @_CCallLayoutB.Main(ptr %.loc22), !dbg !89 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.5a318796badc8ab7:core.Destroy.Core"(ptr %self), !dbg !89 // CHECK:STDOUT: ret void, !dbg !89 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.LayoutC.Main"(ptr %self) #4 !dbg !91 { +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CCallLayoutA__carbon_thunk.Main(ptr %_) #5 !dbg !91 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @"_COp.bb6bd82e06513595:core.Destroy.Core"(ptr %self), !dbg !93 +// CHECK:STDOUT: %.loc21 = load ptr, ptr %_, align 8, !dbg !93 +// CHECK:STDOUT: call void @_CCallLayoutA.Main(ptr %.loc21), !dbg !93 // CHECK:STDOUT: ret void, !dbg !93 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.d1ce4198d9e72e02:core.Destroy.Core"(ptr %self) #5 !dbg !95 { +// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind +// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.LayoutB.Main"(ptr %self) #4 !dbg !95 { // CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSelfDestruct.98b9397038fd95a2:core.Destroy.Core"(ptr %self), !dbg !97 // CHECK:STDOUT: ret void, !dbg !97 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.bb6bd82e06513595:core.Destroy.Core"(ptr %self) #5 !dbg !99 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.680fc8e588bd03e0:core.Destroy.Core"(ptr %self) #5 !dbg !99 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !101 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CCallLayoutC__carbon_thunk.Main(ptr %_) #5 !dbg !103 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.680fc8e588bd03e0:core.Destroy.Core"(ptr %self) #5 !dbg !103 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc23 = load ptr, ptr %_, align 8, !dbg !105 -// CHECK:STDOUT: call void @_CCallLayoutC.Main(ptr %.loc23), !dbg !105 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.680fc8e588bd03e0:core.Destroy.Core"(ptr %self), !dbg !105 // CHECK:STDOUT: ret void, !dbg !105 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.98b9397038fd95a2:core.Destroy.Core"(ptr %self) #5 !dbg !107 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !109 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.98b9397038fd95a2:core.Destroy.Core"(ptr %self) #5 !dbg !111 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.98b9397038fd95a2:core.Destroy.Core"(ptr %self), !dbg !113 +// CHECK:STDOUT: ret void, !dbg !113 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CCallLayoutB__carbon_thunk.Main(ptr %_) #5 !dbg !115 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %.loc22 = load ptr, ptr %_, align 8, !dbg !117 +// CHECK:STDOUT: call void @_CCallLayoutB.Main(ptr %.loc22), !dbg !117 +// CHECK:STDOUT: ret void, !dbg !117 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind +// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.LayoutC.Main"(ptr %self) #4 !dbg !119 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSelfDestruct.bb6bd82e06513595:core.Destroy.Core"(ptr %self), !dbg !121 +// CHECK:STDOUT: ret void, !dbg !121 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.d1ce4198d9e72e02:core.Destroy.Core"(ptr %self) #5 !dbg !123 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !125 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.d1ce4198d9e72e02:core.Destroy.Core"(ptr %self) #5 !dbg !127 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.d1ce4198d9e72e02:core.Destroy.Core"(ptr %self), !dbg !129 +// CHECK:STDOUT: ret void, !dbg !129 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.bb6bd82e06513595:core.Destroy.Core"(ptr %self) #5 !dbg !131 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !133 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.bb6bd82e06513595:core.Destroy.Core"(ptr %self) #5 !dbg !135 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.bb6bd82e06513595:core.Destroy.Core"(ptr %self), !dbg !137 +// CHECK:STDOUT: ret void, !dbg !137 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CCallLayoutC__carbon_thunk.Main(ptr %_) #5 !dbg !139 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %.loc23 = load ptr, ptr %_, align 8, !dbg !141 +// CHECK:STDOUT: call void @_CCallLayoutC.Main(ptr %.loc23), !dbg !141 +// CHECK:STDOUT: ret void, !dbg !141 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives // CHECK:STDOUT: uselistorder ptr @_ZN6Carbon7LayoutAD2Ev, { 2, 1, 0 } // CHECK:STDOUT: @@ -397,60 +458,96 @@ fn G() { // CHECK:STDOUT: !56 = !DILocalVariable(arg: 1, scope: !55, type: !50) // CHECK:STDOUT: !57 = !DILocation(line: 6, column: 1, scope: !55) // CHECK:STDOUT: !58 = !{!56} -// CHECK:STDOUT: !59 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !48, line: 6, type: !54, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !62) -// CHECK:STDOUT: !60 = !DILocalVariable(arg: 1, scope: !59, type: !37) +// CHECK:STDOUT: !59 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.d088c7eb746488be:core.Destroy.Core", scope: null, file: !48, line: 6, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !62) +// CHECK:STDOUT: !60 = !DILocalVariable(arg: 1, scope: !59, type: !50) // CHECK:STDOUT: !61 = !DILocation(line: 6, column: 1, scope: !59) // CHECK:STDOUT: !62 = !{!60} -// CHECK:STDOUT: !63 = distinct !DISubprogram(name: "Op", linkageName: "_COp.63f0d36eb067b612:core.Destroy.Core", scope: null, file: !48, line: 6, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !66) -// CHECK:STDOUT: !64 = !DILocalVariable(arg: 1, scope: !63, type: !50) +// CHECK:STDOUT: !63 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !48, line: 6, type: !54, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !66) +// CHECK:STDOUT: !64 = !DILocalVariable(arg: 1, scope: !63, type: !37) // CHECK:STDOUT: !65 = !DILocation(line: 6, column: 1, scope: !63) // CHECK:STDOUT: !66 = !{!64} -// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5a318796badc8ab7:core.Destroy.Core", scope: null, file: !48, line: 6, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !70) -// CHECK:STDOUT: !68 = !DILocalVariable(arg: 1, scope: !67, type: !50) +// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !48, line: 6, type: !54, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !70) +// CHECK:STDOUT: !68 = !DILocalVariable(arg: 1, scope: !67, type: !37) // CHECK:STDOUT: !69 = !DILocation(line: 6, column: 1, scope: !67) // CHECK:STDOUT: !70 = !{!68} -// CHECK:STDOUT: !71 = distinct !DISubprogram(name: "CallLayoutA__carbon_thunk", linkageName: "_CCallLayoutA__carbon_thunk.Main", scope: null, file: !48, line: 21, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !74) -// CHECK:STDOUT: !72 = !DILocalVariable(arg: 1, scope: !71, type: !50) -// CHECK:STDOUT: !73 = !DILocation(line: 21, column: 1, scope: !71) +// CHECK:STDOUT: !71 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !48, line: 6, type: !54, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !74) +// CHECK:STDOUT: !72 = !DILocalVariable(arg: 1, scope: !71, type: !37) +// CHECK:STDOUT: !73 = !DILocation(line: 6, column: 1, scope: !71) // CHECK:STDOUT: !74 = !{!72} -// CHECK:STDOUT: !75 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.LayoutB.Main", scope: null, file: !48, line: 11, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !78) +// CHECK:STDOUT: !75 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.63f0d36eb067b612:core.Destroy.Core", scope: null, file: !48, line: 6, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !78) // CHECK:STDOUT: !76 = !DILocalVariable(arg: 1, scope: !75, type: !50) -// CHECK:STDOUT: !77 = !DILocation(line: 11, column: 1, scope: !75) +// CHECK:STDOUT: !77 = !DILocation(line: 6, column: 1, scope: !75) // CHECK:STDOUT: !78 = !{!76} -// CHECK:STDOUT: !79 = distinct !DISubprogram(name: "Op", linkageName: "_COp.680fc8e588bd03e0:core.Destroy.Core", scope: null, file: !48, line: 11, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !82) +// CHECK:STDOUT: !79 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.63f0d36eb067b612:core.Destroy.Core", scope: null, file: !48, line: 6, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !82) // CHECK:STDOUT: !80 = !DILocalVariable(arg: 1, scope: !79, type: !50) -// CHECK:STDOUT: !81 = !DILocation(line: 11, column: 1, scope: !79) +// CHECK:STDOUT: !81 = !DILocation(line: 6, column: 1, scope: !79) // CHECK:STDOUT: !82 = !{!80} -// CHECK:STDOUT: !83 = distinct !DISubprogram(name: "Op", linkageName: "_COp.98b9397038fd95a2:core.Destroy.Core", scope: null, file: !48, line: 11, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !86) +// CHECK:STDOUT: !83 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.5a318796badc8ab7:core.Destroy.Core", scope: null, file: !48, line: 6, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !86) // CHECK:STDOUT: !84 = !DILocalVariable(arg: 1, scope: !83, type: !50) -// CHECK:STDOUT: !85 = !DILocation(line: 11, column: 1, scope: !83) +// CHECK:STDOUT: !85 = !DILocation(line: 6, column: 1, scope: !83) // CHECK:STDOUT: !86 = !{!84} -// CHECK:STDOUT: !87 = distinct !DISubprogram(name: "CallLayoutB__carbon_thunk", linkageName: "_CCallLayoutB__carbon_thunk.Main", scope: null, file: !48, line: 22, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !90) +// CHECK:STDOUT: !87 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.5a318796badc8ab7:core.Destroy.Core", scope: null, file: !48, line: 6, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !90) // CHECK:STDOUT: !88 = !DILocalVariable(arg: 1, scope: !87, type: !50) -// CHECK:STDOUT: !89 = !DILocation(line: 22, column: 1, scope: !87) +// CHECK:STDOUT: !89 = !DILocation(line: 6, column: 1, scope: !87) // CHECK:STDOUT: !90 = !{!88} -// CHECK:STDOUT: !91 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.LayoutC.Main", scope: null, file: !48, line: 16, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !94) +// CHECK:STDOUT: !91 = distinct !DISubprogram(name: "CallLayoutA__carbon_thunk", linkageName: "_CCallLayoutA__carbon_thunk.Main", scope: null, file: !48, line: 21, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !94) // CHECK:STDOUT: !92 = !DILocalVariable(arg: 1, scope: !91, type: !50) -// CHECK:STDOUT: !93 = !DILocation(line: 16, column: 1, scope: !91) +// CHECK:STDOUT: !93 = !DILocation(line: 21, column: 1, scope: !91) // CHECK:STDOUT: !94 = !{!92} -// CHECK:STDOUT: !95 = distinct !DISubprogram(name: "Op", linkageName: "_COp.d1ce4198d9e72e02:core.Destroy.Core", scope: null, file: !48, line: 16, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !98) +// CHECK:STDOUT: !95 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.LayoutB.Main", scope: null, file: !48, line: 11, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !98) // CHECK:STDOUT: !96 = !DILocalVariable(arg: 1, scope: !95, type: !50) -// CHECK:STDOUT: !97 = !DILocation(line: 16, column: 1, scope: !95) +// CHECK:STDOUT: !97 = !DILocation(line: 11, column: 1, scope: !95) // CHECK:STDOUT: !98 = !{!96} -// CHECK:STDOUT: !99 = distinct !DISubprogram(name: "Op", linkageName: "_COp.bb6bd82e06513595:core.Destroy.Core", scope: null, file: !48, line: 16, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !102) +// CHECK:STDOUT: !99 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.680fc8e588bd03e0:core.Destroy.Core", scope: null, file: !48, line: 11, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !102) // CHECK:STDOUT: !100 = !DILocalVariable(arg: 1, scope: !99, type: !50) -// CHECK:STDOUT: !101 = !DILocation(line: 16, column: 1, scope: !99) +// CHECK:STDOUT: !101 = !DILocation(line: 11, column: 1, scope: !99) // CHECK:STDOUT: !102 = !{!100} -// CHECK:STDOUT: !103 = distinct !DISubprogram(name: "CallLayoutC__carbon_thunk", linkageName: "_CCallLayoutC__carbon_thunk.Main", scope: null, file: !48, line: 23, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !106) +// CHECK:STDOUT: !103 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.680fc8e588bd03e0:core.Destroy.Core", scope: null, file: !48, line: 11, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !106) // CHECK:STDOUT: !104 = !DILocalVariable(arg: 1, scope: !103, type: !50) -// CHECK:STDOUT: !105 = !DILocation(line: 23, column: 1, scope: !103) +// CHECK:STDOUT: !105 = !DILocation(line: 11, column: 1, scope: !103) // CHECK:STDOUT: !106 = !{!104} -// CHECK:STDOUT: !107 = !{!"p1 _ZTSN6Carbon7LayoutAE", !2, i64 0} -// CHECK:STDOUT: !108 = !{!107, !107, i64 0} -// CHECK:STDOUT: !109 = !{!"p1 _ZTSN6Carbon7LayoutBE", !2, i64 0} -// CHECK:STDOUT: !110 = !{!109, !109, i64 0} -// CHECK:STDOUT: !111 = !{!"p1 _ZTSN6Carbon7LayoutCE", !2, i64 0} -// CHECK:STDOUT: !112 = !{!111, !111, i64 0} +// CHECK:STDOUT: !107 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.98b9397038fd95a2:core.Destroy.Core", scope: null, file: !48, line: 11, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !110) +// CHECK:STDOUT: !108 = !DILocalVariable(arg: 1, scope: !107, type: !50) +// CHECK:STDOUT: !109 = !DILocation(line: 11, column: 1, scope: !107) +// CHECK:STDOUT: !110 = !{!108} +// CHECK:STDOUT: !111 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.98b9397038fd95a2:core.Destroy.Core", scope: null, file: !48, line: 11, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !114) +// CHECK:STDOUT: !112 = !DILocalVariable(arg: 1, scope: !111, type: !50) +// CHECK:STDOUT: !113 = !DILocation(line: 11, column: 1, scope: !111) +// CHECK:STDOUT: !114 = !{!112} +// CHECK:STDOUT: !115 = distinct !DISubprogram(name: "CallLayoutB__carbon_thunk", linkageName: "_CCallLayoutB__carbon_thunk.Main", scope: null, file: !48, line: 22, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !118) +// CHECK:STDOUT: !116 = !DILocalVariable(arg: 1, scope: !115, type: !50) +// CHECK:STDOUT: !117 = !DILocation(line: 22, column: 1, scope: !115) +// CHECK:STDOUT: !118 = !{!116} +// CHECK:STDOUT: !119 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.LayoutC.Main", scope: null, file: !48, line: 16, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !122) +// CHECK:STDOUT: !120 = !DILocalVariable(arg: 1, scope: !119, type: !50) +// CHECK:STDOUT: !121 = !DILocation(line: 16, column: 1, scope: !119) +// CHECK:STDOUT: !122 = !{!120} +// CHECK:STDOUT: !123 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.d1ce4198d9e72e02:core.Destroy.Core", scope: null, file: !48, line: 16, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !126) +// CHECK:STDOUT: !124 = !DILocalVariable(arg: 1, scope: !123, type: !50) +// CHECK:STDOUT: !125 = !DILocation(line: 16, column: 1, scope: !123) +// CHECK:STDOUT: !126 = !{!124} +// CHECK:STDOUT: !127 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.d1ce4198d9e72e02:core.Destroy.Core", scope: null, file: !48, line: 16, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !130) +// CHECK:STDOUT: !128 = !DILocalVariable(arg: 1, scope: !127, type: !50) +// CHECK:STDOUT: !129 = !DILocation(line: 16, column: 1, scope: !127) +// CHECK:STDOUT: !130 = !{!128} +// CHECK:STDOUT: !131 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.bb6bd82e06513595:core.Destroy.Core", scope: null, file: !48, line: 16, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !134) +// CHECK:STDOUT: !132 = !DILocalVariable(arg: 1, scope: !131, type: !50) +// CHECK:STDOUT: !133 = !DILocation(line: 16, column: 1, scope: !131) +// CHECK:STDOUT: !134 = !{!132} +// CHECK:STDOUT: !135 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.bb6bd82e06513595:core.Destroy.Core", scope: null, file: !48, line: 16, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !138) +// CHECK:STDOUT: !136 = !DILocalVariable(arg: 1, scope: !135, type: !50) +// CHECK:STDOUT: !137 = !DILocation(line: 16, column: 1, scope: !135) +// CHECK:STDOUT: !138 = !{!136} +// CHECK:STDOUT: !139 = distinct !DISubprogram(name: "CallLayoutC__carbon_thunk", linkageName: "_CCallLayoutC__carbon_thunk.Main", scope: null, file: !48, line: 23, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !142) +// CHECK:STDOUT: !140 = !DILocalVariable(arg: 1, scope: !139, type: !50) +// CHECK:STDOUT: !141 = !DILocation(line: 23, column: 1, scope: !139) +// CHECK:STDOUT: !142 = !{!140} +// CHECK:STDOUT: !143 = !{!"p1 _ZTSN6Carbon7LayoutAE", !2, i64 0} +// CHECK:STDOUT: !144 = !{!143, !143, i64 0} +// CHECK:STDOUT: !145 = !{!"p1 _ZTSN6Carbon7LayoutBE", !2, i64 0} +// CHECK:STDOUT: !146 = !{!145, !145, i64 0} +// CHECK:STDOUT: !147 = !{!"p1 _ZTSN6Carbon7LayoutCE", !2, i64 0} +// CHECK:STDOUT: !148 = !{!147, !147, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'field.carbon' @@ -477,41 +574,68 @@ fn G() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.FieldC.Main"(ptr %self) #1 !dbg !115 { +// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.FieldC.Main"(ptr %self) #1 !dbg !151 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @"_COp.718874c3c75b803e:core.Destroy.Core"(ptr %self), !dbg !117 -// CHECK:STDOUT: ret void, !dbg !117 +// CHECK:STDOUT: call void @"_CSelfDestruct.718874c3c75b803e:core.Destroy.Core"(ptr %self), !dbg !153 +// CHECK:STDOUT: ret void, !dbg !153 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #2 !dbg !119 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #2 !dbg !155 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !121 +// CHECK:STDOUT: ret void, !dbg !157 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.b4c762864cd9a02b:core.Destroy.Core"(ptr %self) #2 !dbg !123 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #2 !dbg !159 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !125 +// CHECK:STDOUT: ret void, !dbg !161 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.718874c3c75b803e:core.Destroy.Core"(ptr %self) #2 !dbg !127 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #2 !dbg !163 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !129 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !165 +// CHECK:STDOUT: ret void, !dbg !165 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CG.Main() #2 !dbg !131 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.b4c762864cd9a02b:core.Destroy.Core"(ptr %self) #2 !dbg !167 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %c.var = alloca { i32, i32 }, align 4, !dbg !132 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !132 -// CHECK:STDOUT: %.loc19_34.3.a = getelementptr inbounds nuw { i32, i32 }, ptr %c.var, i32 0, i32 0, !dbg !133 -// CHECK:STDOUT: %.loc19_34.6.b = getelementptr inbounds nuw { i32, i32 }, ptr %c.var, i32 0, i32 1, !dbg !133 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %c.var, ptr align 4 @FieldC.val.loc19_3, i64 8, i1 false), !dbg !132 -// CHECK:STDOUT: call void @_Z1FRN6Carbon6FieldCE(ptr %c.var), !dbg !137 -// CHECK:STDOUT: call void @"_COp.718874c3c75b803e:core.Destroy.Core"(ptr %c.var), !dbg !132 -// CHECK:STDOUT: ret void, !dbg !138 +// CHECK:STDOUT: ret void, !dbg !169 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.b4c762864cd9a02b:core.Destroy.Core"(ptr %self) #2 !dbg !171 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.b4c762864cd9a02b:core.Destroy.Core"(ptr %self), !dbg !173 +// CHECK:STDOUT: ret void, !dbg !173 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.718874c3c75b803e:core.Destroy.Core"(ptr %self) #2 !dbg !175 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !177 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.718874c3c75b803e:core.Destroy.Core"(ptr %self) #2 !dbg !179 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.718874c3c75b803e:core.Destroy.Core"(ptr %self), !dbg !181 +// CHECK:STDOUT: ret void, !dbg !181 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CG.Main() #2 !dbg !183 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %c.var = alloca { i32, i32 }, align 4, !dbg !184 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !184 +// CHECK:STDOUT: %.loc19_34.3.a = getelementptr inbounds nuw { i32, i32 }, ptr %c.var, i32 0, i32 0, !dbg !185 +// CHECK:STDOUT: %.loc19_34.6.b = getelementptr inbounds nuw { i32, i32 }, ptr %c.var, i32 0, i32 1, !dbg !185 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %c.var, ptr align 4 @FieldC.val.loc19_3, i64 8, i1 false), !dbg !184 +// CHECK:STDOUT: call void @_Z1FRN6Carbon6FieldCE(ptr %c.var), !dbg !189 +// CHECK:STDOUT: call void @"_CSelfDestruct.718874c3c75b803e:core.Destroy.Core"(ptr %c.var), !dbg !184 +// CHECK:STDOUT: ret void, !dbg !190 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -525,7 +649,7 @@ fn G() { // CHECK:STDOUT: attributes #2 = { nounwind } // CHECK:STDOUT: attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!114} +// CHECK:STDOUT: !llvm.dbg.cu = !{!150} // CHECK:STDOUT: !llvm.module.flags = !{!43, !44, !45, !19, !20} // CHECK:STDOUT: !llvm.errno.tbaa = !{!47} // CHECK:STDOUT: @@ -555,27 +679,43 @@ fn G() { // CHECK:STDOUT: !52 = !DISubroutineType(types: !51) // CHECK:STDOUT: !53 = !{null, !37} // CHECK:STDOUT: !54 = !DISubroutineType(types: !53) -// CHECK:STDOUT: !113 = !DIFile(filename: "field.carbon", directory: "") -// CHECK:STDOUT: !114 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !113, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !115 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.FieldC.Main", scope: null, file: !113, line: 6, type: !52, spFlags: DISPFlagDefinition, unit: !114, retainedNodes: !118) -// CHECK:STDOUT: !116 = !DILocalVariable(arg: 1, scope: !115, type: !50) -// CHECK:STDOUT: !117 = !DILocation(line: 6, column: 1, scope: !115) -// CHECK:STDOUT: !118 = !{!116} -// CHECK:STDOUT: !119 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !113, line: 6, type: !54, spFlags: DISPFlagDefinition, unit: !114, retainedNodes: !122) -// CHECK:STDOUT: !120 = !DILocalVariable(arg: 1, scope: !119, type: !37) -// CHECK:STDOUT: !121 = !DILocation(line: 6, column: 1, scope: !119) -// CHECK:STDOUT: !122 = !{!120} -// CHECK:STDOUT: !123 = distinct !DISubprogram(name: "Op", linkageName: "_COp.b4c762864cd9a02b:core.Destroy.Core", scope: null, file: !113, line: 6, type: !52, spFlags: DISPFlagDefinition, unit: !114, retainedNodes: !126) -// CHECK:STDOUT: !124 = !DILocalVariable(arg: 1, scope: !123, type: !50) -// CHECK:STDOUT: !125 = !DILocation(line: 6, column: 1, scope: !123) -// CHECK:STDOUT: !126 = !{!124} -// CHECK:STDOUT: !127 = distinct !DISubprogram(name: "Op", linkageName: "_COp.718874c3c75b803e:core.Destroy.Core", scope: null, file: !113, line: 6, type: !52, spFlags: DISPFlagDefinition, unit: !114, retainedNodes: !130) -// CHECK:STDOUT: !128 = !DILocalVariable(arg: 1, scope: !127, type: !50) -// CHECK:STDOUT: !129 = !DILocation(line: 6, column: 1, scope: !127) -// CHECK:STDOUT: !130 = !{!128} -// CHECK:STDOUT: !131 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !113, line: 18, type: !39, spFlags: DISPFlagDefinition, unit: !114) -// CHECK:STDOUT: !132 = !DILocation(line: 19, column: 3, scope: !131) -// CHECK:STDOUT: !133 = !DILocation(line: 19, column: 19, scope: !131) -// CHECK:STDOUT: !137 = !DILocation(line: 20, column: 3, scope: !131) -// CHECK:STDOUT: !138 = !DILocation(line: 18, column: 1, scope: !131) +// CHECK:STDOUT: !149 = !DIFile(filename: "field.carbon", directory: "") +// CHECK:STDOUT: !150 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !149, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !151 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.FieldC.Main", scope: null, file: !149, line: 6, type: !52, spFlags: DISPFlagDefinition, unit: !150, retainedNodes: !154) +// CHECK:STDOUT: !152 = !DILocalVariable(arg: 1, scope: !151, type: !50) +// CHECK:STDOUT: !153 = !DILocation(line: 6, column: 1, scope: !151) +// CHECK:STDOUT: !154 = !{!152} +// CHECK:STDOUT: !155 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !149, line: 6, type: !54, spFlags: DISPFlagDefinition, unit: !150, retainedNodes: !158) +// CHECK:STDOUT: !156 = !DILocalVariable(arg: 1, scope: !155, type: !37) +// CHECK:STDOUT: !157 = !DILocation(line: 6, column: 1, scope: !155) +// CHECK:STDOUT: !158 = !{!156} +// CHECK:STDOUT: !159 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !149, line: 6, type: !54, spFlags: DISPFlagDefinition, unit: !150, retainedNodes: !162) +// CHECK:STDOUT: !160 = !DILocalVariable(arg: 1, scope: !159, type: !37) +// CHECK:STDOUT: !161 = !DILocation(line: 6, column: 1, scope: !159) +// CHECK:STDOUT: !162 = !{!160} +// CHECK:STDOUT: !163 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !149, line: 6, type: !54, spFlags: DISPFlagDefinition, unit: !150, retainedNodes: !166) +// CHECK:STDOUT: !164 = !DILocalVariable(arg: 1, scope: !163, type: !37) +// CHECK:STDOUT: !165 = !DILocation(line: 6, column: 1, scope: !163) +// CHECK:STDOUT: !166 = !{!164} +// CHECK:STDOUT: !167 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.b4c762864cd9a02b:core.Destroy.Core", scope: null, file: !149, line: 6, type: !52, spFlags: DISPFlagDefinition, unit: !150, retainedNodes: !170) +// CHECK:STDOUT: !168 = !DILocalVariable(arg: 1, scope: !167, type: !50) +// CHECK:STDOUT: !169 = !DILocation(line: 6, column: 1, scope: !167) +// CHECK:STDOUT: !170 = !{!168} +// CHECK:STDOUT: !171 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.b4c762864cd9a02b:core.Destroy.Core", scope: null, file: !149, line: 6, type: !52, spFlags: DISPFlagDefinition, unit: !150, retainedNodes: !174) +// CHECK:STDOUT: !172 = !DILocalVariable(arg: 1, scope: !171, type: !50) +// CHECK:STDOUT: !173 = !DILocation(line: 6, column: 1, scope: !171) +// CHECK:STDOUT: !174 = !{!172} +// CHECK:STDOUT: !175 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.718874c3c75b803e:core.Destroy.Core", scope: null, file: !149, line: 6, type: !52, spFlags: DISPFlagDefinition, unit: !150, retainedNodes: !178) +// CHECK:STDOUT: !176 = !DILocalVariable(arg: 1, scope: !175, type: !50) +// CHECK:STDOUT: !177 = !DILocation(line: 6, column: 1, scope: !175) +// CHECK:STDOUT: !178 = !{!176} +// CHECK:STDOUT: !179 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.718874c3c75b803e:core.Destroy.Core", scope: null, file: !149, line: 6, type: !52, spFlags: DISPFlagDefinition, unit: !150, retainedNodes: !182) +// CHECK:STDOUT: !180 = !DILocalVariable(arg: 1, scope: !179, type: !50) +// CHECK:STDOUT: !181 = !DILocation(line: 6, column: 1, scope: !179) +// CHECK:STDOUT: !182 = !{!180} +// CHECK:STDOUT: !183 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !149, line: 18, type: !39, spFlags: DISPFlagDefinition, unit: !150) +// CHECK:STDOUT: !184 = !DILocation(line: 19, column: 3, scope: !183) +// CHECK:STDOUT: !185 = !DILocation(line: 19, column: 19, scope: !183) +// CHECK:STDOUT: !189 = !DILocation(line: 20, column: 3, scope: !183) +// CHECK:STDOUT: !190 = !DILocation(line: 18, column: 1, scope: !183) // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/class/export/destroy_from_thunk.carbon b/toolchain/lower/testdata/interop/cpp/class/export/destroy_from_thunk.carbon new file mode 100644 index 000000000000..9536cd6848f2 --- /dev/null +++ b/toolchain/lower/testdata/interop/cpp/class/export/destroy_from_thunk.carbon @@ -0,0 +1,142 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/full.carbon +// +// AUTOUPDATE +// TIP: To test this file alone, run: +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/interop/cpp/class/export/destroy_from_thunk.carbon +// TIP: To dump output, run: +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interop/cpp/class/export/destroy_from_thunk.carbon + +// --- memory.h + +template +auto make_unique() -> void { + T(); +} + +// --- a.carbon + +import Cpp library "memory.h"; + +class C {} + +fn Run() { + Cpp.make_unique(C); +} + +// CHECK:STDOUT: ; --- +// CHECK:STDOUT: ; ModuleID = 'a.carbon' +// CHECK:STDOUT: source_filename = "a.carbon" +// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" +// CHECK:STDOUT: +// CHECK:STDOUT: %"class.Carbon::C" = type {} +// CHECK:STDOUT: +// CHECK:STDOUT: $_Z11make_uniqueIN6Carbon1CEEvv = comdat any +// CHECK:STDOUT: +// CHECK:STDOUT: $_ZN6Carbon1CD2Ev = comdat any +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define i32 @main() #0 !dbg !14 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @_Z11make_uniqueIN6Carbon1CEEvv(), !dbg !15 +// CHECK:STDOUT: ret i32 0, !dbg !16 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable +// CHECK:STDOUT: define linkonce_odr dso_local void @_Z11make_uniqueIN6Carbon1CEEvv() #1 comdat { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %agg.tmp.ensured = alloca %"class.Carbon::C", align 1 +// CHECK:STDOUT: call void @_ZN6Carbon1CD2Ev(ptr noundef nonnull align 1 %agg.tmp.ensured) #0 +// CHECK:STDOUT: ret void +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind +// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.C.Main"(ptr %self) #2 !dbg !17 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr %self), !dbg !19 +// CHECK:STDOUT: ret void, !dbg !19 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %self) #0 !dbg !21 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !23 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !25 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !27 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !29 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core"(ptr %self), !dbg !31 +// CHECK:STDOUT: ret void, !dbg !31 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress nounwind uwtable +// CHECK:STDOUT: define linkonce_odr dso_local void @_ZN6Carbon1CD2Ev(ptr noundef nonnull align 1 %this) unnamed_addr #3 comdat align 2 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %this.addr = alloca ptr, align 8 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !37 +// CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 +// CHECK:STDOUT: call void @"_C__destroy_thunk:thunk.C.Main"(ptr noundef nonnull align 1 %this1) +// CHECK:STDOUT: ret void +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: attributes #0 = { nounwind } +// CHECK:STDOUT: attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } +// CHECK:STDOUT: attributes #2 = { alwaysinline nounwind } +// CHECK:STDOUT: attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!5} +// CHECK:STDOUT: !llvm.module.flags = !{!39, !40, !41, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!44} +// CHECK:STDOUT: +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !4 = !DIFile(filename: "a.carbon", directory: "") +// CHECK:STDOUT: !5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !4, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !6 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !7 = !{!6} +// CHECK:STDOUT: !8 = !DISubroutineType(types: !7) +// CHECK:STDOUT: !11 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !12 = !{null, !11} +// CHECK:STDOUT: !13 = !DISubroutineType(types: !12) +// CHECK:STDOUT: !14 = distinct !DISubprogram(name: "Run", linkageName: "main", scope: null, file: !4, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !15 = !DILocation(line: 7, column: 3, scope: !14) +// CHECK:STDOUT: !16 = !DILocation(line: 6, column: 1, scope: !14) +// CHECK:STDOUT: !17 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.C.Main", scope: null, file: !4, line: 4, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !20) +// CHECK:STDOUT: !18 = !DILocalVariable(arg: 1, scope: !17, type: !11) +// CHECK:STDOUT: !19 = !DILocation(line: 4, column: 1, scope: !17) +// CHECK:STDOUT: !20 = !{!18} +// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !4, line: 4, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !24) +// CHECK:STDOUT: !22 = !DILocalVariable(arg: 1, scope: !21, type: !11) +// CHECK:STDOUT: !23 = !DILocation(line: 4, column: 1, scope: !21) +// CHECK:STDOUT: !24 = !{!22} +// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !4, line: 4, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !28) +// CHECK:STDOUT: !26 = !DILocalVariable(arg: 1, scope: !25, type: !11) +// CHECK:STDOUT: !27 = !DILocation(line: 4, column: 1, scope: !25) +// CHECK:STDOUT: !28 = !{!26} +// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !4, line: 4, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !32) +// CHECK:STDOUT: !30 = !DILocalVariable(arg: 1, scope: !29, type: !11) +// CHECK:STDOUT: !31 = !DILocation(line: 4, column: 1, scope: !29) +// CHECK:STDOUT: !32 = !{!30} +// CHECK:STDOUT: !33 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !34 = !{!"omnipotent char", !33, i64 0} +// CHECK:STDOUT: !35 = !{!"any pointer", !34, i64 0} +// CHECK:STDOUT: !36 = !{!"p1 _ZTSN6Carbon1CE", !35, i64 0} +// CHECK:STDOUT: !37 = !{!36, !36, i64 0} +// CHECK:STDOUT: !39 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !40 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !41 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !42 = !{!"int", !34, i64 0} +// CHECK:STDOUT: !43 = !{!"__libc_errno", !42, i64 0} +// CHECK:STDOUT: !44 = !{!43, !42, i64 0} +// CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/class/export/method.carbon b/toolchain/lower/testdata/interop/cpp/class/export/method.carbon index 3de63fd9883f..83b4fe7fe730 100644 --- a/toolchain/lower/testdata/interop/cpp/class/export/method.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/export/method.carbon @@ -91,7 +91,7 @@ fn CallCallF() { Cpp.CallStaticF(); } // CHECK:STDOUT: define internal void @_ZNK6Carbon1A1FEv(ptr noundef nonnull align 1 %this) #2 align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !47 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !55 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: call void @_CF__carbon_thunk.A.Main(ptr noundef nonnull align 1 %this1) // CHECK:STDOUT: ret void @@ -101,7 +101,7 @@ fn CallCallF() { Cpp.CallStaticF(); } // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN6Carbon1AD2Ev(ptr noundef nonnull align 1 %this) unnamed_addr #3 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !47 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !55 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: call void @"_C__destroy_thunk:thunk.A.Main"(ptr noundef nonnull align 1 %this1) // CHECK:STDOUT: ret void @@ -119,23 +119,36 @@ fn CallCallF() { Cpp.CallStaticF(); } // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind // CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.A.Main"(ptr %self) #5 !dbg !31 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @"_COp.5a23cc09585c55d2:core.Destroy.Core"(ptr %self), !dbg !33 +// CHECK:STDOUT: call void @"_CSelfDestruct.5a23cc09585c55d2:core.Destroy.Core"(ptr %self), !dbg !33 // CHECK:STDOUT: ret void, !dbg !33 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.5a23cc09585c55d2:core.Destroy.Core"(ptr %self) #4 !dbg !35 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %self) #4 !dbg !35 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !37 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF__carbon_thunk.A.Main(ptr %self) #4 !dbg !39 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.5a23cc09585c55d2:core.Destroy.Core"(ptr %self) #4 !dbg !39 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CF.A.Main(ptr %self), !dbg !41 // CHECK:STDOUT: ret void, !dbg !41 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.5a23cc09585c55d2:core.Destroy.Core"(ptr %self) #4 !dbg !43 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.5a23cc09585c55d2:core.Destroy.Core"(ptr %self), !dbg !45 +// CHECK:STDOUT: ret void, !dbg !45 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CF__carbon_thunk.A.Main(ptr %self) #4 !dbg !47 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @_CF.A.Main(ptr %self), !dbg !49 +// CHECK:STDOUT: ret void, !dbg !49 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } // CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: attributes #2 = { alwaysinline mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } @@ -144,8 +157,8 @@ fn CallCallF() { Cpp.CallStaticF(); } // CHECK:STDOUT: attributes #5 = { alwaysinline nounwind } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!21} -// CHECK:STDOUT: !llvm.module.flags = !{!48, !49, !50, !4, !5} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!53} +// CHECK:STDOUT: !llvm.module.flags = !{!56, !57, !58, !4, !5} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!61} // CHECK:STDOUT: // CHECK:STDOUT: !4 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !5 = !{i32 2, !"Debug Info Version", i32 3} @@ -162,25 +175,33 @@ fn CallCallF() { Cpp.CallStaticF(); } // CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !31, type: !22) // CHECK:STDOUT: !33 = !DILocation(line: 5, column: 1, scope: !31) // CHECK:STDOUT: !34 = !{!32} -// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5a23cc09585c55d2:core.Destroy.Core", scope: null, file: !20, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !21, retainedNodes: !38) +// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !20, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !21, retainedNodes: !38) // CHECK:STDOUT: !36 = !DILocalVariable(arg: 1, scope: !35, type: !22) // CHECK:STDOUT: !37 = !DILocation(line: 5, column: 1, scope: !35) // CHECK:STDOUT: !38 = !{!36} -// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "F__carbon_thunk", linkageName: "_CF__carbon_thunk.A.Main", scope: null, file: !20, line: 6, type: !24, spFlags: DISPFlagDefinition, unit: !21, retainedNodes: !42) +// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.5a23cc09585c55d2:core.Destroy.Core", scope: null, file: !20, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !21, retainedNodes: !42) // CHECK:STDOUT: !40 = !DILocalVariable(arg: 1, scope: !39, type: !22) -// CHECK:STDOUT: !41 = !DILocation(line: 6, column: 3, scope: !39) +// CHECK:STDOUT: !41 = !DILocation(line: 5, column: 1, scope: !39) // CHECK:STDOUT: !42 = !{!40} -// CHECK:STDOUT: !43 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !44 = !{!"omnipotent char", !43, i64 0} -// CHECK:STDOUT: !45 = !{!"any pointer", !44, i64 0} -// CHECK:STDOUT: !46 = !{!"p1 _ZTSN6Carbon1AE", !45, i64 0} -// CHECK:STDOUT: !47 = !{!46, !46, i64 0} -// CHECK:STDOUT: !48 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !49 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !50 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !51 = !{!"int", !44, i64 0} -// CHECK:STDOUT: !52 = !{!"__libc_errno", !51, i64 0} -// CHECK:STDOUT: !53 = !{!52, !51, i64 0} +// CHECK:STDOUT: !43 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.5a23cc09585c55d2:core.Destroy.Core", scope: null, file: !20, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !21, retainedNodes: !46) +// CHECK:STDOUT: !44 = !DILocalVariable(arg: 1, scope: !43, type: !22) +// CHECK:STDOUT: !45 = !DILocation(line: 5, column: 1, scope: !43) +// CHECK:STDOUT: !46 = !{!44} +// CHECK:STDOUT: !47 = distinct !DISubprogram(name: "F__carbon_thunk", linkageName: "_CF__carbon_thunk.A.Main", scope: null, file: !20, line: 6, type: !24, spFlags: DISPFlagDefinition, unit: !21, retainedNodes: !50) +// CHECK:STDOUT: !48 = !DILocalVariable(arg: 1, scope: !47, type: !22) +// CHECK:STDOUT: !49 = !DILocation(line: 6, column: 3, scope: !47) +// CHECK:STDOUT: !50 = !{!48} +// CHECK:STDOUT: !51 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !52 = !{!"omnipotent char", !51, i64 0} +// CHECK:STDOUT: !53 = !{!"any pointer", !52, i64 0} +// CHECK:STDOUT: !54 = !{!"p1 _ZTSN6Carbon1AE", !53, i64 0} +// CHECK:STDOUT: !55 = !{!54, !54, i64 0} +// CHECK:STDOUT: !56 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !57 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !58 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !59 = !{!"int", !52, i64 0} +// CHECK:STDOUT: !60 = !{!"__libc_errno", !59, i64 0} +// CHECK:STDOUT: !61 = !{!60, !59, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'method_with_args_and_return.carbon' @@ -212,8 +233,8 @@ fn CallCallF() { Cpp.CallStaticF(); } // CHECK:STDOUT: %retval = alloca i32, align 4 // CHECK:STDOUT: %this.addr = alloca ptr, align 8 // CHECK:STDOUT: %.addr = alloca i32, align 4 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !94 -// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !95 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !110 +// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !111 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: call void @_CF__carbon_thunk.ArgsA.Main(ptr noundef nonnull align 1 %this1, ptr noundef nonnull align 4 dereferenceable(4) %.addr, ptr noundef nonnull align 4 dereferenceable(4) %retval) // CHECK:STDOUT: %1 = load i32, ptr %retval, align 4 @@ -224,7 +245,7 @@ fn CallCallF() { Cpp.CallStaticF(); } // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN6Carbon5ArgsAD2Ev(ptr noundef nonnull align 1 %this) unnamed_addr #3 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !94 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !110 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: call void @"_C__destroy_thunk:thunk.ArgsA.Main"(ptr noundef nonnull align 1 %this1) // CHECK:STDOUT: ret void @@ -234,38 +255,51 @@ fn CallCallF() { Cpp.CallStaticF(); } // CHECK:STDOUT: declare void @llvm.lifetime.end.p0(ptr captures(none)) #1 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CF.ArgsA.Main(ptr %self, i32 %a) #4 !dbg !63 { +// CHECK:STDOUT: define i32 @_CF.ArgsA.Main(ptr %self, i32 %a) #4 !dbg !71 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret i32 %a, !dbg !72 +// CHECK:STDOUT: ret i32 %a, !dbg !80 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.ArgsA.Main"(ptr %self) #5 !dbg !74 { +// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.ArgsA.Main"(ptr %self) #5 !dbg !82 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @"_COp.eefdfd667b52bf5b:core.Destroy.Core"(ptr %self), !dbg !76 -// CHECK:STDOUT: ret void, !dbg !76 +// CHECK:STDOUT: call void @"_CSelfDestruct.eefdfd667b52bf5b:core.Destroy.Core"(ptr %self), !dbg !84 +// CHECK:STDOUT: ret void, !dbg !84 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.eefdfd667b52bf5b:core.Destroy.Core"(ptr %self) #4 !dbg !78 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %self) #4 !dbg !86 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !80 +// CHECK:STDOUT: ret void, !dbg !88 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF__carbon_thunk.ArgsA.Main(ptr %self, ptr %_, ptr %_1) #4 !dbg !82 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.eefdfd667b52bf5b:core.Destroy.Core"(ptr %self) #4 !dbg !90 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc6_29.2 = load i32, ptr %_, align 4, !dbg !86 -// CHECK:STDOUT: %ArgsA.F.call = call i32 @_CF.ArgsA.Main(ptr %self, i32 %.loc6_29.2), !dbg !86 -// CHECK:STDOUT: store i32 %ArgsA.F.call, ptr %_1, align 4, !dbg !86 -// CHECK:STDOUT: ret void, !dbg !86 +// CHECK:STDOUT: ret void, !dbg !92 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CCallCallF.Main() #4 !dbg !88 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.eefdfd667b52bf5b:core.Destroy.Core"(ptr %self) #4 !dbg !94 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %CallArgsF.call = call i32 @_Z9CallArgsFv(), !dbg !91 -// CHECK:STDOUT: ret i32 %CallArgsF.call, !dbg !92 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.eefdfd667b52bf5b:core.Destroy.Core"(ptr %self), !dbg !96 +// CHECK:STDOUT: ret void, !dbg !96 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CF__carbon_thunk.ArgsA.Main(ptr %self, ptr %_, ptr %_1) #4 !dbg !98 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %.loc6_29.2 = load i32, ptr %_, align 4, !dbg !102 +// CHECK:STDOUT: %ArgsA.F.call = call i32 @_CF.ArgsA.Main(ptr %self, i32 %.loc6_29.2), !dbg !102 +// CHECK:STDOUT: store i32 %ArgsA.F.call, ptr %_1, align 4, !dbg !102 +// CHECK:STDOUT: ret void, !dbg !102 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define i32 @_CCallCallF.Main() #4 !dbg !104 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %CallArgsF.call = call i32 @_Z9CallArgsFv(), !dbg !107 +// CHECK:STDOUT: ret i32 %CallArgsF.call, !dbg !108 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } @@ -275,58 +309,66 @@ fn CallCallF() { Cpp.CallStaticF(); } // CHECK:STDOUT: attributes #4 = { nounwind } // CHECK:STDOUT: attributes #5 = { alwaysinline nounwind } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!55} -// CHECK:STDOUT: !llvm.module.flags = !{!48, !49, !50, !4, !5} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!53} +// CHECK:STDOUT: !llvm.dbg.cu = !{!63} +// CHECK:STDOUT: !llvm.module.flags = !{!56, !57, !58, !4, !5} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!61} // CHECK:STDOUT: // CHECK:STDOUT: !4 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !5 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !22 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) // CHECK:STDOUT: !23 = !{null, !22} // CHECK:STDOUT: !24 = !DISubroutineType(types: !23) -// CHECK:STDOUT: !43 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !44 = !{!"omnipotent char", !43, i64 0} -// CHECK:STDOUT: !45 = !{!"any pointer", !44, i64 0} -// CHECK:STDOUT: !48 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !49 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !50 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !51 = !{!"int", !44, i64 0} -// CHECK:STDOUT: !52 = !{!"__libc_errno", !51, i64 0} -// CHECK:STDOUT: !53 = !{!52, !51, i64 0} -// CHECK:STDOUT: !54 = !DIFile(filename: "method_with_args_and_return.carbon", directory: "") -// CHECK:STDOUT: !55 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !54, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !56 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !57 = !{!56, !22, !56} -// CHECK:STDOUT: !58 = !DISubroutineType(types: !57) -// CHECK:STDOUT: !59 = !{null, !22, !56, !56} -// CHECK:STDOUT: !60 = !DISubroutineType(types: !59) -// CHECK:STDOUT: !61 = !{!56} -// CHECK:STDOUT: !62 = !DISubroutineType(types: !61) -// CHECK:STDOUT: !63 = distinct !DISubprogram(name: "F", linkageName: "_CF.ArgsA.Main", scope: null, file: !54, line: 6, type: !58, spFlags: DISPFlagDefinition, unit: !55, retainedNodes: !73) -// CHECK:STDOUT: !64 = !DILocalVariable(arg: 1, scope: !63, type: !22) -// CHECK:STDOUT: !65 = !DILocalVariable(arg: 2, scope: !63, type: !56) -// CHECK:STDOUT: !72 = !DILocation(line: 8, column: 5, scope: !63) -// CHECK:STDOUT: !73 = !{!64, !65} -// CHECK:STDOUT: !74 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.ArgsA.Main", scope: null, file: !54, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !55, retainedNodes: !77) -// CHECK:STDOUT: !75 = !DILocalVariable(arg: 1, scope: !74, type: !22) -// CHECK:STDOUT: !76 = !DILocation(line: 5, column: 1, scope: !74) -// CHECK:STDOUT: !77 = !{!75} -// CHECK:STDOUT: !78 = distinct !DISubprogram(name: "Op", linkageName: "_COp.eefdfd667b52bf5b:core.Destroy.Core", scope: null, file: !54, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !55, retainedNodes: !81) -// CHECK:STDOUT: !79 = !DILocalVariable(arg: 1, scope: !78, type: !22) -// CHECK:STDOUT: !80 = !DILocation(line: 5, column: 1, scope: !78) -// CHECK:STDOUT: !81 = !{!79} -// CHECK:STDOUT: !82 = distinct !DISubprogram(name: "F__carbon_thunk", linkageName: "_CF__carbon_thunk.ArgsA.Main", scope: null, file: !54, line: 6, type: !60, spFlags: DISPFlagDefinition, unit: !55, retainedNodes: !87) +// CHECK:STDOUT: !51 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !52 = !{!"omnipotent char", !51, i64 0} +// CHECK:STDOUT: !53 = !{!"any pointer", !52, i64 0} +// CHECK:STDOUT: !56 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !57 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !58 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !59 = !{!"int", !52, i64 0} +// CHECK:STDOUT: !60 = !{!"__libc_errno", !59, i64 0} +// CHECK:STDOUT: !61 = !{!60, !59, i64 0} +// CHECK:STDOUT: !62 = !DIFile(filename: "method_with_args_and_return.carbon", directory: "") +// CHECK:STDOUT: !63 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !62, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !64 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !65 = !{!64, !22, !64} +// CHECK:STDOUT: !66 = !DISubroutineType(types: !65) +// CHECK:STDOUT: !67 = !{null, !22, !64, !64} +// CHECK:STDOUT: !68 = !DISubroutineType(types: !67) +// CHECK:STDOUT: !69 = !{!64} +// CHECK:STDOUT: !70 = !DISubroutineType(types: !69) +// CHECK:STDOUT: !71 = distinct !DISubprogram(name: "F", linkageName: "_CF.ArgsA.Main", scope: null, file: !62, line: 6, type: !66, spFlags: DISPFlagDefinition, unit: !63, retainedNodes: !81) +// CHECK:STDOUT: !72 = !DILocalVariable(arg: 1, scope: !71, type: !22) +// CHECK:STDOUT: !73 = !DILocalVariable(arg: 2, scope: !71, type: !64) +// CHECK:STDOUT: !80 = !DILocation(line: 8, column: 5, scope: !71) +// CHECK:STDOUT: !81 = !{!72, !73} +// CHECK:STDOUT: !82 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.ArgsA.Main", scope: null, file: !62, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !63, retainedNodes: !85) // CHECK:STDOUT: !83 = !DILocalVariable(arg: 1, scope: !82, type: !22) -// CHECK:STDOUT: !84 = !DILocalVariable(arg: 2, scope: !82, type: !56) -// CHECK:STDOUT: !85 = !DILocalVariable(arg: 3, scope: !82, type: !56) -// CHECK:STDOUT: !86 = !DILocation(line: 6, column: 3, scope: !82) -// CHECK:STDOUT: !87 = !{!83, !84, !85} -// CHECK:STDOUT: !88 = distinct !DISubprogram(name: "CallCallF", linkageName: "_CCallCallF.Main", scope: null, file: !54, line: 18, type: !62, spFlags: DISPFlagDefinition, unit: !55) -// CHECK:STDOUT: !91 = !DILocation(line: 18, column: 32, scope: !88) -// CHECK:STDOUT: !92 = !DILocation(line: 18, column: 25, scope: !88) -// CHECK:STDOUT: !93 = !{!"p1 _ZTSN6Carbon5ArgsAE", !45, i64 0} -// CHECK:STDOUT: !94 = !{!93, !93, i64 0} -// CHECK:STDOUT: !95 = !{!51, !51, i64 0} +// CHECK:STDOUT: !84 = !DILocation(line: 5, column: 1, scope: !82) +// CHECK:STDOUT: !85 = !{!83} +// CHECK:STDOUT: !86 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !62, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !63, retainedNodes: !89) +// CHECK:STDOUT: !87 = !DILocalVariable(arg: 1, scope: !86, type: !22) +// CHECK:STDOUT: !88 = !DILocation(line: 5, column: 1, scope: !86) +// CHECK:STDOUT: !89 = !{!87} +// CHECK:STDOUT: !90 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.eefdfd667b52bf5b:core.Destroy.Core", scope: null, file: !62, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !63, retainedNodes: !93) +// CHECK:STDOUT: !91 = !DILocalVariable(arg: 1, scope: !90, type: !22) +// CHECK:STDOUT: !92 = !DILocation(line: 5, column: 1, scope: !90) +// CHECK:STDOUT: !93 = !{!91} +// CHECK:STDOUT: !94 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.eefdfd667b52bf5b:core.Destroy.Core", scope: null, file: !62, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !63, retainedNodes: !97) +// CHECK:STDOUT: !95 = !DILocalVariable(arg: 1, scope: !94, type: !22) +// CHECK:STDOUT: !96 = !DILocation(line: 5, column: 1, scope: !94) +// CHECK:STDOUT: !97 = !{!95} +// CHECK:STDOUT: !98 = distinct !DISubprogram(name: "F__carbon_thunk", linkageName: "_CF__carbon_thunk.ArgsA.Main", scope: null, file: !62, line: 6, type: !68, spFlags: DISPFlagDefinition, unit: !63, retainedNodes: !103) +// CHECK:STDOUT: !99 = !DILocalVariable(arg: 1, scope: !98, type: !22) +// CHECK:STDOUT: !100 = !DILocalVariable(arg: 2, scope: !98, type: !64) +// CHECK:STDOUT: !101 = !DILocalVariable(arg: 3, scope: !98, type: !64) +// CHECK:STDOUT: !102 = !DILocation(line: 6, column: 3, scope: !98) +// CHECK:STDOUT: !103 = !{!99, !100, !101} +// CHECK:STDOUT: !104 = distinct !DISubprogram(name: "CallCallF", linkageName: "_CCallCallF.Main", scope: null, file: !62, line: 18, type: !70, spFlags: DISPFlagDefinition, unit: !63) +// CHECK:STDOUT: !107 = !DILocation(line: 18, column: 32, scope: !104) +// CHECK:STDOUT: !108 = !DILocation(line: 18, column: 25, scope: !104) +// CHECK:STDOUT: !109 = !{!"p1 _ZTSN6Carbon5ArgsAE", !53, i64 0} +// CHECK:STDOUT: !110 = !{!109, !109, i64 0} +// CHECK:STDOUT: !111 = !{!59, !59, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'static.carbon' @@ -349,36 +391,49 @@ fn CallCallF() { Cpp.CallStaticF(); } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF.StaticA.Main() #2 !dbg !100 { +// CHECK:STDOUT: define void @_CF.StaticA.Main() #2 !dbg !116 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !101 +// CHECK:STDOUT: ret void, !dbg !117 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.StaticA.Main"(ptr %self) #3 !dbg !102 { +// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.StaticA.Main"(ptr %self) #3 !dbg !118 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @"_COp.1be3804f96ff0532:core.Destroy.Core"(ptr %self), !dbg !104 -// CHECK:STDOUT: ret void, !dbg !104 +// CHECK:STDOUT: call void @"_CSelfDestruct.1be3804f96ff0532:core.Destroy.Core"(ptr %self), !dbg !120 +// CHECK:STDOUT: ret void, !dbg !120 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.1be3804f96ff0532:core.Destroy.Core"(ptr %self) #2 !dbg !106 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %self) #2 !dbg !122 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !108 +// CHECK:STDOUT: ret void, !dbg !124 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF__carbon_thunk.StaticA.Main() #2 !dbg !110 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.1be3804f96ff0532:core.Destroy.Core"(ptr %self) #2 !dbg !126 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CF.StaticA.Main(), !dbg !111 -// CHECK:STDOUT: ret void, !dbg !111 +// CHECK:STDOUT: ret void, !dbg !128 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CCallCallF.Main() #2 !dbg !112 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.1be3804f96ff0532:core.Destroy.Core"(ptr %self) #2 !dbg !130 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z11CallStaticFv(), !dbg !113 -// CHECK:STDOUT: ret void, !dbg !114 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.1be3804f96ff0532:core.Destroy.Core"(ptr %self), !dbg !132 +// CHECK:STDOUT: ret void, !dbg !132 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CF__carbon_thunk.StaticA.Main() #2 !dbg !134 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @_CF.StaticA.Main(), !dbg !135 +// CHECK:STDOUT: ret void, !dbg !135 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CCallCallF.Main() #2 !dbg !136 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @_Z11CallStaticFv(), !dbg !137 +// CHECK:STDOUT: ret void, !dbg !138 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } @@ -386,40 +441,48 @@ fn CallCallF() { Cpp.CallStaticF(); } // CHECK:STDOUT: attributes #2 = { nounwind } // CHECK:STDOUT: attributes #3 = { alwaysinline nounwind } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!97} -// CHECK:STDOUT: !llvm.module.flags = !{!48, !49, !50, !4, !5} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!53} +// CHECK:STDOUT: !llvm.dbg.cu = !{!113} +// CHECK:STDOUT: !llvm.module.flags = !{!56, !57, !58, !4, !5} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!61} // CHECK:STDOUT: // CHECK:STDOUT: !4 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !5 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !22 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) // CHECK:STDOUT: !23 = !{null, !22} // CHECK:STDOUT: !24 = !DISubroutineType(types: !23) -// CHECK:STDOUT: !43 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !44 = !{!"omnipotent char", !43, i64 0} -// CHECK:STDOUT: !48 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !49 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !50 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !51 = !{!"int", !44, i64 0} -// CHECK:STDOUT: !52 = !{!"__libc_errno", !51, i64 0} -// CHECK:STDOUT: !53 = !{!52, !51, i64 0} -// CHECK:STDOUT: !96 = !DIFile(filename: "static.carbon", directory: "") -// CHECK:STDOUT: !97 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !96, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !98 = !{null} -// CHECK:STDOUT: !99 = !DISubroutineType(types: !98) -// CHECK:STDOUT: !100 = distinct !DISubprogram(name: "F", linkageName: "_CF.StaticA.Main", scope: null, file: !96, line: 6, type: !99, spFlags: DISPFlagDefinition, unit: !97) -// CHECK:STDOUT: !101 = !DILocation(line: 6, column: 3, scope: !100) -// CHECK:STDOUT: !102 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.StaticA.Main", scope: null, file: !96, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !97, retainedNodes: !105) -// CHECK:STDOUT: !103 = !DILocalVariable(arg: 1, scope: !102, type: !22) -// CHECK:STDOUT: !104 = !DILocation(line: 5, column: 1, scope: !102) -// CHECK:STDOUT: !105 = !{!103} -// CHECK:STDOUT: !106 = distinct !DISubprogram(name: "Op", linkageName: "_COp.1be3804f96ff0532:core.Destroy.Core", scope: null, file: !96, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !97, retainedNodes: !109) -// CHECK:STDOUT: !107 = !DILocalVariable(arg: 1, scope: !106, type: !22) -// CHECK:STDOUT: !108 = !DILocation(line: 5, column: 1, scope: !106) -// CHECK:STDOUT: !109 = !{!107} -// CHECK:STDOUT: !110 = distinct !DISubprogram(name: "F__carbon_thunk", linkageName: "_CF__carbon_thunk.StaticA.Main", scope: null, file: !96, line: 6, type: !99, spFlags: DISPFlagDefinition, unit: !97) -// CHECK:STDOUT: !111 = !DILocation(line: 6, column: 3, scope: !110) -// CHECK:STDOUT: !112 = distinct !DISubprogram(name: "CallCallF", linkageName: "_CCallCallF.Main", scope: null, file: !96, line: 15, type: !99, spFlags: DISPFlagDefinition, unit: !97) -// CHECK:STDOUT: !113 = !DILocation(line: 15, column: 18, scope: !112) -// CHECK:STDOUT: !114 = !DILocation(line: 15, column: 1, scope: !112) +// CHECK:STDOUT: !51 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !52 = !{!"omnipotent char", !51, i64 0} +// CHECK:STDOUT: !56 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !57 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !58 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !59 = !{!"int", !52, i64 0} +// CHECK:STDOUT: !60 = !{!"__libc_errno", !59, i64 0} +// CHECK:STDOUT: !61 = !{!60, !59, i64 0} +// CHECK:STDOUT: !112 = !DIFile(filename: "static.carbon", directory: "") +// CHECK:STDOUT: !113 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !112, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !114 = !{null} +// CHECK:STDOUT: !115 = !DISubroutineType(types: !114) +// CHECK:STDOUT: !116 = distinct !DISubprogram(name: "F", linkageName: "_CF.StaticA.Main", scope: null, file: !112, line: 6, type: !115, spFlags: DISPFlagDefinition, unit: !113) +// CHECK:STDOUT: !117 = !DILocation(line: 6, column: 3, scope: !116) +// CHECK:STDOUT: !118 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.StaticA.Main", scope: null, file: !112, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !113, retainedNodes: !121) +// CHECK:STDOUT: !119 = !DILocalVariable(arg: 1, scope: !118, type: !22) +// CHECK:STDOUT: !120 = !DILocation(line: 5, column: 1, scope: !118) +// CHECK:STDOUT: !121 = !{!119} +// CHECK:STDOUT: !122 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !112, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !113, retainedNodes: !125) +// CHECK:STDOUT: !123 = !DILocalVariable(arg: 1, scope: !122, type: !22) +// CHECK:STDOUT: !124 = !DILocation(line: 5, column: 1, scope: !122) +// CHECK:STDOUT: !125 = !{!123} +// CHECK:STDOUT: !126 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.1be3804f96ff0532:core.Destroy.Core", scope: null, file: !112, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !113, retainedNodes: !129) +// CHECK:STDOUT: !127 = !DILocalVariable(arg: 1, scope: !126, type: !22) +// CHECK:STDOUT: !128 = !DILocation(line: 5, column: 1, scope: !126) +// CHECK:STDOUT: !129 = !{!127} +// CHECK:STDOUT: !130 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.1be3804f96ff0532:core.Destroy.Core", scope: null, file: !112, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !113, retainedNodes: !133) +// CHECK:STDOUT: !131 = !DILocalVariable(arg: 1, scope: !130, type: !22) +// CHECK:STDOUT: !132 = !DILocation(line: 5, column: 1, scope: !130) +// CHECK:STDOUT: !133 = !{!131} +// CHECK:STDOUT: !134 = distinct !DISubprogram(name: "F__carbon_thunk", linkageName: "_CF__carbon_thunk.StaticA.Main", scope: null, file: !112, line: 6, type: !115, spFlags: DISPFlagDefinition, unit: !113) +// CHECK:STDOUT: !135 = !DILocation(line: 6, column: 3, scope: !134) +// CHECK:STDOUT: !136 = distinct !DISubprogram(name: "CallCallF", linkageName: "_CCallCallF.Main", scope: null, file: !112, line: 15, type: !115, spFlags: DISPFlagDefinition, unit: !113) +// CHECK:STDOUT: !137 = !DILocation(line: 15, column: 18, scope: !136) +// CHECK:STDOUT: !138 = !DILocation(line: 15, column: 1, scope: !136) // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/class/import/alignment.carbon b/toolchain/lower/testdata/interop/cpp/class/import/alignment.carbon index 445691f29763..7876af3efe74 100644 --- a/toolchain/lower/testdata/interop/cpp/class/import/alignment.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/import/alignment.carbon @@ -71,6 +71,7 @@ fn Packed(n: i32) { // CHECK:STDOUT: %.loc25.n = getelementptr inbounds nuw [4 x i8], ptr %a.var, i32 0, i32 0, !dbg !47 // CHECK:STDOUT: store i32 %n, ptr %.loc25.n, align 4, !dbg !47 // CHECK:STDOUT: call void @_Z4TakeI16NaturallyAlignedEvRT_(ptr %a.var), !dbg !51 +// CHECK:STDOUT: call void @"_CSelfDestruct.89af5f7a0692dfe8:core.Destroy.Core"(ptr %a.var), !dbg !45 // CHECK:STDOUT: ret void, !dbg !52 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -78,8 +79,8 @@ fn Packed(n: i32) { // CHECK:STDOUT: define internal void @_ZN16NaturallyAlignedC1Ev.carbon_thunk.(ptr noundef %return) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !106 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !106 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !118 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !118 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: @@ -93,84 +94,104 @@ fn Packed(n: i32) { // CHECK:STDOUT: declare void @_Z4TakeI16NaturallyAlignedEvRT_(ptr noundef nonnull align 4 dereferenceable(4)) #3 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CExtraAlignment.Main(i32 %n) #0 !dbg !57 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.89af5f7a0692dfe8:core.Destroy.Core"(ptr %self) #0 !dbg !57 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %a.var = alloca [16 x i8], align 16, !dbg !60 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !60 -// CHECK:STDOUT: call void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.34933c1c343bd645"(ptr %a.var), !dbg !60 -// CHECK:STDOUT: %.loc33.n = getelementptr inbounds nuw [16 x i8], ptr %a.var, i32 0, i32 0, !dbg !62 -// CHECK:STDOUT: store i32 %n, ptr %.loc33.n, align 4, !dbg !62 -// CHECK:STDOUT: call void @_Z4TakeI14ExtraAlignmentEvRT_(ptr %a.var), !dbg !66 -// CHECK:STDOUT: ret void, !dbg !67 +// CHECK:STDOUT: ret void, !dbg !59 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CExtraAlignment.Main(i32 %n) #0 !dbg !61 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %a.var = alloca [16 x i8], align 16, !dbg !64 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !64 +// CHECK:STDOUT: call void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.34933c1c343bd645"(ptr %a.var), !dbg !64 +// CHECK:STDOUT: %.loc33.n = getelementptr inbounds nuw [16 x i8], ptr %a.var, i32 0, i32 0, !dbg !66 +// CHECK:STDOUT: store i32 %n, ptr %.loc33.n, align 4, !dbg !66 +// CHECK:STDOUT: call void @_Z4TakeI14ExtraAlignmentEvRT_(ptr %a.var), !dbg !70 +// CHECK:STDOUT: call void @"_CSelfDestruct.77c39a3d53f40ae2:core.Destroy.Core"(ptr %a.var), !dbg !64 +// CHECK:STDOUT: ret void, !dbg !71 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable // CHECK:STDOUT: define internal void @_ZN14ExtraAlignmentC1Ev.carbon_thunk.(ptr noundef %return) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !108 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !108 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !120 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !120 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Default.52e7708693d29223.Core:ExtraAlignment.Cpp"(ptr sret([16 x i8]) %return) #2 !dbg !69 { +// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Default.52e7708693d29223.Core:ExtraAlignment.Cpp"(ptr sret([16 x i8]) %return) #2 !dbg !73 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_ZN14ExtraAlignmentC1Ev.carbon_thunk.(ptr %return), !dbg !71 -// CHECK:STDOUT: ret void, !dbg !71 +// CHECK:STDOUT: call void @_ZN14ExtraAlignmentC1Ev.carbon_thunk.(ptr %return), !dbg !75 +// CHECK:STDOUT: ret void, !dbg !75 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z4TakeI14ExtraAlignmentEvRT_(ptr noundef nonnull align 16 dereferenceable(16)) #3 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPacked.Main(i32 %n) #0 !dbg !72 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.77c39a3d53f40ae2:core.Destroy.Core"(ptr %self) #0 !dbg !76 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %a.var = alloca [4 x i8], align 1, !dbg !75 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !75 -// CHECK:STDOUT: call void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.3e10857902c69c1a"(ptr %a.var), !dbg !75 -// CHECK:STDOUT: %.loc42.n = getelementptr inbounds nuw [4 x i8], ptr %a.var, i32 0, i32 0, !dbg !77 -// CHECK:STDOUT: store i32 %n, ptr %.loc42.n, align 4, !dbg !77 -// CHECK:STDOUT: call void @_Z4TakeI6PackedEvRT_(ptr %a.var), !dbg !81 -// CHECK:STDOUT: ret void, !dbg !82 +// CHECK:STDOUT: ret void, !dbg !78 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CPacked.Main(i32 %n) #0 !dbg !80 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %a.var = alloca [4 x i8], align 1, !dbg !83 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !83 +// CHECK:STDOUT: call void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.3e10857902c69c1a"(ptr %a.var), !dbg !83 +// CHECK:STDOUT: %.loc42.n = getelementptr inbounds nuw [4 x i8], ptr %a.var, i32 0, i32 0, !dbg !85 +// CHECK:STDOUT: store i32 %n, ptr %.loc42.n, align 4, !dbg !85 +// CHECK:STDOUT: call void @_Z4TakeI6PackedEvRT_(ptr %a.var), !dbg !89 +// CHECK:STDOUT: call void @"_CSelfDestruct.00b787a687567d9a:core.Destroy.Core"(ptr %a.var), !dbg !83 +// CHECK:STDOUT: ret void, !dbg !90 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable // CHECK:STDOUT: define internal void @_ZN6PackedC1Ev.carbon_thunk.(ptr noundef %return) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !110 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !110 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !122 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !122 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Default.ca2b917a39954a06.Core:Packed.Cpp"(ptr sret([4 x i8]) %return) #2 !dbg !84 { +// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Default.ca2b917a39954a06.Core:Packed.Cpp"(ptr sret([4 x i8]) %return) #2 !dbg !92 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_ZN6PackedC1Ev.carbon_thunk.(ptr %return), !dbg !86 -// CHECK:STDOUT: ret void, !dbg !86 +// CHECK:STDOUT: call void @_ZN6PackedC1Ev.carbon_thunk.(ptr %return), !dbg !94 +// CHECK:STDOUT: ret void, !dbg !94 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z4TakeI6PackedEvRT_(ptr noundef nonnull align 1 dereferenceable(4)) #3 // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.00b787a687567d9a:core.Destroy.Core"(ptr %self) #0 !dbg !95 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !97 +// 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)) #4 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.d4cda66b3640b619"(ptr sret([4 x i8]) %return) #0 !dbg !87 { -// CHECK:STDOUT: call void @"_COp:thunk:Default.c846b89dd79c7366.Core:NaturallyAligned.Cpp"(ptr %return), !dbg !90 -// CHECK:STDOUT: ret void, !dbg !91 +// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.d4cda66b3640b619"(ptr sret([4 x i8]) %return) #0 !dbg !99 { +// CHECK:STDOUT: call void @"_COp:thunk:Default.c846b89dd79c7366.Core:NaturallyAligned.Cpp"(ptr %return), !dbg !102 +// CHECK:STDOUT: ret void, !dbg !103 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.34933c1c343bd645"(ptr sret([16 x i8]) %return) #0 !dbg !92 { -// CHECK:STDOUT: call void @"_COp:thunk:Default.52e7708693d29223.Core:ExtraAlignment.Cpp"(ptr %return), !dbg !95 -// CHECK:STDOUT: ret void, !dbg !96 +// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.34933c1c343bd645"(ptr sret([16 x i8]) %return) #0 !dbg !104 { +// CHECK:STDOUT: call void @"_COp:thunk:Default.52e7708693d29223.Core:ExtraAlignment.Cpp"(ptr %return), !dbg !107 +// CHECK:STDOUT: ret void, !dbg !108 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.3e10857902c69c1a"(ptr sret([4 x i8]) %return) #0 !dbg !97 { -// CHECK:STDOUT: call void @"_COp:thunk:Default.ca2b917a39954a06.Core:Packed.Cpp"(ptr %return), !dbg !100 -// CHECK:STDOUT: ret void, !dbg !101 +// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.3e10857902c69c1a"(ptr sret([4 x i8]) %return) #0 !dbg !109 { +// CHECK:STDOUT: call void @"_COp:thunk:Default.ca2b917a39954a06.Core:Packed.Cpp"(ptr %return), !dbg !112 +// CHECK:STDOUT: ret void, !dbg !113 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -183,8 +204,8 @@ fn Packed(n: i32) { // CHECK:STDOUT: attributes #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!33} -// CHECK:STDOUT: !llvm.module.flags = !{!111, !112, !113, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!116} +// CHECK:STDOUT: !llvm.module.flags = !{!123, !124, !125, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!128} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -195,6 +216,8 @@ fn Packed(n: i32) { // CHECK:STDOUT: !35 = !{null, !34} // CHECK:STDOUT: !36 = !DISubroutineType(types: !35) // CHECK:STDOUT: !37 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !38 = !{null, !37} +// CHECK:STDOUT: !39 = !DISubroutineType(types: !38) // CHECK:STDOUT: !40 = !{!37} // CHECK:STDOUT: !41 = !DISubroutineType(types: !40) // CHECK:STDOUT: !42 = distinct !DISubprogram(name: "NaturallyAligned", linkageName: "_CNaturallyAligned.Main", scope: null, file: !32, line: 23, type: !36, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !53) @@ -206,46 +229,58 @@ fn Packed(n: i32) { // CHECK:STDOUT: !53 = !{!43} // CHECK:STDOUT: !54 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.c846b89dd79c7366.Core:NaturallyAligned.Cpp", scope: null, file: !32, line: 7, type: !41, spFlags: DISPFlagDefinition, unit: !33) // CHECK:STDOUT: !56 = !DILocation(line: 7, column: 8, scope: !54) -// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "ExtraAlignment", linkageName: "_CExtraAlignment.Main", scope: null, file: !32, line: 29, type: !36, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !68) -// CHECK:STDOUT: !58 = !DILocalVariable(arg: 1, scope: !57, type: !34) -// CHECK:STDOUT: !60 = !DILocation(line: 30, column: 3, scope: !57) -// CHECK:STDOUT: !62 = !DILocation(line: 33, column: 3, scope: !57) -// CHECK:STDOUT: !66 = !DILocation(line: 34, column: 3, scope: !57) -// CHECK:STDOUT: !67 = !DILocation(line: 29, column: 1, scope: !57) -// CHECK:STDOUT: !68 = !{!58} -// CHECK:STDOUT: !69 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.52e7708693d29223.Core:ExtraAlignment.Cpp", scope: null, file: !32, line: 11, type: !41, spFlags: DISPFlagDefinition, unit: !33) -// CHECK:STDOUT: !71 = !DILocation(line: 11, column: 20, scope: !69) -// CHECK:STDOUT: !72 = distinct !DISubprogram(name: "Packed", linkageName: "_CPacked.Main", scope: null, file: !32, line: 37, type: !36, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !83) -// CHECK:STDOUT: !73 = !DILocalVariable(arg: 1, scope: !72, type: !34) -// CHECK:STDOUT: !75 = !DILocation(line: 38, column: 3, scope: !72) -// CHECK:STDOUT: !77 = !DILocation(line: 42, column: 3, scope: !72) -// CHECK:STDOUT: !81 = !DILocation(line: 43, column: 3, scope: !72) -// CHECK:STDOUT: !82 = !DILocation(line: 37, column: 1, scope: !72) -// CHECK:STDOUT: !83 = !{!73} -// CHECK:STDOUT: !84 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.ca2b917a39954a06.Core:Packed.Cpp", scope: null, file: !32, line: 15, type: !41, spFlags: DISPFlagDefinition, unit: !33) -// CHECK:STDOUT: !86 = !DILocation(line: 15, column: 32, scope: !84) -// CHECK:STDOUT: !87 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.d4cda66b3640b619", scope: null, file: !26, line: 9, type: !41, spFlags: DISPFlagDefinition, unit: !33) -// CHECK:STDOUT: !90 = !DILocation(line: 9, column: 28, scope: !87) -// CHECK:STDOUT: !91 = !DILocation(line: 9, column: 21, scope: !87) -// CHECK:STDOUT: !92 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.34933c1c343bd645", scope: null, file: !26, line: 9, type: !41, spFlags: DISPFlagDefinition, unit: !33) -// CHECK:STDOUT: !95 = !DILocation(line: 9, column: 28, scope: !92) -// CHECK:STDOUT: !96 = !DILocation(line: 9, column: 21, scope: !92) -// CHECK:STDOUT: !97 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.3e10857902c69c1a", scope: null, file: !26, line: 9, type: !41, spFlags: DISPFlagDefinition, unit: !33) -// CHECK:STDOUT: !100 = !DILocation(line: 9, column: 28, scope: !97) -// CHECK:STDOUT: !101 = !DILocation(line: 9, column: 21, scope: !97) -// CHECK:STDOUT: !102 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !103 = !{!"omnipotent char", !102, i64 0} -// CHECK:STDOUT: !104 = !{!"any pointer", !103, i64 0} -// CHECK:STDOUT: !105 = !{!"p1 _ZTS16NaturallyAligned", !104, i64 0} -// CHECK:STDOUT: !106 = !{!105, !105, i64 0} -// CHECK:STDOUT: !107 = !{!"p1 _ZTS14ExtraAlignment", !104, i64 0} -// CHECK:STDOUT: !108 = !{!107, !107, i64 0} -// CHECK:STDOUT: !109 = !{!"p1 _ZTS6Packed", !104, i64 0} -// CHECK:STDOUT: !110 = !{!109, !109, i64 0} -// CHECK:STDOUT: !111 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !112 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !113 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !114 = !{!"int", !103, i64 0} -// CHECK:STDOUT: !115 = !{!"__libc_errno", !114, i64 0} -// CHECK:STDOUT: !116 = !{!115, !114, i64 0} +// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.89af5f7a0692dfe8:core.Destroy.Core", scope: null, file: !32, line: 24, type: !39, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !60) +// CHECK:STDOUT: !58 = !DILocalVariable(arg: 1, scope: !57, type: !37) +// CHECK:STDOUT: !59 = !DILocation(line: 24, column: 3, scope: !57) +// CHECK:STDOUT: !60 = !{!58} +// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "ExtraAlignment", linkageName: "_CExtraAlignment.Main", scope: null, file: !32, line: 29, type: !36, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !72) +// CHECK:STDOUT: !62 = !DILocalVariable(arg: 1, scope: !61, type: !34) +// CHECK:STDOUT: !64 = !DILocation(line: 30, column: 3, scope: !61) +// CHECK:STDOUT: !66 = !DILocation(line: 33, column: 3, scope: !61) +// CHECK:STDOUT: !70 = !DILocation(line: 34, column: 3, scope: !61) +// CHECK:STDOUT: !71 = !DILocation(line: 29, column: 1, scope: !61) +// CHECK:STDOUT: !72 = !{!62} +// CHECK:STDOUT: !73 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.52e7708693d29223.Core:ExtraAlignment.Cpp", scope: null, file: !32, line: 11, type: !41, spFlags: DISPFlagDefinition, unit: !33) +// CHECK:STDOUT: !75 = !DILocation(line: 11, column: 20, scope: !73) +// CHECK:STDOUT: !76 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.77c39a3d53f40ae2:core.Destroy.Core", scope: null, file: !32, line: 30, type: !39, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !79) +// CHECK:STDOUT: !77 = !DILocalVariable(arg: 1, scope: !76, type: !37) +// CHECK:STDOUT: !78 = !DILocation(line: 30, column: 3, scope: !76) +// CHECK:STDOUT: !79 = !{!77} +// CHECK:STDOUT: !80 = distinct !DISubprogram(name: "Packed", linkageName: "_CPacked.Main", scope: null, file: !32, line: 37, type: !36, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !91) +// CHECK:STDOUT: !81 = !DILocalVariable(arg: 1, scope: !80, type: !34) +// CHECK:STDOUT: !83 = !DILocation(line: 38, column: 3, scope: !80) +// CHECK:STDOUT: !85 = !DILocation(line: 42, column: 3, scope: !80) +// CHECK:STDOUT: !89 = !DILocation(line: 43, column: 3, scope: !80) +// CHECK:STDOUT: !90 = !DILocation(line: 37, column: 1, scope: !80) +// CHECK:STDOUT: !91 = !{!81} +// CHECK:STDOUT: !92 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.ca2b917a39954a06.Core:Packed.Cpp", scope: null, file: !32, line: 15, type: !41, spFlags: DISPFlagDefinition, unit: !33) +// CHECK:STDOUT: !94 = !DILocation(line: 15, column: 32, scope: !92) +// CHECK:STDOUT: !95 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.00b787a687567d9a:core.Destroy.Core", scope: null, file: !32, line: 38, type: !39, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !98) +// CHECK:STDOUT: !96 = !DILocalVariable(arg: 1, scope: !95, type: !37) +// CHECK:STDOUT: !97 = !DILocation(line: 38, column: 3, scope: !95) +// CHECK:STDOUT: !98 = !{!96} +// CHECK:STDOUT: !99 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.d4cda66b3640b619", scope: null, file: !26, line: 9, type: !41, spFlags: DISPFlagDefinition, unit: !33) +// CHECK:STDOUT: !102 = !DILocation(line: 9, column: 28, scope: !99) +// CHECK:STDOUT: !103 = !DILocation(line: 9, column: 21, scope: !99) +// CHECK:STDOUT: !104 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.34933c1c343bd645", scope: null, file: !26, line: 9, type: !41, spFlags: DISPFlagDefinition, unit: !33) +// CHECK:STDOUT: !107 = !DILocation(line: 9, column: 28, scope: !104) +// CHECK:STDOUT: !108 = !DILocation(line: 9, column: 21, scope: !104) +// CHECK:STDOUT: !109 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.3e10857902c69c1a", scope: null, file: !26, line: 9, type: !41, spFlags: DISPFlagDefinition, unit: !33) +// CHECK:STDOUT: !112 = !DILocation(line: 9, column: 28, scope: !109) +// CHECK:STDOUT: !113 = !DILocation(line: 9, column: 21, scope: !109) +// CHECK:STDOUT: !114 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !115 = !{!"omnipotent char", !114, i64 0} +// CHECK:STDOUT: !116 = !{!"any pointer", !115, i64 0} +// CHECK:STDOUT: !117 = !{!"p1 _ZTS16NaturallyAligned", !116, i64 0} +// CHECK:STDOUT: !118 = !{!117, !117, i64 0} +// CHECK:STDOUT: !119 = !{!"p1 _ZTS14ExtraAlignment", !116, i64 0} +// CHECK:STDOUT: !120 = !{!119, !119, i64 0} +// CHECK:STDOUT: !121 = !{!"p1 _ZTS6Packed", !116, i64 0} +// CHECK:STDOUT: !122 = !{!121, !121, i64 0} +// CHECK:STDOUT: !123 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !124 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !125 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !126 = !{!"int", !115, i64 0} +// CHECK:STDOUT: !127 = !{!"__libc_errno", !126, i64 0} +// CHECK:STDOUT: !128 = !{!127, !126, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/class/import/constructor.carbon b/toolchain/lower/testdata/interop/cpp/class/import/constructor.carbon index 3415c54ffcee..8fb48a0e6e87 100644 --- a/toolchain/lower/testdata/interop/cpp/class/import/constructor.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/import/constructor.carbon @@ -183,6 +183,7 @@ fn Four() { // CHECK:STDOUT: %.loc7_26.1.temp = alloca [8 x i8], align 4, !dbg !27 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_26.1.temp), !dbg !27 // CHECK:STDOUT: call void @_ZN1CC1Ev.carbon_thunk.(ptr %.loc7_26.1.temp), !dbg !27 +// CHECK:STDOUT: call void @"_CSelfDestruct.417eccf5eb8addbd:core.Destroy.Core"(ptr %.loc7_26.1.temp), !dbg !27 // CHECK:STDOUT: ret void, !dbg !30 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -190,27 +191,34 @@ fn Four() { // CHECK:STDOUT: define internal void @_ZN1CC1Ev.carbon_thunk.(ptr noundef %return) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !40 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !40 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !44 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !44 // CHECK:STDOUT: call void @_ZN1CC2Ev(ptr noundef nonnull align 4 dereferenceable(8) %0) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CG.Main() #0 !dbg !31 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.417eccf5eb8addbd:core.Destroy.Core"(ptr %self) #0 !dbg !31 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc11_19.2.temp = alloca [8 x i8], align 4, !dbg !32 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc11_19.2.temp), !dbg !32 -// CHECK:STDOUT: call void @_ZN1CC1Ev.carbon_thunk_tuple.(ptr %.loc11_19.2.temp), !dbg !32 -// CHECK:STDOUT: ret void, !dbg !35 +// CHECK:STDOUT: ret void, !dbg !33 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CG.Main() #0 !dbg !35 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %.loc11_19.2.temp = alloca [8 x i8], align 4, !dbg !36 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc11_19.2.temp), !dbg !36 +// CHECK:STDOUT: call void @_ZN1CC1Ev.carbon_thunk_tuple.(ptr %.loc11_19.2.temp), !dbg !36 +// CHECK:STDOUT: call void @"_CSelfDestruct.417eccf5eb8addbd:core.Destroy.Core"(ptr %.loc11_19.2.temp), !dbg !36 +// CHECK:STDOUT: ret void, !dbg !39 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define internal void @_ZN1CC1Ev.carbon_thunk_tuple.(ptr noundef %return) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !40 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !40 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !44 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !44 // CHECK:STDOUT: call void @_ZN1CC2Ev(ptr noundef nonnull align 4 dereferenceable(8) %0) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -222,12 +230,12 @@ fn Four() { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN1CC2Ev(ptr noundef nonnull align 4 dereferenceable(8) %this) unnamed_addr #3 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !40 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !44 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: %x_ = getelementptr inbounds nuw %class.C, ptr %this1, i32 0, i32 0 -// CHECK:STDOUT: store i32 8, ptr %x_, align 4, !tbaa !43 +// CHECK:STDOUT: store i32 8, ptr %x_, align 4, !tbaa !47 // CHECK:STDOUT: %y_ = getelementptr inbounds nuw %class.C, ptr %this1, i32 0, i32 1 -// CHECK:STDOUT: store i32 9, ptr %y_, align 4, !tbaa !44 +// CHECK:STDOUT: store i32 9, ptr %y_, align 4, !tbaa !48 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: @@ -240,8 +248,8 @@ fn Four() { // CHECK:STDOUT: attributes #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!19} -// CHECK:STDOUT: !llvm.module.flags = !{!45, !46, !47, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!49} +// CHECK:STDOUT: !llvm.module.flags = !{!49, !50, !51, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!53} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -249,26 +257,33 @@ fn Four() { // CHECK:STDOUT: !19 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !18, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) // CHECK:STDOUT: !21 = !{null} // CHECK:STDOUT: !22 = !DISubroutineType(types: !21) +// CHECK:STDOUT: !23 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !24 = !{null, !23} +// CHECK:STDOUT: !25 = !DISubroutineType(types: !24) // CHECK:STDOUT: !26 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !18, line: 6, type: !22, spFlags: DISPFlagDefinition, unit: !19) // CHECK:STDOUT: !27 = !DILocation(line: 7, column: 18, scope: !26) // CHECK:STDOUT: !30 = !DILocation(line: 6, column: 1, scope: !26) -// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !18, line: 10, type: !22, spFlags: DISPFlagDefinition, unit: !19) -// CHECK:STDOUT: !32 = !DILocation(line: 11, column: 18, scope: !31) -// CHECK:STDOUT: !35 = !DILocation(line: 10, column: 1, scope: !31) -// CHECK:STDOUT: !36 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !37 = !{!"omnipotent char", !36, i64 0} -// CHECK:STDOUT: !38 = !{!"any pointer", !37, i64 0} -// CHECK:STDOUT: !39 = !{!"p1 _ZTS1C", !38, i64 0} -// CHECK:STDOUT: !40 = !{!39, !39, i64 0} -// CHECK:STDOUT: !41 = !{!"int", !37, i64 0} -// CHECK:STDOUT: !42 = !{!"_ZTS1C", !41, i64 0, !41, i64 4} -// CHECK:STDOUT: !43 = !{!42, !41, i64 0} -// CHECK:STDOUT: !44 = !{!42, !41, i64 4} -// CHECK:STDOUT: !45 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !46 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !47 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !48 = !{!"__libc_errno", !41, i64 0} -// CHECK:STDOUT: !49 = !{!48, !41, i64 0} +// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.417eccf5eb8addbd:core.Destroy.Core", scope: null, file: !18, line: 7, type: !25, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !34) +// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !31, type: !23) +// CHECK:STDOUT: !33 = !DILocation(line: 7, column: 18, scope: !31) +// CHECK:STDOUT: !34 = !{!32} +// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !18, line: 10, type: !22, spFlags: DISPFlagDefinition, unit: !19) +// CHECK:STDOUT: !36 = !DILocation(line: 11, column: 18, scope: !35) +// CHECK:STDOUT: !39 = !DILocation(line: 10, column: 1, scope: !35) +// CHECK:STDOUT: !40 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !41 = !{!"omnipotent char", !40, i64 0} +// CHECK:STDOUT: !42 = !{!"any pointer", !41, i64 0} +// CHECK:STDOUT: !43 = !{!"p1 _ZTS1C", !42, i64 0} +// CHECK:STDOUT: !44 = !{!43, !43, i64 0} +// CHECK:STDOUT: !45 = !{!"int", !41, i64 0} +// CHECK:STDOUT: !46 = !{!"_ZTS1C", !45, i64 0, !45, i64 4} +// CHECK:STDOUT: !47 = !{!46, !45, i64 0} +// CHECK:STDOUT: !48 = !{!46, !45, i64 4} +// CHECK:STDOUT: !49 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !50 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !51 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !52 = !{!"__libc_errno", !45, i64 0} +// CHECK:STDOUT: !53 = !{!52, !45, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'implicit_default.carbon' @@ -281,50 +296,57 @@ fn Four() { // CHECK:STDOUT: $_ZN1CC2Ev = comdat any // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !54 { +// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !58 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca [8 x i8], align 4, !dbg !55 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !55 -// CHECK:STDOUT: call void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c"(ptr %_.var), !dbg !55 -// CHECK:STDOUT: ret void, !dbg !57 +// CHECK:STDOUT: %_.var = alloca [8 x i8], align 4, !dbg !59 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !59 +// CHECK:STDOUT: call void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c"(ptr %_.var), !dbg !59 +// CHECK:STDOUT: call void @"_CSelfDestruct.417eccf5eb8addbd:core.Destroy.Core"(ptr %_.var), !dbg !59 +// CHECK:STDOUT: ret void, !dbg !61 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define internal void @_ZN1CC1Ev.carbon_thunk.(ptr noundef %return) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !40 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !40 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !44 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !44 // CHECK:STDOUT: call void @_ZN1CC2Ev(ptr noundef nonnull align 4 dereferenceable(8) %0) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp"(ptr sret([8 x i8]) %return) #2 !dbg !59 { +// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp"(ptr sret([8 x i8]) %return) #2 !dbg !63 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_ZN1CC1Ev.carbon_thunk.(ptr %return), !dbg !60 -// CHECK:STDOUT: ret void, !dbg !60 +// CHECK:STDOUT: call void @_ZN1CC1Ev.carbon_thunk.(ptr %return), !dbg !64 +// CHECK:STDOUT: ret void, !dbg !64 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.417eccf5eb8addbd:core.Destroy.Core"(ptr %self) #0 !dbg !65 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !67 // 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)) #3 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c"(ptr sret([8 x i8]) %return) #0 !dbg !61 { -// CHECK:STDOUT: call void @"_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp"(ptr %return), !dbg !64 -// CHECK:STDOUT: ret void, !dbg !65 +// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c"(ptr sret([8 x i8]) %return) #0 !dbg !69 { +// CHECK:STDOUT: call void @"_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp"(ptr %return), !dbg !72 +// CHECK:STDOUT: ret void, !dbg !73 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN1CC2Ev(ptr noundef nonnull align 4 dereferenceable(8) %this) unnamed_addr #4 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !40 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !44 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: %x_ = getelementptr inbounds nuw %class.C.18, ptr %this1, i32 0, i32 0 -// CHECK:STDOUT: store i32 8, ptr %x_, align 4, !tbaa !43 +// CHECK:STDOUT: store i32 8, ptr %x_, align 4, !tbaa !47 // CHECK:STDOUT: %y_ = getelementptr inbounds nuw %class.C.18, ptr %this1, i32 0, i32 1 -// CHECK:STDOUT: store i32 9, ptr %y_, align 4, !tbaa !44 +// CHECK:STDOUT: store i32 9, ptr %y_, align 4, !tbaa !48 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: @@ -334,9 +356,9 @@ fn Four() { // CHECK:STDOUT: attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: attributes #4 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!51} -// CHECK:STDOUT: !llvm.module.flags = !{!45, !46, !47, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!49} +// CHECK:STDOUT: !llvm.dbg.cu = !{!55} +// CHECK:STDOUT: !llvm.module.flags = !{!49, !50, !51, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!53} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -344,33 +366,39 @@ fn Four() { // CHECK:STDOUT: !21 = !{null} // CHECK:STDOUT: !22 = !DISubroutineType(types: !21) // CHECK:STDOUT: !23 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !36 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !37 = !{!"omnipotent char", !36, i64 0} -// CHECK:STDOUT: !38 = !{!"any pointer", !37, i64 0} -// CHECK:STDOUT: !39 = !{!"p1 _ZTS1C", !38, i64 0} -// CHECK:STDOUT: !40 = !{!39, !39, i64 0} -// CHECK:STDOUT: !41 = !{!"int", !37, i64 0} -// CHECK:STDOUT: !42 = !{!"_ZTS1C", !41, i64 0, !41, i64 4} -// CHECK:STDOUT: !43 = !{!42, !41, i64 0} -// CHECK:STDOUT: !44 = !{!42, !41, i64 4} -// CHECK:STDOUT: !45 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !46 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !47 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !48 = !{!"__libc_errno", !41, i64 0} -// CHECK:STDOUT: !49 = !{!48, !41, i64 0} -// CHECK:STDOUT: !50 = !DIFile(filename: "implicit_default.carbon", directory: "") -// CHECK:STDOUT: !51 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !50, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !52 = !{!23} -// CHECK:STDOUT: !53 = !DISubroutineType(types: !52) -// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !50, line: 6, type: !22, spFlags: DISPFlagDefinition, unit: !51) -// CHECK:STDOUT: !55 = !DILocation(line: 7, column: 3, scope: !54) -// CHECK:STDOUT: !57 = !DILocation(line: 6, column: 1, scope: !54) -// CHECK:STDOUT: !58 = !DIFile(filename: "./default.h", directory: "") -// CHECK:STDOUT: !59 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp", scope: null, file: !58, line: 4, type: !53, spFlags: DISPFlagDefinition, unit: !51) -// CHECK:STDOUT: !60 = !DILocation(line: 4, column: 3, scope: !59) -// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c", scope: null, file: !12, line: 9, type: !53, spFlags: DISPFlagDefinition, unit: !51) -// CHECK:STDOUT: !64 = !DILocation(line: 9, column: 28, scope: !61) -// CHECK:STDOUT: !65 = !DILocation(line: 9, column: 21, scope: !61) +// CHECK:STDOUT: !24 = !{null, !23} +// CHECK:STDOUT: !25 = !DISubroutineType(types: !24) +// CHECK:STDOUT: !40 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !41 = !{!"omnipotent char", !40, i64 0} +// CHECK:STDOUT: !42 = !{!"any pointer", !41, i64 0} +// CHECK:STDOUT: !43 = !{!"p1 _ZTS1C", !42, i64 0} +// CHECK:STDOUT: !44 = !{!43, !43, i64 0} +// CHECK:STDOUT: !45 = !{!"int", !41, i64 0} +// CHECK:STDOUT: !46 = !{!"_ZTS1C", !45, i64 0, !45, i64 4} +// CHECK:STDOUT: !47 = !{!46, !45, i64 0} +// CHECK:STDOUT: !48 = !{!46, !45, i64 4} +// CHECK:STDOUT: !49 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !50 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !51 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !52 = !{!"__libc_errno", !45, i64 0} +// CHECK:STDOUT: !53 = !{!52, !45, i64 0} +// CHECK:STDOUT: !54 = !DIFile(filename: "implicit_default.carbon", directory: "") +// CHECK:STDOUT: !55 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !54, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !56 = !{!23} +// CHECK:STDOUT: !57 = !DISubroutineType(types: !56) +// CHECK:STDOUT: !58 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !54, line: 6, type: !22, spFlags: DISPFlagDefinition, unit: !55) +// CHECK:STDOUT: !59 = !DILocation(line: 7, column: 3, scope: !58) +// CHECK:STDOUT: !61 = !DILocation(line: 6, column: 1, scope: !58) +// CHECK:STDOUT: !62 = !DIFile(filename: "./default.h", directory: "") +// CHECK:STDOUT: !63 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp", scope: null, file: !62, line: 4, type: !57, spFlags: DISPFlagDefinition, unit: !55) +// CHECK:STDOUT: !64 = !DILocation(line: 4, column: 3, scope: !63) +// CHECK:STDOUT: !65 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.417eccf5eb8addbd:core.Destroy.Core", scope: null, file: !54, line: 7, type: !25, spFlags: DISPFlagDefinition, unit: !55, retainedNodes: !68) +// CHECK:STDOUT: !66 = !DILocalVariable(arg: 1, scope: !65, type: !23) +// CHECK:STDOUT: !67 = !DILocation(line: 7, column: 3, scope: !65) +// CHECK:STDOUT: !68 = !{!66} +// CHECK:STDOUT: !69 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c", scope: null, file: !12, line: 9, type: !57, spFlags: DISPFlagDefinition, unit: !55) +// CHECK:STDOUT: !72 = !DILocation(line: 9, column: 28, scope: !69) +// CHECK:STDOUT: !73 = !DILocation(line: 9, column: 21, scope: !69) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'defaulted_default.carbon' @@ -386,80 +414,96 @@ fn Four() { // CHECK:STDOUT: $_ZN26ExplicitlyDefaultedDefaultC2Ev = comdat any // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !68 { +// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !76 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc8_65.1.temp = alloca [4 x i8], align 4, !dbg !69 -// CHECK:STDOUT: %_.var.loc9 = alloca [4 x i8], align 4, !dbg !72 -// CHECK:STDOUT: %.loc12_65.1.temp = alloca [4 x i8], align 4, !dbg !74 -// CHECK:STDOUT: %_.var.loc13 = alloca [4 x i8], align 4, !dbg !77 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc8_65.1.temp), !dbg !69 -// CHECK:STDOUT: call void @_ZN26ImplicitlyDefaultedDefaultC1Ev.carbon_thunk.(ptr %.loc8_65.1.temp), !dbg !69 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc9), !dbg !72 -// CHECK:STDOUT: call void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.c20bae04b665a8c9"(ptr %_.var.loc9), !dbg !72 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_65.1.temp), !dbg !74 -// CHECK:STDOUT: call void @_ZN26ExplicitlyDefaultedDefaultC1Ev.carbon_thunk.(ptr %.loc12_65.1.temp), !dbg !74 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc13), !dbg !77 -// CHECK:STDOUT: call void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.055ae7235dade271"(ptr %_.var.loc13), !dbg !77 -// CHECK:STDOUT: ret void, !dbg !79 +// CHECK:STDOUT: %.loc8_65.1.temp = alloca [4 x i8], align 4, !dbg !77 +// CHECK:STDOUT: %_.var.loc9 = alloca [4 x i8], align 4, !dbg !80 +// CHECK:STDOUT: %.loc12_65.1.temp = alloca [4 x i8], align 4, !dbg !82 +// CHECK:STDOUT: %_.var.loc13 = alloca [4 x i8], align 4, !dbg !85 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc8_65.1.temp), !dbg !77 +// CHECK:STDOUT: call void @_ZN26ImplicitlyDefaultedDefaultC1Ev.carbon_thunk.(ptr %.loc8_65.1.temp), !dbg !77 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc9), !dbg !80 +// CHECK:STDOUT: call void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.c20bae04b665a8c9"(ptr %_.var.loc9), !dbg !80 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_65.1.temp), !dbg !82 +// CHECK:STDOUT: call void @_ZN26ExplicitlyDefaultedDefaultC1Ev.carbon_thunk.(ptr %.loc12_65.1.temp), !dbg !82 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc13), !dbg !85 +// CHECK:STDOUT: call void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.055ae7235dade271"(ptr %_.var.loc13), !dbg !85 +// CHECK:STDOUT: call void @"_CSelfDestruct.681e36e00927c39d:core.Destroy.Core"(ptr %_.var.loc13), !dbg !85 +// CHECK:STDOUT: call void @"_CSelfDestruct.681e36e00927c39d:core.Destroy.Core"(ptr %.loc12_65.1.temp), !dbg !82 +// CHECK:STDOUT: call void @"_CSelfDestruct.20792ac67a297dbd:core.Destroy.Core"(ptr %_.var.loc9), !dbg !80 +// CHECK:STDOUT: call void @"_CSelfDestruct.20792ac67a297dbd:core.Destroy.Core"(ptr %.loc8_65.1.temp), !dbg !77 +// CHECK:STDOUT: ret void, !dbg !87 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable // CHECK:STDOUT: define internal void @_ZN26ImplicitlyDefaultedDefaultC1Ev.carbon_thunk.(ptr noundef %return) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !96 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !96 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !112 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !112 // CHECK:STDOUT: call void @_ZN26ImplicitlyDefaultedDefaultC2Ev(ptr noundef nonnull align 4 dereferenceable(4) %0) #0 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Default.48fb4c4d31b7d0bf.Core:ImplicitlyDefaultedDefault.Cpp"(ptr sret([4 x i8]) %return) #2 !dbg !81 { +// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Default.48fb4c4d31b7d0bf.Core:ImplicitlyDefaultedDefault.Cpp"(ptr sret([4 x i8]) %return) #2 !dbg !89 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_ZN26ImplicitlyDefaultedDefaultC1Ev.carbon_thunk.(ptr %return), !dbg !82 -// CHECK:STDOUT: ret void, !dbg !82 +// CHECK:STDOUT: call void @_ZN26ImplicitlyDefaultedDefaultC1Ev.carbon_thunk.(ptr %return), !dbg !90 +// CHECK:STDOUT: ret void, !dbg !90 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable // CHECK:STDOUT: define internal void @_ZN26ExplicitlyDefaultedDefaultC1Ev.carbon_thunk.(ptr noundef %return) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !100 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !100 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !116 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !116 // CHECK:STDOUT: call void @_ZN26ExplicitlyDefaultedDefaultC2Ev(ptr noundef nonnull align 4 dereferenceable(4) %0) #0 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Default.f7ca6602362234ee.Core:ExplicitlyDefaultedDefault.Cpp"(ptr sret([4 x i8]) %return) #2 !dbg !83 { +// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Default.f7ca6602362234ee.Core:ExplicitlyDefaultedDefault.Cpp"(ptr sret([4 x i8]) %return) #2 !dbg !91 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_ZN26ExplicitlyDefaultedDefaultC1Ev.carbon_thunk.(ptr %return), !dbg !84 -// CHECK:STDOUT: ret void, !dbg !84 +// CHECK:STDOUT: call void @_ZN26ExplicitlyDefaultedDefaultC1Ev.carbon_thunk.(ptr %return), !dbg !92 +// CHECK:STDOUT: ret void, !dbg !92 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.681e36e00927c39d:core.Destroy.Core"(ptr %self) #0 !dbg !93 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !95 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.20792ac67a297dbd:core.Destroy.Core"(ptr %self) #0 !dbg !97 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !99 // 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)) #3 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.c20bae04b665a8c9"(ptr sret([4 x i8]) %return) #0 !dbg !85 { -// CHECK:STDOUT: call void @"_COp:thunk:Default.48fb4c4d31b7d0bf.Core:ImplicitlyDefaultedDefault.Cpp"(ptr %return), !dbg !88 -// CHECK:STDOUT: ret void, !dbg !89 +// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.c20bae04b665a8c9"(ptr sret([4 x i8]) %return) #0 !dbg !101 { +// CHECK:STDOUT: call void @"_COp:thunk:Default.48fb4c4d31b7d0bf.Core:ImplicitlyDefaultedDefault.Cpp"(ptr %return), !dbg !104 +// CHECK:STDOUT: ret void, !dbg !105 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.055ae7235dade271"(ptr sret([4 x i8]) %return) #0 !dbg !90 { -// CHECK:STDOUT: call void @"_COp:thunk:Default.f7ca6602362234ee.Core:ExplicitlyDefaultedDefault.Cpp"(ptr %return), !dbg !93 -// CHECK:STDOUT: ret void, !dbg !94 +// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.055ae7235dade271"(ptr sret([4 x i8]) %return) #0 !dbg !106 { +// CHECK:STDOUT: call void @"_COp:thunk:Default.f7ca6602362234ee.Core:ExplicitlyDefaultedDefault.Cpp"(ptr %return), !dbg !109 +// CHECK:STDOUT: ret void, !dbg !110 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress nounwind uwtable // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN26ImplicitlyDefaultedDefaultC2Ev(ptr noundef nonnull align 4 dereferenceable(4) %this) unnamed_addr #4 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !96 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !112 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: %x_ = getelementptr inbounds nuw %struct.ImplicitlyDefaultedDefault, ptr %this1, i32 0, i32 0 -// CHECK:STDOUT: store i32 1, ptr %x_, align 4, !tbaa !98 +// CHECK:STDOUT: store i32 1, ptr %x_, align 4, !tbaa !114 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: @@ -467,14 +511,16 @@ fn Four() { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN26ExplicitlyDefaultedDefaultC2Ev(ptr noundef nonnull align 4 dereferenceable(4) %this) unnamed_addr #5 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !100 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !116 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: %x_ = getelementptr inbounds nuw %struct.ExplicitlyDefaultedDefault, ptr %this1, i32 0, i32 0 -// CHECK:STDOUT: store i32 1, ptr %x_, align 4, !tbaa !102 +// CHECK:STDOUT: store i32 1, ptr %x_, align 4, !tbaa !118 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.681e36e00927c39d:core.Destroy.Core", { 1, 0 } +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.20792ac67a297dbd:core.Destroy.Core", { 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 3, 2, 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -484,9 +530,9 @@ fn Four() { // CHECK:STDOUT: attributes #4 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } // CHECK:STDOUT: attributes #5 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!67} -// CHECK:STDOUT: !llvm.module.flags = !{!45, !46, !47, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!49} +// CHECK:STDOUT: !llvm.dbg.cu = !{!75} +// CHECK:STDOUT: !llvm.module.flags = !{!49, !50, !51, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!53} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -494,44 +540,54 @@ fn Four() { // CHECK:STDOUT: !21 = !{null} // CHECK:STDOUT: !22 = !DISubroutineType(types: !21) // CHECK:STDOUT: !23 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !36 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !37 = !{!"omnipotent char", !36, i64 0} -// CHECK:STDOUT: !38 = !{!"any pointer", !37, i64 0} -// CHECK:STDOUT: !41 = !{!"int", !37, i64 0} -// CHECK:STDOUT: !45 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !46 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !47 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !48 = !{!"__libc_errno", !41, i64 0} -// CHECK:STDOUT: !49 = !{!48, !41, i64 0} -// CHECK:STDOUT: !52 = !{!23} -// CHECK:STDOUT: !53 = !DISubroutineType(types: !52) -// CHECK:STDOUT: !66 = !DIFile(filename: "defaulted_default.carbon", directory: "") -// CHECK:STDOUT: !67 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !66, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !68 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !66, line: 6, type: !22, spFlags: DISPFlagDefinition, unit: !67) -// CHECK:STDOUT: !69 = !DILocation(line: 8, column: 7, scope: !68) -// CHECK:STDOUT: !72 = !DILocation(line: 9, column: 3, scope: !68) -// CHECK:STDOUT: !74 = !DILocation(line: 12, column: 7, scope: !68) -// CHECK:STDOUT: !77 = !DILocation(line: 13, column: 3, scope: !68) -// CHECK:STDOUT: !79 = !DILocation(line: 6, column: 1, scope: !68) -// CHECK:STDOUT: !80 = !DIFile(filename: "./defaulted_default.h", directory: "") -// CHECK:STDOUT: !81 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.48fb4c4d31b7d0bf.Core:ImplicitlyDefaultedDefault.Cpp", scope: null, file: !80, line: 2, type: !53, spFlags: DISPFlagDefinition, unit: !67) -// CHECK:STDOUT: !82 = !DILocation(line: 2, column: 8, scope: !81) -// CHECK:STDOUT: !83 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.f7ca6602362234ee.Core:ExplicitlyDefaultedDefault.Cpp", scope: null, file: !80, line: 7, type: !53, spFlags: DISPFlagDefinition, unit: !67) -// CHECK:STDOUT: !84 = !DILocation(line: 7, column: 3, scope: !83) -// CHECK:STDOUT: !85 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.c20bae04b665a8c9", scope: null, file: !12, line: 9, type: !53, spFlags: DISPFlagDefinition, unit: !67) -// CHECK:STDOUT: !88 = !DILocation(line: 9, column: 28, scope: !85) -// CHECK:STDOUT: !89 = !DILocation(line: 9, column: 21, scope: !85) -// CHECK:STDOUT: !90 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.055ae7235dade271", scope: null, file: !12, line: 9, type: !53, spFlags: DISPFlagDefinition, unit: !67) -// CHECK:STDOUT: !93 = !DILocation(line: 9, column: 28, scope: !90) -// CHECK:STDOUT: !94 = !DILocation(line: 9, column: 21, scope: !90) -// CHECK:STDOUT: !95 = !{!"p1 _ZTS26ImplicitlyDefaultedDefault", !38, i64 0} -// CHECK:STDOUT: !96 = !{!95, !95, i64 0} -// CHECK:STDOUT: !97 = !{!"_ZTS26ImplicitlyDefaultedDefault", !41, i64 0} -// CHECK:STDOUT: !98 = !{!97, !41, i64 0} -// CHECK:STDOUT: !99 = !{!"p1 _ZTS26ExplicitlyDefaultedDefault", !38, i64 0} -// CHECK:STDOUT: !100 = !{!99, !99, i64 0} -// CHECK:STDOUT: !101 = !{!"_ZTS26ExplicitlyDefaultedDefault", !41, i64 0} -// CHECK:STDOUT: !102 = !{!101, !41, i64 0} +// CHECK:STDOUT: !24 = !{null, !23} +// CHECK:STDOUT: !25 = !DISubroutineType(types: !24) +// CHECK:STDOUT: !40 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !41 = !{!"omnipotent char", !40, i64 0} +// CHECK:STDOUT: !42 = !{!"any pointer", !41, i64 0} +// CHECK:STDOUT: !45 = !{!"int", !41, i64 0} +// CHECK:STDOUT: !49 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !50 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !51 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !52 = !{!"__libc_errno", !45, i64 0} +// CHECK:STDOUT: !53 = !{!52, !45, i64 0} +// CHECK:STDOUT: !56 = !{!23} +// CHECK:STDOUT: !57 = !DISubroutineType(types: !56) +// CHECK:STDOUT: !74 = !DIFile(filename: "defaulted_default.carbon", directory: "") +// CHECK:STDOUT: !75 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !74, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !76 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !74, line: 6, type: !22, spFlags: DISPFlagDefinition, unit: !75) +// CHECK:STDOUT: !77 = !DILocation(line: 8, column: 7, scope: !76) +// CHECK:STDOUT: !80 = !DILocation(line: 9, column: 3, scope: !76) +// CHECK:STDOUT: !82 = !DILocation(line: 12, column: 7, scope: !76) +// CHECK:STDOUT: !85 = !DILocation(line: 13, column: 3, scope: !76) +// CHECK:STDOUT: !87 = !DILocation(line: 6, column: 1, scope: !76) +// CHECK:STDOUT: !88 = !DIFile(filename: "./defaulted_default.h", directory: "") +// CHECK:STDOUT: !89 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.48fb4c4d31b7d0bf.Core:ImplicitlyDefaultedDefault.Cpp", scope: null, file: !88, line: 2, type: !57, spFlags: DISPFlagDefinition, unit: !75) +// CHECK:STDOUT: !90 = !DILocation(line: 2, column: 8, scope: !89) +// CHECK:STDOUT: !91 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.f7ca6602362234ee.Core:ExplicitlyDefaultedDefault.Cpp", scope: null, file: !88, line: 7, type: !57, spFlags: DISPFlagDefinition, unit: !75) +// CHECK:STDOUT: !92 = !DILocation(line: 7, column: 3, scope: !91) +// CHECK:STDOUT: !93 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.681e36e00927c39d:core.Destroy.Core", scope: null, file: !74, line: 13, type: !25, spFlags: DISPFlagDefinition, unit: !75, retainedNodes: !96) +// CHECK:STDOUT: !94 = !DILocalVariable(arg: 1, scope: !93, type: !23) +// CHECK:STDOUT: !95 = !DILocation(line: 13, column: 3, scope: !93) +// CHECK:STDOUT: !96 = !{!94} +// CHECK:STDOUT: !97 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.20792ac67a297dbd:core.Destroy.Core", scope: null, file: !74, line: 9, type: !25, spFlags: DISPFlagDefinition, unit: !75, retainedNodes: !100) +// CHECK:STDOUT: !98 = !DILocalVariable(arg: 1, scope: !97, type: !23) +// CHECK:STDOUT: !99 = !DILocation(line: 9, column: 3, scope: !97) +// CHECK:STDOUT: !100 = !{!98} +// CHECK:STDOUT: !101 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.c20bae04b665a8c9", scope: null, file: !12, line: 9, type: !57, spFlags: DISPFlagDefinition, unit: !75) +// CHECK:STDOUT: !104 = !DILocation(line: 9, column: 28, scope: !101) +// CHECK:STDOUT: !105 = !DILocation(line: 9, column: 21, scope: !101) +// CHECK:STDOUT: !106 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.055ae7235dade271", scope: null, file: !12, line: 9, type: !57, spFlags: DISPFlagDefinition, unit: !75) +// CHECK:STDOUT: !109 = !DILocation(line: 9, column: 28, scope: !106) +// CHECK:STDOUT: !110 = !DILocation(line: 9, column: 21, scope: !106) +// CHECK:STDOUT: !111 = !{!"p1 _ZTS26ImplicitlyDefaultedDefault", !42, i64 0} +// CHECK:STDOUT: !112 = !{!111, !111, i64 0} +// CHECK:STDOUT: !113 = !{!"_ZTS26ImplicitlyDefaultedDefault", !45, i64 0} +// CHECK:STDOUT: !114 = !{!113, !45, i64 0} +// CHECK:STDOUT: !115 = !{!"p1 _ZTS26ExplicitlyDefaultedDefault", !42, i64 0} +// CHECK:STDOUT: !116 = !{!115, !115, i64 0} +// CHECK:STDOUT: !117 = !{!"_ZTS26ExplicitlyDefaultedDefault", !45, i64 0} +// CHECK:STDOUT: !118 = !{!117, !45, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'call_copy.carbon' @@ -540,12 +596,12 @@ fn Four() { // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CCopy.Main(ptr sret([4 x i8]) %return, ptr %c) #0 !dbg !109 { +// CHECK:STDOUT: define void @_CCopy.Main(ptr sret([4 x i8]) %return, ptr %c) #0 !dbg !125 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc7_10.1.temp = alloca [4 x i8], align 4, !dbg !114 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_10.1.temp), !dbg !114 -// CHECK:STDOUT: call void @_ZN4CopyC1ERKS_.carbon_thunk._(ptr %c, ptr %return), !dbg !114 -// CHECK:STDOUT: ret void, !dbg !115 +// CHECK:STDOUT: %.loc7_10.1.temp = alloca [4 x i8], align 4, !dbg !130 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_10.1.temp), !dbg !130 +// CHECK:STDOUT: call void @_ZN4CopyC1ERKS_.carbon_thunk._(ptr %c, ptr %return), !dbg !130 +// CHECK:STDOUT: ret void, !dbg !131 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -553,19 +609,19 @@ fn Four() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !123 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !123 -// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !123 -// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !123 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !139 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !139 +// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !139 +// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !139 // CHECK:STDOUT: call void @_ZN4CopyC1ERKS_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Copy.58fe21e3ef78b0d7.Core:Copy.Cpp"(ptr sret([4 x i8]) %return, ptr %self) #2 !dbg !118 { +// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Copy.58fe21e3ef78b0d7.Core:Copy.Cpp"(ptr sret([4 x i8]) %return, ptr %self) #2 !dbg !134 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_ZN4CopyC1ERKS_.carbon_thunk._(ptr %self, ptr %return), !dbg !120 -// CHECK:STDOUT: ret void, !dbg !120 +// CHECK:STDOUT: call void @_ZN4CopyC1ERKS_.carbon_thunk._(ptr %self, ptr %return), !dbg !136 +// CHECK:STDOUT: ret void, !dbg !136 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -579,38 +635,38 @@ fn Four() { // CHECK:STDOUT: attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!104} -// CHECK:STDOUT: !llvm.module.flags = !{!45, !46, !47, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!49} +// CHECK:STDOUT: !llvm.dbg.cu = !{!120} +// CHECK:STDOUT: !llvm.module.flags = !{!49, !50, !51, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!53} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !23 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !36 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !37 = !{!"omnipotent char", !36, i64 0} -// CHECK:STDOUT: !38 = !{!"any pointer", !37, i64 0} -// CHECK:STDOUT: !41 = !{!"int", !37, i64 0} -// CHECK:STDOUT: !45 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !46 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !47 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !48 = !{!"__libc_errno", !41, i64 0} -// CHECK:STDOUT: !49 = !{!48, !41, i64 0} -// CHECK:STDOUT: !103 = !DIFile(filename: "call_copy.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 = !{!23, !23} -// CHECK:STDOUT: !106 = !DISubroutineType(types: !105) -// CHECK:STDOUT: !109 = distinct !DISubprogram(name: "Copy", linkageName: "_CCopy.Main", scope: null, file: !103, line: 6, type: !106, spFlags: DISPFlagDefinition, unit: !104, retainedNodes: !116) -// CHECK:STDOUT: !110 = !DILocalVariable(arg: 1, scope: !109, type: !23) -// CHECK:STDOUT: !114 = !DILocation(line: 7, column: 10, scope: !109) -// CHECK:STDOUT: !115 = !DILocation(line: 7, column: 3, scope: !109) -// CHECK:STDOUT: !116 = !{!110} -// CHECK:STDOUT: !117 = !DIFile(filename: "./copy.h", directory: "") -// CHECK:STDOUT: !118 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Copy.58fe21e3ef78b0d7.Core:Copy.Cpp", scope: null, file: !117, line: 5, type: !106, spFlags: DISPFlagDefinition, unit: !104, retainedNodes: !121) -// CHECK:STDOUT: !119 = !DILocalVariable(arg: 1, scope: !118, type: !23) -// CHECK:STDOUT: !120 = !DILocation(line: 5, column: 3, scope: !118) -// CHECK:STDOUT: !121 = !{!119} -// CHECK:STDOUT: !122 = !{!"p1 _ZTS4Copy", !38, i64 0} -// CHECK:STDOUT: !123 = !{!122, !122, i64 0} +// CHECK:STDOUT: !40 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !41 = !{!"omnipotent char", !40, i64 0} +// CHECK:STDOUT: !42 = !{!"any pointer", !41, i64 0} +// CHECK:STDOUT: !45 = !{!"int", !41, i64 0} +// CHECK:STDOUT: !49 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !50 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !51 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !52 = !{!"__libc_errno", !45, i64 0} +// CHECK:STDOUT: !53 = !{!52, !45, i64 0} +// CHECK:STDOUT: !119 = !DIFile(filename: "call_copy.carbon", directory: "") +// CHECK:STDOUT: !120 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !119, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !121 = !{!23, !23} +// CHECK:STDOUT: !122 = !DISubroutineType(types: !121) +// CHECK:STDOUT: !125 = distinct !DISubprogram(name: "Copy", linkageName: "_CCopy.Main", scope: null, file: !119, line: 6, type: !122, spFlags: DISPFlagDefinition, unit: !120, retainedNodes: !132) +// CHECK:STDOUT: !126 = !DILocalVariable(arg: 1, scope: !125, type: !23) +// CHECK:STDOUT: !130 = !DILocation(line: 7, column: 10, scope: !125) +// CHECK:STDOUT: !131 = !DILocation(line: 7, column: 3, scope: !125) +// CHECK:STDOUT: !132 = !{!126} +// CHECK:STDOUT: !133 = !DIFile(filename: "./copy.h", directory: "") +// CHECK:STDOUT: !134 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Copy.58fe21e3ef78b0d7.Core:Copy.Cpp", scope: null, file: !133, line: 5, type: !122, spFlags: DISPFlagDefinition, unit: !120, retainedNodes: !137) +// CHECK:STDOUT: !135 = !DILocalVariable(arg: 1, scope: !134, type: !23) +// CHECK:STDOUT: !136 = !DILocation(line: 5, column: 3, scope: !134) +// CHECK:STDOUT: !137 = !{!135} +// CHECK:STDOUT: !138 = !{!"p1 _ZTS4Copy", !42, i64 0} +// CHECK:STDOUT: !139 = !{!138, !138, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'call_c1_in_thunk.carbon' @@ -642,24 +698,31 @@ fn Four() { // CHECK:STDOUT: @_ZTS4Base = linkonce_odr dso_local constant [6 x i8] c"4Base\00", comdat, align 1 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !127 { +// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !143 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc7_44.1.temp = alloca [8 x i8], align 8, !dbg !128 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_44.1.temp), !dbg !128 -// CHECK:STDOUT: call void @_ZN7DerivedC1Ev.carbon_thunk.(ptr %.loc7_44.1.temp), !dbg !128 -// CHECK:STDOUT: ret void, !dbg !131 +// CHECK:STDOUT: %.loc7_44.1.temp = alloca [8 x i8], align 8, !dbg !144 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_44.1.temp), !dbg !144 +// CHECK:STDOUT: call void @_ZN7DerivedC1Ev.carbon_thunk.(ptr %.loc7_44.1.temp), !dbg !144 +// CHECK:STDOUT: call void @"_CSelfDestruct.9b95953847aa58ac:core.Destroy.Core"(ptr %.loc7_44.1.temp), !dbg !144 +// CHECK:STDOUT: ret void, !dbg !147 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable // CHECK:STDOUT: define internal void @_ZN7DerivedC1Ev.carbon_thunk.(ptr noundef %return) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !133 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !133 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !153 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !153 // CHECK:STDOUT: call void @_ZN7DerivedC1Ev(ptr noundef nonnull align 8 dereferenceable(8) %0) #0 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.9b95953847aa58ac:core.Destroy.Core"(ptr %self) #0 !dbg !148 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !150 +// 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)) #2 // CHECK:STDOUT: @@ -667,9 +730,9 @@ fn Four() { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN7DerivedC1Ev(ptr noundef nonnull align 8 dereferenceable(8) %this) unnamed_addr #3 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !133 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !153 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 -// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-24, 0) ({ [3 x ptr] }, ptr @_ZTV7Derived, i32 0, i32 0, i32 3), ptr %this1, align 8, !tbaa !135 +// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-24, 0) ({ [3 x ptr] }, ptr @_ZTV7Derived, i32 0, i32 0, i32 3), ptr %this1, align 8, !tbaa !155 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: @@ -678,32 +741,39 @@ fn Four() { // CHECK:STDOUT: attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!126} -// CHECK:STDOUT: !llvm.module.flags = !{!45, !46, !47, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!49} +// CHECK:STDOUT: !llvm.dbg.cu = !{!142} +// CHECK:STDOUT: !llvm.module.flags = !{!49, !50, !51, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!53} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !21 = !{null} // CHECK:STDOUT: !22 = !DISubroutineType(types: !21) -// CHECK:STDOUT: !36 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !37 = !{!"omnipotent char", !36, i64 0} -// CHECK:STDOUT: !38 = !{!"any pointer", !37, i64 0} -// CHECK:STDOUT: !41 = !{!"int", !37, i64 0} -// CHECK:STDOUT: !45 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !46 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !47 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !48 = !{!"__libc_errno", !41, i64 0} -// CHECK:STDOUT: !49 = !{!48, !41, i64 0} -// CHECK:STDOUT: !125 = !DIFile(filename: "call_c1_in_thunk.carbon", directory: "") -// CHECK:STDOUT: !126 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !125, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !127 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !125, line: 6, type: !22, spFlags: DISPFlagDefinition, unit: !126) -// CHECK:STDOUT: !128 = !DILocation(line: 7, column: 24, scope: !127) -// CHECK:STDOUT: !131 = !DILocation(line: 6, column: 1, scope: !127) -// CHECK:STDOUT: !132 = !{!"p1 _ZTS7Derived", !38, i64 0} -// CHECK:STDOUT: !133 = !{!132, !132, i64 0} -// CHECK:STDOUT: !134 = !{!"vtable pointer", !36, i64 0} -// CHECK:STDOUT: !135 = !{!134, !134, i64 0} +// CHECK:STDOUT: !23 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !24 = !{null, !23} +// CHECK:STDOUT: !25 = !DISubroutineType(types: !24) +// CHECK:STDOUT: !40 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !41 = !{!"omnipotent char", !40, i64 0} +// CHECK:STDOUT: !42 = !{!"any pointer", !41, i64 0} +// CHECK:STDOUT: !45 = !{!"int", !41, i64 0} +// CHECK:STDOUT: !49 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !50 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !51 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !52 = !{!"__libc_errno", !45, i64 0} +// CHECK:STDOUT: !53 = !{!52, !45, i64 0} +// CHECK:STDOUT: !141 = !DIFile(filename: "call_c1_in_thunk.carbon", directory: "") +// CHECK:STDOUT: !142 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !141, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !143 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !141, line: 6, type: !22, spFlags: DISPFlagDefinition, unit: !142) +// CHECK:STDOUT: !144 = !DILocation(line: 7, column: 24, scope: !143) +// CHECK:STDOUT: !147 = !DILocation(line: 6, column: 1, scope: !143) +// CHECK:STDOUT: !148 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.9b95953847aa58ac:core.Destroy.Core", scope: null, file: !141, line: 7, type: !25, spFlags: DISPFlagDefinition, unit: !142, retainedNodes: !151) +// CHECK:STDOUT: !149 = !DILocalVariable(arg: 1, scope: !148, type: !23) +// CHECK:STDOUT: !150 = !DILocation(line: 7, column: 24, scope: !148) +// CHECK:STDOUT: !151 = !{!149} +// CHECK:STDOUT: !152 = !{!"p1 _ZTS7Derived", !42, i64 0} +// CHECK:STDOUT: !153 = !{!152, !152, i64 0} +// CHECK:STDOUT: !154 = !{!"vtable pointer", !40, i64 0} +// CHECK:STDOUT: !155 = !{!154, !154, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'call_multi_argument.carbon' @@ -720,23 +790,25 @@ fn Four() { // CHECK:STDOUT: $_ZN9MultiArgCC2Eiiii = comdat any // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CZero.Main() #0 !dbg !146 { +// CHECK:STDOUT: define void @_CZero.Main() #0 !dbg !166 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc7_50.1.temp = alloca [1 x i8], align 1, !dbg !147 -// CHECK:STDOUT: %.loc8_27.2.temp = alloca [1 x i8], align 1, !dbg !150 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_50.1.temp), !dbg !147 -// CHECK:STDOUT: call void @_ZN9MultiArgCC1Ev.carbon_thunk.(ptr %.loc7_50.1.temp), !dbg !147 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc8_27.2.temp), !dbg !150 -// CHECK:STDOUT: call void @_ZN9MultiArgCC1Ev.carbon_thunk_tuple.(ptr %.loc8_27.2.temp), !dbg !150 -// CHECK:STDOUT: ret void, !dbg !153 +// CHECK:STDOUT: %.loc7_50.1.temp = alloca [1 x i8], align 1, !dbg !167 +// CHECK:STDOUT: %.loc8_27.2.temp = alloca [1 x i8], align 1, !dbg !170 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_50.1.temp), !dbg !167 +// CHECK:STDOUT: call void @_ZN9MultiArgCC1Ev.carbon_thunk.(ptr %.loc7_50.1.temp), !dbg !167 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc8_27.2.temp), !dbg !170 +// CHECK:STDOUT: call void @_ZN9MultiArgCC1Ev.carbon_thunk_tuple.(ptr %.loc8_27.2.temp), !dbg !170 +// CHECK:STDOUT: call void @"_CSelfDestruct.878901d112b4b1fd:core.Destroy.Core"(ptr %.loc8_27.2.temp), !dbg !170 +// CHECK:STDOUT: call void @"_CSelfDestruct.878901d112b4b1fd:core.Destroy.Core"(ptr %.loc7_50.1.temp), !dbg !167 +// CHECK:STDOUT: ret void, !dbg !173 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define internal void @_ZN9MultiArgCC1Ev.carbon_thunk.(ptr noundef %return) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !190 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !190 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !214 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !214 // CHECK:STDOUT: call void @_ZN9MultiArgCC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %0) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -745,25 +817,34 @@ fn Four() { // CHECK:STDOUT: define internal void @_ZN9MultiArgCC1Ev.carbon_thunk_tuple.(ptr noundef %return) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !190 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !190 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !214 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !214 // CHECK:STDOUT: call void @_ZN9MultiArgCC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %0) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_COne.Main() #0 !dbg !154 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.878901d112b4b1fd:core.Destroy.Core"(ptr %self) #0 !dbg !174 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc12_51.1.temp = alloca [1 x i8], align 1, !dbg !155 -// CHECK:STDOUT: %.loc13_26.1.temp = alloca [1 x i8], align 1, !dbg !158 -// CHECK:STDOUT: %.loc14_29.2.temp = alloca [1 x i8], align 1, !dbg !161 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_51.1.temp), !dbg !155 -// CHECK:STDOUT: call void @_ZN9MultiArgCC1Ei.carbon_thunk._(i32 1, ptr %.loc12_51.1.temp), !dbg !155 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc13_26.1.temp), !dbg !158 -// CHECK:STDOUT: call void @_ZN9MultiArgCC1Ei.carbon_thunk._(i32 2, ptr %.loc13_26.1.temp), !dbg !158 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc14_29.2.temp), !dbg !161 -// CHECK:STDOUT: call void @_ZN9MultiArgCC1Ei.carbon_thunk_tuple._(i32 3, ptr %.loc14_29.2.temp), !dbg !161 -// CHECK:STDOUT: ret void, !dbg !164 +// CHECK:STDOUT: ret void, !dbg !176 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_COne.Main() #0 !dbg !178 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %.loc12_51.1.temp = alloca [1 x i8], align 1, !dbg !179 +// CHECK:STDOUT: %.loc13_26.1.temp = alloca [1 x i8], align 1, !dbg !182 +// CHECK:STDOUT: %.loc14_29.2.temp = alloca [1 x i8], align 1, !dbg !185 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_51.1.temp), !dbg !179 +// CHECK:STDOUT: call void @_ZN9MultiArgCC1Ei.carbon_thunk._(i32 1, ptr %.loc12_51.1.temp), !dbg !179 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc13_26.1.temp), !dbg !182 +// CHECK:STDOUT: call void @_ZN9MultiArgCC1Ei.carbon_thunk._(i32 2, ptr %.loc13_26.1.temp), !dbg !182 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc14_29.2.temp), !dbg !185 +// CHECK:STDOUT: call void @_ZN9MultiArgCC1Ei.carbon_thunk_tuple._(i32 3, ptr %.loc14_29.2.temp), !dbg !185 +// CHECK:STDOUT: call void @"_CSelfDestruct.878901d112b4b1fd:core.Destroy.Core"(ptr %.loc14_29.2.temp), !dbg !185 +// CHECK:STDOUT: call void @"_CSelfDestruct.878901d112b4b1fd:core.Destroy.Core"(ptr %.loc13_26.1.temp), !dbg !182 +// CHECK:STDOUT: call void @"_CSelfDestruct.878901d112b4b1fd:core.Destroy.Core"(ptr %.loc12_51.1.temp), !dbg !179 +// CHECK:STDOUT: ret void, !dbg !188 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -771,10 +852,10 @@ fn Four() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca i32, align 4 // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !191 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !190 -// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !190 -// CHECK:STDOUT: %2 = load i32, ptr %.addr, align 4, !tbaa !191 +// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !215 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !214 +// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !214 +// CHECK:STDOUT: %2 = load i32, ptr %.addr, align 4, !tbaa !215 // CHECK:STDOUT: call void @_ZN9MultiArgCC2Ei(ptr noundef nonnull align 1 dereferenceable(1) %1, i32 noundef %2) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -784,24 +865,26 @@ fn Four() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca i32, align 4 // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !191 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !190 -// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !190 -// CHECK:STDOUT: %2 = load i32, ptr %.addr, align 4, !tbaa !191 +// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !215 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !214 +// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !214 +// CHECK:STDOUT: %2 = load i32, ptr %.addr, align 4, !tbaa !215 // CHECK:STDOUT: call void @_ZN9MultiArgCC2Ei(ptr noundef nonnull align 1 dereferenceable(1) %1, i32 noundef %2) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CTwo.Main() #0 !dbg !165 { +// CHECK:STDOUT: define void @_CTwo.Main() #0 !dbg !189 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc18_54.1.temp = alloca [1 x i8], align 1, !dbg !166 -// CHECK:STDOUT: %.loc19_31.2.temp = alloca [1 x i8], align 1, !dbg !169 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_54.1.temp), !dbg !166 -// CHECK:STDOUT: call void @_ZN9MultiArgCC1Eii.carbon_thunk.__(i32 1, i32 2, ptr %.loc18_54.1.temp), !dbg !166 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc19_31.2.temp), !dbg !169 -// CHECK:STDOUT: call void @_ZN9MultiArgCC1Eii.carbon_thunk_tuple.__(i32 3, i32 4, ptr %.loc19_31.2.temp), !dbg !169 -// CHECK:STDOUT: ret void, !dbg !172 +// CHECK:STDOUT: %.loc18_54.1.temp = alloca [1 x i8], align 1, !dbg !190 +// CHECK:STDOUT: %.loc19_31.2.temp = alloca [1 x i8], align 1, !dbg !193 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_54.1.temp), !dbg !190 +// CHECK:STDOUT: call void @_ZN9MultiArgCC1Eii.carbon_thunk.__(i32 1, i32 2, ptr %.loc18_54.1.temp), !dbg !190 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc19_31.2.temp), !dbg !193 +// CHECK:STDOUT: call void @_ZN9MultiArgCC1Eii.carbon_thunk_tuple.__(i32 3, i32 4, ptr %.loc19_31.2.temp), !dbg !193 +// CHECK:STDOUT: call void @"_CSelfDestruct.878901d112b4b1fd:core.Destroy.Core"(ptr %.loc19_31.2.temp), !dbg !193 +// CHECK:STDOUT: call void @"_CSelfDestruct.878901d112b4b1fd:core.Destroy.Core"(ptr %.loc18_54.1.temp), !dbg !190 +// CHECK:STDOUT: ret void, !dbg !196 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -810,12 +893,12 @@ fn Four() { // CHECK:STDOUT: %.addr = alloca i32, align 4 // CHECK:STDOUT: %.addr1 = alloca i32, align 4 // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !191 -// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !191 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !190 -// CHECK:STDOUT: %2 = load ptr, ptr %return.addr, align 8, !tbaa !190 -// CHECK:STDOUT: %3 = load i32, ptr %.addr, align 4, !tbaa !191 -// CHECK:STDOUT: %4 = load i32, ptr %.addr1, align 4, !tbaa !191 +// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !215 +// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !215 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !214 +// CHECK:STDOUT: %2 = load ptr, ptr %return.addr, align 8, !tbaa !214 +// CHECK:STDOUT: %3 = load i32, ptr %.addr, align 4, !tbaa !215 +// CHECK:STDOUT: %4 = load i32, ptr %.addr1, align 4, !tbaa !215 // CHECK:STDOUT: call void @_ZN9MultiArgCC2Eii(ptr noundef nonnull align 1 dereferenceable(1) %2, i32 noundef %3, i32 noundef %4) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -826,26 +909,28 @@ fn Four() { // CHECK:STDOUT: %.addr = alloca i32, align 4 // CHECK:STDOUT: %.addr1 = alloca i32, align 4 // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !191 -// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !191 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !190 -// CHECK:STDOUT: %2 = load ptr, ptr %return.addr, align 8, !tbaa !190 -// CHECK:STDOUT: %3 = load i32, ptr %.addr, align 4, !tbaa !191 -// CHECK:STDOUT: %4 = load i32, ptr %.addr1, align 4, !tbaa !191 +// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !215 +// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !215 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !214 +// CHECK:STDOUT: %2 = load ptr, ptr %return.addr, align 8, !tbaa !214 +// CHECK:STDOUT: %3 = load i32, ptr %.addr, align 4, !tbaa !215 +// CHECK:STDOUT: %4 = load i32, ptr %.addr1, align 4, !tbaa !215 // CHECK:STDOUT: call void @_ZN9MultiArgCC2Eii(ptr noundef nonnull align 1 dereferenceable(1) %2, i32 noundef %3, i32 noundef %4) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CThree.Main() #0 !dbg !173 { +// CHECK:STDOUT: define void @_CThree.Main() #0 !dbg !197 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc23_57.1.temp = alloca [1 x i8], align 1, !dbg !174 -// CHECK:STDOUT: %.loc24_34.2.temp = alloca [1 x i8], align 1, !dbg !177 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc23_57.1.temp), !dbg !174 -// CHECK:STDOUT: call void @_ZN9MultiArgCC1Eiiii.carbon_thunk.___(i32 1, i32 2, i32 3, ptr %.loc23_57.1.temp), !dbg !174 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc24_34.2.temp), !dbg !177 -// CHECK:STDOUT: call void @_ZN9MultiArgCC1Eiiii.carbon_thunk_tuple.___(i32 4, i32 5, i32 6, ptr %.loc24_34.2.temp), !dbg !177 -// CHECK:STDOUT: ret void, !dbg !180 +// CHECK:STDOUT: %.loc23_57.1.temp = alloca [1 x i8], align 1, !dbg !198 +// CHECK:STDOUT: %.loc24_34.2.temp = alloca [1 x i8], align 1, !dbg !201 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc23_57.1.temp), !dbg !198 +// CHECK:STDOUT: call void @_ZN9MultiArgCC1Eiiii.carbon_thunk.___(i32 1, i32 2, i32 3, ptr %.loc23_57.1.temp), !dbg !198 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc24_34.2.temp), !dbg !201 +// CHECK:STDOUT: call void @_ZN9MultiArgCC1Eiiii.carbon_thunk_tuple.___(i32 4, i32 5, i32 6, ptr %.loc24_34.2.temp), !dbg !201 +// CHECK:STDOUT: call void @"_CSelfDestruct.878901d112b4b1fd:core.Destroy.Core"(ptr %.loc24_34.2.temp), !dbg !201 +// CHECK:STDOUT: call void @"_CSelfDestruct.878901d112b4b1fd:core.Destroy.Core"(ptr %.loc23_57.1.temp), !dbg !198 +// CHECK:STDOUT: ret void, !dbg !204 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -855,14 +940,14 @@ fn Four() { // CHECK:STDOUT: %.addr1 = alloca i32, align 4 // CHECK:STDOUT: %.addr2 = alloca i32, align 4 // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !191 -// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !191 -// CHECK:STDOUT: store i32 %2, ptr %.addr2, align 4, !tbaa !191 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !190 -// CHECK:STDOUT: %3 = load ptr, ptr %return.addr, align 8, !tbaa !190 -// CHECK:STDOUT: %4 = load i32, ptr %.addr, align 4, !tbaa !191 -// CHECK:STDOUT: %5 = load i32, ptr %.addr1, align 4, !tbaa !191 -// CHECK:STDOUT: %6 = load i32, ptr %.addr2, align 4, !tbaa !191 +// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !215 +// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !215 +// CHECK:STDOUT: store i32 %2, ptr %.addr2, align 4, !tbaa !215 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !214 +// CHECK:STDOUT: %3 = load ptr, ptr %return.addr, align 8, !tbaa !214 +// CHECK:STDOUT: %4 = load i32, ptr %.addr, align 4, !tbaa !215 +// CHECK:STDOUT: %5 = load i32, ptr %.addr1, align 4, !tbaa !215 +// CHECK:STDOUT: %6 = load i32, ptr %.addr2, align 4, !tbaa !215 // CHECK:STDOUT: call void @_ZN9MultiArgCC2Eiiii(ptr noundef nonnull align 1 dereferenceable(1) %3, i32 noundef %4, i32 noundef %5, i32 noundef %6, i32 noundef 0) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -874,28 +959,30 @@ fn Four() { // CHECK:STDOUT: %.addr1 = alloca i32, align 4 // CHECK:STDOUT: %.addr2 = alloca i32, align 4 // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !191 -// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !191 -// CHECK:STDOUT: store i32 %2, ptr %.addr2, align 4, !tbaa !191 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !190 -// CHECK:STDOUT: %3 = load ptr, ptr %return.addr, align 8, !tbaa !190 -// CHECK:STDOUT: %4 = load i32, ptr %.addr, align 4, !tbaa !191 -// CHECK:STDOUT: %5 = load i32, ptr %.addr1, align 4, !tbaa !191 -// CHECK:STDOUT: %6 = load i32, ptr %.addr2, align 4, !tbaa !191 +// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !215 +// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !215 +// CHECK:STDOUT: store i32 %2, ptr %.addr2, align 4, !tbaa !215 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !214 +// CHECK:STDOUT: %3 = load ptr, ptr %return.addr, align 8, !tbaa !214 +// CHECK:STDOUT: %4 = load i32, ptr %.addr, align 4, !tbaa !215 +// CHECK:STDOUT: %5 = load i32, ptr %.addr1, align 4, !tbaa !215 +// CHECK:STDOUT: %6 = load i32, ptr %.addr2, align 4, !tbaa !215 // CHECK:STDOUT: call void @_ZN9MultiArgCC2Eiiii(ptr noundef nonnull align 1 dereferenceable(1) %3, i32 noundef %4, i32 noundef %5, i32 noundef %6, i32 noundef 0) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CFour.Main() #0 !dbg !181 { +// CHECK:STDOUT: define void @_CFour.Main() #0 !dbg !205 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc28_60.1.temp = alloca [1 x i8], align 1, !dbg !182 -// CHECK:STDOUT: %.loc29_37.2.temp = alloca [1 x i8], align 1, !dbg !185 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc28_60.1.temp), !dbg !182 -// CHECK:STDOUT: call void @_ZN9MultiArgCC1Eiiii.carbon_thunk.____(i32 1, i32 2, i32 3, i32 4, ptr %.loc28_60.1.temp), !dbg !182 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc29_37.2.temp), !dbg !185 -// CHECK:STDOUT: call void @_ZN9MultiArgCC1Eiiii.carbon_thunk_tuple.____(i32 5, i32 6, i32 7, i32 8, ptr %.loc29_37.2.temp), !dbg !185 -// CHECK:STDOUT: ret void, !dbg !188 +// CHECK:STDOUT: %.loc28_60.1.temp = alloca [1 x i8], align 1, !dbg !206 +// CHECK:STDOUT: %.loc29_37.2.temp = alloca [1 x i8], align 1, !dbg !209 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc28_60.1.temp), !dbg !206 +// CHECK:STDOUT: call void @_ZN9MultiArgCC1Eiiii.carbon_thunk.____(i32 1, i32 2, i32 3, i32 4, ptr %.loc28_60.1.temp), !dbg !206 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc29_37.2.temp), !dbg !209 +// CHECK:STDOUT: call void @_ZN9MultiArgCC1Eiiii.carbon_thunk_tuple.____(i32 5, i32 6, i32 7, i32 8, ptr %.loc29_37.2.temp), !dbg !209 +// CHECK:STDOUT: call void @"_CSelfDestruct.878901d112b4b1fd:core.Destroy.Core"(ptr %.loc29_37.2.temp), !dbg !209 +// CHECK:STDOUT: call void @"_CSelfDestruct.878901d112b4b1fd:core.Destroy.Core"(ptr %.loc28_60.1.temp), !dbg !206 +// CHECK:STDOUT: ret void, !dbg !212 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -906,16 +993,16 @@ fn Four() { // CHECK:STDOUT: %.addr2 = alloca i32, align 4 // CHECK:STDOUT: %.addr3 = alloca i32, align 4 // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !191 -// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !191 -// CHECK:STDOUT: store i32 %2, ptr %.addr2, align 4, !tbaa !191 -// CHECK:STDOUT: store i32 %3, ptr %.addr3, align 4, !tbaa !191 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !190 -// CHECK:STDOUT: %4 = load ptr, ptr %return.addr, align 8, !tbaa !190 -// CHECK:STDOUT: %5 = load i32, ptr %.addr, align 4, !tbaa !191 -// CHECK:STDOUT: %6 = load i32, ptr %.addr1, align 4, !tbaa !191 -// CHECK:STDOUT: %7 = load i32, ptr %.addr2, align 4, !tbaa !191 -// CHECK:STDOUT: %8 = load i32, ptr %.addr3, align 4, !tbaa !191 +// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !215 +// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !215 +// CHECK:STDOUT: store i32 %2, ptr %.addr2, align 4, !tbaa !215 +// CHECK:STDOUT: store i32 %3, ptr %.addr3, align 4, !tbaa !215 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !214 +// CHECK:STDOUT: %4 = load ptr, ptr %return.addr, align 8, !tbaa !214 +// CHECK:STDOUT: %5 = load i32, ptr %.addr, align 4, !tbaa !215 +// CHECK:STDOUT: %6 = load i32, ptr %.addr1, align 4, !tbaa !215 +// CHECK:STDOUT: %7 = load i32, ptr %.addr2, align 4, !tbaa !215 +// CHECK:STDOUT: %8 = load i32, ptr %.addr3, align 4, !tbaa !215 // CHECK:STDOUT: call void @_ZN9MultiArgCC2Eiiii(ptr noundef nonnull align 1 dereferenceable(1) %4, i32 noundef %5, i32 noundef %6, i32 noundef %7, i32 noundef %8) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -928,16 +1015,16 @@ fn Four() { // CHECK:STDOUT: %.addr2 = alloca i32, align 4 // CHECK:STDOUT: %.addr3 = alloca i32, align 4 // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !191 -// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !191 -// CHECK:STDOUT: store i32 %2, ptr %.addr2, align 4, !tbaa !191 -// CHECK:STDOUT: store i32 %3, ptr %.addr3, align 4, !tbaa !191 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !190 -// CHECK:STDOUT: %4 = load ptr, ptr %return.addr, align 8, !tbaa !190 -// CHECK:STDOUT: %5 = load i32, ptr %.addr, align 4, !tbaa !191 -// CHECK:STDOUT: %6 = load i32, ptr %.addr1, align 4, !tbaa !191 -// CHECK:STDOUT: %7 = load i32, ptr %.addr2, align 4, !tbaa !191 -// CHECK:STDOUT: %8 = load i32, ptr %.addr3, align 4, !tbaa !191 +// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !215 +// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !215 +// CHECK:STDOUT: store i32 %2, ptr %.addr2, align 4, !tbaa !215 +// CHECK:STDOUT: store i32 %3, ptr %.addr3, align 4, !tbaa !215 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !214 +// CHECK:STDOUT: %4 = load ptr, ptr %return.addr, align 8, !tbaa !214 +// CHECK:STDOUT: %5 = load i32, ptr %.addr, align 4, !tbaa !215 +// CHECK:STDOUT: %6 = load i32, ptr %.addr1, align 4, !tbaa !215 +// CHECK:STDOUT: %7 = load i32, ptr %.addr2, align 4, !tbaa !215 +// CHECK:STDOUT: %8 = load i32, ptr %.addr3, align 4, !tbaa !215 // CHECK:STDOUT: call void @_ZN9MultiArgCC2Eiiii(ptr noundef nonnull align 1 dereferenceable(1) %4, i32 noundef %5, i32 noundef %6, i32 noundef %7, i32 noundef %8) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -949,7 +1036,7 @@ fn Four() { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN9MultiArgCC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %this) unnamed_addr #3 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !190 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !214 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -959,8 +1046,8 @@ fn Four() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 // CHECK:STDOUT: %.addr = alloca i32, align 4 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !190 -// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !191 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !214 +// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !215 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -971,9 +1058,9 @@ fn Four() { // CHECK:STDOUT: %this.addr = alloca ptr, align 8 // CHECK:STDOUT: %.addr = alloca i32, align 4 // CHECK:STDOUT: %.addr1 = alloca i32, align 4 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !190 -// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !191 -// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !191 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !214 +// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !215 +// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !215 // CHECK:STDOUT: %this2 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -986,16 +1073,17 @@ fn Four() { // CHECK:STDOUT: %.addr1 = alloca i32, align 4 // CHECK:STDOUT: %.addr2 = alloca i32, align 4 // CHECK:STDOUT: %.addr3 = alloca i32, align 4 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !190 -// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !191 -// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !191 -// CHECK:STDOUT: store i32 %2, ptr %.addr2, align 4, !tbaa !191 -// CHECK:STDOUT: store i32 %3, ptr %.addr3, align 4, !tbaa !191 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !214 +// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !215 +// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !215 +// CHECK:STDOUT: store i32 %2, ptr %.addr2, align 4, !tbaa !215 +// CHECK:STDOUT: store i32 %3, ptr %.addr3, align 4, !tbaa !215 // CHECK:STDOUT: %this4 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.878901d112b4b1fd:core.Destroy.Core", { 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 9 } // CHECK:STDOUT: uselistorder ptr @_ZN9MultiArgCC1Ei.carbon_thunk._, { 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 } // CHECK:STDOUT: @@ -1004,47 +1092,54 @@ fn Four() { // CHECK:STDOUT: attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: attributes #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!137} -// CHECK:STDOUT: !llvm.module.flags = !{!45, !46, !47, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!49} +// CHECK:STDOUT: !llvm.dbg.cu = !{!157} +// CHECK:STDOUT: !llvm.module.flags = !{!49, !50, !51, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!53} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !21 = !{null} // CHECK:STDOUT: !22 = !DISubroutineType(types: !21) -// CHECK:STDOUT: !36 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !37 = !{!"omnipotent char", !36, i64 0} -// CHECK:STDOUT: !38 = !{!"any pointer", !37, i64 0} -// CHECK:STDOUT: !41 = !{!"int", !37, i64 0} -// CHECK:STDOUT: !45 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !46 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !47 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !48 = !{!"__libc_errno", !41, i64 0} -// CHECK:STDOUT: !49 = !{!48, !41, i64 0} -// CHECK:STDOUT: !136 = !DIFile(filename: "call_multi_argument.carbon", directory: "") -// CHECK:STDOUT: !137 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !136, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !146 = distinct !DISubprogram(name: "Zero", linkageName: "_CZero.Main", scope: null, file: !136, line: 6, type: !22, spFlags: DISPFlagDefinition, unit: !137) -// CHECK:STDOUT: !147 = !DILocation(line: 7, column: 26, scope: !146) -// CHECK:STDOUT: !150 = !DILocation(line: 8, column: 26, scope: !146) -// CHECK:STDOUT: !153 = !DILocation(line: 6, column: 1, scope: !146) -// CHECK:STDOUT: !154 = distinct !DISubprogram(name: "One", linkageName: "_COne.Main", scope: null, file: !136, line: 11, type: !22, spFlags: DISPFlagDefinition, unit: !137) -// CHECK:STDOUT: !155 = !DILocation(line: 12, column: 26, scope: !154) -// CHECK:STDOUT: !158 = !DILocation(line: 13, column: 26, scope: !154) -// CHECK:STDOUT: !161 = !DILocation(line: 14, column: 26, scope: !154) -// CHECK:STDOUT: !164 = !DILocation(line: 11, column: 1, scope: !154) -// CHECK:STDOUT: !165 = distinct !DISubprogram(name: "Two", linkageName: "_CTwo.Main", scope: null, file: !136, line: 17, type: !22, spFlags: DISPFlagDefinition, unit: !137) -// CHECK:STDOUT: !166 = !DILocation(line: 18, column: 26, scope: !165) -// CHECK:STDOUT: !169 = !DILocation(line: 19, column: 26, scope: !165) -// CHECK:STDOUT: !172 = !DILocation(line: 17, column: 1, scope: !165) -// CHECK:STDOUT: !173 = distinct !DISubprogram(name: "Three", linkageName: "_CThree.Main", scope: null, file: !136, line: 22, type: !22, spFlags: DISPFlagDefinition, unit: !137) -// CHECK:STDOUT: !174 = !DILocation(line: 23, column: 26, scope: !173) -// CHECK:STDOUT: !177 = !DILocation(line: 24, column: 26, scope: !173) -// CHECK:STDOUT: !180 = !DILocation(line: 22, column: 1, scope: !173) -// CHECK:STDOUT: !181 = distinct !DISubprogram(name: "Four", linkageName: "_CFour.Main", scope: null, file: !136, line: 27, type: !22, spFlags: DISPFlagDefinition, unit: !137) -// CHECK:STDOUT: !182 = !DILocation(line: 28, column: 26, scope: !181) -// CHECK:STDOUT: !185 = !DILocation(line: 29, column: 26, scope: !181) -// CHECK:STDOUT: !188 = !DILocation(line: 27, column: 1, scope: !181) -// CHECK:STDOUT: !189 = !{!"p1 _ZTS9MultiArgC", !38, i64 0} -// CHECK:STDOUT: !190 = !{!189, !189, i64 0} -// CHECK:STDOUT: !191 = !{!41, !41, i64 0} +// CHECK:STDOUT: !23 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !24 = !{null, !23} +// CHECK:STDOUT: !25 = !DISubroutineType(types: !24) +// CHECK:STDOUT: !40 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !41 = !{!"omnipotent char", !40, i64 0} +// CHECK:STDOUT: !42 = !{!"any pointer", !41, i64 0} +// CHECK:STDOUT: !45 = !{!"int", !41, i64 0} +// CHECK:STDOUT: !49 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !50 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !51 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !52 = !{!"__libc_errno", !45, i64 0} +// CHECK:STDOUT: !53 = !{!52, !45, i64 0} +// CHECK:STDOUT: !156 = !DIFile(filename: "call_multi_argument.carbon", directory: "") +// CHECK:STDOUT: !157 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !156, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !166 = distinct !DISubprogram(name: "Zero", linkageName: "_CZero.Main", scope: null, file: !156, line: 6, type: !22, spFlags: DISPFlagDefinition, unit: !157) +// CHECK:STDOUT: !167 = !DILocation(line: 7, column: 26, scope: !166) +// CHECK:STDOUT: !170 = !DILocation(line: 8, column: 26, scope: !166) +// CHECK:STDOUT: !173 = !DILocation(line: 6, column: 1, scope: !166) +// CHECK:STDOUT: !174 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.878901d112b4b1fd:core.Destroy.Core", scope: null, file: !156, line: 8, type: !25, spFlags: DISPFlagDefinition, unit: !157, retainedNodes: !177) +// CHECK:STDOUT: !175 = !DILocalVariable(arg: 1, scope: !174, type: !23) +// CHECK:STDOUT: !176 = !DILocation(line: 8, column: 26, scope: !174) +// CHECK:STDOUT: !177 = !{!175} +// CHECK:STDOUT: !178 = distinct !DISubprogram(name: "One", linkageName: "_COne.Main", scope: null, file: !156, line: 11, type: !22, spFlags: DISPFlagDefinition, unit: !157) +// CHECK:STDOUT: !179 = !DILocation(line: 12, column: 26, scope: !178) +// CHECK:STDOUT: !182 = !DILocation(line: 13, column: 26, scope: !178) +// CHECK:STDOUT: !185 = !DILocation(line: 14, column: 26, scope: !178) +// CHECK:STDOUT: !188 = !DILocation(line: 11, column: 1, scope: !178) +// CHECK:STDOUT: !189 = distinct !DISubprogram(name: "Two", linkageName: "_CTwo.Main", scope: null, file: !156, line: 17, type: !22, spFlags: DISPFlagDefinition, unit: !157) +// CHECK:STDOUT: !190 = !DILocation(line: 18, column: 26, scope: !189) +// CHECK:STDOUT: !193 = !DILocation(line: 19, column: 26, scope: !189) +// CHECK:STDOUT: !196 = !DILocation(line: 17, column: 1, scope: !189) +// CHECK:STDOUT: !197 = distinct !DISubprogram(name: "Three", linkageName: "_CThree.Main", scope: null, file: !156, line: 22, type: !22, spFlags: DISPFlagDefinition, unit: !157) +// CHECK:STDOUT: !198 = !DILocation(line: 23, column: 26, scope: !197) +// CHECK:STDOUT: !201 = !DILocation(line: 24, column: 26, scope: !197) +// CHECK:STDOUT: !204 = !DILocation(line: 22, column: 1, scope: !197) +// CHECK:STDOUT: !205 = distinct !DISubprogram(name: "Four", linkageName: "_CFour.Main", scope: null, file: !156, line: 27, type: !22, spFlags: DISPFlagDefinition, unit: !157) +// CHECK:STDOUT: !206 = !DILocation(line: 28, column: 26, scope: !205) +// CHECK:STDOUT: !209 = !DILocation(line: 29, column: 26, scope: !205) +// CHECK:STDOUT: !212 = !DILocation(line: 27, column: 1, scope: !205) +// CHECK:STDOUT: !213 = !{!"p1 _ZTS9MultiArgC", !42, i64 0} +// CHECK:STDOUT: !214 = !{!213, !213, i64 0} +// CHECK:STDOUT: !215 = !{!45, !45, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/class/import/conversion.carbon b/toolchain/lower/testdata/interop/cpp/class/import/conversion.carbon index 62b1010eef55..cbfd3749d3b1 100644 --- a/toolchain/lower/testdata/interop/cpp/class/import/conversion.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/import/conversion.carbon @@ -90,7 +90,7 @@ fn ConvertToValue(b: Cpp.IntB) { // CHECK:STDOUT: %a.var = alloca [4 x i8], align 4, !dbg !29 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !29 // CHECK:STDOUT: call void @_ZNK1Bcv1AEv.carbon_thunk._(ptr %b, ptr %a.var), !dbg !29 -// CHECK:STDOUT: call void @_ZN1AD1Ev(ptr %a.var), !dbg !29 +// CHECK:STDOUT: call void @"_CSelfDestruct.f2cd4feee22137a3:core.Destroy.Core"(ptr %a.var), !dbg !29 // CHECK:STDOUT: ret void, !dbg !32 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -99,10 +99,10 @@ fn ConvertToValue(b: Cpp.IntB) { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !46 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !48 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !48 -// CHECK:STDOUT: %1 = load ptr, ptr %this.addr, align 8, !tbaa !46, !nonnull !50 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !50 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !52 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !52 +// CHECK:STDOUT: %1 = load ptr, ptr %this.addr, align 8, !tbaa !50, !nonnull !54 // CHECK:STDOUT: call void @_ZNK1Bcv1AEv(ptr dead_on_unwind writable sret(%struct.A) align 4 %0, ptr noundef nonnull align 1 dereferenceable(1) %1) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -111,13 +111,20 @@ fn ConvertToValue(b: Cpp.IntB) { // CHECK:STDOUT: declare void @_ZN1AD1Ev(ptr noundef nonnull align 4 dead_on_return(4) dereferenceable(4)) unnamed_addr #2 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CConvertToValue.Main(ptr %b) #0 !dbg !34 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f2cd4feee22137a3:core.Destroy.Core"(ptr %self) #0 !dbg !34 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc20_25.1.temp = alloca [4 x i8], align 4, !dbg !37 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_25.1.temp), !dbg !37 -// CHECK:STDOUT: call void @_ZNK1Bcv1AEv.carbon_thunk._(ptr %b, ptr %.loc20_25.1.temp), !dbg !37 -// CHECK:STDOUT: call void @_ZN1AD1Ev(ptr %.loc20_25.1.temp), !dbg !37 -// CHECK:STDOUT: ret void, !dbg !40 +// CHECK:STDOUT: call void @_ZN1AD1Ev(ptr %self), !dbg !36 +// CHECK:STDOUT: ret void, !dbg !36 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CConvertToValue.Main(ptr %b) #0 !dbg !38 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %.loc20_25.1.temp = alloca [4 x i8], align 4, !dbg !41 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_25.1.temp), !dbg !41 +// CHECK:STDOUT: call void @_ZNK1Bcv1AEv.carbon_thunk._(ptr %b, ptr %.loc20_25.1.temp), !dbg !41 +// CHECK:STDOUT: call void @"_CSelfDestruct.f2cd4feee22137a3:core.Destroy.Core"(ptr %.loc20_25.1.temp), !dbg !41 +// CHECK:STDOUT: ret void, !dbg !44 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -135,8 +142,8 @@ fn ConvertToValue(b: Cpp.IntB) { // CHECK:STDOUT: attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!19} -// CHECK:STDOUT: !llvm.module.flags = !{!53, !54, !55, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!57} +// CHECK:STDOUT: !llvm.module.flags = !{!57, !58, !59, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!61} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -150,25 +157,29 @@ fn ConvertToValue(b: Cpp.IntB) { // CHECK:STDOUT: !29 = !DILocation(line: 16, column: 3, scope: !26) // CHECK:STDOUT: !32 = !DILocation(line: 15, column: 1, scope: !26) // CHECK:STDOUT: !33 = !{!27} -// CHECK:STDOUT: !34 = distinct !DISubprogram(name: "ConvertToValue", linkageName: "_CConvertToValue.Main", scope: null, file: !18, line: 19, type: !23, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !41) +// CHECK:STDOUT: !34 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f2cd4feee22137a3:core.Destroy.Core", scope: null, file: !18, line: 16, type: !23, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !37) // CHECK:STDOUT: !35 = !DILocalVariable(arg: 1, scope: !34, type: !21) -// CHECK:STDOUT: !37 = !DILocation(line: 20, column: 25, scope: !34) -// CHECK:STDOUT: !40 = !DILocation(line: 19, column: 1, scope: !34) -// CHECK:STDOUT: !41 = !{!35} -// CHECK:STDOUT: !42 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !43 = !{!"omnipotent char", !42, i64 0} -// CHECK:STDOUT: !44 = !{!"any pointer", !43, i64 0} -// CHECK:STDOUT: !45 = !{!"p1 _ZTS1B", !44, i64 0} -// CHECK:STDOUT: !46 = !{!45, !45, i64 0} -// CHECK:STDOUT: !47 = !{!"p1 _ZTS1A", !44, i64 0} -// CHECK:STDOUT: !48 = !{!47, !47, i64 0} -// CHECK:STDOUT: !50 = !{} -// CHECK:STDOUT: !51 = !{!"int", !43, i64 0} -// CHECK:STDOUT: !53 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !54 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !55 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !56 = !{!"__libc_errno", !51, i64 0} -// CHECK:STDOUT: !57 = !{!56, !51, i64 0} +// CHECK:STDOUT: !36 = !DILocation(line: 16, column: 3, scope: !34) +// CHECK:STDOUT: !37 = !{!35} +// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "ConvertToValue", linkageName: "_CConvertToValue.Main", scope: null, file: !18, line: 19, type: !23, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !45) +// CHECK:STDOUT: !39 = !DILocalVariable(arg: 1, scope: !38, type: !21) +// CHECK:STDOUT: !41 = !DILocation(line: 20, column: 25, scope: !38) +// CHECK:STDOUT: !44 = !DILocation(line: 19, column: 1, scope: !38) +// CHECK:STDOUT: !45 = !{!39} +// CHECK:STDOUT: !46 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !47 = !{!"omnipotent char", !46, i64 0} +// CHECK:STDOUT: !48 = !{!"any pointer", !47, i64 0} +// CHECK:STDOUT: !49 = !{!"p1 _ZTS1B", !48, i64 0} +// CHECK:STDOUT: !50 = !{!49, !49, i64 0} +// CHECK:STDOUT: !51 = !{!"p1 _ZTS1A", !48, i64 0} +// CHECK:STDOUT: !52 = !{!51, !51, i64 0} +// CHECK:STDOUT: !54 = !{} +// CHECK:STDOUT: !55 = !{!"int", !47, i64 0} +// CHECK:STDOUT: !57 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !58 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !59 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !60 = !{!"__libc_errno", !55, i64 0} +// CHECK:STDOUT: !61 = !{!60, !55, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'class_to_enum.carbon' @@ -177,15 +188,17 @@ fn ConvertToValue(b: Cpp.IntB) { // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CConvertToVar.Main(ptr %b) #0 !dbg !61 { +// CHECK:STDOUT: define void @_CConvertToVar.Main(ptr %b) #0 !dbg !67 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %s.var = alloca i16, align 2, !dbg !64 -// CHECK:STDOUT: %i.var = alloca i16, align 2, !dbg !67 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %s.var), !dbg !64 -// CHECK:STDOUT: call void @_ZNK5EnumBcv1SEv.carbon_thunk._(ptr %b, ptr %s.var), !dbg !64 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %i.var), !dbg !67 -// CHECK:STDOUT: call void @_ZNK5EnumBcv1IEv.carbon_thunk._(ptr %b, ptr %i.var), !dbg !67 -// CHECK:STDOUT: ret void, !dbg !70 +// CHECK:STDOUT: %s.var = alloca i16, align 2, !dbg !70 +// CHECK:STDOUT: %i.var = alloca i16, align 2, !dbg !73 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %s.var), !dbg !70 +// CHECK:STDOUT: call void @_ZNK5EnumBcv1SEv.carbon_thunk._(ptr %b, ptr %s.var), !dbg !70 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %i.var), !dbg !73 +// CHECK:STDOUT: call void @_ZNK5EnumBcv1IEv.carbon_thunk._(ptr %b, ptr %i.var), !dbg !73 +// CHECK:STDOUT: call void @"_CSelfDestruct.93ce72f55a28222b:core.Destroy.Core"(ptr %i.var), !dbg !73 +// CHECK:STDOUT: call void @"_CSelfDestruct.7c9bfa05445fab48:core.Destroy.Core"(ptr %s.var), !dbg !70 +// CHECK:STDOUT: ret void, !dbg !76 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -193,12 +206,12 @@ fn ConvertToValue(b: Cpp.IntB) { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !84 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !85 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !85 -// CHECK:STDOUT: %1 = load ptr, ptr %this.addr, align 8, !tbaa !84, !nonnull !50 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !98 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !99 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !99 +// CHECK:STDOUT: %1 = load ptr, ptr %this.addr, align 8, !tbaa !98, !nonnull !54 // CHECK:STDOUT: %call = call noundef signext i16 @_ZNK5EnumBcv1SEv(ptr noundef nonnull align 1 dereferenceable(1) %1) -// CHECK:STDOUT: store i16 %call, ptr %0, align 2, !tbaa !88 +// CHECK:STDOUT: store i16 %call, ptr %0, align 2, !tbaa !102 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: @@ -207,27 +220,41 @@ fn ConvertToValue(b: Cpp.IntB) { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !84 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !85 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !85 -// CHECK:STDOUT: %1 = load ptr, ptr %this.addr, align 8, !tbaa !84, !nonnull !50 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !98 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !99 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !99 +// CHECK:STDOUT: %1 = load ptr, ptr %this.addr, align 8, !tbaa !98, !nonnull !54 // CHECK:STDOUT: %call = call noundef signext i16 @_ZNK5EnumBcv1IEv(ptr noundef nonnull align 1 dereferenceable(1) %1) -// CHECK:STDOUT: store i16 %call, ptr %0, align 2, !tbaa !90 +// CHECK:STDOUT: store i16 %call, ptr %0, align 2, !tbaa !104 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CConvertToValue.Main(ptr %b) #0 !dbg !72 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.93ce72f55a28222b:core.Destroy.Core"(ptr %self) #0 !dbg !78 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc20_25.1.temp = alloca i16, align 2, !dbg !75 -// CHECK:STDOUT: %.loc21_25.1.temp = alloca i16, align 2, !dbg !78 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_25.1.temp), !dbg !75 -// CHECK:STDOUT: call void @_ZNK5EnumBcv1SEv.carbon_thunk._(ptr %b, ptr %.loc20_25.1.temp), !dbg !75 -// CHECK:STDOUT: %.loc20_25.5 = load i16, ptr %.loc20_25.1.temp, align 2, !dbg !75 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc21_25.1.temp), !dbg !78 -// CHECK:STDOUT: call void @_ZNK5EnumBcv1IEv.carbon_thunk._(ptr %b, ptr %.loc21_25.1.temp), !dbg !78 -// CHECK:STDOUT: %.loc21_25.5 = load i16, ptr %.loc21_25.1.temp, align 2, !dbg !78 -// CHECK:STDOUT: ret void, !dbg !81 +// CHECK:STDOUT: ret void, !dbg !80 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.7c9bfa05445fab48:core.Destroy.Core"(ptr %self) #0 !dbg !82 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !84 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CConvertToValue.Main(ptr %b) #0 !dbg !86 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %.loc20_25.1.temp = alloca i16, align 2, !dbg !89 +// CHECK:STDOUT: %.loc21_25.1.temp = alloca i16, align 2, !dbg !92 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_25.1.temp), !dbg !89 +// CHECK:STDOUT: call void @_ZNK5EnumBcv1SEv.carbon_thunk._(ptr %b, ptr %.loc20_25.1.temp), !dbg !89 +// CHECK:STDOUT: %.loc20_25.5 = load i16, ptr %.loc20_25.1.temp, align 2, !dbg !89 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc21_25.1.temp), !dbg !92 +// CHECK:STDOUT: call void @_ZNK5EnumBcv1IEv.carbon_thunk._(ptr %b, ptr %.loc21_25.1.temp), !dbg !92 +// CHECK:STDOUT: %.loc21_25.5 = load i16, ptr %.loc21_25.1.temp, align 2, !dbg !92 +// CHECK:STDOUT: call void @"_CSelfDestruct.93ce72f55a28222b:core.Destroy.Core"(ptr %.loc21_25.1.temp), !dbg !92 +// CHECK:STDOUT: call void @"_CSelfDestruct.7c9bfa05445fab48:core.Destroy.Core"(ptr %.loc20_25.1.temp), !dbg !89 +// CHECK:STDOUT: ret void, !dbg !95 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -245,46 +272,57 @@ fn ConvertToValue(b: Cpp.IntB) { // CHECK:STDOUT: attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!59} -// CHECK:STDOUT: !llvm.module.flags = !{!53, !54, !55, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!57} +// CHECK:STDOUT: !llvm.dbg.cu = !{!63} +// CHECK:STDOUT: !llvm.module.flags = !{!57, !58, !59, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!61} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !21 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) // CHECK:STDOUT: !22 = !{null, !21} // CHECK:STDOUT: !23 = !DISubroutineType(types: !22) -// CHECK:STDOUT: !42 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !43 = !{!"omnipotent char", !42, i64 0} -// CHECK:STDOUT: !44 = !{!"any pointer", !43, i64 0} -// CHECK:STDOUT: !50 = !{} -// CHECK:STDOUT: !51 = !{!"int", !43, i64 0} -// CHECK:STDOUT: !53 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !54 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !55 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !56 = !{!"__libc_errno", !51, i64 0} -// CHECK:STDOUT: !57 = !{!56, !51, i64 0} -// CHECK:STDOUT: !58 = !DIFile(filename: "class_to_enum.carbon", directory: "") -// CHECK:STDOUT: !59 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !58, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "ConvertToVar", linkageName: "_CConvertToVar.Main", scope: null, file: !58, line: 14, type: !23, spFlags: DISPFlagDefinition, unit: !59, retainedNodes: !71) -// CHECK:STDOUT: !62 = !DILocalVariable(arg: 1, scope: !61, type: !21) -// CHECK:STDOUT: !64 = !DILocation(line: 15, column: 3, scope: !61) -// CHECK:STDOUT: !67 = !DILocation(line: 16, column: 3, scope: !61) -// CHECK:STDOUT: !70 = !DILocation(line: 14, column: 1, scope: !61) -// CHECK:STDOUT: !71 = !{!62} -// CHECK:STDOUT: !72 = distinct !DISubprogram(name: "ConvertToValue", linkageName: "_CConvertToValue.Main", scope: null, file: !58, line: 19, type: !23, spFlags: DISPFlagDefinition, unit: !59, retainedNodes: !82) -// CHECK:STDOUT: !73 = !DILocalVariable(arg: 1, scope: !72, type: !21) -// CHECK:STDOUT: !75 = !DILocation(line: 20, column: 25, scope: !72) -// CHECK:STDOUT: !78 = !DILocation(line: 21, column: 25, scope: !72) -// CHECK:STDOUT: !81 = !DILocation(line: 19, column: 1, scope: !72) -// CHECK:STDOUT: !82 = !{!73} -// CHECK:STDOUT: !83 = !{!"p1 _ZTS5EnumB", !44, i64 0} -// CHECK:STDOUT: !84 = !{!83, !83, i64 0} -// CHECK:STDOUT: !85 = !{!44, !44, i64 0} -// CHECK:STDOUT: !86 = !{!"_ZTS1S", !43, i64 0} -// CHECK:STDOUT: !88 = !{!86, !86, i64 0} -// CHECK:STDOUT: !89 = !{!"_ZTS1I", !43, i64 0} -// CHECK:STDOUT: !90 = !{!89, !89, i64 0} +// CHECK:STDOUT: !46 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !47 = !{!"omnipotent char", !46, i64 0} +// CHECK:STDOUT: !48 = !{!"any pointer", !47, i64 0} +// CHECK:STDOUT: !54 = !{} +// CHECK:STDOUT: !55 = !{!"int", !47, i64 0} +// CHECK:STDOUT: !57 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !58 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !59 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !60 = !{!"__libc_errno", !55, i64 0} +// CHECK:STDOUT: !61 = !{!60, !55, i64 0} +// CHECK:STDOUT: !62 = !DIFile(filename: "class_to_enum.carbon", directory: "") +// CHECK:STDOUT: !63 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !62, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !64 = !DIBasicType(name: "int", size: 16, encoding: DW_ATE_signed) +// CHECK:STDOUT: !65 = !{null, !64} +// CHECK:STDOUT: !66 = !DISubroutineType(types: !65) +// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "ConvertToVar", linkageName: "_CConvertToVar.Main", scope: null, file: !62, line: 14, type: !23, spFlags: DISPFlagDefinition, unit: !63, retainedNodes: !77) +// CHECK:STDOUT: !68 = !DILocalVariable(arg: 1, scope: !67, type: !21) +// CHECK:STDOUT: !70 = !DILocation(line: 15, column: 3, scope: !67) +// CHECK:STDOUT: !73 = !DILocation(line: 16, column: 3, scope: !67) +// CHECK:STDOUT: !76 = !DILocation(line: 14, column: 1, scope: !67) +// CHECK:STDOUT: !77 = !{!68} +// CHECK:STDOUT: !78 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.93ce72f55a28222b:core.Destroy.Core", scope: null, file: !62, line: 16, type: !66, spFlags: DISPFlagDefinition, unit: !63, retainedNodes: !81) +// CHECK:STDOUT: !79 = !DILocalVariable(arg: 1, scope: !78, type: !64) +// CHECK:STDOUT: !80 = !DILocation(line: 16, column: 3, scope: !78) +// CHECK:STDOUT: !81 = !{!79} +// CHECK:STDOUT: !82 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.7c9bfa05445fab48:core.Destroy.Core", scope: null, file: !62, line: 15, type: !66, spFlags: DISPFlagDefinition, unit: !63, retainedNodes: !85) +// CHECK:STDOUT: !83 = !DILocalVariable(arg: 1, scope: !82, type: !64) +// CHECK:STDOUT: !84 = !DILocation(line: 15, column: 3, scope: !82) +// CHECK:STDOUT: !85 = !{!83} +// CHECK:STDOUT: !86 = distinct !DISubprogram(name: "ConvertToValue", linkageName: "_CConvertToValue.Main", scope: null, file: !62, line: 19, type: !23, spFlags: DISPFlagDefinition, unit: !63, retainedNodes: !96) +// CHECK:STDOUT: !87 = !DILocalVariable(arg: 1, scope: !86, type: !21) +// CHECK:STDOUT: !89 = !DILocation(line: 20, column: 25, scope: !86) +// CHECK:STDOUT: !92 = !DILocation(line: 21, column: 25, scope: !86) +// CHECK:STDOUT: !95 = !DILocation(line: 19, column: 1, scope: !86) +// CHECK:STDOUT: !96 = !{!87} +// CHECK:STDOUT: !97 = !{!"p1 _ZTS5EnumB", !48, i64 0} +// CHECK:STDOUT: !98 = !{!97, !97, i64 0} +// CHECK:STDOUT: !99 = !{!48, !48, i64 0} +// CHECK:STDOUT: !100 = !{!"_ZTS1S", !47, i64 0} +// CHECK:STDOUT: !102 = !{!100, !100, i64 0} +// CHECK:STDOUT: !103 = !{!"_ZTS1I", !47, i64 0} +// CHECK:STDOUT: !104 = !{!103, !103, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'class_to_int.carbon' @@ -293,37 +331,50 @@ fn ConvertToValue(b: Cpp.IntB) { // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CConvertToVar.Main(ptr %b) #0 !dbg !97 { +// CHECK:STDOUT: define void @_CConvertToVar.Main(ptr %b) #0 !dbg !111 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %a.var = alloca i32, align 4, !dbg !100 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !100 -// CHECK:STDOUT: %__carbon_thunk.call = call i32 @_ZNK4IntBcviEv.carbon_thunk._(ptr %b), !dbg !100 -// CHECK:STDOUT: store i32 %__carbon_thunk.call, ptr %a.var, align 4, !dbg !100 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %a.var), !dbg !100 -// CHECK:STDOUT: ret void, !dbg !103 +// CHECK:STDOUT: %a.var = alloca i32, align 4, !dbg !114 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !114 +// CHECK:STDOUT: %__carbon_thunk.call = call i32 @_ZNK4IntBcviEv.carbon_thunk._(ptr %b), !dbg !114 +// CHECK:STDOUT: store i32 %__carbon_thunk.call, ptr %a.var, align 4, !dbg !114 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %a.var), !dbg !114 +// CHECK:STDOUT: ret void, !dbg !117 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define internal noundef i32 @_ZNK4IntBcviEv.carbon_thunk._(ptr noundef nonnull align 1 dereferenceable(1) %this) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !118 -// CHECK:STDOUT: %0 = load ptr, ptr %this.addr, align 8, !tbaa !118, !nonnull !50 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !140 +// CHECK:STDOUT: %0 = load ptr, ptr %this.addr, align 8, !tbaa !140, !nonnull !54 // CHECK:STDOUT: %call = call noundef i32 @_ZNK4IntBcviEv(ptr noundef nonnull align 1 dereferenceable(1) %0) // CHECK:STDOUT: ret i32 %call // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !105 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !119 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !107 +// CHECK:STDOUT: ret void, !dbg !121 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CConvertToValue.Main(ptr %b) #0 !dbg !109 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !123 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %__carbon_thunk.call = call i32 @_ZNK4IntBcviEv.carbon_thunk._(ptr %b), !dbg !112 -// CHECK:STDOUT: ret void, !dbg !115 +// CHECK:STDOUT: ret void, !dbg !125 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !127 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !129 +// CHECK:STDOUT: ret void, !dbg !129 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CConvertToValue.Main(ptr %b) #0 !dbg !131 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %__carbon_thunk.call = call i32 @_ZNK4IntBcviEv.carbon_thunk._(ptr %b), !dbg !134 +// CHECK:STDOUT: ret void, !dbg !137 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -336,9 +387,9 @@ fn ConvertToValue(b: Cpp.IntB) { // CHECK:STDOUT: attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!92} -// CHECK:STDOUT: !llvm.module.flags = !{!53, !54, !55, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!57} +// CHECK:STDOUT: !llvm.dbg.cu = !{!106} +// CHECK:STDOUT: !llvm.module.flags = !{!57, !58, !59, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!61} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -346,34 +397,42 @@ fn ConvertToValue(b: Cpp.IntB) { // CHECK:STDOUT: !21 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) // CHECK:STDOUT: !22 = !{null, !21} // CHECK:STDOUT: !23 = !DISubroutineType(types: !22) -// CHECK:STDOUT: !42 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !43 = !{!"omnipotent char", !42, i64 0} -// CHECK:STDOUT: !44 = !{!"any pointer", !43, i64 0} -// CHECK:STDOUT: !50 = !{} -// CHECK:STDOUT: !51 = !{!"int", !43, i64 0} -// CHECK:STDOUT: !53 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !54 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !55 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !56 = !{!"__libc_errno", !51, i64 0} -// CHECK:STDOUT: !57 = !{!56, !51, i64 0} -// CHECK:STDOUT: !91 = !DIFile(filename: "class_to_int.carbon", directory: "") -// CHECK:STDOUT: !92 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !91, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !95 = !{null, !20} -// CHECK:STDOUT: !96 = !DISubroutineType(types: !95) -// CHECK:STDOUT: !97 = distinct !DISubprogram(name: "ConvertToVar", linkageName: "_CConvertToVar.Main", scope: null, file: !91, line: 11, type: !23, spFlags: DISPFlagDefinition, unit: !92, retainedNodes: !104) -// CHECK:STDOUT: !98 = !DILocalVariable(arg: 1, scope: !97, type: !21) -// CHECK:STDOUT: !100 = !DILocation(line: 12, column: 3, scope: !97) -// CHECK:STDOUT: !103 = !DILocation(line: 11, column: 1, scope: !97) -// CHECK:STDOUT: !104 = !{!98} -// CHECK:STDOUT: !105 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !91, line: 12, type: !96, spFlags: DISPFlagDefinition, unit: !92, retainedNodes: !108) -// CHECK:STDOUT: !106 = !DILocalVariable(arg: 1, scope: !105, type: !20) -// CHECK:STDOUT: !107 = !DILocation(line: 12, column: 3, scope: !105) -// CHECK:STDOUT: !108 = !{!106} -// CHECK:STDOUT: !109 = distinct !DISubprogram(name: "ConvertToValue", linkageName: "_CConvertToValue.Main", scope: null, file: !91, line: 15, type: !23, spFlags: DISPFlagDefinition, unit: !92, retainedNodes: !116) -// CHECK:STDOUT: !110 = !DILocalVariable(arg: 1, scope: !109, type: !21) -// CHECK:STDOUT: !112 = !DILocation(line: 16, column: 27, scope: !109) -// CHECK:STDOUT: !115 = !DILocation(line: 15, column: 1, scope: !109) -// CHECK:STDOUT: !116 = !{!110} -// CHECK:STDOUT: !117 = !{!"p1 _ZTS4IntB", !44, i64 0} -// CHECK:STDOUT: !118 = !{!117, !117, i64 0} +// CHECK:STDOUT: !46 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !47 = !{!"omnipotent char", !46, i64 0} +// CHECK:STDOUT: !48 = !{!"any pointer", !47, i64 0} +// CHECK:STDOUT: !54 = !{} +// CHECK:STDOUT: !55 = !{!"int", !47, i64 0} +// CHECK:STDOUT: !57 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !58 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !59 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !60 = !{!"__libc_errno", !55, i64 0} +// CHECK:STDOUT: !61 = !{!60, !55, i64 0} +// CHECK:STDOUT: !105 = !DIFile(filename: "class_to_int.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: !109 = !{null, !20} +// CHECK:STDOUT: !110 = !DISubroutineType(types: !109) +// CHECK:STDOUT: !111 = distinct !DISubprogram(name: "ConvertToVar", linkageName: "_CConvertToVar.Main", scope: null, file: !105, line: 11, type: !23, spFlags: DISPFlagDefinition, unit: !106, retainedNodes: !118) +// CHECK:STDOUT: !112 = !DILocalVariable(arg: 1, scope: !111, type: !21) +// CHECK:STDOUT: !114 = !DILocation(line: 12, column: 3, scope: !111) +// CHECK:STDOUT: !117 = !DILocation(line: 11, column: 1, scope: !111) +// CHECK:STDOUT: !118 = !{!112} +// CHECK:STDOUT: !119 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !105, line: 12, type: !110, spFlags: DISPFlagDefinition, unit: !106, retainedNodes: !122) +// CHECK:STDOUT: !120 = !DILocalVariable(arg: 1, scope: !119, type: !20) +// CHECK:STDOUT: !121 = !DILocation(line: 12, column: 3, scope: !119) +// CHECK:STDOUT: !122 = !{!120} +// CHECK:STDOUT: !123 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !105, line: 12, type: !110, spFlags: DISPFlagDefinition, unit: !106, retainedNodes: !126) +// CHECK:STDOUT: !124 = !DILocalVariable(arg: 1, scope: !123, type: !20) +// CHECK:STDOUT: !125 = !DILocation(line: 12, column: 3, scope: !123) +// CHECK:STDOUT: !126 = !{!124} +// CHECK:STDOUT: !127 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !105, line: 12, type: !110, spFlags: DISPFlagDefinition, unit: !106, retainedNodes: !130) +// CHECK:STDOUT: !128 = !DILocalVariable(arg: 1, scope: !127, type: !20) +// CHECK:STDOUT: !129 = !DILocation(line: 12, column: 3, scope: !127) +// CHECK:STDOUT: !130 = !{!128} +// CHECK:STDOUT: !131 = distinct !DISubprogram(name: "ConvertToValue", linkageName: "_CConvertToValue.Main", scope: null, file: !105, line: 15, type: !23, spFlags: DISPFlagDefinition, unit: !106, retainedNodes: !138) +// CHECK:STDOUT: !132 = !DILocalVariable(arg: 1, scope: !131, type: !21) +// CHECK:STDOUT: !134 = !DILocation(line: 16, column: 27, scope: !131) +// CHECK:STDOUT: !137 = !DILocation(line: 15, column: 1, scope: !131) +// CHECK:STDOUT: !138 = !{!132} +// CHECK:STDOUT: !139 = !{!"p1 _ZTS4IntB", !48, i64 0} +// CHECK:STDOUT: !140 = !{!139, !139, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/class/import/copy_vs_move.carbon b/toolchain/lower/testdata/interop/cpp/class/import/copy_vs_move.carbon index d7818548b51c..ac0917831ce2 100644 --- a/toolchain/lower/testdata/interop/cpp/class/import/copy_vs_move.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/import/copy_vs_move.carbon @@ -123,8 +123,8 @@ fn PassTemporary() { // CHECK:STDOUT: define internal void @_Z13make_copyablev.carbon_thunk.(ptr noundef %return) #0 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !43 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !43 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !47 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !47 // CHECK:STDOUT: call void @_Z13make_copyablev(ptr dead_on_unwind writable sret(%struct.Copyable) align 1 %0) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -141,8 +141,8 @@ fn PassTemporary() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 // CHECK:STDOUT: %agg.tmp = alloca %struct.Copyable, align 1 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !43 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !43 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !47 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !47 // CHECK:STDOUT: call void @_ZN8CopyableC1ERKS_(ptr noundef nonnull align 1 dereferenceable(1) %agg.tmp, ptr noundef nonnull align 1 dereferenceable(1) %1) // CHECK:STDOUT: call void @_Z13pass_copyable8Copyable(ptr nofreeobj noundef align 1 dereferenceable(1) %agg.tmp) // CHECK:STDOUT: call void @_ZN8CopyableD1Ev(ptr noundef nonnull align 1 dereferenceable(1) %agg.tmp) #1 @@ -156,7 +156,7 @@ fn PassTemporary() { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc21_39.1.temp), !dbg !18 // CHECK:STDOUT: call void @_Z13make_copyablev.carbon_thunk.(ptr %.loc21_39.1.temp), !dbg !18 // CHECK:STDOUT: call void @_Z13pass_copyable8Copyable.carbon_thunk._(ptr %.loc21_39.1.temp), !dbg !19 -// CHECK:STDOUT: call void @_ZN8CopyableD1Ev(ptr %.loc21_39.1.temp), !dbg !18 +// CHECK:STDOUT: call void @"_CSelfDestruct.fd98d268aadcda21:core.Destroy.Core"(ptr %.loc21_39.1.temp), !dbg !18 // CHECK:STDOUT: ret void, !dbg !20 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -164,27 +164,34 @@ fn PassTemporary() { // CHECK:STDOUT: declare void @_ZN8CopyableD1Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassValue.Main(ptr %c) #1 !dbg !21 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.fd98d268aadcda21:core.Destroy.Core"(ptr %self) #1 !dbg !21 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z13pass_copyable8Copyable.carbon_thunk._(ptr %c), !dbg !25 -// CHECK:STDOUT: ret void, !dbg !26 +// CHECK:STDOUT: call void @_ZN8CopyableD1Ev(ptr %self), !dbg !23 +// CHECK:STDOUT: ret void, !dbg !23 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassRef.Main(ptr %c) #1 !dbg !28 { +// CHECK:STDOUT: define void @_CPassValue.Main(ptr %c) #1 !dbg !25 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z13pass_copyable8Copyable.carbon_thunk._(ptr %c), !dbg !32 -// CHECK:STDOUT: ret void, !dbg !33 +// CHECK:STDOUT: call void @_Z13pass_copyable8Copyable.carbon_thunk._(ptr %c), !dbg !29 +// CHECK:STDOUT: ret void, !dbg !30 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CPassRef.Main(ptr %c) #1 !dbg !32 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @_Z13pass_copyable8Copyable.carbon_thunk._(ptr %c), !dbg !36 +// CHECK:STDOUT: ret void, !dbg !37 // 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)) #3 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define internal void @_C__global_init.Main() #1 !dbg !35 { +// CHECK:STDOUT: define internal void @_C__global_init.Main() #1 !dbg !39 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z13make_copyablev.carbon_thunk.(ptr @_Cc.Main), !dbg !36 -// CHECK:STDOUT: ret void, !dbg !38 +// CHECK:STDOUT: call void @_Z13make_copyablev.carbon_thunk.(ptr @_Cc.Main), !dbg !40 +// CHECK:STDOUT: ret void, !dbg !42 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z13make_copyablev(ptr dead_on_unwind writable sret(%struct.Copyable) align 1) #4 @@ -193,6 +200,9 @@ fn PassTemporary() { // CHECK:STDOUT: // CHECK:STDOUT: declare void @_ZN8CopyableC1ERKS_(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 // CHECK:STDOUT: +// CHECK:STDOUT: ; uselistorder directives +// CHECK:STDOUT: uselistorder ptr @_ZN8CopyableD1Ev, { 1, 0 } +// CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { alwaysinline mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } // CHECK:STDOUT: attributes #1 = { nounwind } // CHECK:STDOUT: attributes #2 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } @@ -200,8 +210,8 @@ fn PassTemporary() { // CHECK:STDOUT: attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!7} -// CHECK:STDOUT: !llvm.module.flags = !{!45, !46, !47, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!50} +// CHECK:STDOUT: !llvm.module.flags = !{!49, !50, !51, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!54} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -219,30 +229,34 @@ fn PassTemporary() { // CHECK:STDOUT: !18 = !DILocation(line: 21, column: 21, scope: !17) // CHECK:STDOUT: !19 = !DILocation(line: 21, column: 3, scope: !17) // CHECK:STDOUT: !20 = !DILocation(line: 20, column: 1, scope: !17) -// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "PassValue", linkageName: "_CPassValue.Main", scope: null, file: !6, line: 24, type: !10, spFlags: DISPFlagDefinition, unit: !7, retainedNodes: !27) +// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.fd98d268aadcda21:core.Destroy.Core", scope: null, file: !6, line: 21, type: !10, spFlags: DISPFlagDefinition, unit: !7, retainedNodes: !24) // CHECK:STDOUT: !22 = !DILocalVariable(arg: 1, scope: !21, type: !8) -// CHECK:STDOUT: !25 = !DILocation(line: 25, column: 3, scope: !21) -// CHECK:STDOUT: !26 = !DILocation(line: 24, column: 1, scope: !21) -// CHECK:STDOUT: !27 = !{!22} -// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "PassRef", linkageName: "_CPassRef.Main", scope: null, file: !6, line: 28, type: !10, spFlags: DISPFlagDefinition, unit: !7, retainedNodes: !34) -// CHECK:STDOUT: !29 = !DILocalVariable(arg: 1, scope: !28, type: !8) -// CHECK:STDOUT: !32 = !DILocation(line: 29, column: 3, scope: !28) -// CHECK:STDOUT: !33 = !DILocation(line: 28, column: 1, scope: !28) -// CHECK:STDOUT: !34 = !{!29} -// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !6, type: !12, spFlags: DISPFlagDefinition, unit: !7) -// CHECK:STDOUT: !36 = !DILocation(line: 14, column: 23, scope: !35) -// CHECK:STDOUT: !38 = !DILocation(line: 0, scope: !35) -// CHECK:STDOUT: !39 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !40 = !{!"omnipotent char", !39, i64 0} -// CHECK:STDOUT: !41 = !{!"any pointer", !40, i64 0} -// CHECK:STDOUT: !42 = !{!"p1 _ZTS8Copyable", !41, i64 0} -// CHECK:STDOUT: !43 = !{!42, !42, i64 0} -// CHECK:STDOUT: !45 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !46 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !47 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !48 = !{!"int", !40, i64 0} -// CHECK:STDOUT: !49 = !{!"__libc_errno", !48, i64 0} -// CHECK:STDOUT: !50 = !{!49, !48, i64 0} +// CHECK:STDOUT: !23 = !DILocation(line: 21, column: 21, scope: !21) +// CHECK:STDOUT: !24 = !{!22} +// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "PassValue", linkageName: "_CPassValue.Main", scope: null, file: !6, line: 24, type: !10, spFlags: DISPFlagDefinition, unit: !7, retainedNodes: !31) +// CHECK:STDOUT: !26 = !DILocalVariable(arg: 1, scope: !25, type: !8) +// CHECK:STDOUT: !29 = !DILocation(line: 25, column: 3, scope: !25) +// CHECK:STDOUT: !30 = !DILocation(line: 24, column: 1, scope: !25) +// CHECK:STDOUT: !31 = !{!26} +// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "PassRef", linkageName: "_CPassRef.Main", scope: null, file: !6, line: 28, type: !10, spFlags: DISPFlagDefinition, unit: !7, retainedNodes: !38) +// CHECK:STDOUT: !33 = !DILocalVariable(arg: 1, scope: !32, type: !8) +// CHECK:STDOUT: !36 = !DILocation(line: 29, column: 3, scope: !32) +// CHECK:STDOUT: !37 = !DILocation(line: 28, column: 1, scope: !32) +// CHECK:STDOUT: !38 = !{!33} +// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !6, type: !12, spFlags: DISPFlagDefinition, unit: !7) +// CHECK:STDOUT: !40 = !DILocation(line: 14, column: 23, scope: !39) +// CHECK:STDOUT: !42 = !DILocation(line: 0, scope: !39) +// CHECK:STDOUT: !43 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !44 = !{!"omnipotent char", !43, i64 0} +// CHECK:STDOUT: !45 = !{!"any pointer", !44, i64 0} +// CHECK:STDOUT: !46 = !{!"p1 _ZTS8Copyable", !45, i64 0} +// CHECK:STDOUT: !47 = !{!46, !46, i64 0} +// CHECK:STDOUT: !49 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !50 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !51 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !52 = !{!"int", !44, i64 0} +// CHECK:STDOUT: !53 = !{!"__libc_errno", !52, i64 0} +// CHECK:STDOUT: !54 = !{!53, !52, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'copy_or_move.carbon' @@ -259,17 +273,17 @@ fn PassTemporary() { // CHECK:STDOUT: define internal void @_Z17make_copy_or_movev.carbon_thunk.(ptr noundef %return) #0 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !81 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !81 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !89 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !89 // CHECK:STDOUT: call void @_Z17make_copy_or_movev(ptr dead_on_unwind writable sret(%struct.CopyOrMove) align 1 %0) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassGlobal.Main() #1 !dbg !53 { +// CHECK:STDOUT: define void @_CPassGlobal.Main() #1 !dbg !57 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z17pass_copy_or_move10CopyOrMove.carbon_thunk._(ptr @_Cc.Main), !dbg !55 -// CHECK:STDOUT: ret void, !dbg !56 +// CHECK:STDOUT: call void @_Z17pass_copy_or_move10CopyOrMove.carbon_thunk._(ptr @_Cc.Main), !dbg !59 +// CHECK:STDOUT: ret void, !dbg !60 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable @@ -277,8 +291,8 @@ fn PassTemporary() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 // CHECK:STDOUT: %agg.tmp = alloca %struct.CopyOrMove, align 1 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !81 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !81 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !89 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !89 // CHECK:STDOUT: call void @_ZN10CopyOrMoveC1ERKS_(ptr noundef nonnull align 1 dereferenceable(1) %agg.tmp, ptr noundef nonnull align 1 dereferenceable(1) %1) // CHECK:STDOUT: call void @_Z17pass_copy_or_move10CopyOrMove(ptr nofreeobj noundef align 1 dereferenceable(1) %agg.tmp) // CHECK:STDOUT: call void @_ZN10CopyOrMoveD1Ev(ptr noundef nonnull align 1 dereferenceable(1) %agg.tmp) #1 @@ -286,14 +300,14 @@ fn PassTemporary() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassTemporary.Main() #1 !dbg !57 { +// CHECK:STDOUT: define void @_CPassTemporary.Main() #1 !dbg !61 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca [1 x i8], align 1, !dbg !58 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !58 -// CHECK:STDOUT: call void @_Z17make_copy_or_movev.carbon_thunk.(ptr %_.var), !dbg !59 -// CHECK:STDOUT: call void @_Z17pass_copy_or_move10CopyOrMove.carbon_thunk.v(ptr %_.var), !dbg !60 -// CHECK:STDOUT: call void @_ZN10CopyOrMoveD1Ev(ptr %_.var), !dbg !58 -// CHECK:STDOUT: ret void, !dbg !61 +// CHECK:STDOUT: %_.var = alloca [1 x i8], align 1, !dbg !62 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !62 +// CHECK:STDOUT: call void @_Z17make_copy_or_movev.carbon_thunk.(ptr %_.var), !dbg !63 +// CHECK:STDOUT: call void @_Z17pass_copy_or_move10CopyOrMove.carbon_thunk.v(ptr %_.var), !dbg !64 +// CHECK:STDOUT: call void @"_CSelfDestruct.47b8ebd18f50db75:core.Destroy.Core"(ptr %_.var), !dbg !62 +// CHECK:STDOUT: ret void, !dbg !65 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable @@ -301,8 +315,8 @@ fn PassTemporary() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 // CHECK:STDOUT: %agg.tmp = alloca %struct.CopyOrMove, align 1 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !81 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !81 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !89 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !89 // CHECK:STDOUT: call void @_ZN10CopyOrMoveC1EOS_(ptr noundef nonnull align 1 dereferenceable(1) %agg.tmp, ptr noundef nonnull align 1 dereferenceable(1) %1) // CHECK:STDOUT: call void @_Z17pass_copy_or_move10CopyOrMove(ptr nofreeobj noundef align 1 dereferenceable(1) %agg.tmp) // CHECK:STDOUT: call void @_ZN10CopyOrMoveD1Ev(ptr noundef nonnull align 1 dereferenceable(1) %agg.tmp) #1 @@ -313,27 +327,34 @@ fn PassTemporary() { // CHECK:STDOUT: declare void @_ZN10CopyOrMoveD1Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassValue.Main(ptr %c) #1 !dbg !62 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.47b8ebd18f50db75:core.Destroy.Core"(ptr %self) #1 !dbg !66 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z17pass_copy_or_move10CopyOrMove.carbon_thunk._(ptr %c), !dbg !66 -// CHECK:STDOUT: ret void, !dbg !67 +// CHECK:STDOUT: call void @_ZN10CopyOrMoveD1Ev(ptr %self), !dbg !68 +// CHECK:STDOUT: ret void, !dbg !68 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassRef.Main(ptr %c) #1 !dbg !69 { +// CHECK:STDOUT: define void @_CPassValue.Main(ptr %c) #1 !dbg !70 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z17pass_copy_or_move10CopyOrMove.carbon_thunk._(ptr %c), !dbg !73 -// CHECK:STDOUT: ret void, !dbg !74 +// CHECK:STDOUT: call void @_Z17pass_copy_or_move10CopyOrMove.carbon_thunk._(ptr %c), !dbg !74 +// CHECK:STDOUT: ret void, !dbg !75 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CPassRef.Main(ptr %c) #1 !dbg !77 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @_Z17pass_copy_or_move10CopyOrMove.carbon_thunk._(ptr %c), !dbg !81 +// CHECK:STDOUT: ret void, !dbg !82 // 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)) #3 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define internal void @_C__global_init.Main() #1 !dbg !76 { +// CHECK:STDOUT: define internal void @_C__global_init.Main() #1 !dbg !84 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z17make_copy_or_movev.carbon_thunk.(ptr @_Cc.Main), !dbg !77 -// CHECK:STDOUT: ret void, !dbg !79 +// CHECK:STDOUT: call void @_Z17make_copy_or_movev.carbon_thunk.(ptr @_Cc.Main), !dbg !85 +// CHECK:STDOUT: ret void, !dbg !87 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z17make_copy_or_movev(ptr dead_on_unwind writable sret(%struct.CopyOrMove) align 1) #4 @@ -345,7 +366,7 @@ fn PassTemporary() { // CHECK:STDOUT: declare void @_ZN10CopyOrMoveC1EOS_(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives -// CHECK:STDOUT: uselistorder ptr @_ZN10CopyOrMoveD1Ev, { 1, 2, 0 } +// CHECK:STDOUT: uselistorder ptr @_ZN10CopyOrMoveD1Ev, { 2, 1, 0 } // CHECK:STDOUT: uselistorder ptr @_Z17pass_copy_or_move10CopyOrMove, { 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { alwaysinline mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } @@ -354,9 +375,9 @@ fn PassTemporary() { // CHECK:STDOUT: attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!52} -// CHECK:STDOUT: !llvm.module.flags = !{!45, !46, !47, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!50} +// CHECK:STDOUT: !llvm.dbg.cu = !{!56} +// CHECK:STDOUT: !llvm.module.flags = !{!49, !50, !51, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!54} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -365,40 +386,44 @@ fn PassTemporary() { // CHECK:STDOUT: !10 = !DISubroutineType(types: !9) // CHECK:STDOUT: !11 = !{null} // CHECK:STDOUT: !12 = !DISubroutineType(types: !11) -// CHECK:STDOUT: !39 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !40 = !{!"omnipotent char", !39, i64 0} -// CHECK:STDOUT: !41 = !{!"any pointer", !40, i64 0} -// CHECK:STDOUT: !45 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !46 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !47 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !48 = !{!"int", !40, i64 0} -// CHECK:STDOUT: !49 = !{!"__libc_errno", !48, i64 0} -// CHECK:STDOUT: !50 = !{!49, !48, i64 0} -// CHECK:STDOUT: !51 = !DIFile(filename: "copy_or_move.carbon", directory: "") -// CHECK:STDOUT: !52 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !51, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "PassGlobal", linkageName: "_CPassGlobal.Main", scope: null, file: !51, line: 18, type: !12, spFlags: DISPFlagDefinition, unit: !52) -// CHECK:STDOUT: !55 = !DILocation(line: 19, column: 3, scope: !53) -// CHECK:STDOUT: !56 = !DILocation(line: 18, column: 1, scope: !53) -// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "PassTemporary", linkageName: "_CPassTemporary.Main", scope: null, file: !51, line: 22, type: !12, spFlags: DISPFlagDefinition, unit: !52) -// CHECK:STDOUT: !58 = !DILocation(line: 13, column: 34, scope: !57) -// CHECK:STDOUT: !59 = !DILocation(line: 23, column: 25, scope: !57) -// CHECK:STDOUT: !60 = !DILocation(line: 23, column: 3, scope: !57) -// CHECK:STDOUT: !61 = !DILocation(line: 22, column: 1, scope: !57) -// CHECK:STDOUT: !62 = distinct !DISubprogram(name: "PassValue", linkageName: "_CPassValue.Main", scope: null, file: !51, line: 26, type: !10, spFlags: DISPFlagDefinition, unit: !52, retainedNodes: !68) -// CHECK:STDOUT: !63 = !DILocalVariable(arg: 1, scope: !62, type: !8) -// CHECK:STDOUT: !66 = !DILocation(line: 27, column: 3, scope: !62) -// CHECK:STDOUT: !67 = !DILocation(line: 26, column: 1, scope: !62) -// CHECK:STDOUT: !68 = !{!63} -// CHECK:STDOUT: !69 = distinct !DISubprogram(name: "PassRef", linkageName: "_CPassRef.Main", scope: null, file: !51, line: 30, type: !10, spFlags: DISPFlagDefinition, unit: !52, retainedNodes: !75) -// CHECK:STDOUT: !70 = !DILocalVariable(arg: 1, scope: !69, type: !8) -// CHECK:STDOUT: !73 = !DILocation(line: 31, column: 3, scope: !69) -// CHECK:STDOUT: !74 = !DILocation(line: 30, column: 1, scope: !69) -// CHECK:STDOUT: !75 = !{!70} -// CHECK:STDOUT: !76 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !51, type: !12, spFlags: DISPFlagDefinition, unit: !52) -// CHECK:STDOUT: !77 = !DILocation(line: 16, column: 25, scope: !76) -// CHECK:STDOUT: !79 = !DILocation(line: 0, scope: !76) -// CHECK:STDOUT: !80 = !{!"p1 _ZTS10CopyOrMove", !41, i64 0} -// CHECK:STDOUT: !81 = !{!80, !80, i64 0} +// CHECK:STDOUT: !43 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !44 = !{!"omnipotent char", !43, i64 0} +// CHECK:STDOUT: !45 = !{!"any pointer", !44, i64 0} +// CHECK:STDOUT: !49 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !50 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !51 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !52 = !{!"int", !44, i64 0} +// CHECK:STDOUT: !53 = !{!"__libc_errno", !52, i64 0} +// CHECK:STDOUT: !54 = !{!53, !52, i64 0} +// CHECK:STDOUT: !55 = !DIFile(filename: "copy_or_move.carbon", directory: "") +// CHECK:STDOUT: !56 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !55, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "PassGlobal", linkageName: "_CPassGlobal.Main", scope: null, file: !55, line: 18, type: !12, spFlags: DISPFlagDefinition, unit: !56) +// CHECK:STDOUT: !59 = !DILocation(line: 19, column: 3, scope: !57) +// CHECK:STDOUT: !60 = !DILocation(line: 18, column: 1, scope: !57) +// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "PassTemporary", linkageName: "_CPassTemporary.Main", scope: null, file: !55, line: 22, type: !12, spFlags: DISPFlagDefinition, unit: !56) +// CHECK:STDOUT: !62 = !DILocation(line: 13, column: 34, scope: !61) +// CHECK:STDOUT: !63 = !DILocation(line: 23, column: 25, scope: !61) +// CHECK:STDOUT: !64 = !DILocation(line: 23, column: 3, scope: !61) +// CHECK:STDOUT: !65 = !DILocation(line: 22, column: 1, scope: !61) +// CHECK:STDOUT: !66 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.47b8ebd18f50db75:core.Destroy.Core", scope: null, file: !55, line: 13, type: !10, spFlags: DISPFlagDefinition, unit: !56, retainedNodes: !69) +// CHECK:STDOUT: !67 = !DILocalVariable(arg: 1, scope: !66, type: !8) +// CHECK:STDOUT: !68 = !DILocation(line: 13, column: 34, scope: !66) +// CHECK:STDOUT: !69 = !{!67} +// CHECK:STDOUT: !70 = distinct !DISubprogram(name: "PassValue", linkageName: "_CPassValue.Main", scope: null, file: !55, line: 26, type: !10, spFlags: DISPFlagDefinition, unit: !56, retainedNodes: !76) +// CHECK:STDOUT: !71 = !DILocalVariable(arg: 1, scope: !70, type: !8) +// CHECK:STDOUT: !74 = !DILocation(line: 27, column: 3, scope: !70) +// CHECK:STDOUT: !75 = !DILocation(line: 26, column: 1, scope: !70) +// CHECK:STDOUT: !76 = !{!71} +// CHECK:STDOUT: !77 = distinct !DISubprogram(name: "PassRef", linkageName: "_CPassRef.Main", scope: null, file: !55, line: 30, type: !10, spFlags: DISPFlagDefinition, unit: !56, retainedNodes: !83) +// CHECK:STDOUT: !78 = !DILocalVariable(arg: 1, scope: !77, type: !8) +// CHECK:STDOUT: !81 = !DILocation(line: 31, column: 3, scope: !77) +// CHECK:STDOUT: !82 = !DILocation(line: 30, column: 1, scope: !77) +// CHECK:STDOUT: !83 = !{!78} +// CHECK:STDOUT: !84 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !55, type: !12, spFlags: DISPFlagDefinition, unit: !56) +// CHECK:STDOUT: !85 = !DILocation(line: 16, column: 25, scope: !84) +// CHECK:STDOUT: !87 = !DILocation(line: 0, scope: !84) +// CHECK:STDOUT: !88 = !{!"p1 _ZTS10CopyOrMove", !45, i64 0} +// CHECK:STDOUT: !89 = !{!88, !88, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'move_only.carbon' @@ -415,27 +440,27 @@ fn PassTemporary() { // CHECK:STDOUT: define internal void @_Z14make_move_onlyv.carbon_thunk.(ptr noundef %return) #0 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !97 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !97 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !109 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !109 // CHECK:STDOUT: call void @_Z14make_move_onlyv(ptr dead_on_unwind writable sret(%struct.MoveOnly) align 1 %0) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassGlobalByMove.Main() #1 !dbg !85 { +// CHECK:STDOUT: define void @_CPassGlobalByMove.Main() #1 !dbg !93 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !86 +// CHECK:STDOUT: ret void, !dbg !94 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassTemporary.Main() #1 !dbg !87 { +// CHECK:STDOUT: define void @_CPassTemporary.Main() #1 !dbg !95 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca [1 x i8], align 1, !dbg !88 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !88 -// CHECK:STDOUT: call void @_Z14make_move_onlyv.carbon_thunk.(ptr %_.var), !dbg !89 -// CHECK:STDOUT: call void @_Z14pass_move_only8MoveOnly.carbon_thunk.v(ptr %_.var), !dbg !90 -// CHECK:STDOUT: call void @_ZN8MoveOnlyD1Ev(ptr %_.var), !dbg !88 -// CHECK:STDOUT: ret void, !dbg !91 +// CHECK:STDOUT: %_.var = alloca [1 x i8], align 1, !dbg !96 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !96 +// CHECK:STDOUT: call void @_Z14make_move_onlyv.carbon_thunk.(ptr %_.var), !dbg !97 +// CHECK:STDOUT: call void @_Z14pass_move_only8MoveOnly.carbon_thunk.v(ptr %_.var), !dbg !98 +// CHECK:STDOUT: call void @"_CSelfDestruct.48e50e337b0b966c:core.Destroy.Core"(ptr %_.var), !dbg !96 +// CHECK:STDOUT: ret void, !dbg !99 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable @@ -443,8 +468,8 @@ fn PassTemporary() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 // CHECK:STDOUT: %agg.tmp = alloca %struct.MoveOnly, align 1 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !97 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !97 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !109 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !109 // CHECK:STDOUT: call void @_ZN8MoveOnlyC1EOS_(ptr noundef nonnull align 1 dereferenceable(1) %agg.tmp, ptr noundef nonnull align 1 dereferenceable(1) %1) // CHECK:STDOUT: call void @_Z14pass_move_only8MoveOnly(ptr nofreeobj noundef align 1 dereferenceable(1) %agg.tmp) // CHECK:STDOUT: call void @_ZN8MoveOnlyD1Ev(ptr noundef nonnull align 1 dereferenceable(1) %agg.tmp) #1 @@ -454,14 +479,21 @@ fn PassTemporary() { // CHECK:STDOUT: ; Function Attrs: nounwind // CHECK:STDOUT: declare void @_ZN8MoveOnlyD1Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.48e50e337b0b966c:core.Destroy.Core"(ptr %self) #1 !dbg !100 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @_ZN8MoveOnlyD1Ev(ptr %self), !dbg !102 +// CHECK:STDOUT: ret void, !dbg !102 +// 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)) #3 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define internal void @_C__global_init.Main() #1 !dbg !92 { +// CHECK:STDOUT: define internal void @_C__global_init.Main() #1 !dbg !104 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z14make_move_onlyv.carbon_thunk.(ptr @_Cc.Main), !dbg !93 -// CHECK:STDOUT: ret void, !dbg !95 +// CHECK:STDOUT: call void @_Z14make_move_onlyv.carbon_thunk.(ptr @_Cc.Main), !dbg !105 +// CHECK:STDOUT: ret void, !dbg !107 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z14make_move_onlyv(ptr dead_on_unwind writable sret(%struct.MoveOnly) align 1) #4 @@ -479,35 +511,42 @@ fn PassTemporary() { // CHECK:STDOUT: attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!84} -// CHECK:STDOUT: !llvm.module.flags = !{!45, !46, !47, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!50} +// CHECK:STDOUT: !llvm.dbg.cu = !{!92} +// CHECK:STDOUT: !llvm.module.flags = !{!49, !50, !51, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!54} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !8 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !9 = !{null, !8} +// CHECK:STDOUT: !10 = !DISubroutineType(types: !9) // CHECK:STDOUT: !11 = !{null} // CHECK:STDOUT: !12 = !DISubroutineType(types: !11) -// CHECK:STDOUT: !39 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !40 = !{!"omnipotent char", !39, i64 0} -// CHECK:STDOUT: !41 = !{!"any pointer", !40, i64 0} -// CHECK:STDOUT: !45 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !46 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !47 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !48 = !{!"int", !40, i64 0} -// CHECK:STDOUT: !49 = !{!"__libc_errno", !48, i64 0} -// CHECK:STDOUT: !50 = !{!49, !48, i64 0} -// CHECK:STDOUT: !83 = !DIFile(filename: "move_only.carbon", directory: "") -// CHECK:STDOUT: !84 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !83, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !85 = distinct !DISubprogram(name: "PassGlobalByMove", linkageName: "_CPassGlobalByMove.Main", scope: null, file: !83, line: 22, type: !12, spFlags: DISPFlagDefinition, unit: !84) -// CHECK:STDOUT: !86 = !DILocation(line: 22, column: 1, scope: !85) -// CHECK:STDOUT: !87 = distinct !DISubprogram(name: "PassTemporary", linkageName: "_CPassTemporary.Main", scope: null, file: !83, line: 27, type: !12, spFlags: DISPFlagDefinition, unit: !84) -// CHECK:STDOUT: !88 = !DILocation(line: 17, column: 29, scope: !87) -// CHECK:STDOUT: !89 = !DILocation(line: 28, column: 22, scope: !87) -// CHECK:STDOUT: !90 = !DILocation(line: 28, column: 3, scope: !87) -// CHECK:STDOUT: !91 = !DILocation(line: 27, column: 1, scope: !87) -// CHECK:STDOUT: !92 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !83, type: !12, spFlags: DISPFlagDefinition, unit: !84) -// CHECK:STDOUT: !93 = !DILocation(line: 20, column: 23, scope: !92) -// CHECK:STDOUT: !95 = !DILocation(line: 0, scope: !92) -// CHECK:STDOUT: !96 = !{!"p1 _ZTS8MoveOnly", !41, i64 0} -// CHECK:STDOUT: !97 = !{!96, !96, i64 0} +// CHECK:STDOUT: !43 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !44 = !{!"omnipotent char", !43, i64 0} +// CHECK:STDOUT: !45 = !{!"any pointer", !44, i64 0} +// CHECK:STDOUT: !49 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !50 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !51 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !52 = !{!"int", !44, i64 0} +// CHECK:STDOUT: !53 = !{!"__libc_errno", !52, i64 0} +// CHECK:STDOUT: !54 = !{!53, !52, i64 0} +// CHECK:STDOUT: !91 = !DIFile(filename: "move_only.carbon", directory: "") +// CHECK:STDOUT: !92 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !91, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !93 = distinct !DISubprogram(name: "PassGlobalByMove", linkageName: "_CPassGlobalByMove.Main", scope: null, file: !91, line: 22, type: !12, spFlags: DISPFlagDefinition, unit: !92) +// CHECK:STDOUT: !94 = !DILocation(line: 22, column: 1, scope: !93) +// CHECK:STDOUT: !95 = distinct !DISubprogram(name: "PassTemporary", linkageName: "_CPassTemporary.Main", scope: null, file: !91, line: 27, type: !12, spFlags: DISPFlagDefinition, unit: !92) +// CHECK:STDOUT: !96 = !DILocation(line: 17, column: 29, scope: !95) +// CHECK:STDOUT: !97 = !DILocation(line: 28, column: 22, scope: !95) +// CHECK:STDOUT: !98 = !DILocation(line: 28, column: 3, scope: !95) +// CHECK:STDOUT: !99 = !DILocation(line: 27, column: 1, scope: !95) +// CHECK:STDOUT: !100 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.48e50e337b0b966c:core.Destroy.Core", scope: null, file: !91, line: 17, type: !10, spFlags: DISPFlagDefinition, unit: !92, retainedNodes: !103) +// CHECK:STDOUT: !101 = !DILocalVariable(arg: 1, scope: !100, type: !8) +// CHECK:STDOUT: !102 = !DILocation(line: 17, column: 29, scope: !100) +// CHECK:STDOUT: !103 = !{!101} +// CHECK:STDOUT: !104 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !91, type: !12, spFlags: DISPFlagDefinition, unit: !92) +// CHECK:STDOUT: !105 = !DILocation(line: 20, column: 23, scope: !104) +// CHECK:STDOUT: !107 = !DILocation(line: 0, scope: !104) +// CHECK:STDOUT: !108 = !{!"p1 _ZTS8MoveOnly", !45, i64 0} +// CHECK:STDOUT: !109 = !{!108, !108, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/class/import/destructor.carbon b/toolchain/lower/testdata/interop/cpp/class/import/destructor.carbon index 8f2a057f3647..4adfef9f6be1 100644 --- a/toolchain/lower/testdata/interop/cpp/class/import/destructor.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/import/destructor.carbon @@ -79,8 +79,9 @@ fn DestroyAIndirectly() { // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %_.var.loc17, ptr align 1 @Nontrivial.val.loc17_3, i64 0, i1 false), !dbg !44 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc18), !dbg !46 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %_.var.loc18, ptr align 1 @Constexpr.val.loc18_3, i64 0, i1 false), !dbg !46 -// CHECK:STDOUT: call void @_ZN9ConstexprD2Ev(ptr %_.var.loc18), !dbg !46 -// CHECK:STDOUT: call void @_ZN10NontrivialD1Ev(ptr %_.var.loc17), !dbg !44 +// CHECK:STDOUT: call void @"_CSelfDestruct.dec26c21eef1f685:core.Destroy.Core"(ptr %_.var.loc18), !dbg !46 +// CHECK:STDOUT: call void @"_CSelfDestruct.c1d87436718894ba:core.Destroy.Core"(ptr %_.var.loc17), !dbg !44 +// CHECK:STDOUT: call void @"_CSelfDestruct.74d7ad7746f17264:core.Destroy.Core"(ptr %_.var.loc16), !dbg !42 // CHECK:STDOUT: ret void, !dbg !48 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -88,82 +89,102 @@ fn DestroyAIndirectly() { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN9ConstexprD2Ev(ptr noundef nonnull align 1 dereferenceable(1) %this) unnamed_addr #1 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !98 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !110 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Destroy.74d6bfd440841f14.Core:Constexpr.Cpp"(ptr %self) #2 !dbg !49 { +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.dec26c21eef1f685:core.Destroy.Core"(ptr %self) #0 !dbg !49 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_ZN9ConstexprD2Ev(ptr %self), !dbg !52 -// CHECK:STDOUT: ret void, !dbg !52 +// CHECK:STDOUT: call void @_ZN9ConstexprD2Ev(ptr %self), !dbg !51 +// CHECK:STDOUT: ret void, !dbg !51 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy:thunk:Destroy.74d6bfd440841f14.Core:Constexpr.Cpp"(ptr %self) #2 !dbg !53 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @_ZN9ConstexprD2Ev(ptr %self), !dbg !56 +// CHECK:STDOUT: ret void, !dbg !56 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind // CHECK:STDOUT: declare void @_ZN10NontrivialD1Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 // CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Destroy.470f41253d102356.Core:Trivial.Cpp"(ptr %self) #2 !dbg !54 { +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.c1d87436718894ba:core.Destroy.Core"(ptr %self) #0 !dbg !58 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !57 +// CHECK:STDOUT: call void @_ZN10NontrivialD1Ev(ptr %self), !dbg !60 +// CHECK:STDOUT: ret void, !dbg !60 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @"_CMake.Trivial.Cpp:Make.Main"(ptr sret({}) %return) #0 !dbg !59 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.74d7ad7746f17264:core.Destroy.Core"(ptr %self) #0 !dbg !62 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_ZN7TrivialC1Ev.carbon_thunk.(ptr %return), !dbg !62 -// CHECK:STDOUT: ret void, !dbg !63 +// CHECK:STDOUT: ret void, !dbg !64 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy:thunk:Destroy.470f41253d102356.Core:Trivial.Cpp"(ptr %self) #2 !dbg !66 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !69 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @"_CMake.Trivial.Cpp:Make.Main"(ptr sret({}) %return) #0 !dbg !71 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @_ZN7TrivialC1Ev.carbon_thunk.(ptr %return), !dbg !74 +// CHECK:STDOUT: ret void, !dbg !75 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable // CHECK:STDOUT: define internal void @_ZN7TrivialC1Ev.carbon_thunk.(ptr noundef %return) #4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !100 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !100 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !112 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !112 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @"_CMake.Nontrivial.Cpp:Make.Main"(ptr sret({}) %return) #0 !dbg !64 { +// CHECK:STDOUT: define void @"_CMake.Nontrivial.Cpp:Make.Main"(ptr sret({}) %return) #0 !dbg !76 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_ZN10NontrivialC1Ev.carbon_thunk.(ptr %return), !dbg !67 -// CHECK:STDOUT: ret void, !dbg !68 +// CHECK:STDOUT: call void @_ZN10NontrivialC1Ev.carbon_thunk.(ptr %return), !dbg !79 +// CHECK:STDOUT: ret void, !dbg !80 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable // CHECK:STDOUT: define internal void @_ZN10NontrivialC1Ev.carbon_thunk.(ptr noundef %return) #4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !102 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !102 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !114 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !114 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @"_CMake.Constexpr.Cpp:Make.Main"(ptr sret({}) %return) #0 !dbg !69 { +// CHECK:STDOUT: define void @"_CMake.Constexpr.Cpp:Make.Main"(ptr sret({}) %return) #0 !dbg !81 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_ZN9ConstexprC1Ev.carbon_thunk.(ptr %return), !dbg !72 -// CHECK:STDOUT: ret void, !dbg !73 +// CHECK:STDOUT: call void @_ZN9ConstexprC1Ev.carbon_thunk.(ptr %return), !dbg !84 +// CHECK:STDOUT: ret void, !dbg !85 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable // CHECK:STDOUT: define internal void @_ZN9ConstexprC1Ev.carbon_thunk.(ptr noundef %return) #4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !98 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !98 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !110 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !110 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CDestroyAIndirectly.Main() #0 !dbg !74 { +// CHECK:STDOUT: define void @_CDestroyAIndirectly.Main() #0 !dbg !86 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CDestroyIndirectly.Main.2a28a415478a31f5(), !dbg !75 -// CHECK:STDOUT: call void @_CDestroyIndirectly.Main.a0f524e76111d8a1(), !dbg !76 -// CHECK:STDOUT: call void @_CDestroyIndirectly.Main.bf648cc7ac7f04db(), !dbg !77 -// CHECK:STDOUT: ret void, !dbg !78 +// CHECK:STDOUT: call void @_CDestroyIndirectly.Main.bbfc87135555afbb(), !dbg !87 +// CHECK:STDOUT: call void @_CDestroyIndirectly.Main.cbf5e6d817f75fdf(), !dbg !88 +// CHECK:STDOUT: call void @_CDestroyIndirectly.Main.310c2661ae23419f(), !dbg !89 +// CHECK:STDOUT: ret void, !dbg !90 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -173,33 +194,33 @@ fn DestroyAIndirectly() { // CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #5 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CDestroyIndirectly.Main.2a28a415478a31f5() #0 !dbg !79 { +// CHECK:STDOUT: define linkonce_odr void @_CDestroyIndirectly.Main.bbfc87135555afbb() #0 !dbg !91 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %a.var = alloca {}, align 1, !dbg !80 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !80 -// CHECK:STDOUT: call void @"_CMake.Trivial.Cpp:Make.Main"(ptr %a.var), !dbg !81 -// CHECK:STDOUT: call void @"_COp:thunk:Destroy.470f41253d102356.Core:Trivial.Cpp"(ptr %a.var), !dbg !80 -// CHECK:STDOUT: ret void, !dbg !83 +// CHECK:STDOUT: %a.var = alloca {}, align 1, !dbg !92 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !92 +// CHECK:STDOUT: call void @"_CMake.Trivial.Cpp:Make.Main"(ptr %a.var), !dbg !93 +// CHECK:STDOUT: call void @"_CSelfDestruct.74d7ad7746f17264:core.Destroy.Core"(ptr %a.var), !dbg !92 +// CHECK:STDOUT: ret void, !dbg !95 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CDestroyIndirectly.Main.a0f524e76111d8a1() #0 !dbg !84 { +// CHECK:STDOUT: define linkonce_odr void @_CDestroyIndirectly.Main.cbf5e6d817f75fdf() #0 !dbg !96 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %a.var = alloca {}, align 1, !dbg !85 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !85 -// CHECK:STDOUT: call void @"_CMake.Nontrivial.Cpp:Make.Main"(ptr %a.var), !dbg !86 -// CHECK:STDOUT: call void @_ZN10NontrivialD1Ev(ptr %a.var), !dbg !85 -// CHECK:STDOUT: ret void, !dbg !88 +// CHECK:STDOUT: %a.var = alloca {}, align 1, !dbg !97 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !97 +// CHECK:STDOUT: call void @"_CMake.Nontrivial.Cpp:Make.Main"(ptr %a.var), !dbg !98 +// CHECK:STDOUT: call void @"_CSelfDestruct.c1d87436718894ba:core.Destroy.Core"(ptr %a.var), !dbg !97 +// CHECK:STDOUT: ret void, !dbg !100 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CDestroyIndirectly.Main.bf648cc7ac7f04db() #0 !dbg !89 { +// CHECK:STDOUT: define linkonce_odr void @_CDestroyIndirectly.Main.310c2661ae23419f() #0 !dbg !101 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %a.var = alloca {}, align 1, !dbg !90 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !90 -// CHECK:STDOUT: call void @"_CMake.Constexpr.Cpp:Make.Main"(ptr %a.var), !dbg !91 -// CHECK:STDOUT: call void @"_COp:thunk:Destroy.74d6bfd440841f14.Core:Constexpr.Cpp"(ptr %a.var), !dbg !90 -// CHECK:STDOUT: ret void, !dbg !93 +// CHECK:STDOUT: %a.var = alloca {}, align 1, !dbg !102 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !102 +// CHECK:STDOUT: call void @"_CMake.Constexpr.Cpp:Make.Main"(ptr %a.var), !dbg !103 +// CHECK:STDOUT: call void @"_CSelfDestruct.dec26c21eef1f685:core.Destroy.Core"(ptr %a.var), !dbg !102 +// CHECK:STDOUT: ret void, !dbg !105 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -215,8 +236,8 @@ fn DestroyAIndirectly() { // CHECK:STDOUT: attributes #5 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!33} -// CHECK:STDOUT: !llvm.module.flags = !{!103, !104, !105, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!108} +// CHECK:STDOUT: !llvm.module.flags = !{!115, !116, !117, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!120} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -234,53 +255,65 @@ fn DestroyAIndirectly() { // CHECK:STDOUT: !44 = !DILocation(line: 17, column: 3, scope: !41) // CHECK:STDOUT: !46 = !DILocation(line: 18, column: 3, scope: !41) // CHECK:STDOUT: !48 = !DILocation(line: 15, column: 1, scope: !41) -// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Destroy.74d6bfd440841f14.Core:Constexpr.Cpp", scope: null, file: !32, line: 11, type: !38, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !53) +// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.dec26c21eef1f685:core.Destroy.Core", scope: null, file: !32, line: 18, type: !38, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !52) // CHECK:STDOUT: !50 = !DILocalVariable(arg: 1, scope: !49, type: !36) -// CHECK:STDOUT: !52 = !DILocation(line: 11, column: 13, scope: !49) -// CHECK:STDOUT: !53 = !{!50} -// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Destroy.470f41253d102356.Core:Trivial.Cpp", scope: null, file: !32, line: 6, type: !38, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !58) -// CHECK:STDOUT: !55 = !DILocalVariable(arg: 1, scope: !54, type: !36) -// CHECK:STDOUT: !57 = !DILocation(line: 6, column: 8, scope: !54) -// CHECK:STDOUT: !58 = !{!55} -// CHECK:STDOUT: !59 = distinct !DISubprogram(name: "Make", linkageName: "_CMake.Trivial.Cpp:Make.Main", scope: null, file: !32, line: 25, type: !40, spFlags: DISPFlagDefinition, unit: !33) -// CHECK:STDOUT: !62 = !DILocation(line: 25, column: 30, scope: !59) -// CHECK:STDOUT: !63 = !DILocation(line: 25, column: 23, scope: !59) -// CHECK:STDOUT: !64 = distinct !DISubprogram(name: "Make", linkageName: "_CMake.Nontrivial.Cpp:Make.Main", scope: null, file: !32, line: 28, type: !40, spFlags: DISPFlagDefinition, unit: !33) -// CHECK:STDOUT: !67 = !DILocation(line: 28, column: 30, scope: !64) -// CHECK:STDOUT: !68 = !DILocation(line: 28, column: 23, scope: !64) -// CHECK:STDOUT: !69 = distinct !DISubprogram(name: "Make", linkageName: "_CMake.Constexpr.Cpp:Make.Main", scope: null, file: !32, line: 31, type: !40, spFlags: DISPFlagDefinition, unit: !33) -// CHECK:STDOUT: !72 = !DILocation(line: 31, column: 30, scope: !69) -// CHECK:STDOUT: !73 = !DILocation(line: 31, column: 23, scope: !69) -// CHECK:STDOUT: !74 = distinct !DISubprogram(name: "DestroyAIndirectly", linkageName: "_CDestroyAIndirectly.Main", scope: null, file: !32, line: 38, type: !35, spFlags: DISPFlagDefinition, unit: !33) -// CHECK:STDOUT: !75 = !DILocation(line: 39, column: 3, scope: !74) -// CHECK:STDOUT: !76 = !DILocation(line: 40, column: 3, scope: !74) -// CHECK:STDOUT: !77 = !DILocation(line: 41, column: 3, scope: !74) -// CHECK:STDOUT: !78 = !DILocation(line: 38, column: 1, scope: !74) -// CHECK:STDOUT: !79 = distinct !DISubprogram(name: "DestroyIndirectly", linkageName: "_CDestroyIndirectly.Main.2a28a415478a31f5", scope: null, file: !32, line: 34, type: !35, spFlags: DISPFlagDefinition, unit: !33) -// CHECK:STDOUT: !80 = !DILocation(line: 35, column: 3, scope: !79) -// CHECK:STDOUT: !81 = !DILocation(line: 35, column: 21, scope: !79) -// CHECK:STDOUT: !83 = !DILocation(line: 34, column: 1, scope: !79) -// CHECK:STDOUT: !84 = distinct !DISubprogram(name: "DestroyIndirectly", linkageName: "_CDestroyIndirectly.Main.a0f524e76111d8a1", scope: null, file: !32, line: 34, type: !35, spFlags: DISPFlagDefinition, unit: !33) -// CHECK:STDOUT: !85 = !DILocation(line: 35, column: 3, scope: !84) -// CHECK:STDOUT: !86 = !DILocation(line: 35, column: 21, scope: !84) -// CHECK:STDOUT: !88 = !DILocation(line: 34, column: 1, scope: !84) -// CHECK:STDOUT: !89 = distinct !DISubprogram(name: "DestroyIndirectly", linkageName: "_CDestroyIndirectly.Main.bf648cc7ac7f04db", scope: null, file: !32, line: 34, type: !35, spFlags: DISPFlagDefinition, unit: !33) -// CHECK:STDOUT: !90 = !DILocation(line: 35, column: 3, scope: !89) -// CHECK:STDOUT: !91 = !DILocation(line: 35, column: 21, scope: !89) -// CHECK:STDOUT: !93 = !DILocation(line: 34, column: 1, scope: !89) -// CHECK:STDOUT: !94 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !95 = !{!"omnipotent char", !94, i64 0} -// CHECK:STDOUT: !96 = !{!"any pointer", !95, i64 0} -// CHECK:STDOUT: !97 = !{!"p1 _ZTS9Constexpr", !96, i64 0} -// CHECK:STDOUT: !98 = !{!97, !97, i64 0} -// CHECK:STDOUT: !99 = !{!"p1 _ZTS7Trivial", !96, i64 0} -// CHECK:STDOUT: !100 = !{!99, !99, i64 0} -// CHECK:STDOUT: !101 = !{!"p1 _ZTS10Nontrivial", !96, i64 0} -// CHECK:STDOUT: !102 = !{!101, !101, i64 0} -// CHECK:STDOUT: !103 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !104 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !105 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !106 = !{!"int", !95, i64 0} -// CHECK:STDOUT: !107 = !{!"__libc_errno", !106, i64 0} -// CHECK:STDOUT: !108 = !{!107, !106, i64 0} +// CHECK:STDOUT: !51 = !DILocation(line: 18, column: 3, scope: !49) +// CHECK:STDOUT: !52 = !{!50} +// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy:thunk:Destroy.74d6bfd440841f14.Core:Constexpr.Cpp", scope: null, file: !32, line: 11, type: !38, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !57) +// CHECK:STDOUT: !54 = !DILocalVariable(arg: 1, scope: !53, type: !36) +// CHECK:STDOUT: !56 = !DILocation(line: 11, column: 13, scope: !53) +// CHECK:STDOUT: !57 = !{!54} +// CHECK:STDOUT: !58 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.c1d87436718894ba:core.Destroy.Core", scope: null, file: !32, line: 17, type: !38, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !61) +// CHECK:STDOUT: !59 = !DILocalVariable(arg: 1, scope: !58, type: !36) +// CHECK:STDOUT: !60 = !DILocation(line: 17, column: 3, scope: !58) +// CHECK:STDOUT: !61 = !{!59} +// CHECK:STDOUT: !62 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.74d7ad7746f17264:core.Destroy.Core", scope: null, file: !32, line: 16, type: !38, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !65) +// CHECK:STDOUT: !63 = !DILocalVariable(arg: 1, scope: !62, type: !36) +// CHECK:STDOUT: !64 = !DILocation(line: 16, column: 3, scope: !62) +// CHECK:STDOUT: !65 = !{!63} +// CHECK:STDOUT: !66 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy:thunk:Destroy.470f41253d102356.Core:Trivial.Cpp", scope: null, file: !32, line: 6, type: !38, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !70) +// CHECK:STDOUT: !67 = !DILocalVariable(arg: 1, scope: !66, type: !36) +// CHECK:STDOUT: !69 = !DILocation(line: 6, column: 8, scope: !66) +// CHECK:STDOUT: !70 = !{!67} +// CHECK:STDOUT: !71 = distinct !DISubprogram(name: "Make", linkageName: "_CMake.Trivial.Cpp:Make.Main", scope: null, file: !32, line: 25, type: !40, spFlags: DISPFlagDefinition, unit: !33) +// CHECK:STDOUT: !74 = !DILocation(line: 25, column: 30, scope: !71) +// CHECK:STDOUT: !75 = !DILocation(line: 25, column: 23, scope: !71) +// CHECK:STDOUT: !76 = distinct !DISubprogram(name: "Make", linkageName: "_CMake.Nontrivial.Cpp:Make.Main", scope: null, file: !32, line: 28, type: !40, spFlags: DISPFlagDefinition, unit: !33) +// CHECK:STDOUT: !79 = !DILocation(line: 28, column: 30, scope: !76) +// CHECK:STDOUT: !80 = !DILocation(line: 28, column: 23, scope: !76) +// CHECK:STDOUT: !81 = distinct !DISubprogram(name: "Make", linkageName: "_CMake.Constexpr.Cpp:Make.Main", scope: null, file: !32, line: 31, type: !40, spFlags: DISPFlagDefinition, unit: !33) +// CHECK:STDOUT: !84 = !DILocation(line: 31, column: 30, scope: !81) +// CHECK:STDOUT: !85 = !DILocation(line: 31, column: 23, scope: !81) +// CHECK:STDOUT: !86 = distinct !DISubprogram(name: "DestroyAIndirectly", linkageName: "_CDestroyAIndirectly.Main", scope: null, file: !32, line: 38, type: !35, spFlags: DISPFlagDefinition, unit: !33) +// CHECK:STDOUT: !87 = !DILocation(line: 39, column: 3, scope: !86) +// CHECK:STDOUT: !88 = !DILocation(line: 40, column: 3, scope: !86) +// CHECK:STDOUT: !89 = !DILocation(line: 41, column: 3, scope: !86) +// CHECK:STDOUT: !90 = !DILocation(line: 38, column: 1, scope: !86) +// CHECK:STDOUT: !91 = distinct !DISubprogram(name: "DestroyIndirectly", linkageName: "_CDestroyIndirectly.Main.bbfc87135555afbb", scope: null, file: !32, line: 34, type: !35, spFlags: DISPFlagDefinition, unit: !33) +// CHECK:STDOUT: !92 = !DILocation(line: 35, column: 3, scope: !91) +// CHECK:STDOUT: !93 = !DILocation(line: 35, column: 21, scope: !91) +// CHECK:STDOUT: !95 = !DILocation(line: 34, column: 1, scope: !91) +// CHECK:STDOUT: !96 = distinct !DISubprogram(name: "DestroyIndirectly", linkageName: "_CDestroyIndirectly.Main.cbf5e6d817f75fdf", scope: null, file: !32, line: 34, type: !35, spFlags: DISPFlagDefinition, unit: !33) +// CHECK:STDOUT: !97 = !DILocation(line: 35, column: 3, scope: !96) +// CHECK:STDOUT: !98 = !DILocation(line: 35, column: 21, scope: !96) +// CHECK:STDOUT: !100 = !DILocation(line: 34, column: 1, scope: !96) +// CHECK:STDOUT: !101 = distinct !DISubprogram(name: "DestroyIndirectly", linkageName: "_CDestroyIndirectly.Main.310c2661ae23419f", scope: null, file: !32, line: 34, type: !35, spFlags: DISPFlagDefinition, unit: !33) +// CHECK:STDOUT: !102 = !DILocation(line: 35, column: 3, scope: !101) +// CHECK:STDOUT: !103 = !DILocation(line: 35, column: 21, scope: !101) +// CHECK:STDOUT: !105 = !DILocation(line: 34, column: 1, scope: !101) +// CHECK:STDOUT: !106 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !107 = !{!"omnipotent char", !106, i64 0} +// CHECK:STDOUT: !108 = !{!"any pointer", !107, i64 0} +// CHECK:STDOUT: !109 = !{!"p1 _ZTS9Constexpr", !108, i64 0} +// CHECK:STDOUT: !110 = !{!109, !109, i64 0} +// CHECK:STDOUT: !111 = !{!"p1 _ZTS7Trivial", !108, i64 0} +// CHECK:STDOUT: !112 = !{!111, !111, i64 0} +// CHECK:STDOUT: !113 = !{!"p1 _ZTS10Nontrivial", !108, i64 0} +// CHECK:STDOUT: !114 = !{!113, !113, i64 0} +// CHECK:STDOUT: !115 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !116 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !117 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !118 = !{!"int", !107, i64 0} +// CHECK:STDOUT: !119 = !{!"__libc_errno", !118, i64 0} +// CHECK:STDOUT: !120 = !{!119, !118, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/class/import/dynamic.carbon b/toolchain/lower/testdata/interop/cpp/class/import/dynamic.carbon index 666573af7db4..0b9ed01a6778 100644 --- a/toolchain/lower/testdata/interop/cpp/class/import/dynamic.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/import/dynamic.carbon @@ -104,53 +104,73 @@ fn DoThing() { // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind // CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.Derived.Main"(ptr %self) #3 !dbg !60 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @"_COp.b25525d21a9bd472:core.Destroy.Core"(ptr %self), !dbg !62 +// CHECK:STDOUT: call void @"_CSelfDestruct.b25525d21a9bd472:core.Destroy.Core"(ptr %self), !dbg !62 // CHECK:STDOUT: ret void, !dbg !62 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.0a0b9df20a60c6f6:core.Destroy.Core"(ptr %self) #2 !dbg !64 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.352b8f386f44a614:core.Destroy.Core"(ptr %self) #2 !dbg !64 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !66 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.b25525d21a9bd472:core.Destroy.Core"(ptr %self) #2 !dbg !68 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.0a0b9df20a60c6f6:core.Destroy.Core"(ptr %self) #2 !dbg !68 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !70 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_Cfunc__carbon_thunk.Derived.Main(ptr %self) #2 !dbg !72 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.0a0b9df20a60c6f6:core.Destroy.Core"(ptr %self) #2 !dbg !72 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Cfunc.Derived.Main(ptr %self), !dbg !74 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.0a0b9df20a60c6f6:core.Destroy.Core"(ptr %self), !dbg !74 // CHECK:STDOUT: ret void, !dbg !74 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_Cother_func__carbon_thunk.Derived.Main(ptr %self) #2 !dbg !76 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.b25525d21a9bd472:core.Destroy.Core"(ptr %self) #2 !dbg !76 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Derived.other_func.call.vtable = load ptr, ptr %self, align 8, !dbg !78 -// CHECK:STDOUT: %Derived.other_func.call = call ptr @llvm.load.relative.i32(ptr %Derived.other_func.call.vtable, i32 8), !dbg !78 -// CHECK:STDOUT: call void %Derived.other_func.call(ptr %self), !dbg !78 // CHECK:STDOUT: ret void, !dbg !78 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CDoThing.Main() #2 !dbg !80 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.b25525d21a9bd472:core.Destroy.Core"(ptr %self) #2 !dbg !80 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %d.var = alloca { [16 x i8] }, align 8, !dbg !81 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %d.var), !dbg !81 -// CHECK:STDOUT: %.loc31_44.1.base = getelementptr inbounds nuw { [16 x i8] }, ptr %d.var, i32 0, i32 0, !dbg !82 -// CHECK:STDOUT: call void @_ZN4BaseC1Ev.carbon_thunk.(ptr %.loc31_44.1.base), !dbg !83 -// CHECK:STDOUT: %.loc31_44.7.base = getelementptr inbounds nuw { [16 x i8] }, ptr %d.var, i32 0, i32 0, !dbg !82 -// CHECK:STDOUT: %.loc31_44.8.base = getelementptr inbounds nuw [16 x i8], ptr %.loc31_44.7.base, i32 0, i32 0, !dbg !82 -// CHECK:STDOUT: %.loc31_44.9.vptr = getelementptr inbounds nuw [8 x i8], ptr %.loc31_44.8.base, i32 0, i32 0, !dbg !82 -// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-16, 24) ({ [5 x ptr] }, ptr @_ZTVN6Carbon7DerivedE, i32 0, i32 0, i32 2), ptr %.loc31_44.9.vptr, align 8, !dbg !82 -// CHECK:STDOUT: %.loc32_11.2.base = getelementptr inbounds nuw { [16 x i8] }, ptr %d.var, i32 0, i32 0, !dbg !86 -// CHECK:STDOUT: call void @_Z3UseR4Base(ptr %.loc32_11.2.base), !dbg !87 -// CHECK:STDOUT: call void @"_COp.b25525d21a9bd472:core.Destroy.Core"(ptr %d.var), !dbg !81 -// CHECK:STDOUT: ret void, !dbg !88 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.b25525d21a9bd472:core.Destroy.Core"(ptr %self), !dbg !82 +// CHECK:STDOUT: ret void, !dbg !82 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_Cfunc__carbon_thunk.Derived.Main(ptr %self) #2 !dbg !84 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @_Cfunc.Derived.Main(ptr %self), !dbg !86 +// CHECK:STDOUT: ret void, !dbg !86 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_Cother_func__carbon_thunk.Derived.Main(ptr %self) #2 !dbg !88 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %Derived.other_func.call.vtable = load ptr, ptr %self, align 8, !dbg !90 +// CHECK:STDOUT: %Derived.other_func.call = call ptr @llvm.load.relative.i32(ptr %Derived.other_func.call.vtable, i32 8), !dbg !90 +// CHECK:STDOUT: call void %Derived.other_func.call(ptr %self), !dbg !90 +// CHECK:STDOUT: ret void, !dbg !90 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CDoThing.Main() #2 !dbg !92 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %d.var = alloca { [16 x i8] }, align 8, !dbg !93 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %d.var), !dbg !93 +// CHECK:STDOUT: %.loc31_44.1.base = getelementptr inbounds nuw { [16 x i8] }, ptr %d.var, i32 0, i32 0, !dbg !94 +// CHECK:STDOUT: call void @_ZN4BaseC1Ev.carbon_thunk.(ptr %.loc31_44.1.base), !dbg !95 +// CHECK:STDOUT: %.loc31_44.7.base = getelementptr inbounds nuw { [16 x i8] }, ptr %d.var, i32 0, i32 0, !dbg !94 +// CHECK:STDOUT: %.loc31_44.8.base = getelementptr inbounds nuw [16 x i8], ptr %.loc31_44.7.base, i32 0, i32 0, !dbg !94 +// CHECK:STDOUT: %.loc31_44.9.vptr = getelementptr inbounds nuw [8 x i8], ptr %.loc31_44.8.base, i32 0, i32 0, !dbg !94 +// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-16, 24) ({ [5 x ptr] }, ptr @_ZTVN6Carbon7DerivedE, i32 0, i32 0, i32 2), ptr %.loc31_44.9.vptr, align 8, !dbg !94 +// CHECK:STDOUT: %.loc32_11.2.base = getelementptr inbounds nuw { [16 x i8] }, ptr %d.var, i32 0, i32 0, !dbg !98 +// CHECK:STDOUT: call void @_Z3UseR4Base(ptr %.loc32_11.2.base), !dbg !99 +// CHECK:STDOUT: call void @"_CSelfDestruct.b25525d21a9bd472:core.Destroy.Core"(ptr %d.var), !dbg !93 +// CHECK:STDOUT: ret void, !dbg !100 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable @@ -173,7 +193,7 @@ fn DoThing() { // CHECK:STDOUT: define internal void @_ZNR6Carbon7Derived4funcEv(ptr noundef nonnull align 8 dereferenceable(12) %this) unnamed_addr #4 align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !94 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !106 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: call void @_Cfunc__carbon_thunk.Derived.Main(ptr noundef nonnull align 8 dereferenceable(12) %this1) // CHECK:STDOUT: ret void @@ -183,7 +203,7 @@ fn DoThing() { // CHECK:STDOUT: define internal void @_ZNK6Carbon7Derived10other_funcEv(ptr noundef nonnull align 8 dereferenceable(12) %this) unnamed_addr #4 align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !94 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !106 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: call void @_Cother_func__carbon_thunk.Derived.Main(ptr noundef nonnull align 8 dereferenceable(12) %this1) // CHECK:STDOUT: ret void @@ -196,7 +216,7 @@ fn DoThing() { // CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !4 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: call void @_ZN11FurtherBaseC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %this1) #2 -// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-16, 16) ({ [4 x ptr] }, ptr @_ZTV4Base, i32 0, i32 0, i32 2), ptr %this1, align 8, !tbaa !90 +// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-16, 16) ({ [4 x ptr] }, ptr @_ZTV4Base, i32 0, i32 0, i32 2), ptr %this1, align 8, !tbaa !102 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: @@ -204,9 +224,9 @@ fn DoThing() { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN11FurtherBaseC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %this) unnamed_addr #7 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !92 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !104 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 -// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-16, 8) ({ [3 x ptr] }, ptr @_ZTV11FurtherBase, i32 0, i32 0, i32 2), ptr %this1, align 8, !tbaa !90 +// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-16, 8) ({ [3 x ptr] }, ptr @_ZTV11FurtherBase, i32 0, i32 0, i32 2), ptr %this1, align 8, !tbaa !102 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: @@ -223,8 +243,8 @@ fn DoThing() { // CHECK:STDOUT: attributes #7 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!38} -// CHECK:STDOUT: !llvm.module.flags = !{!99, !100, !101, !7, !8} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!103} +// CHECK:STDOUT: !llvm.module.flags = !{!111, !112, !113, !7, !8} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!115} // CHECK:STDOUT: // CHECK:STDOUT: !0 = !{!"Simple C++ TBAA"} // CHECK:STDOUT: !1 = !{!"omnipotent char", !0, i64 0} @@ -256,39 +276,51 @@ fn DoThing() { // CHECK:STDOUT: !61 = !DILocalVariable(arg: 1, scope: !60, type: !40) // CHECK:STDOUT: !62 = !DILocation(line: 22, column: 1, scope: !60) // CHECK:STDOUT: !63 = !{!61} -// CHECK:STDOUT: !64 = distinct !DISubprogram(name: "Op", linkageName: "_COp.0a0b9df20a60c6f6:core.Destroy.Core", scope: null, file: !37, line: 22, type: !42, spFlags: DISPFlagDefinition, unit: !38, retainedNodes: !67) +// CHECK:STDOUT: !64 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.352b8f386f44a614:core.Destroy.Core", scope: null, file: !37, line: 22, type: !42, spFlags: DISPFlagDefinition, unit: !38, retainedNodes: !67) // CHECK:STDOUT: !65 = !DILocalVariable(arg: 1, scope: !64, type: !40) // CHECK:STDOUT: !66 = !DILocation(line: 22, column: 1, scope: !64) // CHECK:STDOUT: !67 = !{!65} -// CHECK:STDOUT: !68 = distinct !DISubprogram(name: "Op", linkageName: "_COp.b25525d21a9bd472:core.Destroy.Core", scope: null, file: !37, line: 22, type: !42, spFlags: DISPFlagDefinition, unit: !38, retainedNodes: !71) +// CHECK:STDOUT: !68 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.0a0b9df20a60c6f6:core.Destroy.Core", scope: null, file: !37, line: 22, type: !42, spFlags: DISPFlagDefinition, unit: !38, retainedNodes: !71) // CHECK:STDOUT: !69 = !DILocalVariable(arg: 1, scope: !68, type: !40) // CHECK:STDOUT: !70 = !DILocation(line: 22, column: 1, scope: !68) // CHECK:STDOUT: !71 = !{!69} -// CHECK:STDOUT: !72 = distinct !DISubprogram(name: "func__carbon_thunk", linkageName: "_Cfunc__carbon_thunk.Derived.Main", scope: null, file: !37, line: 26, type: !42, spFlags: DISPFlagDefinition, unit: !38, retainedNodes: !75) +// CHECK:STDOUT: !72 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.0a0b9df20a60c6f6:core.Destroy.Core", scope: null, file: !37, line: 22, type: !42, spFlags: DISPFlagDefinition, unit: !38, retainedNodes: !75) // CHECK:STDOUT: !73 = !DILocalVariable(arg: 1, scope: !72, type: !40) -// CHECK:STDOUT: !74 = !DILocation(line: 26, column: 3, scope: !72) +// CHECK:STDOUT: !74 = !DILocation(line: 22, column: 1, scope: !72) // CHECK:STDOUT: !75 = !{!73} -// CHECK:STDOUT: !76 = distinct !DISubprogram(name: "other_func__carbon_thunk", linkageName: "_Cother_func__carbon_thunk.Derived.Main", scope: null, file: !37, line: 24, type: !42, spFlags: DISPFlagDefinition, unit: !38, retainedNodes: !79) +// CHECK:STDOUT: !76 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.b25525d21a9bd472:core.Destroy.Core", scope: null, file: !37, line: 22, type: !42, spFlags: DISPFlagDefinition, unit: !38, retainedNodes: !79) // CHECK:STDOUT: !77 = !DILocalVariable(arg: 1, scope: !76, type: !40) -// CHECK:STDOUT: !78 = !DILocation(line: 24, column: 3, scope: !76) +// CHECK:STDOUT: !78 = !DILocation(line: 22, column: 1, scope: !76) // CHECK:STDOUT: !79 = !{!77} -// CHECK:STDOUT: !80 = distinct !DISubprogram(name: "DoThing", linkageName: "_CDoThing.Main", scope: null, file: !37, line: 30, type: !44, spFlags: DISPFlagDefinition, unit: !38) -// CHECK:STDOUT: !81 = !DILocation(line: 31, column: 3, scope: !80) -// CHECK:STDOUT: !82 = !DILocation(line: 31, column: 20, scope: !80) -// CHECK:STDOUT: !83 = !DILocation(line: 31, column: 29, scope: !80) -// CHECK:STDOUT: !86 = !DILocation(line: 32, column: 11, scope: !80) -// CHECK:STDOUT: !87 = !DILocation(line: 32, column: 3, scope: !80) -// CHECK:STDOUT: !88 = !DILocation(line: 30, column: 1, scope: !80) -// CHECK:STDOUT: !89 = !{!"vtable pointer", !0, i64 0} -// CHECK:STDOUT: !90 = !{!89, !89, i64 0} -// CHECK:STDOUT: !91 = !{!"p1 _ZTS11FurtherBase", !2, i64 0} -// CHECK:STDOUT: !92 = !{!91, !91, i64 0} -// CHECK:STDOUT: !93 = !{!"p1 _ZTSN6Carbon7DerivedE", !2, i64 0} -// CHECK:STDOUT: !94 = !{!93, !93, i64 0} -// CHECK:STDOUT: !96 = !{!"int", !1, i64 0} -// CHECK:STDOUT: !99 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !100 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !101 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !102 = !{!"__libc_errno", !96, i64 0} -// CHECK:STDOUT: !103 = !{!102, !96, i64 0} +// CHECK:STDOUT: !80 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.b25525d21a9bd472:core.Destroy.Core", scope: null, file: !37, line: 22, type: !42, spFlags: DISPFlagDefinition, unit: !38, retainedNodes: !83) +// CHECK:STDOUT: !81 = !DILocalVariable(arg: 1, scope: !80, type: !40) +// CHECK:STDOUT: !82 = !DILocation(line: 22, column: 1, scope: !80) +// CHECK:STDOUT: !83 = !{!81} +// CHECK:STDOUT: !84 = distinct !DISubprogram(name: "func__carbon_thunk", linkageName: "_Cfunc__carbon_thunk.Derived.Main", scope: null, file: !37, line: 26, type: !42, spFlags: DISPFlagDefinition, unit: !38, retainedNodes: !87) +// CHECK:STDOUT: !85 = !DILocalVariable(arg: 1, scope: !84, type: !40) +// CHECK:STDOUT: !86 = !DILocation(line: 26, column: 3, scope: !84) +// CHECK:STDOUT: !87 = !{!85} +// CHECK:STDOUT: !88 = distinct !DISubprogram(name: "other_func__carbon_thunk", linkageName: "_Cother_func__carbon_thunk.Derived.Main", scope: null, file: !37, line: 24, type: !42, spFlags: DISPFlagDefinition, unit: !38, retainedNodes: !91) +// CHECK:STDOUT: !89 = !DILocalVariable(arg: 1, scope: !88, type: !40) +// CHECK:STDOUT: !90 = !DILocation(line: 24, column: 3, scope: !88) +// CHECK:STDOUT: !91 = !{!89} +// CHECK:STDOUT: !92 = distinct !DISubprogram(name: "DoThing", linkageName: "_CDoThing.Main", scope: null, file: !37, line: 30, type: !44, spFlags: DISPFlagDefinition, unit: !38) +// CHECK:STDOUT: !93 = !DILocation(line: 31, column: 3, scope: !92) +// CHECK:STDOUT: !94 = !DILocation(line: 31, column: 20, scope: !92) +// CHECK:STDOUT: !95 = !DILocation(line: 31, column: 29, scope: !92) +// CHECK:STDOUT: !98 = !DILocation(line: 32, column: 11, scope: !92) +// CHECK:STDOUT: !99 = !DILocation(line: 32, column: 3, scope: !92) +// CHECK:STDOUT: !100 = !DILocation(line: 30, column: 1, scope: !92) +// CHECK:STDOUT: !101 = !{!"vtable pointer", !0, i64 0} +// CHECK:STDOUT: !102 = !{!101, !101, i64 0} +// CHECK:STDOUT: !103 = !{!"p1 _ZTS11FurtherBase", !2, i64 0} +// CHECK:STDOUT: !104 = !{!103, !103, i64 0} +// CHECK:STDOUT: !105 = !{!"p1 _ZTSN6Carbon7DerivedE", !2, i64 0} +// CHECK:STDOUT: !106 = !{!105, !105, i64 0} +// CHECK:STDOUT: !108 = !{!"int", !1, i64 0} +// CHECK:STDOUT: !111 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !112 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !113 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !114 = !{!"__libc_errno", !108, i64 0} +// CHECK:STDOUT: !115 = !{!114, !108, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/class/import/method.carbon b/toolchain/lower/testdata/interop/cpp/class/import/method.carbon index a1806f081029..6c6ee7b602da 100644 --- a/toolchain/lower/testdata/interop/cpp/class/import/method.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/import/method.carbon @@ -334,10 +334,10 @@ fn F(ref r: Cpp.RefSelfA) { // CHECK:STDOUT: %.loc8_14.3.temp = alloca i8, align 1, !dbg !82 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_14.3.temp), !dbg !80 // CHECK:STDOUT: call void @_ZNK9NeedThunk8ImplicitEa.carbon_thunk.__(ptr %n, ptr @int_1.f1e), !dbg !79 -// CHECK:STDOUT: call void @"_COp.4954785a8b134801:core.Destroy.Core"(ptr @int_1.f1e), !dbg !80 +// CHECK:STDOUT: call void @"_CSelfDestruct.4954785a8b134801:core.Destroy.Core"(ptr @int_1.f1e), !dbg !80 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc8_14.3.temp), !dbg !82 // CHECK:STDOUT: call void @_ZNH9NeedThunk8ExplicitES_a.carbon_thunk.__(ptr %n, ptr @int_1.f1e), !dbg !81 -// CHECK:STDOUT: call void @"_COp.4954785a8b134801:core.Destroy.Core"(ptr @int_1.f1e), !dbg !82 +// CHECK:STDOUT: call void @"_CSelfDestruct.4954785a8b134801:core.Destroy.Core"(ptr @int_1.f1e), !dbg !82 // CHECK:STDOUT: ret void, !dbg !83 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -346,32 +346,45 @@ fn F(ref r: Cpp.RefSelfA) { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 // CHECK:STDOUT: %c.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !90 -// CHECK:STDOUT: store ptr %c, ptr %c.addr, align 8, !tbaa !92 -// CHECK:STDOUT: %0 = load ptr, ptr %this.addr, align 8, !tbaa !90, !nonnull !42 -// CHECK:STDOUT: %1 = load ptr, ptr %c.addr, align 8, !tbaa !92 -// CHECK:STDOUT: %2 = load i8, ptr %1, align 1, !tbaa !94 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !98 +// CHECK:STDOUT: store ptr %c, ptr %c.addr, align 8, !tbaa !100 +// CHECK:STDOUT: %0 = load ptr, ptr %this.addr, align 8, !tbaa !98, !nonnull !42 +// CHECK:STDOUT: %1 = load ptr, ptr %c.addr, align 8, !tbaa !100 +// CHECK:STDOUT: %2 = load i8, ptr %1, align 1, !tbaa !102 // CHECK:STDOUT: call void @_ZNK9NeedThunk8ImplicitEa(ptr noundef nonnull align 1 dereferenceable(1) %0, i8 noundef signext %2) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.4954785a8b134801:core.Destroy.Core"(ptr %self) #0 !dbg !85 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.c4a4fcc00062c7f0:core.Destroy.Core"(ptr %self) #0 !dbg !85 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !87 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.4954785a8b134801:core.Destroy.Core"(ptr %self) #0 !dbg !89 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !91 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.4954785a8b134801:core.Destroy.Core"(ptr %self) #0 !dbg !93 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.4954785a8b134801:core.Destroy.Core"(ptr %self), !dbg !95 +// CHECK:STDOUT: ret void, !dbg !95 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define internal void @_ZNH9NeedThunk8ExplicitES_a.carbon_thunk.__(ptr noundef %0, ptr noundef %c) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 // CHECK:STDOUT: %c.addr = alloca ptr, align 8 // CHECK:STDOUT: %agg.tmp = alloca %struct.NeedThunk, align 1 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !90 -// CHECK:STDOUT: store ptr %c, ptr %c.addr, align 8, !tbaa !92 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !90 -// CHECK:STDOUT: %2 = load ptr, ptr %c.addr, align 8, !tbaa !92 -// CHECK:STDOUT: %3 = load i8, ptr %2, align 1, !tbaa !94 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !98 +// CHECK:STDOUT: store ptr %c, ptr %c.addr, align 8, !tbaa !100 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !98 +// CHECK:STDOUT: %2 = load ptr, ptr %c.addr, align 8, !tbaa !100 +// CHECK:STDOUT: %3 = load i8, ptr %2, align 1, !tbaa !102 // CHECK:STDOUT: call void @_ZNH9NeedThunk8ExplicitES_a(i8 noundef signext %3) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -384,7 +397,7 @@ fn F(ref r: Cpp.RefSelfA) { // CHECK:STDOUT: declare void @_ZNH9NeedThunk8ExplicitES_a(i8 noundef signext) #3 // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives -// CHECK:STDOUT: uselistorder ptr @"_COp.4954785a8b134801:core.Destroy.Core", { 1, 0 } +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.4954785a8b134801:core.Destroy.Core", { 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -424,15 +437,23 @@ fn F(ref r: Cpp.RefSelfA) { // CHECK:STDOUT: !82 = !DILocation(line: 8, column: 14, scope: !76) // CHECK:STDOUT: !83 = !DILocation(line: 6, column: 1, scope: !76) // CHECK:STDOUT: !84 = !{!77} -// CHECK:STDOUT: !85 = distinct !DISubprogram(name: "Op", linkageName: "_COp.4954785a8b134801:core.Destroy.Core", scope: null, file: !69, line: 7, type: !75, spFlags: DISPFlagDefinition, unit: !70, retainedNodes: !88) +// CHECK:STDOUT: !85 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.c4a4fcc00062c7f0:core.Destroy.Core", scope: null, file: !69, line: 7, type: !75, spFlags: DISPFlagDefinition, unit: !70, retainedNodes: !88) // CHECK:STDOUT: !86 = !DILocalVariable(arg: 1, scope: !85, type: !71) // CHECK:STDOUT: !87 = !DILocation(line: 7, column: 14, scope: !85) // CHECK:STDOUT: !88 = !{!86} -// CHECK:STDOUT: !89 = !{!"p1 _ZTS9NeedThunk", !36, i64 0} -// CHECK:STDOUT: !90 = !{!89, !89, i64 0} -// CHECK:STDOUT: !91 = !{!"p1 omnipotent char", !36, i64 0} -// CHECK:STDOUT: !92 = !{!91, !91, i64 0} -// CHECK:STDOUT: !94 = !{!35, !35, i64 0} +// CHECK:STDOUT: !89 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.4954785a8b134801:core.Destroy.Core", scope: null, file: !69, line: 7, type: !75, spFlags: DISPFlagDefinition, unit: !70, retainedNodes: !92) +// CHECK:STDOUT: !90 = !DILocalVariable(arg: 1, scope: !89, type: !71) +// CHECK:STDOUT: !91 = !DILocation(line: 7, column: 14, scope: !89) +// CHECK:STDOUT: !92 = !{!90} +// CHECK:STDOUT: !93 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.4954785a8b134801:core.Destroy.Core", scope: null, file: !69, line: 7, type: !75, spFlags: DISPFlagDefinition, unit: !70, retainedNodes: !96) +// CHECK:STDOUT: !94 = !DILocalVariable(arg: 1, scope: !93, type: !71) +// CHECK:STDOUT: !95 = !DILocation(line: 7, column: 14, scope: !93) +// CHECK:STDOUT: !96 = !{!94} +// CHECK:STDOUT: !97 = !{!"p1 _ZTS9NeedThunk", !36, i64 0} +// CHECK:STDOUT: !98 = !{!97, !97, i64 0} +// CHECK:STDOUT: !99 = !{!"p1 omnipotent char", !36, i64 0} +// CHECK:STDOUT: !100 = !{!99, !99, i64 0} +// CHECK:STDOUT: !102 = !{!35, !35, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'call_with_ref_self.carbon' @@ -441,10 +462,10 @@ fn F(ref r: Cpp.RefSelfA) { // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF.Main(ptr %r) #0 !dbg !99 { +// CHECK:STDOUT: define void @_CF.Main(ptr %r) #0 !dbg !107 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_ZN8RefSelfA1fEii(ptr %r, i32 1, i32 2), !dbg !102 -// CHECK:STDOUT: ret void, !dbg !103 +// CHECK:STDOUT: call void @_ZN8RefSelfA1fEii(ptr %r, i32 1, i32 2), !dbg !110 +// CHECK:STDOUT: ret void, !dbg !111 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_ZN8RefSelfA1fEii(ptr noundef nonnull align 1 dereferenceable(1), i32 noundef, i32 noundef) #1 @@ -452,7 +473,7 @@ fn F(ref r: Cpp.RefSelfA) { // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!96} +// CHECK:STDOUT: !llvm.dbg.cu = !{!104} // CHECK:STDOUT: !llvm.module.flags = !{!45, !46, !47, !2, !3} // CHECK:STDOUT: !llvm.errno.tbaa = !{!49} // CHECK:STDOUT: @@ -469,11 +490,11 @@ fn F(ref r: Cpp.RefSelfA) { // CHECK:STDOUT: !47 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !48 = !{!"__libc_errno", !40, i64 0} // CHECK:STDOUT: !49 = !{!48, !40, i64 0} -// CHECK:STDOUT: !95 = !DIFile(filename: "call_with_ref_self.carbon", directory: "") -// CHECK:STDOUT: !96 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !95, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !99 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !95, line: 11, type: !25, spFlags: DISPFlagDefinition, unit: !96, retainedNodes: !104) -// CHECK:STDOUT: !100 = !DILocalVariable(arg: 1, scope: !99, type: !21) -// CHECK:STDOUT: !102 = !DILocation(line: 12, column: 3, scope: !99) -// CHECK:STDOUT: !103 = !DILocation(line: 11, column: 1, scope: !99) -// CHECK:STDOUT: !104 = !{!100} +// CHECK:STDOUT: !103 = !DIFile(filename: "call_with_ref_self.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: !107 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !103, line: 11, type: !25, spFlags: DISPFlagDefinition, unit: !104, retainedNodes: !112) +// CHECK:STDOUT: !108 = !DILocalVariable(arg: 1, scope: !107, type: !21) +// CHECK:STDOUT: !110 = !DILocation(line: 12, column: 3, scope: !107) +// CHECK:STDOUT: !111 = !DILocation(line: 11, column: 1, scope: !107) +// CHECK:STDOUT: !112 = !{!108} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/class/import/virtual_base.carbon b/toolchain/lower/testdata/interop/cpp/class/import/virtual_base.carbon index 056c46c61a16..fd3d6cb1971f 100644 --- a/toolchain/lower/testdata/interop/cpp/class/import/virtual_base.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/import/virtual_base.carbon @@ -127,6 +127,7 @@ fn AccessD(d: Cpp.D) -> i32 { // CHECK:STDOUT: %_.var = alloca [40 x i8], align 8, !dbg !29 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !29 // CHECK:STDOUT: call void @_ZN1DC1Ev.carbon_thunk.(ptr %_.var), !dbg !30 +// CHECK:STDOUT: call void @"_CSelfDestruct.87042109e4175f46:core.Destroy.Core"(ptr %_.var), !dbg !29 // CHECK:STDOUT: ret void, !dbg !32 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -134,18 +135,24 @@ fn AccessD(d: Cpp.D) -> i32 { // CHECK:STDOUT: define internal void @_ZN1DC1Ev.carbon_thunk.(ptr noundef %return) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !45 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !45 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !49 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !49 // CHECK:STDOUT: call void @_ZN1DC1Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CAccessD.Main(ptr %d) #0 !dbg !33 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.87042109e4175f46:core.Destroy.Core"(ptr %self) #0 !dbg !33 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc16_11.1.d = getelementptr inbounds nuw [40 x i8], ptr %d, i32 0, i32 28, !dbg !38 -// CHECK:STDOUT: %.loc16_11.2 = load i32, ptr %.loc16_11.1.d, align 4, !dbg !38 -// CHECK:STDOUT: ret i32 %.loc16_11.2, !dbg !39 +// CHECK:STDOUT: ret void, !dbg !35 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define i32 @_CAccessD.Main(ptr %d) #0 !dbg !37 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %.loc16_11.1.d = getelementptr inbounds nuw [40 x i8], ptr %d, i32 0, i32 28, !dbg !42 +// CHECK:STDOUT: %.loc16_11.2 = load i32, ptr %.loc16_11.1.d, align 4, !dbg !42 +// CHECK:STDOUT: ret i32 %.loc16_11.2, !dbg !43 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -155,16 +162,16 @@ fn AccessD(d: Cpp.D) -> i32 { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN1DC1Ev(ptr noundef nonnull align 8 dereferenceable(32) %this) unnamed_addr #3 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !45 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !49 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: %0 = getelementptr inbounds i8, ptr %this1, i64 32 // CHECK:STDOUT: call void @_ZN1AC2Ev(ptr noundef nonnull align 4 dereferenceable(4) %0) // CHECK:STDOUT: call void @_ZN1BC2Ev(ptr noundef nonnull align 8 dereferenceable(12) %this1, ptr noundef getelementptr inbounds nuw (i8, ptr @_ZTT1D, i64 8)) // CHECK:STDOUT: %1 = getelementptr inbounds i8, ptr %this1, i64 16 // CHECK:STDOUT: call void @_ZN1CC2Ev(ptr noundef nonnull align 8 dereferenceable(12) %1, ptr noundef getelementptr inbounds nuw (i8, ptr @_ZTT1D, i64 16)) -// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-24, 0) ({ [3 x ptr], [3 x ptr] }, ptr @_ZTV1D, i32 0, i32 0, i32 3), ptr %this1, align 8, !tbaa !47 +// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-24, 0) ({ [3 x ptr], [3 x ptr] }, ptr @_ZTV1D, i32 0, i32 0, i32 3), ptr %this1, align 8, !tbaa !51 // CHECK:STDOUT: %add.ptr = getelementptr inbounds i8, ptr %this1, i64 16 -// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-24, 0) ({ [3 x ptr], [3 x ptr] }, ptr @_ZTV1D, i32 0, i32 1, i32 3), ptr %add.ptr, align 8, !tbaa !47 +// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-24, 0) ({ [3 x ptr], [3 x ptr] }, ptr @_ZTV1D, i32 0, i32 1, i32 3), ptr %add.ptr, align 8, !tbaa !51 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: @@ -188,8 +195,8 @@ fn AccessD(d: Cpp.D) -> i32 { // CHECK:STDOUT: attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!19} -// CHECK:STDOUT: !llvm.module.flags = !{!48, !49, !50, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!53} +// CHECK:STDOUT: !llvm.module.flags = !{!52, !53, !54, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!57} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -199,28 +206,34 @@ fn AccessD(d: Cpp.D) -> i32 { // CHECK:STDOUT: !21 = !{null} // CHECK:STDOUT: !22 = !DISubroutineType(types: !21) // CHECK:STDOUT: !23 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !24 = !{null, !23} +// CHECK:STDOUT: !25 = !DISubroutineType(types: !24) // CHECK:STDOUT: !26 = !{!20, !23} // CHECK:STDOUT: !27 = !DISubroutineType(types: !26) // CHECK:STDOUT: !28 = distinct !DISubprogram(name: "Make", linkageName: "_CMake.Main", scope: null, file: !18, line: 6, type: !22, spFlags: DISPFlagDefinition, unit: !19) // CHECK:STDOUT: !29 = !DILocation(line: 11, column: 3, scope: !28) // CHECK:STDOUT: !30 = !DILocation(line: 11, column: 18, scope: !28) // CHECK:STDOUT: !32 = !DILocation(line: 6, column: 1, scope: !28) -// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "AccessD", linkageName: "_CAccessD.Main", scope: null, file: !18, line: 14, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !40) +// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.87042109e4175f46:core.Destroy.Core", scope: null, file: !18, line: 11, type: !25, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !36) // CHECK:STDOUT: !34 = !DILocalVariable(arg: 1, scope: !33, type: !23) -// CHECK:STDOUT: !38 = !DILocation(line: 16, column: 10, scope: !33) -// CHECK:STDOUT: !39 = !DILocation(line: 16, column: 3, scope: !33) -// CHECK:STDOUT: !40 = !{!34} -// CHECK:STDOUT: !41 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !42 = !{!"omnipotent char", !41, i64 0} -// CHECK:STDOUT: !43 = !{!"any pointer", !42, i64 0} -// CHECK:STDOUT: !44 = !{!"p1 _ZTS1D", !43, i64 0} -// CHECK:STDOUT: !45 = !{!44, !44, i64 0} -// CHECK:STDOUT: !46 = !{!"vtable pointer", !41, i64 0} -// CHECK:STDOUT: !47 = !{!46, !46, i64 0} -// CHECK:STDOUT: !48 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !49 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !50 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !51 = !{!"int", !42, i64 0} -// CHECK:STDOUT: !52 = !{!"__libc_errno", !51, i64 0} -// CHECK:STDOUT: !53 = !{!52, !51, i64 0} +// CHECK:STDOUT: !35 = !DILocation(line: 11, column: 3, scope: !33) +// CHECK:STDOUT: !36 = !{!34} +// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "AccessD", linkageName: "_CAccessD.Main", scope: null, file: !18, line: 14, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !44) +// CHECK:STDOUT: !38 = !DILocalVariable(arg: 1, scope: !37, type: !23) +// CHECK:STDOUT: !42 = !DILocation(line: 16, column: 10, scope: !37) +// CHECK:STDOUT: !43 = !DILocation(line: 16, column: 3, scope: !37) +// CHECK:STDOUT: !44 = !{!38} +// CHECK:STDOUT: !45 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !46 = !{!"omnipotent char", !45, i64 0} +// CHECK:STDOUT: !47 = !{!"any pointer", !46, i64 0} +// CHECK:STDOUT: !48 = !{!"p1 _ZTS1D", !47, i64 0} +// CHECK:STDOUT: !49 = !{!48, !48, i64 0} +// CHECK:STDOUT: !50 = !{!"vtable pointer", !45, i64 0} +// CHECK:STDOUT: !51 = !{!50, !50, i64 0} +// CHECK:STDOUT: !52 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !53 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !54 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !55 = !{!"int", !46, i64 0} +// CHECK:STDOUT: !56 = !{!"__libc_errno", !55, i64 0} +// CHECK:STDOUT: !57 = !{!56, !55, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/class/virtual_fn.carbon b/toolchain/lower/testdata/interop/cpp/class/virtual_fn.carbon index 5488084f937f..70ae10e2a750 100644 --- a/toolchain/lower/testdata/interop/cpp/class/virtual_fn.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/virtual_fn.carbon @@ -186,8 +186,8 @@ void delete_new_Base() { // CHECK:STDOUT: define internal void @_ZNK1A1FEv.carbon_thunk._(ptr noundef nonnull align 8 dereferenceable(8) %this) #5 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !71 -// CHECK:STDOUT: %0 = load ptr, ptr %this.addr, align 8, !tbaa !71, !nonnull !74, !align !75 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !87 +// CHECK:STDOUT: %0 = load ptr, ptr %this.addr, align 8, !tbaa !87, !nonnull !90, !align !91 // CHECK:STDOUT: %vtable = load ptr, ptr %0, align 8, !tbaa !8 // CHECK:STDOUT: %vfn = getelementptr inbounds ptr, ptr %vtable, i64 2 // CHECK:STDOUT: %1 = load ptr, ptr %vfn, align 8 @@ -207,7 +207,7 @@ void delete_new_Base() { // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind // CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.Final.Main"(ptr %self) #6 !dbg !37 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @"_COp.28387b086eba9957:core.Destroy.Core"(ptr %self), !dbg !39 +// CHECK:STDOUT: call void @"_CSelfDestruct.28387b086eba9957:core.Destroy.Core"(ptr %self), !dbg !39 // CHECK:STDOUT: ret void, !dbg !39 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -215,53 +215,84 @@ void delete_new_Base() { // CHECK:STDOUT: declare void @_ZN1AD1Ev(ptr noundef nonnull align 8 dead_on_return(8) dereferenceable(8)) unnamed_addr #7 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.e9cc9e95545cc62f:core.Destroy.Core"(ptr %self) #8 !dbg !41 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f2cd4feee22137a3:core.Destroy.Core"(ptr %self) #8 !dbg !41 { // CHECK:STDOUT: entry: +// CHECK:STDOUT: %A.cpp_destructor.call.vtable = load ptr, ptr %self, align 8, !dbg !43 +// CHECK:STDOUT: %A.cpp_destructor.call = getelementptr ptr, ptr %A.cpp_destructor.call.vtable, i32 0, !dbg !43 +// CHECK:STDOUT: %A.cpp_destructor.call.memptr.virtualfn = load ptr, ptr %A.cpp_destructor.call, align 8, !dbg !43 +// CHECK:STDOUT: call void %A.cpp_destructor.call.memptr.virtualfn(ptr %self), !dbg !43 // CHECK:STDOUT: ret void, !dbg !43 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.28387b086eba9957:core.Destroy.Core"(ptr %self) #8 !dbg !45 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.e9cc9e95545cc62f:core.Destroy.Core"(ptr %self) #8 !dbg !45 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !47 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF__carbon_thunk.Final.Main(ptr %self) #8 !dbg !49 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.e9cc9e95545cc62f:core.Destroy.Core"(ptr %self) #8 !dbg !49 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CF.Final.Main(ptr %self), !dbg !51 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.e9cc9e95545cc62f:core.Destroy.Core"(ptr %self), !dbg !51 // CHECK:STDOUT: ret void, !dbg !51 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.28387b086eba9957:core.Destroy.Core"(ptr %self) #8 !dbg !53 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !55 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.28387b086eba9957:core.Destroy.Core"(ptr %self) #8 !dbg !57 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.28387b086eba9957:core.Destroy.Core"(ptr %self), !dbg !59 +// CHECK:STDOUT: ret void, !dbg !59 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CF__carbon_thunk.Final.Main(ptr %self) #8 !dbg !61 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @_CF.Final.Main(ptr %self), !dbg !63 +// CHECK:STDOUT: ret void, !dbg !63 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: declare void @_CF.Base.Main(ptr) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr void @"_CF:thunk:A.Cpp:Base.Main"(ptr %self) #6 !dbg !53 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CF.Base.Main(ptr %self), !dbg !56 -// CHECK:STDOUT: ret void, !dbg !56 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.Base.Main"(ptr %self) #6 !dbg !58 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @"_COp.294df737cd074d60:core.Destroy.Core"(ptr %self), !dbg !60 -// CHECK:STDOUT: ret void, !dbg !60 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.294df737cd074d60:core.Destroy.Core"(ptr %self) #8 !dbg !62 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !64 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF__carbon_thunk.Base.Main(ptr %self) #8 !dbg !66 { +// CHECK:STDOUT: define weak_odr void @"_CF:thunk:A.Cpp:Base.Main"(ptr %self) #6 !dbg !65 { // CHECK:STDOUT: entry: // CHECK:STDOUT: call void @_CF.Base.Main(ptr %self), !dbg !68 // CHECK:STDOUT: ret void, !dbg !68 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind +// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.Base.Main"(ptr %self) #6 !dbg !70 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSelfDestruct.294df737cd074d60:core.Destroy.Core"(ptr %self), !dbg !72 +// CHECK:STDOUT: ret void, !dbg !72 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.294df737cd074d60:core.Destroy.Core"(ptr %self) #8 !dbg !74 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !76 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.294df737cd074d60:core.Destroy.Core"(ptr %self) #8 !dbg !78 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.294df737cd074d60:core.Destroy.Core"(ptr %self), !dbg !80 +// CHECK:STDOUT: ret void, !dbg !80 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CF__carbon_thunk.Base.Main(ptr %self) #8 !dbg !82 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @_CF.Base.Main(ptr %self), !dbg !84 +// CHECK:STDOUT: ret void, !dbg !84 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: declare void @__cxa_pure_virtual() unnamed_addr // CHECK:STDOUT: // CHECK:STDOUT: declare void @_ZNK1A1FEv(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #9 @@ -324,7 +355,7 @@ void delete_new_Base() { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN1AC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %this) unnamed_addr #3 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !71 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !87 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: store ptr getelementptr inbounds inrange(-16, 24) ({ [5 x ptr] }, ptr @_ZTV1A, i32 0, i32 0, i32 2), ptr %this1, align 8, !tbaa !8 // CHECK:STDOUT: ret void @@ -354,8 +385,8 @@ void delete_new_Base() { // CHECK:STDOUT: attributes #11 = { builtin nounwind } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!28} -// CHECK:STDOUT: !llvm.module.flags = !{!77, !78, !79, !11, !12} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!82} +// CHECK:STDOUT: !llvm.module.flags = !{!93, !94, !95, !11, !12} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!98} // CHECK:STDOUT: // CHECK:STDOUT: !0 = !{!"Simple C++ TBAA"} // CHECK:STDOUT: !1 = !{!"omnipotent char", !0, i64 0} @@ -381,42 +412,58 @@ void delete_new_Base() { // CHECK:STDOUT: !38 = !DILocalVariable(arg: 1, scope: !37, type: !29) // CHECK:STDOUT: !39 = !DILocation(line: 12, column: 1, scope: !37) // CHECK:STDOUT: !40 = !{!38} -// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "Op", linkageName: "_COp.e9cc9e95545cc62f:core.Destroy.Core", scope: null, file: !27, line: 12, type: !31, spFlags: DISPFlagDefinition, unit: !28, retainedNodes: !44) +// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f2cd4feee22137a3:core.Destroy.Core", scope: null, file: !27, line: 12, type: !31, spFlags: DISPFlagDefinition, unit: !28, retainedNodes: !44) // CHECK:STDOUT: !42 = !DILocalVariable(arg: 1, scope: !41, type: !29) // CHECK:STDOUT: !43 = !DILocation(line: 12, column: 1, scope: !41) // CHECK:STDOUT: !44 = !{!42} -// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "Op", linkageName: "_COp.28387b086eba9957:core.Destroy.Core", scope: null, file: !27, line: 12, type: !31, spFlags: DISPFlagDefinition, unit: !28, retainedNodes: !48) +// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.e9cc9e95545cc62f:core.Destroy.Core", scope: null, file: !27, line: 12, type: !31, spFlags: DISPFlagDefinition, unit: !28, retainedNodes: !48) // CHECK:STDOUT: !46 = !DILocalVariable(arg: 1, scope: !45, type: !29) // CHECK:STDOUT: !47 = !DILocation(line: 12, column: 1, scope: !45) // CHECK:STDOUT: !48 = !{!46} -// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "F__carbon_thunk", linkageName: "_CF__carbon_thunk.Final.Main", scope: null, file: !27, line: 14, type: !31, spFlags: DISPFlagDefinition, unit: !28, retainedNodes: !52) +// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.e9cc9e95545cc62f:core.Destroy.Core", scope: null, file: !27, line: 12, type: !31, spFlags: DISPFlagDefinition, unit: !28, retainedNodes: !52) // CHECK:STDOUT: !50 = !DILocalVariable(arg: 1, scope: !49, type: !29) -// CHECK:STDOUT: !51 = !DILocation(line: 14, column: 3, scope: !49) +// CHECK:STDOUT: !51 = !DILocation(line: 12, column: 1, scope: !49) // CHECK:STDOUT: !52 = !{!50} -// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "F", linkageName: "_CF:thunk:A.Cpp:Base.Main", scope: null, file: !27, line: 19, type: !31, spFlags: DISPFlagDefinition, unit: !28, retainedNodes: !57) +// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.28387b086eba9957:core.Destroy.Core", scope: null, file: !27, line: 12, type: !31, spFlags: DISPFlagDefinition, unit: !28, retainedNodes: !56) // CHECK:STDOUT: !54 = !DILocalVariable(arg: 1, scope: !53, type: !29) -// CHECK:STDOUT: !56 = !DILocation(line: 19, column: 3, scope: !53) -// CHECK:STDOUT: !57 = !{!54} -// CHECK:STDOUT: !58 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.Base.Main", scope: null, file: !27, line: 17, type: !31, spFlags: DISPFlagDefinition, unit: !28, retainedNodes: !61) -// CHECK:STDOUT: !59 = !DILocalVariable(arg: 1, scope: !58, type: !29) -// CHECK:STDOUT: !60 = !DILocation(line: 17, column: 1, scope: !58) -// CHECK:STDOUT: !61 = !{!59} -// CHECK:STDOUT: !62 = distinct !DISubprogram(name: "Op", linkageName: "_COp.294df737cd074d60:core.Destroy.Core", scope: null, file: !27, line: 17, type: !31, spFlags: DISPFlagDefinition, unit: !28, retainedNodes: !65) -// CHECK:STDOUT: !63 = !DILocalVariable(arg: 1, scope: !62, type: !29) -// CHECK:STDOUT: !64 = !DILocation(line: 17, column: 1, scope: !62) -// CHECK:STDOUT: !65 = !{!63} -// CHECK:STDOUT: !66 = distinct !DISubprogram(name: "F__carbon_thunk", linkageName: "_CF__carbon_thunk.Base.Main", scope: null, file: !27, line: 19, type: !31, spFlags: DISPFlagDefinition, unit: !28, retainedNodes: !69) -// CHECK:STDOUT: !67 = !DILocalVariable(arg: 1, scope: !66, type: !29) -// CHECK:STDOUT: !68 = !DILocation(line: 19, column: 3, scope: !66) -// CHECK:STDOUT: !69 = !{!67} -// CHECK:STDOUT: !70 = !{!"p1 _ZTS1A", !2, i64 0} -// CHECK:STDOUT: !71 = !{!70, !70, i64 0} -// CHECK:STDOUT: !74 = !{} -// CHECK:STDOUT: !75 = !{i64 8} -// CHECK:STDOUT: !77 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !78 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !79 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !80 = !{!"int", !1, i64 0} -// CHECK:STDOUT: !81 = !{!"__libc_errno", !80, i64 0} -// CHECK:STDOUT: !82 = !{!81, !80, i64 0} +// CHECK:STDOUT: !55 = !DILocation(line: 12, column: 1, scope: !53) +// CHECK:STDOUT: !56 = !{!54} +// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.28387b086eba9957:core.Destroy.Core", scope: null, file: !27, line: 12, type: !31, spFlags: DISPFlagDefinition, unit: !28, retainedNodes: !60) +// CHECK:STDOUT: !58 = !DILocalVariable(arg: 1, scope: !57, type: !29) +// CHECK:STDOUT: !59 = !DILocation(line: 12, column: 1, scope: !57) +// CHECK:STDOUT: !60 = !{!58} +// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "F__carbon_thunk", linkageName: "_CF__carbon_thunk.Final.Main", scope: null, file: !27, line: 14, type: !31, spFlags: DISPFlagDefinition, unit: !28, retainedNodes: !64) +// CHECK:STDOUT: !62 = !DILocalVariable(arg: 1, scope: !61, type: !29) +// CHECK:STDOUT: !63 = !DILocation(line: 14, column: 3, scope: !61) +// CHECK:STDOUT: !64 = !{!62} +// CHECK:STDOUT: !65 = distinct !DISubprogram(name: "F", linkageName: "_CF:thunk:A.Cpp:Base.Main", scope: null, file: !27, line: 19, type: !31, spFlags: DISPFlagDefinition, unit: !28, retainedNodes: !69) +// CHECK:STDOUT: !66 = !DILocalVariable(arg: 1, scope: !65, type: !29) +// CHECK:STDOUT: !68 = !DILocation(line: 19, column: 3, scope: !65) +// CHECK:STDOUT: !69 = !{!66} +// CHECK:STDOUT: !70 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.Base.Main", scope: null, file: !27, line: 17, type: !31, spFlags: DISPFlagDefinition, unit: !28, retainedNodes: !73) +// CHECK:STDOUT: !71 = !DILocalVariable(arg: 1, scope: !70, type: !29) +// CHECK:STDOUT: !72 = !DILocation(line: 17, column: 1, scope: !70) +// CHECK:STDOUT: !73 = !{!71} +// CHECK:STDOUT: !74 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.294df737cd074d60:core.Destroy.Core", scope: null, file: !27, line: 17, type: !31, spFlags: DISPFlagDefinition, unit: !28, retainedNodes: !77) +// CHECK:STDOUT: !75 = !DILocalVariable(arg: 1, scope: !74, type: !29) +// CHECK:STDOUT: !76 = !DILocation(line: 17, column: 1, scope: !74) +// CHECK:STDOUT: !77 = !{!75} +// CHECK:STDOUT: !78 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.294df737cd074d60:core.Destroy.Core", scope: null, file: !27, line: 17, type: !31, spFlags: DISPFlagDefinition, unit: !28, retainedNodes: !81) +// CHECK:STDOUT: !79 = !DILocalVariable(arg: 1, scope: !78, type: !29) +// CHECK:STDOUT: !80 = !DILocation(line: 17, column: 1, scope: !78) +// CHECK:STDOUT: !81 = !{!79} +// CHECK:STDOUT: !82 = distinct !DISubprogram(name: "F__carbon_thunk", linkageName: "_CF__carbon_thunk.Base.Main", scope: null, file: !27, line: 19, type: !31, spFlags: DISPFlagDefinition, unit: !28, retainedNodes: !85) +// CHECK:STDOUT: !83 = !DILocalVariable(arg: 1, scope: !82, type: !29) +// CHECK:STDOUT: !84 = !DILocation(line: 19, column: 3, scope: !82) +// CHECK:STDOUT: !85 = !{!83} +// CHECK:STDOUT: !86 = !{!"p1 _ZTS1A", !2, i64 0} +// CHECK:STDOUT: !87 = !{!86, !86, i64 0} +// CHECK:STDOUT: !90 = !{} +// CHECK:STDOUT: !91 = !{i64 8} +// CHECK:STDOUT: !93 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !94 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !95 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !96 = !{!"int", !1, i64 0} +// CHECK:STDOUT: !97 = !{!"__libc_errno", !96, i64 0} +// CHECK:STDOUT: !98 = !{!97, !96, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/class/virtual_fn_carbon_only.carbon b/toolchain/lower/testdata/interop/cpp/class/virtual_fn_carbon_only.carbon index 42e1d23d3197..32965d3a2f67 100644 --- a/toolchain/lower/testdata/interop/cpp/class/virtual_fn_carbon_only.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/virtual_fn_carbon_only.carbon @@ -59,7 +59,7 @@ fn F() { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN1X1fEv(ptr noundef nonnull align 8 dereferenceable(8) %this) unnamed_addr #0 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !49 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !61 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -80,49 +80,69 @@ fn F() { // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind // CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.Z.Main"(ptr %self) #2 !dbg !23 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @"_COp.680f7fa3ef86df7a:core.Destroy.Core"(ptr %self), !dbg !25 +// CHECK:STDOUT: call void @"_CSelfDestruct.680f7fa3ef86df7a:core.Destroy.Core"(ptr %self), !dbg !25 // CHECK:STDOUT: ret void, !dbg !25 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.de73a19002e400c9:core.Destroy.Core"(ptr %self) #1 !dbg !27 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.3d7b8a41b4c67e71:core.Destroy.Core"(ptr %self) #1 !dbg !27 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !29 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.680f7fa3ef86df7a:core.Destroy.Core"(ptr %self) #1 !dbg !31 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.de73a19002e400c9:core.Destroy.Core"(ptr %self) #1 !dbg !31 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !33 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_Cf__carbon_thunk.Z.Main(ptr %self) #1 !dbg !35 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.de73a19002e400c9:core.Destroy.Core"(ptr %self) #1 !dbg !35 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Cf.Z.Main(ptr %self), !dbg !37 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.de73a19002e400c9:core.Destroy.Core"(ptr %self), !dbg !37 // CHECK:STDOUT: ret void, !dbg !37 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF.Main() #1 !dbg !39 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.680f7fa3ef86df7a:core.Destroy.Core"(ptr %self) #1 !dbg !39 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca { [8 x i8] }, align 8, !dbg !40 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !40 -// CHECK:STDOUT: %.loc24_32.1.base = getelementptr inbounds nuw { [8 x i8] }, ptr %_.var, i32 0, i32 0, !dbg !41 -// CHECK:STDOUT: call void @_ZN1XC1Ev.carbon_thunk.(ptr %.loc24_32.1.base), !dbg !42 -// CHECK:STDOUT: %.loc24_32.7.base = getelementptr inbounds nuw { [8 x i8] }, ptr %_.var, i32 0, i32 0, !dbg !41 -// CHECK:STDOUT: %.loc24_32.8.vptr = getelementptr inbounds nuw [8 x i8], ptr %.loc24_32.7.base, i32 0, i32 0, !dbg !41 -// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-16, 8) ({ [3 x ptr] }, ptr @_ZTVN6Carbon1ZE, i32 0, i32 0, i32 2), ptr %.loc24_32.8.vptr, align 8, !dbg !41 -// CHECK:STDOUT: call void @"_COp.680f7fa3ef86df7a:core.Destroy.Core"(ptr %_.var), !dbg !40 -// CHECK:STDOUT: ret void, !dbg !44 +// CHECK:STDOUT: ret void, !dbg !41 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.680f7fa3ef86df7a:core.Destroy.Core"(ptr %self) #1 !dbg !43 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.680f7fa3ef86df7a:core.Destroy.Core"(ptr %self), !dbg !45 +// CHECK:STDOUT: ret void, !dbg !45 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_Cf__carbon_thunk.Z.Main(ptr %self) #1 !dbg !47 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @_Cf.Z.Main(ptr %self), !dbg !49 +// CHECK:STDOUT: ret void, !dbg !49 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CF.Main() #1 !dbg !51 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %_.var = alloca { [8 x i8] }, align 8, !dbg !52 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !52 +// CHECK:STDOUT: %.loc24_32.1.base = getelementptr inbounds nuw { [8 x i8] }, ptr %_.var, i32 0, i32 0, !dbg !53 +// CHECK:STDOUT: call void @_ZN1XC1Ev.carbon_thunk.(ptr %.loc24_32.1.base), !dbg !54 +// CHECK:STDOUT: %.loc24_32.7.base = getelementptr inbounds nuw { [8 x i8] }, ptr %_.var, i32 0, i32 0, !dbg !53 +// CHECK:STDOUT: %.loc24_32.8.vptr = getelementptr inbounds nuw [8 x i8], ptr %.loc24_32.7.base, i32 0, i32 0, !dbg !53 +// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-16, 8) ({ [3 x ptr] }, ptr @_ZTVN6Carbon1ZE, i32 0, i32 0, i32 2), ptr %.loc24_32.8.vptr, align 8, !dbg !53 +// CHECK:STDOUT: call void @"_CSelfDestruct.680f7fa3ef86df7a:core.Destroy.Core"(ptr %_.var), !dbg !52 +// CHECK:STDOUT: ret void, !dbg !56 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable // CHECK:STDOUT: define internal void @_ZN1XC1Ev.carbon_thunk.(ptr noundef %return) #3 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !49 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !49 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !61 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !61 // CHECK:STDOUT: call void @_ZN1XC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %0) #1 // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -134,7 +154,7 @@ fn F() { // CHECK:STDOUT: define internal void @_ZN6Carbon1Z1fEv(ptr noundef nonnull align 8 dereferenceable(8) %this) unnamed_addr #3 align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !53 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !65 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: call void @_Cf__carbon_thunk.Z.Main(ptr noundef nonnull align 8 dereferenceable(8) %this1) // CHECK:STDOUT: ret void @@ -144,9 +164,9 @@ fn F() { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN1XC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %this) unnamed_addr #5 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !49 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !61 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 -// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-16, 8) ({ [3 x ptr] }, ptr @_ZTV1X, i32 0, i32 0, i32 2), ptr %this1, align 8, !tbaa !51 +// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-16, 8) ({ [3 x ptr] }, ptr @_ZTV1X, i32 0, i32 0, i32 2), ptr %this1, align 8, !tbaa !63 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: @@ -158,8 +178,8 @@ fn F() { // CHECK:STDOUT: attributes #5 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!7} -// CHECK:STDOUT: !llvm.module.flags = !{!56, !57, !58, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!61} +// CHECK:STDOUT: !llvm.module.flags = !{!68, !69, !70, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!73} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -182,36 +202,48 @@ fn F() { // CHECK:STDOUT: !24 = !DILocalVariable(arg: 1, scope: !23, type: !8) // CHECK:STDOUT: !25 = !DILocation(line: 18, column: 1, scope: !23) // CHECK:STDOUT: !26 = !{!24} -// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "Op", linkageName: "_COp.de73a19002e400c9:core.Destroy.Core", scope: null, file: !6, line: 18, type: !10, spFlags: DISPFlagDefinition, unit: !7, retainedNodes: !30) +// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.3d7b8a41b4c67e71:core.Destroy.Core", scope: null, file: !6, line: 18, type: !10, spFlags: DISPFlagDefinition, unit: !7, retainedNodes: !30) // CHECK:STDOUT: !28 = !DILocalVariable(arg: 1, scope: !27, type: !8) // CHECK:STDOUT: !29 = !DILocation(line: 18, column: 1, scope: !27) // CHECK:STDOUT: !30 = !{!28} -// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "Op", linkageName: "_COp.680f7fa3ef86df7a:core.Destroy.Core", scope: null, file: !6, line: 18, type: !10, spFlags: DISPFlagDefinition, unit: !7, retainedNodes: !34) +// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.de73a19002e400c9:core.Destroy.Core", scope: null, file: !6, line: 18, type: !10, spFlags: DISPFlagDefinition, unit: !7, retainedNodes: !34) // CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !31, type: !8) // CHECK:STDOUT: !33 = !DILocation(line: 18, column: 1, scope: !31) // CHECK:STDOUT: !34 = !{!32} -// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "f__carbon_thunk", linkageName: "_Cf__carbon_thunk.Z.Main", scope: null, file: !6, line: 20, type: !10, spFlags: DISPFlagDefinition, unit: !7, retainedNodes: !38) +// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.de73a19002e400c9:core.Destroy.Core", scope: null, file: !6, line: 18, type: !10, spFlags: DISPFlagDefinition, unit: !7, retainedNodes: !38) // CHECK:STDOUT: !36 = !DILocalVariable(arg: 1, scope: !35, type: !8) -// CHECK:STDOUT: !37 = !DILocation(line: 20, column: 3, scope: !35) +// CHECK:STDOUT: !37 = !DILocation(line: 18, column: 1, scope: !35) // CHECK:STDOUT: !38 = !{!36} -// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !6, line: 23, type: !12, spFlags: DISPFlagDefinition, unit: !7) -// CHECK:STDOUT: !40 = !DILocation(line: 24, column: 3, scope: !39) -// CHECK:STDOUT: !41 = !DILocation(line: 24, column: 14, scope: !39) -// CHECK:STDOUT: !42 = !DILocation(line: 24, column: 23, scope: !39) -// CHECK:STDOUT: !44 = !DILocation(line: 23, column: 1, scope: !39) -// CHECK:STDOUT: !45 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !46 = !{!"omnipotent char", !45, i64 0} -// CHECK:STDOUT: !47 = !{!"any pointer", !46, i64 0} -// CHECK:STDOUT: !48 = !{!"p1 _ZTS1X", !47, i64 0} -// CHECK:STDOUT: !49 = !{!48, !48, i64 0} -// CHECK:STDOUT: !50 = !{!"vtable pointer", !45, i64 0} -// CHECK:STDOUT: !51 = !{!50, !50, i64 0} -// CHECK:STDOUT: !52 = !{!"p1 _ZTSN6Carbon1ZE", !47, i64 0} -// CHECK:STDOUT: !53 = !{!52, !52, i64 0} -// CHECK:STDOUT: !56 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !57 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !58 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !59 = !{!"int", !46, i64 0} -// CHECK:STDOUT: !60 = !{!"__libc_errno", !59, i64 0} -// CHECK:STDOUT: !61 = !{!60, !59, i64 0} +// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.680f7fa3ef86df7a:core.Destroy.Core", scope: null, file: !6, line: 18, type: !10, spFlags: DISPFlagDefinition, unit: !7, retainedNodes: !42) +// CHECK:STDOUT: !40 = !DILocalVariable(arg: 1, scope: !39, type: !8) +// CHECK:STDOUT: !41 = !DILocation(line: 18, column: 1, scope: !39) +// CHECK:STDOUT: !42 = !{!40} +// CHECK:STDOUT: !43 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.680f7fa3ef86df7a:core.Destroy.Core", scope: null, file: !6, line: 18, type: !10, spFlags: DISPFlagDefinition, unit: !7, retainedNodes: !46) +// CHECK:STDOUT: !44 = !DILocalVariable(arg: 1, scope: !43, type: !8) +// CHECK:STDOUT: !45 = !DILocation(line: 18, column: 1, scope: !43) +// CHECK:STDOUT: !46 = !{!44} +// CHECK:STDOUT: !47 = distinct !DISubprogram(name: "f__carbon_thunk", linkageName: "_Cf__carbon_thunk.Z.Main", scope: null, file: !6, line: 20, type: !10, spFlags: DISPFlagDefinition, unit: !7, retainedNodes: !50) +// CHECK:STDOUT: !48 = !DILocalVariable(arg: 1, scope: !47, type: !8) +// CHECK:STDOUT: !49 = !DILocation(line: 20, column: 3, scope: !47) +// CHECK:STDOUT: !50 = !{!48} +// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !6, line: 23, type: !12, spFlags: DISPFlagDefinition, unit: !7) +// CHECK:STDOUT: !52 = !DILocation(line: 24, column: 3, scope: !51) +// CHECK:STDOUT: !53 = !DILocation(line: 24, column: 14, scope: !51) +// CHECK:STDOUT: !54 = !DILocation(line: 24, column: 23, scope: !51) +// CHECK:STDOUT: !56 = !DILocation(line: 23, column: 1, scope: !51) +// CHECK:STDOUT: !57 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !58 = !{!"omnipotent char", !57, i64 0} +// CHECK:STDOUT: !59 = !{!"any pointer", !58, i64 0} +// CHECK:STDOUT: !60 = !{!"p1 _ZTS1X", !59, i64 0} +// CHECK:STDOUT: !61 = !{!60, !60, i64 0} +// CHECK:STDOUT: !62 = !{!"vtable pointer", !57, i64 0} +// CHECK:STDOUT: !63 = !{!62, !62, i64 0} +// CHECK:STDOUT: !64 = !{!"p1 _ZTSN6Carbon1ZE", !59, i64 0} +// CHECK:STDOUT: !65 = !{!64, !64, i64 0} +// CHECK:STDOUT: !68 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !69 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !70 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !71 = !{!"int", !58, i64 0} +// CHECK:STDOUT: !72 = !{!"__libc_errno", !71, i64 0} +// CHECK:STDOUT: !73 = !{!72, !71, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/enum.carbon b/toolchain/lower/testdata/interop/cpp/enum.carbon index 5ec3cd71a707..105f5ee602bc 100644 --- a/toolchain/lower/testdata/interop/cpp/enum.carbon +++ b/toolchain/lower/testdata/interop/cpp/enum.carbon @@ -167,43 +167,56 @@ fn CallCompareGeneric3(a: Cpp.C.E, b: Cpp.ConvertToEnum2) -> bool { // CHECK:STDOUT: @int_8 = internal constant i16 8 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPass.Main() #0 !dbg !12 { +// CHECK:STDOUT: define void @_CPass.Main() #0 !dbg !14 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc7_16.1.temp = alloca i16, align 2, !dbg !13 -// CHECK:STDOUT: %.loc8_16.1.temp = alloca i16, align 2, !dbg !15 -// CHECK:STDOUT: %.loc9_16.1.temp = alloca i16, align 2, !dbg !17 -// CHECK:STDOUT: %.loc10_16.1.temp = alloca i16, align 2, !dbg !19 -// CHECK:STDOUT: %.loc11_18.1.temp = alloca i16, align 2, !dbg !21 -// CHECK:STDOUT: %.loc12_18.1.temp = alloca i16, align 2, !dbg !23 -// CHECK:STDOUT: %.loc13_18.1.temp = alloca i16, align 2, !dbg !25 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_16.1.temp), !dbg !13 -// CHECK:STDOUT: call void @_ZN1C1FENS_1EE.carbon_thunk._(ptr @int_0), !dbg !14 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc8_16.1.temp), !dbg !15 +// CHECK:STDOUT: %.loc7_16.1.temp = alloca i16, align 2, !dbg !15 +// CHECK:STDOUT: %.loc8_16.1.temp = alloca i16, align 2, !dbg !17 +// CHECK:STDOUT: %.loc9_16.1.temp = alloca i16, align 2, !dbg !19 +// CHECK:STDOUT: %.loc10_16.1.temp = alloca i16, align 2, !dbg !21 +// CHECK:STDOUT: %.loc11_18.1.temp = alloca i16, align 2, !dbg !23 +// CHECK:STDOUT: %.loc12_18.1.temp = alloca i16, align 2, !dbg !25 +// CHECK:STDOUT: %.loc13_18.1.temp = alloca i16, align 2, !dbg !27 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_16.1.temp), !dbg !15 // CHECK:STDOUT: call void @_ZN1C1FENS_1EE.carbon_thunk._(ptr @int_0), !dbg !16 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_16.1.temp), !dbg !17 -// CHECK:STDOUT: call void @_ZN1C1FENS_1EE.carbon_thunk._(ptr @int_7), !dbg !18 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc10_16.1.temp), !dbg !19 -// CHECK:STDOUT: call void @_ZN1C1FENS_1EE.carbon_thunk._(ptr @int_8), !dbg !20 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc11_18.1.temp), !dbg !21 -// CHECK:STDOUT: call void @_ZN1C1FENS_1EE.carbon_thunk._(ptr @int_0), !dbg !22 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_18.1.temp), !dbg !23 -// CHECK:STDOUT: call void @_ZN1C1FENS_1EE.carbon_thunk._(ptr @int_7), !dbg !24 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc13_18.1.temp), !dbg !25 -// CHECK:STDOUT: call void @_ZN1C1FENS_1EE.carbon_thunk._(ptr @int_8), !dbg !26 -// CHECK:STDOUT: ret void, !dbg !27 +// CHECK:STDOUT: call void @"_CSelfDestruct.4f81cc432cb50e07:core.Destroy.Core"(ptr @int_0), !dbg !15 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc8_16.1.temp), !dbg !17 +// CHECK:STDOUT: call void @_ZN1C1FENS_1EE.carbon_thunk._(ptr @int_0), !dbg !18 +// CHECK:STDOUT: call void @"_CSelfDestruct.4f81cc432cb50e07:core.Destroy.Core"(ptr @int_0), !dbg !17 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_16.1.temp), !dbg !19 +// CHECK:STDOUT: call void @_ZN1C1FENS_1EE.carbon_thunk._(ptr @int_7), !dbg !20 +// CHECK:STDOUT: call void @"_CSelfDestruct.4f81cc432cb50e07:core.Destroy.Core"(ptr @int_7), !dbg !19 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc10_16.1.temp), !dbg !21 +// CHECK:STDOUT: call void @_ZN1C1FENS_1EE.carbon_thunk._(ptr @int_8), !dbg !22 +// CHECK:STDOUT: call void @"_CSelfDestruct.4f81cc432cb50e07:core.Destroy.Core"(ptr @int_8), !dbg !21 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc11_18.1.temp), !dbg !23 +// CHECK:STDOUT: call void @_ZN1C1FENS_1EE.carbon_thunk._(ptr @int_0), !dbg !24 +// CHECK:STDOUT: call void @"_CSelfDestruct.4f81cc432cb50e07:core.Destroy.Core"(ptr @int_0), !dbg !23 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_18.1.temp), !dbg !25 +// CHECK:STDOUT: call void @_ZN1C1FENS_1EE.carbon_thunk._(ptr @int_7), !dbg !26 +// CHECK:STDOUT: call void @"_CSelfDestruct.4f81cc432cb50e07:core.Destroy.Core"(ptr @int_7), !dbg !25 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc13_18.1.temp), !dbg !27 +// CHECK:STDOUT: call void @_ZN1C1FENS_1EE.carbon_thunk._(ptr @int_8), !dbg !28 +// CHECK:STDOUT: call void @"_CSelfDestruct.4f81cc432cb50e07:core.Destroy.Core"(ptr @int_8), !dbg !27 +// CHECK:STDOUT: ret void, !dbg !29 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define internal void @_ZN1C1FENS_1EE.carbon_thunk._(ptr noundef %0) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !31 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !31 -// CHECK:STDOUT: %2 = load i16, ptr %1, align 2, !tbaa !33 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !37 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !37 +// CHECK:STDOUT: %2 = load i16, ptr %1, align 2, !tbaa !39 // CHECK:STDOUT: call void @_ZN1C1FENS_1EE(i16 noundef signext %2) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.4f81cc432cb50e07:core.Destroy.Core"(ptr %self) #0 !dbg !30 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !32 +// 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)) #2 // CHECK:STDOUT: @@ -211,6 +224,7 @@ fn CallCompareGeneric3(a: Cpp.C.E, b: Cpp.ConvertToEnum2) -> bool { // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives // CHECK:STDOUT: uselistorder ptr @_ZN1C1FENS_1EE.carbon_thunk._, { 6, 5, 4, 3, 2, 1, 0 } +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.4f81cc432cb50e07:core.Destroy.Core", { 6, 5, 4, 3, 2, 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 6, 5, 4, 3, 2, 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -219,43 +233,50 @@ fn CallCompareGeneric3(a: Cpp.C.E, b: Cpp.ConvertToEnum2) -> bool { // CHECK:STDOUT: attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!5} -// CHECK:STDOUT: !llvm.module.flags = !{!34, !35, !36, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!39} +// CHECK:STDOUT: !llvm.module.flags = !{!40, !41, !42, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!45} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !4 = !DIFile(filename: "pass_as_arg.carbon", directory: "") // CHECK:STDOUT: !5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !4, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !6 = !DIBasicType(name: "int", size: 16, encoding: DW_ATE_signed) // CHECK:STDOUT: !7 = !{null} // CHECK:STDOUT: !8 = !DISubroutineType(types: !7) -// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "Pass", linkageName: "_CPass.Main", scope: null, file: !4, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !13 = !DILocation(line: 7, column: 11, scope: !12) -// CHECK:STDOUT: !14 = !DILocation(line: 7, column: 3, scope: !12) -// CHECK:STDOUT: !15 = !DILocation(line: 8, column: 11, scope: !12) -// CHECK:STDOUT: !16 = !DILocation(line: 8, column: 3, scope: !12) -// CHECK:STDOUT: !17 = !DILocation(line: 9, column: 11, scope: !12) -// CHECK:STDOUT: !18 = !DILocation(line: 9, column: 3, scope: !12) -// CHECK:STDOUT: !19 = !DILocation(line: 10, column: 11, scope: !12) -// CHECK:STDOUT: !20 = !DILocation(line: 10, column: 3, scope: !12) -// CHECK:STDOUT: !21 = !DILocation(line: 11, column: 11, scope: !12) -// CHECK:STDOUT: !22 = !DILocation(line: 11, column: 3, scope: !12) -// CHECK:STDOUT: !23 = !DILocation(line: 12, column: 11, scope: !12) -// CHECK:STDOUT: !24 = !DILocation(line: 12, column: 3, scope: !12) -// CHECK:STDOUT: !25 = !DILocation(line: 13, column: 11, scope: !12) -// CHECK:STDOUT: !26 = !DILocation(line: 13, column: 3, scope: !12) -// CHECK:STDOUT: !27 = !DILocation(line: 6, column: 1, scope: !12) -// CHECK:STDOUT: !28 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !29 = !{!"omnipotent char", !28, i64 0} -// CHECK:STDOUT: !30 = !{!"any pointer", !29, i64 0} -// CHECK:STDOUT: !31 = !{!30, !30, i64 0} -// CHECK:STDOUT: !32 = !{!"_ZTSN1C1EE", !29, i64 0} -// CHECK:STDOUT: !33 = !{!32, !32, i64 0} -// CHECK:STDOUT: !34 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !35 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !36 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !37 = !{!"int", !29, i64 0} -// CHECK:STDOUT: !38 = !{!"__libc_errno", !37, i64 0} -// CHECK:STDOUT: !39 = !{!38, !37, i64 0} +// CHECK:STDOUT: !12 = !{null, !6} +// CHECK:STDOUT: !13 = !DISubroutineType(types: !12) +// CHECK:STDOUT: !14 = distinct !DISubprogram(name: "Pass", linkageName: "_CPass.Main", scope: null, file: !4, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !15 = !DILocation(line: 7, column: 11, scope: !14) +// CHECK:STDOUT: !16 = !DILocation(line: 7, column: 3, scope: !14) +// CHECK:STDOUT: !17 = !DILocation(line: 8, column: 11, scope: !14) +// CHECK:STDOUT: !18 = !DILocation(line: 8, column: 3, scope: !14) +// CHECK:STDOUT: !19 = !DILocation(line: 9, column: 11, scope: !14) +// CHECK:STDOUT: !20 = !DILocation(line: 9, column: 3, scope: !14) +// CHECK:STDOUT: !21 = !DILocation(line: 10, column: 11, scope: !14) +// CHECK:STDOUT: !22 = !DILocation(line: 10, column: 3, scope: !14) +// CHECK:STDOUT: !23 = !DILocation(line: 11, column: 11, scope: !14) +// CHECK:STDOUT: !24 = !DILocation(line: 11, column: 3, scope: !14) +// CHECK:STDOUT: !25 = !DILocation(line: 12, column: 11, scope: !14) +// CHECK:STDOUT: !26 = !DILocation(line: 12, column: 3, scope: !14) +// CHECK:STDOUT: !27 = !DILocation(line: 13, column: 11, scope: !14) +// CHECK:STDOUT: !28 = !DILocation(line: 13, column: 3, scope: !14) +// CHECK:STDOUT: !29 = !DILocation(line: 6, column: 1, scope: !14) +// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.4f81cc432cb50e07:core.Destroy.Core", scope: null, file: !4, line: 7, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !33) +// CHECK:STDOUT: !31 = !DILocalVariable(arg: 1, scope: !30, type: !6) +// CHECK:STDOUT: !32 = !DILocation(line: 7, column: 11, scope: !30) +// CHECK:STDOUT: !33 = !{!31} +// CHECK:STDOUT: !34 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !35 = !{!"omnipotent char", !34, i64 0} +// CHECK:STDOUT: !36 = !{!"any pointer", !35, i64 0} +// CHECK:STDOUT: !37 = !{!36, !36, i64 0} +// CHECK:STDOUT: !38 = !{!"_ZTSN1C1EE", !35, i64 0} +// CHECK:STDOUT: !39 = !{!38, !38, i64 0} +// CHECK:STDOUT: !40 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !41 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !42 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !43 = !{!"int", !35, i64 0} +// CHECK:STDOUT: !44 = !{!"__libc_errno", !43, i64 0} +// CHECK:STDOUT: !45 = !{!44, !43, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'convert.carbon' @@ -266,40 +287,47 @@ fn CallCompareGeneric3(a: Cpp.C.E, b: Cpp.ConvertToEnum2) -> bool { // CHECK:STDOUT: declare void @_CTakeI16.Main(i16) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassEnum.Main() #0 !dbg !44 { +// CHECK:STDOUT: define void @_CPassEnum.Main() #0 !dbg !48 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CTakeI16.Main(i16 7), !dbg !45 -// CHECK:STDOUT: ret void, !dbg !46 +// CHECK:STDOUT: call void @_CTakeI16.Main(i16 7), !dbg !49 +// CHECK:STDOUT: ret void, !dbg !50 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CConvertEnumToI16.Main(i16 %e) #0 !dbg !47 { +// CHECK:STDOUT: define void @_CConvertEnumToI16.Main(i16 %e) #0 !dbg !51 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CTakeI16.Main(i16 %e), !dbg !51 -// CHECK:STDOUT: ret void, !dbg !52 +// CHECK:STDOUT: call void @_CTakeI16.Main(i16 %e), !dbg !55 +// CHECK:STDOUT: ret void, !dbg !56 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CConvertI16ToEnum.Main(i16 %n) #0 !dbg !54 { +// CHECK:STDOUT: define void @_CConvertI16ToEnum.Main(i16 %n) #0 !dbg !58 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc17_13.3.temp = alloca i16, align 2, !dbg !57 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc17_13.3.temp), !dbg !57 -// CHECK:STDOUT: store i16 %n, ptr %.loc17_13.3.temp, align 2, !dbg !57 -// CHECK:STDOUT: call void @_ZN1C1FENS_1EE.carbon_thunk._(ptr %.loc17_13.3.temp), !dbg !58 -// CHECK:STDOUT: ret void, !dbg !59 +// CHECK:STDOUT: %.loc17_13.3.temp = alloca i16, align 2, !dbg !61 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc17_13.3.temp), !dbg !61 +// CHECK:STDOUT: store i16 %n, ptr %.loc17_13.3.temp, align 2, !dbg !61 +// CHECK:STDOUT: call void @_ZN1C1FENS_1EE.carbon_thunk._(ptr %.loc17_13.3.temp), !dbg !62 +// CHECK:STDOUT: call void @"_CSelfDestruct.4f81cc432cb50e07:core.Destroy.Core"(ptr %.loc17_13.3.temp), !dbg !61 +// CHECK:STDOUT: ret void, !dbg !63 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define internal void @_ZN1C1FENS_1EE.carbon_thunk._(ptr noundef %0) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !31 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !31 -// CHECK:STDOUT: %2 = load i16, ptr %1, align 2, !tbaa !33 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !37 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !37 +// CHECK:STDOUT: %2 = load i16, ptr %1, align 2, !tbaa !39 // CHECK:STDOUT: call void @_ZN1C1FENS_1EE(i16 noundef signext %2) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.4f81cc432cb50e07:core.Destroy.Core"(ptr %self) #0 !dbg !65 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !67 +// 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)) #2 // CHECK:STDOUT: @@ -310,45 +338,49 @@ fn CallCompareGeneric3(a: Cpp.C.E, b: Cpp.ConvertToEnum2) -> bool { // CHECK:STDOUT: attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!41} -// CHECK:STDOUT: !llvm.module.flags = !{!34, !35, !36, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!39} +// CHECK:STDOUT: !llvm.dbg.cu = !{!47} +// CHECK:STDOUT: !llvm.module.flags = !{!40, !41, !42, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!45} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !6 = !DIBasicType(name: "int", size: 16, encoding: DW_ATE_signed) // CHECK:STDOUT: !7 = !{null} // CHECK:STDOUT: !8 = !DISubroutineType(types: !7) -// CHECK:STDOUT: !28 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !29 = !{!"omnipotent char", !28, i64 0} -// CHECK:STDOUT: !30 = !{!"any pointer", !29, i64 0} -// CHECK:STDOUT: !31 = !{!30, !30, i64 0} -// CHECK:STDOUT: !32 = !{!"_ZTSN1C1EE", !29, i64 0} -// CHECK:STDOUT: !33 = !{!32, !32, i64 0} -// CHECK:STDOUT: !34 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !35 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !36 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !37 = !{!"int", !29, i64 0} -// CHECK:STDOUT: !38 = !{!"__libc_errno", !37, i64 0} -// CHECK:STDOUT: !39 = !{!38, !37, i64 0} -// CHECK:STDOUT: !40 = !DIFile(filename: "convert.carbon", directory: "") -// CHECK:STDOUT: !41 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !40, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !42 = !{null, !6} -// CHECK:STDOUT: !43 = !DISubroutineType(types: !42) -// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "PassEnum", linkageName: "_CPassEnum.Main", scope: null, file: !40, line: 8, type: !8, spFlags: DISPFlagDefinition, unit: !41) -// CHECK:STDOUT: !45 = !DILocation(line: 9, column: 3, scope: !44) -// CHECK:STDOUT: !46 = !DILocation(line: 8, column: 1, scope: !44) -// CHECK:STDOUT: !47 = distinct !DISubprogram(name: "ConvertEnumToI16", linkageName: "_CConvertEnumToI16.Main", scope: null, file: !40, line: 12, type: !43, spFlags: DISPFlagDefinition, unit: !41, retainedNodes: !53) -// CHECK:STDOUT: !48 = !DILocalVariable(arg: 1, scope: !47, type: !6) -// CHECK:STDOUT: !51 = !DILocation(line: 13, column: 3, scope: !47) -// CHECK:STDOUT: !52 = !DILocation(line: 12, column: 1, scope: !47) -// CHECK:STDOUT: !53 = !{!48} -// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "ConvertI16ToEnum", linkageName: "_CConvertI16ToEnum.Main", scope: null, file: !40, line: 16, type: !43, spFlags: DISPFlagDefinition, unit: !41, retainedNodes: !60) -// CHECK:STDOUT: !55 = !DILocalVariable(arg: 1, scope: !54, type: !6) -// CHECK:STDOUT: !57 = !DILocation(line: 17, column: 11, scope: !54) -// CHECK:STDOUT: !58 = !DILocation(line: 17, column: 3, scope: !54) -// CHECK:STDOUT: !59 = !DILocation(line: 16, column: 1, scope: !54) -// CHECK:STDOUT: !60 = !{!55} +// CHECK:STDOUT: !12 = !{null, !6} +// CHECK:STDOUT: !13 = !DISubroutineType(types: !12) +// CHECK:STDOUT: !34 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !35 = !{!"omnipotent char", !34, i64 0} +// CHECK:STDOUT: !36 = !{!"any pointer", !35, i64 0} +// CHECK:STDOUT: !37 = !{!36, !36, i64 0} +// CHECK:STDOUT: !38 = !{!"_ZTSN1C1EE", !35, i64 0} +// CHECK:STDOUT: !39 = !{!38, !38, i64 0} +// CHECK:STDOUT: !40 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !41 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !42 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !43 = !{!"int", !35, i64 0} +// CHECK:STDOUT: !44 = !{!"__libc_errno", !43, i64 0} +// CHECK:STDOUT: !45 = !{!44, !43, i64 0} +// CHECK:STDOUT: !46 = !DIFile(filename: "convert.carbon", directory: "") +// CHECK:STDOUT: !47 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !46, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "PassEnum", linkageName: "_CPassEnum.Main", scope: null, file: !46, line: 8, type: !8, spFlags: DISPFlagDefinition, unit: !47) +// CHECK:STDOUT: !49 = !DILocation(line: 9, column: 3, scope: !48) +// CHECK:STDOUT: !50 = !DILocation(line: 8, column: 1, scope: !48) +// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "ConvertEnumToI16", linkageName: "_CConvertEnumToI16.Main", scope: null, file: !46, line: 12, type: !13, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !57) +// CHECK:STDOUT: !52 = !DILocalVariable(arg: 1, scope: !51, type: !6) +// CHECK:STDOUT: !55 = !DILocation(line: 13, column: 3, scope: !51) +// CHECK:STDOUT: !56 = !DILocation(line: 12, column: 1, scope: !51) +// CHECK:STDOUT: !57 = !{!52} +// CHECK:STDOUT: !58 = distinct !DISubprogram(name: "ConvertI16ToEnum", linkageName: "_CConvertI16ToEnum.Main", scope: null, file: !46, line: 16, type: !13, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !64) +// CHECK:STDOUT: !59 = !DILocalVariable(arg: 1, scope: !58, type: !6) +// CHECK:STDOUT: !61 = !DILocation(line: 17, column: 11, scope: !58) +// CHECK:STDOUT: !62 = !DILocation(line: 17, column: 3, scope: !58) +// CHECK:STDOUT: !63 = !DILocation(line: 16, column: 1, scope: !58) +// CHECK:STDOUT: !64 = !{!59} +// CHECK:STDOUT: !65 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.4f81cc432cb50e07:core.Destroy.Core", scope: null, file: !46, line: 17, type: !13, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !68) +// CHECK:STDOUT: !66 = !DILocalVariable(arg: 1, scope: !65, type: !6) +// CHECK:STDOUT: !67 = !DILocation(line: 17, column: 11, scope: !65) +// CHECK:STDOUT: !68 = !{!66} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'use_bitmask.carbon' @@ -357,29 +389,29 @@ fn CallCompareGeneric3(a: Cpp.C.E, b: Cpp.ConvertToEnum2) -> bool { // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CCompileTime.Main() #0 !dbg !68 { +// CHECK:STDOUT: define void @_CCompileTime.Main() #0 !dbg !76 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z4Take4Bits(i32 0), !dbg !69 -// CHECK:STDOUT: call void @_Z4Take4Bits(i32 5), !dbg !70 -// CHECK:STDOUT: call void @_Z4Take4Bits(i32 5), !dbg !71 -// CHECK:STDOUT: call void @_Z4Take4Bits(i32 -2), !dbg !72 -// CHECK:STDOUT: ret void, !dbg !73 +// CHECK:STDOUT: call void @_Z4Take4Bits(i32 0), !dbg !77 +// CHECK:STDOUT: call void @_Z4Take4Bits(i32 5), !dbg !78 +// CHECK:STDOUT: call void @_Z4Take4Bits(i32 5), !dbg !79 +// CHECK:STDOUT: call void @_Z4Take4Bits(i32 -2), !dbg !80 +// CHECK:STDOUT: ret void, !dbg !81 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z4Take4Bits(i32 noundef) #1 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CRuntime.Main(i32 %a, i32 %b) #0 !dbg !74 { +// CHECK:STDOUT: define void @_CRuntime.Main(i32 %a, i32 %b) #0 !dbg !82 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %BitAndWith.WithSelf.Op.call = and i32 %a, %b, !dbg !79 -// CHECK:STDOUT: call void @_Z4Take4Bits(i32 %BitAndWith.WithSelf.Op.call), !dbg !81 -// CHECK:STDOUT: %BitOrWith.WithSelf.Op.call = or i32 %a, %b, !dbg !82 -// CHECK:STDOUT: call void @_Z4Take4Bits(i32 %BitOrWith.WithSelf.Op.call), !dbg !84 -// CHECK:STDOUT: %BitXorWith.WithSelf.Op.call = xor i32 %a, %b, !dbg !85 -// CHECK:STDOUT: call void @_Z4Take4Bits(i32 %BitXorWith.WithSelf.Op.call), !dbg !87 -// CHECK:STDOUT: %BitComplement.WithSelf.Op.call = xor i32 -1, %a, !dbg !89 -// CHECK:STDOUT: call void @_Z4Take4Bits(i32 %BitComplement.WithSelf.Op.call), !dbg !90 -// CHECK:STDOUT: ret void, !dbg !91 +// CHECK:STDOUT: %BitAndWith.WithSelf.Op.call = and i32 %a, %b, !dbg !87 +// CHECK:STDOUT: call void @_Z4Take4Bits(i32 %BitAndWith.WithSelf.Op.call), !dbg !89 +// CHECK:STDOUT: %BitOrWith.WithSelf.Op.call = or i32 %a, %b, !dbg !90 +// CHECK:STDOUT: call void @_Z4Take4Bits(i32 %BitOrWith.WithSelf.Op.call), !dbg !92 +// CHECK:STDOUT: %BitXorWith.WithSelf.Op.call = xor i32 %a, %b, !dbg !93 +// CHECK:STDOUT: call void @_Z4Take4Bits(i32 %BitXorWith.WithSelf.Op.call), !dbg !95 +// CHECK:STDOUT: %BitComplement.WithSelf.Op.call = xor i32 -1, %a, !dbg !97 +// CHECK:STDOUT: call void @_Z4Take4Bits(i32 %BitComplement.WithSelf.Op.call), !dbg !98 +// CHECK:STDOUT: ret void, !dbg !99 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -388,46 +420,46 @@ fn CallCompareGeneric3(a: Cpp.C.E, b: Cpp.ConvertToEnum2) -> bool { // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!62} -// CHECK:STDOUT: !llvm.module.flags = !{!34, !35, !36, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!39} +// CHECK:STDOUT: !llvm.dbg.cu = !{!70} +// CHECK:STDOUT: !llvm.module.flags = !{!40, !41, !42, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!45} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !7 = !{null} // CHECK:STDOUT: !8 = !DISubroutineType(types: !7) -// CHECK:STDOUT: !28 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !29 = !{!"omnipotent char", !28, i64 0} -// CHECK:STDOUT: !34 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !35 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !36 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !37 = !{!"int", !29, i64 0} -// CHECK:STDOUT: !38 = !{!"__libc_errno", !37, i64 0} -// CHECK:STDOUT: !39 = !{!38, !37, i64 0} -// CHECK:STDOUT: !61 = !DIFile(filename: "use_bitmask.carbon", directory: "") -// CHECK:STDOUT: !62 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !61, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !63 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_unsigned) -// CHECK:STDOUT: !66 = !{null, !63, !63} -// CHECK:STDOUT: !67 = !DISubroutineType(types: !66) -// CHECK:STDOUT: !68 = distinct !DISubprogram(name: "CompileTime", linkageName: "_CCompileTime.Main", scope: null, file: !61, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !62) -// CHECK:STDOUT: !69 = !DILocation(line: 7, column: 3, scope: !68) -// CHECK:STDOUT: !70 = !DILocation(line: 8, column: 3, scope: !68) -// CHECK:STDOUT: !71 = !DILocation(line: 9, column: 3, scope: !68) -// CHECK:STDOUT: !72 = !DILocation(line: 10, column: 3, scope: !68) -// CHECK:STDOUT: !73 = !DILocation(line: 6, column: 1, scope: !68) -// CHECK:STDOUT: !74 = distinct !DISubprogram(name: "Runtime", linkageName: "_CRuntime.Main", scope: null, file: !61, line: 13, type: !67, spFlags: DISPFlagDefinition, unit: !62, retainedNodes: !92) -// CHECK:STDOUT: !75 = !DILocalVariable(arg: 1, scope: !74, type: !63) -// CHECK:STDOUT: !76 = !DILocalVariable(arg: 2, scope: !74, type: !63) -// CHECK:STDOUT: !79 = !DILocation(line: 14, column: 12, scope: !74) -// CHECK:STDOUT: !81 = !DILocation(line: 14, column: 3, scope: !74) -// CHECK:STDOUT: !82 = !DILocation(line: 15, column: 12, scope: !74) -// CHECK:STDOUT: !84 = !DILocation(line: 15, column: 3, scope: !74) -// CHECK:STDOUT: !85 = !DILocation(line: 16, column: 12, scope: !74) -// CHECK:STDOUT: !87 = !DILocation(line: 16, column: 3, scope: !74) -// CHECK:STDOUT: !89 = !DILocation(line: 20, column: 12, scope: !74) -// CHECK:STDOUT: !90 = !DILocation(line: 20, column: 3, scope: !74) -// CHECK:STDOUT: !91 = !DILocation(line: 13, column: 1, scope: !74) -// CHECK:STDOUT: !92 = !{!75, !76} +// CHECK:STDOUT: !34 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !35 = !{!"omnipotent char", !34, i64 0} +// CHECK:STDOUT: !40 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !41 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !42 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !43 = !{!"int", !35, i64 0} +// CHECK:STDOUT: !44 = !{!"__libc_errno", !43, i64 0} +// CHECK:STDOUT: !45 = !{!44, !43, i64 0} +// CHECK:STDOUT: !69 = !DIFile(filename: "use_bitmask.carbon", directory: "") +// CHECK:STDOUT: !70 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !69, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !71 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_unsigned) +// CHECK:STDOUT: !74 = !{null, !71, !71} +// CHECK:STDOUT: !75 = !DISubroutineType(types: !74) +// CHECK:STDOUT: !76 = distinct !DISubprogram(name: "CompileTime", linkageName: "_CCompileTime.Main", scope: null, file: !69, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !70) +// CHECK:STDOUT: !77 = !DILocation(line: 7, column: 3, scope: !76) +// CHECK:STDOUT: !78 = !DILocation(line: 8, column: 3, scope: !76) +// CHECK:STDOUT: !79 = !DILocation(line: 9, column: 3, scope: !76) +// CHECK:STDOUT: !80 = !DILocation(line: 10, column: 3, scope: !76) +// CHECK:STDOUT: !81 = !DILocation(line: 6, column: 1, scope: !76) +// CHECK:STDOUT: !82 = distinct !DISubprogram(name: "Runtime", linkageName: "_CRuntime.Main", scope: null, file: !69, line: 13, type: !75, spFlags: DISPFlagDefinition, unit: !70, retainedNodes: !100) +// CHECK:STDOUT: !83 = !DILocalVariable(arg: 1, scope: !82, type: !71) +// CHECK:STDOUT: !84 = !DILocalVariable(arg: 2, scope: !82, type: !71) +// CHECK:STDOUT: !87 = !DILocation(line: 14, column: 12, scope: !82) +// CHECK:STDOUT: !89 = !DILocation(line: 14, column: 3, scope: !82) +// CHECK:STDOUT: !90 = !DILocation(line: 15, column: 12, scope: !82) +// CHECK:STDOUT: !92 = !DILocation(line: 15, column: 3, scope: !82) +// CHECK:STDOUT: !93 = !DILocation(line: 16, column: 12, scope: !82) +// CHECK:STDOUT: !95 = !DILocation(line: 16, column: 3, scope: !82) +// CHECK:STDOUT: !97 = !DILocation(line: 20, column: 12, scope: !82) +// CHECK:STDOUT: !98 = !DILocation(line: 20, column: 3, scope: !82) +// CHECK:STDOUT: !99 = !DILocation(line: 13, column: 1, scope: !82) +// CHECK:STDOUT: !100 = !{!83, !84} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'compare.carbon' @@ -436,66 +468,66 @@ fn CallCompareGeneric3(a: Cpp.C.E, b: Cpp.ConvertToEnum2) -> bool { // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i1 @_CCompare.Main(i16 %a, i16 %b) #0 !dbg !97 { +// CHECK:STDOUT: define i1 @_CCompare.Main(i16 %a, i16 %b) #0 !dbg !105 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %OrderedWith.WithSelf.Equal.call = icmp eq i16 %a, %b, !dbg !104 -// CHECK:STDOUT: ret i1 %OrderedWith.WithSelf.Equal.call, !dbg !106 +// CHECK:STDOUT: %OrderedWith.WithSelf.Equal.call = icmp eq i16 %a, %b, !dbg !112 +// CHECK:STDOUT: ret i1 %OrderedWith.WithSelf.Equal.call, !dbg !114 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i1 @_CCallCompareGeneric.Main(i16 %a, i16 %b) #0 !dbg !108 { +// CHECK:STDOUT: define i1 @_CCallCompareGeneric.Main(i16 %a, i16 %b) #0 !dbg !116 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %CompareGeneric.call = call i1 @_CCompareGeneric.Main.7602ebbc958eec83(i16 %a, i16 %b), !dbg !117 -// CHECK:STDOUT: ret i1 %CompareGeneric.call, !dbg !118 +// CHECK:STDOUT: %CompareGeneric.call = call i1 @_CCompareGeneric.Main.7602ebbc958eec83(i16 %a, i16 %b), !dbg !125 +// CHECK:STDOUT: ret i1 %CompareGeneric.call, !dbg !126 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @_CCompareGeneric.Main.7602ebbc958eec83(i16 %x, i16 %y) #0 !dbg !120 { +// CHECK:STDOUT: define linkonce_odr i1 @_CCompareGeneric.Main.7602ebbc958eec83(i16 %x, i16 %y) #0 !dbg !128 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %EqWith.WithSelf.Equal.call = icmp eq i16 %x, %y, !dbg !127 -// CHECK:STDOUT: ret i1 %EqWith.WithSelf.Equal.call, !dbg !129 +// CHECK:STDOUT: %EqWith.WithSelf.Equal.call = icmp eq i16 %x, %y, !dbg !135 +// CHECK:STDOUT: ret i1 %EqWith.WithSelf.Equal.call, !dbg !137 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!94} -// CHECK:STDOUT: !llvm.module.flags = !{!34, !35, !36, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!39} +// CHECK:STDOUT: !llvm.dbg.cu = !{!102} +// CHECK:STDOUT: !llvm.module.flags = !{!40, !41, !42, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!45} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !6 = !DIBasicType(name: "int", size: 16, encoding: DW_ATE_signed) // CHECK:STDOUT: !9 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !28 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !29 = !{!"omnipotent char", !28, i64 0} -// CHECK:STDOUT: !34 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !35 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !36 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !37 = !{!"int", !29, i64 0} -// CHECK:STDOUT: !38 = !{!"__libc_errno", !37, i64 0} -// CHECK:STDOUT: !39 = !{!38, !37, i64 0} -// CHECK:STDOUT: !93 = !DIFile(filename: "compare.carbon", directory: "") -// CHECK:STDOUT: !94 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !93, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !95 = !{!9, !6, !6} -// CHECK:STDOUT: !96 = !DISubroutineType(types: !95) -// CHECK:STDOUT: !97 = distinct !DISubprogram(name: "Compare", linkageName: "_CCompare.Main", scope: null, file: !93, line: 6, type: !96, spFlags: DISPFlagDefinition, unit: !94, retainedNodes: !107) -// CHECK:STDOUT: !98 = !DILocalVariable(arg: 1, scope: !97, type: !6) -// CHECK:STDOUT: !99 = !DILocalVariable(arg: 2, scope: !97, type: !6) -// CHECK:STDOUT: !104 = !DILocation(line: 7, column: 10, scope: !97) -// CHECK:STDOUT: !106 = !DILocation(line: 7, column: 3, scope: !97) -// CHECK:STDOUT: !107 = !{!98, !99} -// CHECK:STDOUT: !108 = distinct !DISubprogram(name: "CallCompareGeneric", linkageName: "_CCallCompareGeneric.Main", scope: null, file: !93, line: 14, type: !96, spFlags: DISPFlagDefinition, unit: !94, retainedNodes: !119) -// CHECK:STDOUT: !109 = !DILocalVariable(arg: 1, scope: !108, type: !6) -// CHECK:STDOUT: !110 = !DILocalVariable(arg: 2, scope: !108, type: !6) -// CHECK:STDOUT: !117 = !DILocation(line: 15, column: 10, scope: !108) -// CHECK:STDOUT: !118 = !DILocation(line: 15, column: 3, scope: !108) -// CHECK:STDOUT: !119 = !{!109, !110} -// CHECK:STDOUT: !120 = distinct !DISubprogram(name: "CompareGeneric", linkageName: "_CCompareGeneric.Main.7602ebbc958eec83", scope: null, file: !93, line: 10, type: !96, spFlags: DISPFlagDefinition, unit: !94, retainedNodes: !130) -// CHECK:STDOUT: !121 = !DILocalVariable(arg: 1, scope: !120, type: !6) -// CHECK:STDOUT: !122 = !DILocalVariable(arg: 2, scope: !120, type: !6) -// CHECK:STDOUT: !127 = !DILocation(line: 11, column: 10, scope: !120) -// CHECK:STDOUT: !129 = !DILocation(line: 11, column: 3, scope: !120) -// CHECK:STDOUT: !130 = !{!121, !122} +// CHECK:STDOUT: !34 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !35 = !{!"omnipotent char", !34, i64 0} +// CHECK:STDOUT: !40 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !41 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !42 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !43 = !{!"int", !35, i64 0} +// CHECK:STDOUT: !44 = !{!"__libc_errno", !43, i64 0} +// CHECK:STDOUT: !45 = !{!44, !43, i64 0} +// CHECK:STDOUT: !101 = !DIFile(filename: "compare.carbon", directory: "") +// CHECK:STDOUT: !102 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !101, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !103 = !{!9, !6, !6} +// CHECK:STDOUT: !104 = !DISubroutineType(types: !103) +// CHECK:STDOUT: !105 = distinct !DISubprogram(name: "Compare", linkageName: "_CCompare.Main", scope: null, file: !101, line: 6, type: !104, spFlags: DISPFlagDefinition, unit: !102, retainedNodes: !115) +// CHECK:STDOUT: !106 = !DILocalVariable(arg: 1, scope: !105, type: !6) +// CHECK:STDOUT: !107 = !DILocalVariable(arg: 2, scope: !105, type: !6) +// CHECK:STDOUT: !112 = !DILocation(line: 7, column: 10, scope: !105) +// CHECK:STDOUT: !114 = !DILocation(line: 7, column: 3, scope: !105) +// CHECK:STDOUT: !115 = !{!106, !107} +// CHECK:STDOUT: !116 = distinct !DISubprogram(name: "CallCompareGeneric", linkageName: "_CCallCompareGeneric.Main", scope: null, file: !101, line: 14, type: !104, spFlags: DISPFlagDefinition, unit: !102, retainedNodes: !127) +// CHECK:STDOUT: !117 = !DILocalVariable(arg: 1, scope: !116, type: !6) +// CHECK:STDOUT: !118 = !DILocalVariable(arg: 2, scope: !116, type: !6) +// CHECK:STDOUT: !125 = !DILocation(line: 15, column: 10, scope: !116) +// CHECK:STDOUT: !126 = !DILocation(line: 15, column: 3, scope: !116) +// CHECK:STDOUT: !127 = !{!117, !118} +// CHECK:STDOUT: !128 = distinct !DISubprogram(name: "CompareGeneric", linkageName: "_CCompareGeneric.Main.7602ebbc958eec83", scope: null, file: !101, line: 10, type: !104, spFlags: DISPFlagDefinition, unit: !102, retainedNodes: !138) +// CHECK:STDOUT: !129 = !DILocalVariable(arg: 1, scope: !128, type: !6) +// CHECK:STDOUT: !130 = !DILocalVariable(arg: 2, scope: !128, type: !6) +// CHECK:STDOUT: !135 = !DILocation(line: 11, column: 10, scope: !128) +// CHECK:STDOUT: !137 = !DILocation(line: 11, column: 3, scope: !128) +// CHECK:STDOUT: !138 = !{!129, !130} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'compare_class.carbon' @@ -504,14 +536,15 @@ fn CallCompareGeneric3(a: Cpp.C.E, b: Cpp.ConvertToEnum2) -> bool { // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i1 @_CCompare.Main(i16 %a, ptr %b) #0 !dbg !141 { +// CHECK:STDOUT: define i1 @_CCompare.Main(i16 %a, ptr %b) #0 !dbg !149 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc18_15.1.temp = alloca i16, align 2, !dbg !149 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_15.1.temp), !dbg !149 -// CHECK:STDOUT: call void @_ZNK13ConvertToEnumcvN1C1EEEv.carbon_thunk._(ptr %b, ptr %.loc18_15.1.temp), !dbg !149 -// CHECK:STDOUT: %.loc18_15.5 = load i16, ptr %.loc18_15.1.temp, align 2, !dbg !149 -// CHECK:STDOUT: %OrderedWith.WithSelf.Equal.call = icmp eq i16 %a, %.loc18_15.5, !dbg !148 -// CHECK:STDOUT: ret i1 %OrderedWith.WithSelf.Equal.call, !dbg !150 +// CHECK:STDOUT: %.loc18_15.1.temp = alloca i16, align 2, !dbg !157 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_15.1.temp), !dbg !157 +// CHECK:STDOUT: call void @_ZNK13ConvertToEnumcvN1C1EEEv.carbon_thunk._(ptr %b, ptr %.loc18_15.1.temp), !dbg !157 +// CHECK:STDOUT: %.loc18_15.5 = load i16, ptr %.loc18_15.1.temp, align 2, !dbg !157 +// CHECK:STDOUT: %OrderedWith.WithSelf.Equal.call = icmp eq i16 %a, %.loc18_15.5, !dbg !156 +// CHECK:STDOUT: call void @"_CSelfDestruct.4f81cc432cb50e07:core.Destroy.Core"(ptr %.loc18_15.1.temp), !dbg !157 +// CHECK:STDOUT: ret i1 %OrderedWith.WithSelf.Equal.call, !dbg !158 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -519,42 +552,49 @@ fn CallCompareGeneric3(a: Cpp.C.E, b: Cpp.ConvertToEnum2) -> bool { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !274 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !31 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !31 -// CHECK:STDOUT: %1 = load ptr, ptr %this.addr, align 8, !tbaa !274, !nonnull !276 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !286 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !37 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !37 +// CHECK:STDOUT: %1 = load ptr, ptr %this.addr, align 8, !tbaa !286, !nonnull !288 // CHECK:STDOUT: %call = call noundef signext i16 @_ZNK13ConvertToEnumcvN1C1EEEv(ptr noundef nonnull align 1 dereferenceable(1) %1) -// CHECK:STDOUT: store i16 %call, ptr %0, align 2, !tbaa !33 +// CHECK:STDOUT: store i16 %call, ptr %0, align 2, !tbaa !39 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i1 @_CCompare2.Main(i32 %a, ptr %b) #0 !dbg !152 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.4f81cc432cb50e07:core.Destroy.Core"(ptr %self) #0 !dbg !160 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %__carbon_thunk.call = call i32 @_ZNK13ConvertToEnumcv2E2Ev.carbon_thunk._(ptr %b), !dbg !160 -// CHECK:STDOUT: %OrderedWith.WithSelf.Equal.call = icmp eq i32 %a, %__carbon_thunk.call, !dbg !159 -// CHECK:STDOUT: ret i1 %OrderedWith.WithSelf.Equal.call, !dbg !161 +// CHECK:STDOUT: ret void, !dbg !162 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define i1 @_CCompare2.Main(i32 %a, ptr %b) #0 !dbg !164 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %__carbon_thunk.call = call i32 @_ZNK13ConvertToEnumcv2E2Ev.carbon_thunk._(ptr %b), !dbg !172 +// CHECK:STDOUT: %OrderedWith.WithSelf.Equal.call = icmp eq i32 %a, %__carbon_thunk.call, !dbg !171 +// CHECK:STDOUT: ret i1 %OrderedWith.WithSelf.Equal.call, !dbg !173 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define internal noundef i32 @_ZNK13ConvertToEnumcv2E2Ev.carbon_thunk._(ptr noundef nonnull align 1 dereferenceable(1) %this) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !274 -// CHECK:STDOUT: %0 = load ptr, ptr %this.addr, align 8, !tbaa !274, !nonnull !276 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !286 +// CHECK:STDOUT: %0 = load ptr, ptr %this.addr, align 8, !tbaa !286, !nonnull !288 // CHECK:STDOUT: %call = call noundef i32 @_ZNK13ConvertToEnumcv2E2Ev(ptr noundef nonnull align 1 dereferenceable(1) %0) // CHECK:STDOUT: ret i32 %call // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i1 @_CCompare3.Main(i16 %a, ptr %b) #0 !dbg !163 { +// CHECK:STDOUT: define i1 @_CCompare3.Main(i16 %a, ptr %b) #0 !dbg !175 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc26_15.1.temp = alloca i16, align 2, !dbg !171 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc26_15.1.temp), !dbg !171 -// CHECK:STDOUT: call void @_ZNK14ConvertToEnum2cvN1C1EEEv.carbon_thunk._(ptr %b, ptr %.loc26_15.1.temp), !dbg !171 -// CHECK:STDOUT: %.loc26_15.5 = load i16, ptr %.loc26_15.1.temp, align 2, !dbg !171 -// CHECK:STDOUT: %OrderedWith.WithSelf.Equal.call = icmp eq i16 %a, %.loc26_15.5, !dbg !170 -// CHECK:STDOUT: ret i1 %OrderedWith.WithSelf.Equal.call, !dbg !172 +// CHECK:STDOUT: %.loc26_15.1.temp = alloca i16, align 2, !dbg !183 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc26_15.1.temp), !dbg !183 +// CHECK:STDOUT: call void @_ZNK14ConvertToEnum2cvN1C1EEEv.carbon_thunk._(ptr %b, ptr %.loc26_15.1.temp), !dbg !183 +// CHECK:STDOUT: %.loc26_15.5 = load i16, ptr %.loc26_15.1.temp, align 2, !dbg !183 +// CHECK:STDOUT: %OrderedWith.WithSelf.Equal.call = icmp eq i16 %a, %.loc26_15.5, !dbg !182 +// CHECK:STDOUT: call void @"_CSelfDestruct.4f81cc432cb50e07:core.Destroy.Core"(ptr %.loc26_15.1.temp), !dbg !183 +// CHECK:STDOUT: ret i1 %OrderedWith.WithSelf.Equal.call, !dbg !184 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -562,118 +602,122 @@ fn CallCompareGeneric3(a: Cpp.C.E, b: Cpp.ConvertToEnum2) -> bool { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !278 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !31 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !31 -// CHECK:STDOUT: %1 = load ptr, ptr %this.addr, align 8, !tbaa !278, !nonnull !276 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !290 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !37 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !37 +// CHECK:STDOUT: %1 = load ptr, ptr %this.addr, align 8, !tbaa !290, !nonnull !288 // CHECK:STDOUT: %call = call noundef signext i16 @_ZNK14ConvertToEnum2cvN1C1EEEv(ptr noundef nonnull align 1 dereferenceable(1) %1) -// CHECK:STDOUT: store i16 %call, ptr %0, align 2, !tbaa !33 +// CHECK:STDOUT: store i16 %call, ptr %0, align 2, !tbaa !39 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i1 @_CCallCompareGeneric.Main(i16 %a, ptr %b) #0 !dbg !174 { +// CHECK:STDOUT: define i1 @_CCallCompareGeneric.Main(i16 %a, ptr %b) #0 !dbg !186 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %CompareGeneric.call = call i1 @_CCompareGeneric.Main.356c7bb457b5b49b(i16 %a, ptr %b), !dbg !183 -// CHECK:STDOUT: ret i1 %CompareGeneric.call, !dbg !184 +// CHECK:STDOUT: %CompareGeneric.call = call i1 @_CCompareGeneric.Main.356c7bb457b5b49b(i16 %a, ptr %b), !dbg !195 +// CHECK:STDOUT: ret i1 %CompareGeneric.call, !dbg !196 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr i1 @"_CEqual:thunk:EqWith.83b9626e83cf3dcc.Core:OrderedWith.Core"(i16 %self, ptr %other) #2 !dbg !186 { +// CHECK:STDOUT: define weak_odr i1 @"_CEqual:thunk:EqWith.83b9626e83cf3dcc.Core:OrderedWith.Core"(i16 %self, ptr %other) #2 !dbg !198 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.4.temp = alloca i16, align 2, !dbg !189 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.4.temp), !dbg !189 -// CHECK:STDOUT: call void @_ZNK13ConvertToEnumcvN1C1EEEv.carbon_thunk._(ptr %other, ptr %.4.temp), !dbg !189 -// CHECK:STDOUT: %.8 = load i16, ptr %.4.temp, align 2, !dbg !189 -// CHECK:STDOUT: %OrderedWith.WithSelf.Equal.call = icmp eq i16 %self, %.8, !dbg !189 -// CHECK:STDOUT: ret i1 %OrderedWith.WithSelf.Equal.call, !dbg !189 +// CHECK:STDOUT: %.4.temp = alloca i16, align 2, !dbg !201 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.4.temp), !dbg !201 +// CHECK:STDOUT: call void @_ZNK13ConvertToEnumcvN1C1EEEv.carbon_thunk._(ptr %other, ptr %.4.temp), !dbg !201 +// CHECK:STDOUT: %.8 = load i16, ptr %.4.temp, align 2, !dbg !201 +// CHECK:STDOUT: %OrderedWith.WithSelf.Equal.call = icmp eq i16 %self, %.8, !dbg !201 +// CHECK:STDOUT: call void @"_CSelfDestruct.4f81cc432cb50e07:core.Destroy.Core"(ptr %.4.temp), !dbg !201 +// CHECK:STDOUT: ret i1 %OrderedWith.WithSelf.Equal.call, !dbg !201 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr i1 @"_CNotEqual:thunk:EqWith.83b9626e83cf3dcc.Core:OrderedWith.Core"(i16 %self, ptr %other) #2 !dbg !191 { +// CHECK:STDOUT: define weak_odr i1 @"_CNotEqual:thunk:EqWith.83b9626e83cf3dcc.Core:OrderedWith.Core"(i16 %self, ptr %other) #2 !dbg !203 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.4.temp = alloca i16, align 2, !dbg !194 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.4.temp), !dbg !194 -// CHECK:STDOUT: call void @_ZNK13ConvertToEnumcvN1C1EEEv.carbon_thunk._(ptr %other, ptr %.4.temp), !dbg !194 -// CHECK:STDOUT: %.8 = load i16, ptr %.4.temp, align 2, !dbg !194 -// CHECK:STDOUT: %OrderedWith.WithSelf.NotEqual.call = icmp ne i16 %self, %.8, !dbg !194 -// CHECK:STDOUT: ret i1 %OrderedWith.WithSelf.NotEqual.call, !dbg !194 +// CHECK:STDOUT: %.4.temp = alloca i16, align 2, !dbg !206 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.4.temp), !dbg !206 +// CHECK:STDOUT: call void @_ZNK13ConvertToEnumcvN1C1EEEv.carbon_thunk._(ptr %other, ptr %.4.temp), !dbg !206 +// CHECK:STDOUT: %.8 = load i16, ptr %.4.temp, align 2, !dbg !206 +// CHECK:STDOUT: %OrderedWith.WithSelf.NotEqual.call = icmp ne i16 %self, %.8, !dbg !206 +// CHECK:STDOUT: call void @"_CSelfDestruct.4f81cc432cb50e07:core.Destroy.Core"(ptr %.4.temp), !dbg !206 +// CHECK:STDOUT: ret i1 %OrderedWith.WithSelf.NotEqual.call, !dbg !206 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i1 @_CCallCompareGeneric2.Main(i32 %a, ptr %b) #0 !dbg !196 { +// CHECK:STDOUT: define i1 @_CCallCompareGeneric2.Main(i32 %a, ptr %b) #0 !dbg !208 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %CompareGeneric.call = call i1 @_CCompareGeneric.Main.4512c7023c79a313(i32 %a, ptr %b), !dbg !205 -// CHECK:STDOUT: ret i1 %CompareGeneric.call, !dbg !206 +// CHECK:STDOUT: %CompareGeneric.call = call i1 @_CCompareGeneric.Main.4512c7023c79a313(i32 %a, ptr %b), !dbg !217 +// CHECK:STDOUT: ret i1 %CompareGeneric.call, !dbg !218 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr i1 @"_CEqual:thunk:EqWith.e8fe48de943d9652.Core:OrderedWith.Core"(i32 %self, ptr %other) #2 !dbg !208 { +// CHECK:STDOUT: define weak_odr i1 @"_CEqual:thunk:EqWith.e8fe48de943d9652.Core:OrderedWith.Core"(i32 %self, ptr %other) #2 !dbg !220 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %__carbon_thunk.call = call i32 @_ZNK13ConvertToEnumcv2E2Ev.carbon_thunk._(ptr %other), !dbg !211 -// CHECK:STDOUT: %OrderedWith.WithSelf.Equal.call = icmp eq i32 %self, %__carbon_thunk.call, !dbg !211 -// CHECK:STDOUT: ret i1 %OrderedWith.WithSelf.Equal.call, !dbg !211 +// CHECK:STDOUT: %__carbon_thunk.call = call i32 @_ZNK13ConvertToEnumcv2E2Ev.carbon_thunk._(ptr %other), !dbg !223 +// CHECK:STDOUT: %OrderedWith.WithSelf.Equal.call = icmp eq i32 %self, %__carbon_thunk.call, !dbg !223 +// CHECK:STDOUT: ret i1 %OrderedWith.WithSelf.Equal.call, !dbg !223 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr i1 @"_CNotEqual:thunk:EqWith.e8fe48de943d9652.Core:OrderedWith.Core"(i32 %self, ptr %other) #2 !dbg !213 { +// CHECK:STDOUT: define weak_odr i1 @"_CNotEqual:thunk:EqWith.e8fe48de943d9652.Core:OrderedWith.Core"(i32 %self, ptr %other) #2 !dbg !225 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %__carbon_thunk.call = call i32 @_ZNK13ConvertToEnumcv2E2Ev.carbon_thunk._(ptr %other), !dbg !216 -// CHECK:STDOUT: %OrderedWith.WithSelf.NotEqual.call = icmp ne i32 %self, %__carbon_thunk.call, !dbg !216 -// CHECK:STDOUT: ret i1 %OrderedWith.WithSelf.NotEqual.call, !dbg !216 +// CHECK:STDOUT: %__carbon_thunk.call = call i32 @_ZNK13ConvertToEnumcv2E2Ev.carbon_thunk._(ptr %other), !dbg !228 +// CHECK:STDOUT: %OrderedWith.WithSelf.NotEqual.call = icmp ne i32 %self, %__carbon_thunk.call, !dbg !228 +// CHECK:STDOUT: ret i1 %OrderedWith.WithSelf.NotEqual.call, !dbg !228 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i1 @_CCallCompareGeneric3.Main(i16 %a, ptr %b) #0 !dbg !218 { +// CHECK:STDOUT: define i1 @_CCallCompareGeneric3.Main(i16 %a, ptr %b) #0 !dbg !230 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %CompareGeneric.call = call i1 @_CCompareGeneric.Main.070a42571d1942e2(i16 %a, ptr %b), !dbg !227 -// CHECK:STDOUT: ret i1 %CompareGeneric.call, !dbg !228 +// CHECK:STDOUT: %CompareGeneric.call = call i1 @_CCompareGeneric.Main.070a42571d1942e2(i16 %a, ptr %b), !dbg !239 +// CHECK:STDOUT: ret i1 %CompareGeneric.call, !dbg !240 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr i1 @"_CEqual:thunk:EqWith.a294139a6615e163.Core:OrderedWith.Core"(i16 %self, ptr %other) #2 !dbg !230 { +// CHECK:STDOUT: define weak_odr i1 @"_CEqual:thunk:EqWith.a294139a6615e163.Core:OrderedWith.Core"(i16 %self, ptr %other) #2 !dbg !242 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.4.temp = alloca i16, align 2, !dbg !233 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.4.temp), !dbg !233 -// CHECK:STDOUT: call void @_ZNK14ConvertToEnum2cvN1C1EEEv.carbon_thunk._(ptr %other, ptr %.4.temp), !dbg !233 -// CHECK:STDOUT: %.8 = load i16, ptr %.4.temp, align 2, !dbg !233 -// CHECK:STDOUT: %OrderedWith.WithSelf.Equal.call = icmp eq i16 %self, %.8, !dbg !233 -// CHECK:STDOUT: ret i1 %OrderedWith.WithSelf.Equal.call, !dbg !233 +// CHECK:STDOUT: %.4.temp = alloca i16, align 2, !dbg !245 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.4.temp), !dbg !245 +// CHECK:STDOUT: call void @_ZNK14ConvertToEnum2cvN1C1EEEv.carbon_thunk._(ptr %other, ptr %.4.temp), !dbg !245 +// CHECK:STDOUT: %.8 = load i16, ptr %.4.temp, align 2, !dbg !245 +// CHECK:STDOUT: %OrderedWith.WithSelf.Equal.call = icmp eq i16 %self, %.8, !dbg !245 +// CHECK:STDOUT: call void @"_CSelfDestruct.4f81cc432cb50e07:core.Destroy.Core"(ptr %.4.temp), !dbg !245 +// CHECK:STDOUT: ret i1 %OrderedWith.WithSelf.Equal.call, !dbg !245 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr i1 @"_CNotEqual:thunk:EqWith.a294139a6615e163.Core:OrderedWith.Core"(i16 %self, ptr %other) #2 !dbg !235 { +// CHECK:STDOUT: define weak_odr i1 @"_CNotEqual:thunk:EqWith.a294139a6615e163.Core:OrderedWith.Core"(i16 %self, ptr %other) #2 !dbg !247 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.4.temp = alloca i16, align 2, !dbg !238 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.4.temp), !dbg !238 -// CHECK:STDOUT: call void @_ZNK14ConvertToEnum2cvN1C1EEEv.carbon_thunk._(ptr %other, ptr %.4.temp), !dbg !238 -// CHECK:STDOUT: %.8 = load i16, ptr %.4.temp, align 2, !dbg !238 -// CHECK:STDOUT: %OrderedWith.WithSelf.NotEqual.call = icmp ne i16 %self, %.8, !dbg !238 -// CHECK:STDOUT: ret i1 %OrderedWith.WithSelf.NotEqual.call, !dbg !238 +// CHECK:STDOUT: %.4.temp = alloca i16, align 2, !dbg !250 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.4.temp), !dbg !250 +// CHECK:STDOUT: call void @_ZNK14ConvertToEnum2cvN1C1EEEv.carbon_thunk._(ptr %other, ptr %.4.temp), !dbg !250 +// CHECK:STDOUT: %.8 = load i16, ptr %.4.temp, align 2, !dbg !250 +// CHECK:STDOUT: %OrderedWith.WithSelf.NotEqual.call = icmp ne i16 %self, %.8, !dbg !250 +// CHECK:STDOUT: call void @"_CSelfDestruct.4f81cc432cb50e07:core.Destroy.Core"(ptr %.4.temp), !dbg !250 +// CHECK:STDOUT: ret i1 %OrderedWith.WithSelf.NotEqual.call, !dbg !250 // 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)) #3 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @_CCompareGeneric.Main.356c7bb457b5b49b(i16 %x, ptr %y) #0 !dbg !240 { +// CHECK:STDOUT: define linkonce_odr i1 @_CCompareGeneric.Main.356c7bb457b5b49b(i16 %x, ptr %y) #0 !dbg !252 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %EqWith.WithSelf.Equal.call = call i1 @"_CEqual:thunk:EqWith.83b9626e83cf3dcc.Core:OrderedWith.Core"(i16 %x, ptr %y), !dbg !247 -// CHECK:STDOUT: ret i1 %EqWith.WithSelf.Equal.call, !dbg !249 +// CHECK:STDOUT: %EqWith.WithSelf.Equal.call = call i1 @"_CEqual:thunk:EqWith.83b9626e83cf3dcc.Core:OrderedWith.Core"(i16 %x, ptr %y), !dbg !259 +// CHECK:STDOUT: ret i1 %EqWith.WithSelf.Equal.call, !dbg !261 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @_CCompareGeneric.Main.4512c7023c79a313(i32 %x, ptr %y) #0 !dbg !251 { +// CHECK:STDOUT: define linkonce_odr i1 @_CCompareGeneric.Main.4512c7023c79a313(i32 %x, ptr %y) #0 !dbg !263 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %EqWith.WithSelf.Equal.call = call i1 @"_CEqual:thunk:EqWith.e8fe48de943d9652.Core:OrderedWith.Core"(i32 %x, ptr %y), !dbg !258 -// CHECK:STDOUT: ret i1 %EqWith.WithSelf.Equal.call, !dbg !260 +// CHECK:STDOUT: %EqWith.WithSelf.Equal.call = call i1 @"_CEqual:thunk:EqWith.e8fe48de943d9652.Core:OrderedWith.Core"(i32 %x, ptr %y), !dbg !270 +// CHECK:STDOUT: ret i1 %EqWith.WithSelf.Equal.call, !dbg !272 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @_CCompareGeneric.Main.070a42571d1942e2(i16 %x, ptr %y) #0 !dbg !262 { +// CHECK:STDOUT: define linkonce_odr i1 @_CCompareGeneric.Main.070a42571d1942e2(i16 %x, ptr %y) #0 !dbg !274 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %EqWith.WithSelf.Equal.call = call i1 @"_CEqual:thunk:EqWith.a294139a6615e163.Core:OrderedWith.Core"(i16 %x, ptr %y), !dbg !269 -// CHECK:STDOUT: ret i1 %EqWith.WithSelf.Equal.call, !dbg !271 +// CHECK:STDOUT: %EqWith.WithSelf.Equal.call = call i1 @"_CEqual:thunk:EqWith.a294139a6615e163.Core:OrderedWith.Core"(i16 %x, ptr %y), !dbg !281 +// CHECK:STDOUT: ret i1 %EqWith.WithSelf.Equal.call, !dbg !283 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare noundef signext i16 @_ZNK13ConvertToEnumcvN1C1EEEv(ptr noundef nonnull align 1 dereferenceable(1)) #4 @@ -691,123 +735,129 @@ fn CallCompareGeneric3(a: Cpp.C.E, b: Cpp.ConvertToEnum2) -> bool { // CHECK:STDOUT: attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!132} -// CHECK:STDOUT: !llvm.module.flags = !{!34, !35, !36, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!39} +// CHECK:STDOUT: !llvm.dbg.cu = !{!140} +// CHECK:STDOUT: !llvm.module.flags = !{!40, !41, !42, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!45} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !6 = !DIBasicType(name: "int", size: 16, encoding: DW_ATE_signed) // CHECK:STDOUT: !9 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !28 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !29 = !{!"omnipotent char", !28, i64 0} -// CHECK:STDOUT: !30 = !{!"any pointer", !29, i64 0} -// CHECK:STDOUT: !31 = !{!30, !30, i64 0} -// CHECK:STDOUT: !32 = !{!"_ZTSN1C1EE", !29, i64 0} -// CHECK:STDOUT: !33 = !{!32, !32, i64 0} -// CHECK:STDOUT: !34 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !35 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !36 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !37 = !{!"int", !29, i64 0} -// CHECK:STDOUT: !38 = !{!"__libc_errno", !37, i64 0} -// CHECK:STDOUT: !39 = !{!38, !37, i64 0} -// CHECK:STDOUT: !63 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_unsigned) -// CHECK:STDOUT: !131 = !DIFile(filename: "compare_class.carbon", directory: "") -// CHECK:STDOUT: !132 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !131, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !133 = !{!9, !6, !9} -// CHECK:STDOUT: !134 = !DISubroutineType(types: !133) -// CHECK:STDOUT: !137 = !{!9, !63, !9} -// CHECK:STDOUT: !138 = !DISubroutineType(types: !137) -// CHECK:STDOUT: !141 = distinct !DISubprogram(name: "Compare", linkageName: "_CCompare.Main", scope: null, file: !131, line: 17, type: !134, spFlags: DISPFlagDefinition, unit: !132, retainedNodes: !151) -// CHECK:STDOUT: !142 = !DILocalVariable(arg: 1, scope: !141, type: !6) -// CHECK:STDOUT: !143 = !DILocalVariable(arg: 2, scope: !141, type: !9) -// CHECK:STDOUT: !148 = !DILocation(line: 18, column: 10, scope: !141) -// CHECK:STDOUT: !149 = !DILocation(line: 18, column: 15, scope: !141) -// CHECK:STDOUT: !150 = !DILocation(line: 18, column: 3, scope: !141) -// CHECK:STDOUT: !151 = !{!142, !143} -// CHECK:STDOUT: !152 = distinct !DISubprogram(name: "Compare2", linkageName: "_CCompare2.Main", scope: null, file: !131, line: 21, type: !138, spFlags: DISPFlagDefinition, unit: !132, retainedNodes: !162) -// CHECK:STDOUT: !153 = !DILocalVariable(arg: 1, scope: !152, type: !63) -// CHECK:STDOUT: !154 = !DILocalVariable(arg: 2, scope: !152, type: !9) -// CHECK:STDOUT: !159 = !DILocation(line: 22, column: 10, scope: !152) -// CHECK:STDOUT: !160 = !DILocation(line: 22, column: 15, scope: !152) -// CHECK:STDOUT: !161 = !DILocation(line: 22, column: 3, scope: !152) -// CHECK:STDOUT: !162 = !{!153, !154} -// CHECK:STDOUT: !163 = distinct !DISubprogram(name: "Compare3", linkageName: "_CCompare3.Main", scope: null, file: !131, line: 25, type: !134, spFlags: DISPFlagDefinition, unit: !132, retainedNodes: !173) -// CHECK:STDOUT: !164 = !DILocalVariable(arg: 1, scope: !163, type: !6) -// CHECK:STDOUT: !165 = !DILocalVariable(arg: 2, scope: !163, type: !9) -// CHECK:STDOUT: !170 = !DILocation(line: 26, column: 10, scope: !163) -// CHECK:STDOUT: !171 = !DILocation(line: 26, column: 15, scope: !163) -// CHECK:STDOUT: !172 = !DILocation(line: 26, column: 3, scope: !163) -// CHECK:STDOUT: !173 = !{!164, !165} -// CHECK:STDOUT: !174 = distinct !DISubprogram(name: "CallCompareGeneric", linkageName: "_CCallCompareGeneric.Main", scope: null, file: !131, line: 35, type: !134, spFlags: DISPFlagDefinition, unit: !132, retainedNodes: !185) -// CHECK:STDOUT: !175 = !DILocalVariable(arg: 1, scope: !174, type: !6) -// CHECK:STDOUT: !176 = !DILocalVariable(arg: 2, scope: !174, type: !9) -// CHECK:STDOUT: !183 = !DILocation(line: 36, column: 10, scope: !174) -// CHECK:STDOUT: !184 = !DILocation(line: 36, column: 3, scope: !174) -// CHECK:STDOUT: !185 = !{!175, !176} -// CHECK:STDOUT: !186 = distinct !DISubprogram(name: "Equal", linkageName: "_CEqual:thunk:EqWith.83b9626e83cf3dcc.Core:OrderedWith.Core", scope: null, file: !131, type: !134, spFlags: DISPFlagDefinition, unit: !132, retainedNodes: !190) +// CHECK:STDOUT: !12 = !{null, !6} +// CHECK:STDOUT: !13 = !DISubroutineType(types: !12) +// CHECK:STDOUT: !34 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !35 = !{!"omnipotent char", !34, i64 0} +// CHECK:STDOUT: !36 = !{!"any pointer", !35, i64 0} +// CHECK:STDOUT: !37 = !{!36, !36, i64 0} +// CHECK:STDOUT: !38 = !{!"_ZTSN1C1EE", !35, i64 0} +// CHECK:STDOUT: !39 = !{!38, !38, i64 0} +// CHECK:STDOUT: !40 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !41 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !42 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !43 = !{!"int", !35, i64 0} +// CHECK:STDOUT: !44 = !{!"__libc_errno", !43, i64 0} +// CHECK:STDOUT: !45 = !{!44, !43, i64 0} +// CHECK:STDOUT: !71 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_unsigned) +// CHECK:STDOUT: !139 = !DIFile(filename: "compare_class.carbon", directory: "") +// CHECK:STDOUT: !140 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !139, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !141 = !{!9, !6, !9} +// CHECK:STDOUT: !142 = !DISubroutineType(types: !141) +// CHECK:STDOUT: !145 = !{!9, !71, !9} +// CHECK:STDOUT: !146 = !DISubroutineType(types: !145) +// CHECK:STDOUT: !149 = distinct !DISubprogram(name: "Compare", linkageName: "_CCompare.Main", scope: null, file: !139, line: 17, type: !142, spFlags: DISPFlagDefinition, unit: !140, retainedNodes: !159) +// CHECK:STDOUT: !150 = !DILocalVariable(arg: 1, scope: !149, type: !6) +// CHECK:STDOUT: !151 = !DILocalVariable(arg: 2, scope: !149, type: !9) +// CHECK:STDOUT: !156 = !DILocation(line: 18, column: 10, scope: !149) +// CHECK:STDOUT: !157 = !DILocation(line: 18, column: 15, scope: !149) +// CHECK:STDOUT: !158 = !DILocation(line: 18, column: 3, scope: !149) +// CHECK:STDOUT: !159 = !{!150, !151} +// CHECK:STDOUT: !160 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.4f81cc432cb50e07:core.Destroy.Core", scope: null, file: !139, line: 18, type: !13, spFlags: DISPFlagDefinition, unit: !140, retainedNodes: !163) +// CHECK:STDOUT: !161 = !DILocalVariable(arg: 1, scope: !160, type: !6) +// CHECK:STDOUT: !162 = !DILocation(line: 18, column: 15, scope: !160) +// CHECK:STDOUT: !163 = !{!161} +// CHECK:STDOUT: !164 = distinct !DISubprogram(name: "Compare2", linkageName: "_CCompare2.Main", scope: null, file: !139, line: 21, type: !146, spFlags: DISPFlagDefinition, unit: !140, retainedNodes: !174) +// CHECK:STDOUT: !165 = !DILocalVariable(arg: 1, scope: !164, type: !71) +// CHECK:STDOUT: !166 = !DILocalVariable(arg: 2, scope: !164, type: !9) +// CHECK:STDOUT: !171 = !DILocation(line: 22, column: 10, scope: !164) +// CHECK:STDOUT: !172 = !DILocation(line: 22, column: 15, scope: !164) +// CHECK:STDOUT: !173 = !DILocation(line: 22, column: 3, scope: !164) +// CHECK:STDOUT: !174 = !{!165, !166} +// CHECK:STDOUT: !175 = distinct !DISubprogram(name: "Compare3", linkageName: "_CCompare3.Main", scope: null, file: !139, line: 25, type: !142, spFlags: DISPFlagDefinition, unit: !140, retainedNodes: !185) +// CHECK:STDOUT: !176 = !DILocalVariable(arg: 1, scope: !175, type: !6) +// CHECK:STDOUT: !177 = !DILocalVariable(arg: 2, scope: !175, type: !9) +// CHECK:STDOUT: !182 = !DILocation(line: 26, column: 10, scope: !175) +// CHECK:STDOUT: !183 = !DILocation(line: 26, column: 15, scope: !175) +// CHECK:STDOUT: !184 = !DILocation(line: 26, column: 3, scope: !175) +// CHECK:STDOUT: !185 = !{!176, !177} +// CHECK:STDOUT: !186 = distinct !DISubprogram(name: "CallCompareGeneric", linkageName: "_CCallCompareGeneric.Main", scope: null, file: !139, line: 35, type: !142, spFlags: DISPFlagDefinition, unit: !140, retainedNodes: !197) // CHECK:STDOUT: !187 = !DILocalVariable(arg: 1, scope: !186, type: !6) // CHECK:STDOUT: !188 = !DILocalVariable(arg: 2, scope: !186, type: !9) -// CHECK:STDOUT: !189 = !DILocation(line: 0, scope: !186) -// CHECK:STDOUT: !190 = !{!187, !188} -// CHECK:STDOUT: !191 = distinct !DISubprogram(name: "NotEqual", linkageName: "_CNotEqual:thunk:EqWith.83b9626e83cf3dcc.Core:OrderedWith.Core", scope: null, file: !131, type: !134, spFlags: DISPFlagDefinition, unit: !132, retainedNodes: !195) -// CHECK:STDOUT: !192 = !DILocalVariable(arg: 1, scope: !191, type: !6) -// CHECK:STDOUT: !193 = !DILocalVariable(arg: 2, scope: !191, type: !9) -// CHECK:STDOUT: !194 = !DILocation(line: 0, scope: !191) -// CHECK:STDOUT: !195 = !{!192, !193} -// CHECK:STDOUT: !196 = distinct !DISubprogram(name: "CallCompareGeneric2", linkageName: "_CCallCompareGeneric2.Main", scope: null, file: !131, line: 39, type: !138, spFlags: DISPFlagDefinition, unit: !132, retainedNodes: !207) -// CHECK:STDOUT: !197 = !DILocalVariable(arg: 1, scope: !196, type: !63) -// CHECK:STDOUT: !198 = !DILocalVariable(arg: 2, scope: !196, type: !9) -// CHECK:STDOUT: !205 = !DILocation(line: 40, column: 10, scope: !196) -// CHECK:STDOUT: !206 = !DILocation(line: 40, column: 3, scope: !196) -// CHECK:STDOUT: !207 = !{!197, !198} -// CHECK:STDOUT: !208 = distinct !DISubprogram(name: "Equal", linkageName: "_CEqual:thunk:EqWith.e8fe48de943d9652.Core:OrderedWith.Core", scope: null, file: !131, type: !138, spFlags: DISPFlagDefinition, unit: !132, retainedNodes: !212) -// CHECK:STDOUT: !209 = !DILocalVariable(arg: 1, scope: !208, type: !63) +// CHECK:STDOUT: !195 = !DILocation(line: 36, column: 10, scope: !186) +// CHECK:STDOUT: !196 = !DILocation(line: 36, column: 3, scope: !186) +// CHECK:STDOUT: !197 = !{!187, !188} +// CHECK:STDOUT: !198 = distinct !DISubprogram(name: "Equal", linkageName: "_CEqual:thunk:EqWith.83b9626e83cf3dcc.Core:OrderedWith.Core", scope: null, file: !139, type: !142, spFlags: DISPFlagDefinition, unit: !140, retainedNodes: !202) +// CHECK:STDOUT: !199 = !DILocalVariable(arg: 1, scope: !198, type: !6) +// CHECK:STDOUT: !200 = !DILocalVariable(arg: 2, scope: !198, type: !9) +// CHECK:STDOUT: !201 = !DILocation(line: 0, scope: !198) +// CHECK:STDOUT: !202 = !{!199, !200} +// CHECK:STDOUT: !203 = distinct !DISubprogram(name: "NotEqual", linkageName: "_CNotEqual:thunk:EqWith.83b9626e83cf3dcc.Core:OrderedWith.Core", scope: null, file: !139, type: !142, spFlags: DISPFlagDefinition, unit: !140, retainedNodes: !207) +// CHECK:STDOUT: !204 = !DILocalVariable(arg: 1, scope: !203, type: !6) +// CHECK:STDOUT: !205 = !DILocalVariable(arg: 2, scope: !203, type: !9) +// CHECK:STDOUT: !206 = !DILocation(line: 0, scope: !203) +// CHECK:STDOUT: !207 = !{!204, !205} +// CHECK:STDOUT: !208 = distinct !DISubprogram(name: "CallCompareGeneric2", linkageName: "_CCallCompareGeneric2.Main", scope: null, file: !139, line: 39, type: !146, spFlags: DISPFlagDefinition, unit: !140, retainedNodes: !219) +// CHECK:STDOUT: !209 = !DILocalVariable(arg: 1, scope: !208, type: !71) // CHECK:STDOUT: !210 = !DILocalVariable(arg: 2, scope: !208, type: !9) -// CHECK:STDOUT: !211 = !DILocation(line: 0, scope: !208) -// CHECK:STDOUT: !212 = !{!209, !210} -// CHECK:STDOUT: !213 = distinct !DISubprogram(name: "NotEqual", linkageName: "_CNotEqual:thunk:EqWith.e8fe48de943d9652.Core:OrderedWith.Core", scope: null, file: !131, type: !138, spFlags: DISPFlagDefinition, unit: !132, retainedNodes: !217) -// CHECK:STDOUT: !214 = !DILocalVariable(arg: 1, scope: !213, type: !63) -// CHECK:STDOUT: !215 = !DILocalVariable(arg: 2, scope: !213, type: !9) -// CHECK:STDOUT: !216 = !DILocation(line: 0, scope: !213) -// CHECK:STDOUT: !217 = !{!214, !215} -// CHECK:STDOUT: !218 = distinct !DISubprogram(name: "CallCompareGeneric3", linkageName: "_CCallCompareGeneric3.Main", scope: null, file: !131, line: 43, type: !134, spFlags: DISPFlagDefinition, unit: !132, retainedNodes: !229) -// CHECK:STDOUT: !219 = !DILocalVariable(arg: 1, scope: !218, type: !6) -// CHECK:STDOUT: !220 = !DILocalVariable(arg: 2, scope: !218, type: !9) -// CHECK:STDOUT: !227 = !DILocation(line: 44, column: 10, scope: !218) -// CHECK:STDOUT: !228 = !DILocation(line: 44, column: 3, scope: !218) -// CHECK:STDOUT: !229 = !{!219, !220} -// CHECK:STDOUT: !230 = distinct !DISubprogram(name: "Equal", linkageName: "_CEqual:thunk:EqWith.a294139a6615e163.Core:OrderedWith.Core", scope: null, file: !131, type: !134, spFlags: DISPFlagDefinition, unit: !132, retainedNodes: !234) +// CHECK:STDOUT: !217 = !DILocation(line: 40, column: 10, scope: !208) +// CHECK:STDOUT: !218 = !DILocation(line: 40, column: 3, scope: !208) +// CHECK:STDOUT: !219 = !{!209, !210} +// CHECK:STDOUT: !220 = distinct !DISubprogram(name: "Equal", linkageName: "_CEqual:thunk:EqWith.e8fe48de943d9652.Core:OrderedWith.Core", scope: null, file: !139, type: !146, spFlags: DISPFlagDefinition, unit: !140, retainedNodes: !224) +// CHECK:STDOUT: !221 = !DILocalVariable(arg: 1, scope: !220, type: !71) +// CHECK:STDOUT: !222 = !DILocalVariable(arg: 2, scope: !220, type: !9) +// CHECK:STDOUT: !223 = !DILocation(line: 0, scope: !220) +// CHECK:STDOUT: !224 = !{!221, !222} +// CHECK:STDOUT: !225 = distinct !DISubprogram(name: "NotEqual", linkageName: "_CNotEqual:thunk:EqWith.e8fe48de943d9652.Core:OrderedWith.Core", scope: null, file: !139, type: !146, spFlags: DISPFlagDefinition, unit: !140, retainedNodes: !229) +// CHECK:STDOUT: !226 = !DILocalVariable(arg: 1, scope: !225, type: !71) +// CHECK:STDOUT: !227 = !DILocalVariable(arg: 2, scope: !225, type: !9) +// CHECK:STDOUT: !228 = !DILocation(line: 0, scope: !225) +// CHECK:STDOUT: !229 = !{!226, !227} +// CHECK:STDOUT: !230 = distinct !DISubprogram(name: "CallCompareGeneric3", linkageName: "_CCallCompareGeneric3.Main", scope: null, file: !139, line: 43, type: !142, spFlags: DISPFlagDefinition, unit: !140, retainedNodes: !241) // CHECK:STDOUT: !231 = !DILocalVariable(arg: 1, scope: !230, type: !6) // CHECK:STDOUT: !232 = !DILocalVariable(arg: 2, scope: !230, type: !9) -// CHECK:STDOUT: !233 = !DILocation(line: 0, scope: !230) -// CHECK:STDOUT: !234 = !{!231, !232} -// CHECK:STDOUT: !235 = distinct !DISubprogram(name: "NotEqual", linkageName: "_CNotEqual:thunk:EqWith.a294139a6615e163.Core:OrderedWith.Core", scope: null, file: !131, type: !134, spFlags: DISPFlagDefinition, unit: !132, retainedNodes: !239) -// CHECK:STDOUT: !236 = !DILocalVariable(arg: 1, scope: !235, type: !6) -// CHECK:STDOUT: !237 = !DILocalVariable(arg: 2, scope: !235, type: !9) -// CHECK:STDOUT: !238 = !DILocation(line: 0, scope: !235) -// CHECK:STDOUT: !239 = !{!236, !237} -// CHECK:STDOUT: !240 = distinct !DISubprogram(name: "CompareGeneric", linkageName: "_CCompareGeneric.Main.356c7bb457b5b49b", scope: null, file: !131, line: 29, type: !134, spFlags: DISPFlagDefinition, unit: !132, retainedNodes: !250) -// CHECK:STDOUT: !241 = !DILocalVariable(arg: 1, scope: !240, type: !6) -// CHECK:STDOUT: !242 = !DILocalVariable(arg: 2, scope: !240, type: !9) -// CHECK:STDOUT: !247 = !DILocation(line: 30, column: 10, scope: !240) -// CHECK:STDOUT: !249 = !DILocation(line: 30, column: 3, scope: !240) -// CHECK:STDOUT: !250 = !{!241, !242} -// CHECK:STDOUT: !251 = distinct !DISubprogram(name: "CompareGeneric", linkageName: "_CCompareGeneric.Main.4512c7023c79a313", scope: null, file: !131, line: 29, type: !138, spFlags: DISPFlagDefinition, unit: !132, retainedNodes: !261) -// CHECK:STDOUT: !252 = !DILocalVariable(arg: 1, scope: !251, type: !63) -// CHECK:STDOUT: !253 = !DILocalVariable(arg: 2, scope: !251, type: !9) -// CHECK:STDOUT: !258 = !DILocation(line: 30, column: 10, scope: !251) -// CHECK:STDOUT: !260 = !DILocation(line: 30, column: 3, scope: !251) -// CHECK:STDOUT: !261 = !{!252, !253} -// CHECK:STDOUT: !262 = distinct !DISubprogram(name: "CompareGeneric", linkageName: "_CCompareGeneric.Main.070a42571d1942e2", scope: null, file: !131, line: 29, type: !134, spFlags: DISPFlagDefinition, unit: !132, retainedNodes: !272) -// CHECK:STDOUT: !263 = !DILocalVariable(arg: 1, scope: !262, type: !6) -// CHECK:STDOUT: !264 = !DILocalVariable(arg: 2, scope: !262, type: !9) -// CHECK:STDOUT: !269 = !DILocation(line: 30, column: 10, scope: !262) -// CHECK:STDOUT: !271 = !DILocation(line: 30, column: 3, scope: !262) -// CHECK:STDOUT: !272 = !{!263, !264} -// CHECK:STDOUT: !273 = !{!"p1 _ZTS13ConvertToEnum", !30, i64 0} -// CHECK:STDOUT: !274 = !{!273, !273, i64 0} -// CHECK:STDOUT: !276 = !{} -// CHECK:STDOUT: !277 = !{!"p1 _ZTS14ConvertToEnum2", !30, i64 0} -// CHECK:STDOUT: !278 = !{!277, !277, i64 0} +// CHECK:STDOUT: !239 = !DILocation(line: 44, column: 10, scope: !230) +// CHECK:STDOUT: !240 = !DILocation(line: 44, column: 3, scope: !230) +// CHECK:STDOUT: !241 = !{!231, !232} +// CHECK:STDOUT: !242 = distinct !DISubprogram(name: "Equal", linkageName: "_CEqual:thunk:EqWith.a294139a6615e163.Core:OrderedWith.Core", scope: null, file: !139, type: !142, spFlags: DISPFlagDefinition, unit: !140, retainedNodes: !246) +// CHECK:STDOUT: !243 = !DILocalVariable(arg: 1, scope: !242, type: !6) +// CHECK:STDOUT: !244 = !DILocalVariable(arg: 2, scope: !242, type: !9) +// CHECK:STDOUT: !245 = !DILocation(line: 0, scope: !242) +// CHECK:STDOUT: !246 = !{!243, !244} +// CHECK:STDOUT: !247 = distinct !DISubprogram(name: "NotEqual", linkageName: "_CNotEqual:thunk:EqWith.a294139a6615e163.Core:OrderedWith.Core", scope: null, file: !139, type: !142, spFlags: DISPFlagDefinition, unit: !140, retainedNodes: !251) +// CHECK:STDOUT: !248 = !DILocalVariable(arg: 1, scope: !247, type: !6) +// CHECK:STDOUT: !249 = !DILocalVariable(arg: 2, scope: !247, type: !9) +// CHECK:STDOUT: !250 = !DILocation(line: 0, scope: !247) +// CHECK:STDOUT: !251 = !{!248, !249} +// CHECK:STDOUT: !252 = distinct !DISubprogram(name: "CompareGeneric", linkageName: "_CCompareGeneric.Main.356c7bb457b5b49b", scope: null, file: !139, line: 29, type: !142, spFlags: DISPFlagDefinition, unit: !140, retainedNodes: !262) +// CHECK:STDOUT: !253 = !DILocalVariable(arg: 1, scope: !252, type: !6) +// CHECK:STDOUT: !254 = !DILocalVariable(arg: 2, scope: !252, type: !9) +// CHECK:STDOUT: !259 = !DILocation(line: 30, column: 10, scope: !252) +// CHECK:STDOUT: !261 = !DILocation(line: 30, column: 3, scope: !252) +// CHECK:STDOUT: !262 = !{!253, !254} +// CHECK:STDOUT: !263 = distinct !DISubprogram(name: "CompareGeneric", linkageName: "_CCompareGeneric.Main.4512c7023c79a313", scope: null, file: !139, line: 29, type: !146, spFlags: DISPFlagDefinition, unit: !140, retainedNodes: !273) +// CHECK:STDOUT: !264 = !DILocalVariable(arg: 1, scope: !263, type: !71) +// CHECK:STDOUT: !265 = !DILocalVariable(arg: 2, scope: !263, type: !9) +// CHECK:STDOUT: !270 = !DILocation(line: 30, column: 10, scope: !263) +// CHECK:STDOUT: !272 = !DILocation(line: 30, column: 3, scope: !263) +// CHECK:STDOUT: !273 = !{!264, !265} +// CHECK:STDOUT: !274 = distinct !DISubprogram(name: "CompareGeneric", linkageName: "_CCompareGeneric.Main.070a42571d1942e2", scope: null, file: !139, line: 29, type: !142, spFlags: DISPFlagDefinition, unit: !140, retainedNodes: !284) +// CHECK:STDOUT: !275 = !DILocalVariable(arg: 1, scope: !274, type: !6) +// CHECK:STDOUT: !276 = !DILocalVariable(arg: 2, scope: !274, type: !9) +// CHECK:STDOUT: !281 = !DILocation(line: 30, column: 10, scope: !274) +// CHECK:STDOUT: !283 = !DILocation(line: 30, column: 3, scope: !274) +// CHECK:STDOUT: !284 = !{!275, !276} +// CHECK:STDOUT: !285 = !{!"p1 _ZTS13ConvertToEnum", !36, i64 0} +// CHECK:STDOUT: !286 = !{!285, !285, i64 0} +// CHECK:STDOUT: !288 = !{} +// CHECK:STDOUT: !289 = !{!"p1 _ZTS14ConvertToEnum2", !36, i64 0} +// CHECK:STDOUT: !290 = !{!289, !289, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/function/export/constructor.carbon b/toolchain/lower/testdata/interop/cpp/function/export/constructor.carbon index d99c77746d24..0f3bb29fa820 100644 --- a/toolchain/lower/testdata/interop/cpp/function/export/constructor.carbon +++ b/toolchain/lower/testdata/interop/cpp/function/export/constructor.carbon @@ -54,8 +54,8 @@ void f() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 // CHECK:STDOUT: %.addr = alloca i32, align 4 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !32 -// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !34 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !40 +// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !42 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: call void @_COneArg__carbon_thunk.OneArg.Main(ptr noundef nonnull align 1 %this1, ptr noundef nonnull align 4 dereferenceable(4) %.addr) // CHECK:STDOUT: ret void @@ -65,7 +65,7 @@ void f() { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN6Carbon6OneArgD2Ev(ptr noundef nonnull align 1 %this) unnamed_addr #3 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !32 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !40 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: call void @"_C__destroy_thunk:thunk.OneArg.Main"(ptr noundef nonnull align 1 %this1) // CHECK:STDOUT: ret void @@ -79,22 +79,35 @@ void f() { // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind // CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.OneArg.Main"(ptr %self) #4 !dbg !15 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @"_COp.7040ef4e2429d520:core.Destroy.Core"(ptr %self), !dbg !17 +// CHECK:STDOUT: call void @"_CSelfDestruct.7040ef4e2429d520:core.Destroy.Core"(ptr %self), !dbg !17 // CHECK:STDOUT: ret void, !dbg !17 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.7040ef4e2429d520:core.Destroy.Core"(ptr %self) #5 !dbg !19 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %self) #5 !dbg !19 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !21 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_COneArg__carbon_thunk.OneArg.Main(ptr %_, ptr %_1) #5 !dbg !23 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.7040ef4e2429d520:core.Destroy.Core"(ptr %self) #5 !dbg !23 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc6_28.2 = load i32, ptr %_1, align 4, !dbg !26 -// CHECK:STDOUT: call void @_COneArg.OneArg.Main(ptr %_, i32 %.loc6_28.2), !dbg !26 -// CHECK:STDOUT: ret void, !dbg !26 +// CHECK:STDOUT: ret void, !dbg !25 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.7040ef4e2429d520:core.Destroy.Core"(ptr %self) #5 !dbg !27 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.7040ef4e2429d520:core.Destroy.Core"(ptr %self), !dbg !29 +// CHECK:STDOUT: ret void, !dbg !29 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_COneArg__carbon_thunk.OneArg.Main(ptr %_, ptr %_1) #5 !dbg !31 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %.loc6_28.2 = load i32, ptr %_1, align 4, !dbg !34 +// CHECK:STDOUT: call void @_COneArg.OneArg.Main(ptr %_, i32 %.loc6_28.2), !dbg !34 +// CHECK:STDOUT: ret void, !dbg !34 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } @@ -105,8 +118,8 @@ void f() { // CHECK:STDOUT: attributes #5 = { nounwind } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!6} -// CHECK:STDOUT: !llvm.module.flags = !{!35, !36, !37, !3, !4} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!39} +// CHECK:STDOUT: !llvm.module.flags = !{!43, !44, !45, !3, !4} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!47} // CHECK:STDOUT: // CHECK:STDOUT: !3 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !4 = !{i32 2, !"Debug Info Version", i32 3} @@ -122,25 +135,33 @@ void f() { // CHECK:STDOUT: !16 = !DILocalVariable(arg: 1, scope: !15, type: !8) // CHECK:STDOUT: !17 = !DILocation(line: 5, column: 1, scope: !15) // CHECK:STDOUT: !18 = !{!16} -// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7040ef4e2429d520:core.Destroy.Core", scope: null, file: !5, line: 5, type: !12, spFlags: DISPFlagDefinition, unit: !6, retainedNodes: !22) +// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !5, line: 5, type: !12, spFlags: DISPFlagDefinition, unit: !6, retainedNodes: !22) // CHECK:STDOUT: !20 = !DILocalVariable(arg: 1, scope: !19, type: !8) // CHECK:STDOUT: !21 = !DILocation(line: 5, column: 1, scope: !19) // CHECK:STDOUT: !22 = !{!20} -// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "OneArg__carbon_thunk", linkageName: "_COneArg__carbon_thunk.OneArg.Main", scope: null, file: !5, line: 6, type: !14, spFlags: DISPFlagDefinition, unit: !6, retainedNodes: !27) +// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.7040ef4e2429d520:core.Destroy.Core", scope: null, file: !5, line: 5, type: !12, spFlags: DISPFlagDefinition, unit: !6, retainedNodes: !26) // CHECK:STDOUT: !24 = !DILocalVariable(arg: 1, scope: !23, type: !8) -// CHECK:STDOUT: !25 = !DILocalVariable(arg: 2, scope: !23, type: !7) -// CHECK:STDOUT: !26 = !DILocation(line: 6, column: 3, scope: !23) -// CHECK:STDOUT: !27 = !{!24, !25} -// CHECK:STDOUT: !28 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !29 = !{!"omnipotent char", !28, i64 0} -// CHECK:STDOUT: !30 = !{!"any pointer", !29, i64 0} -// CHECK:STDOUT: !31 = !{!"p1 _ZTSN6Carbon6OneArgE", !30, i64 0} -// CHECK:STDOUT: !32 = !{!31, !31, i64 0} -// CHECK:STDOUT: !33 = !{!"int", !29, i64 0} -// CHECK:STDOUT: !34 = !{!33, !33, i64 0} -// CHECK:STDOUT: !35 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !36 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !37 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !38 = !{!"__libc_errno", !33, i64 0} -// CHECK:STDOUT: !39 = !{!38, !33, i64 0} +// CHECK:STDOUT: !25 = !DILocation(line: 5, column: 1, scope: !23) +// CHECK:STDOUT: !26 = !{!24} +// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.7040ef4e2429d520:core.Destroy.Core", scope: null, file: !5, line: 5, type: !12, spFlags: DISPFlagDefinition, unit: !6, retainedNodes: !30) +// CHECK:STDOUT: !28 = !DILocalVariable(arg: 1, scope: !27, type: !8) +// CHECK:STDOUT: !29 = !DILocation(line: 5, column: 1, scope: !27) +// CHECK:STDOUT: !30 = !{!28} +// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "OneArg__carbon_thunk", linkageName: "_COneArg__carbon_thunk.OneArg.Main", scope: null, file: !5, line: 6, type: !14, spFlags: DISPFlagDefinition, unit: !6, retainedNodes: !35) +// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !31, type: !8) +// CHECK:STDOUT: !33 = !DILocalVariable(arg: 2, scope: !31, type: !7) +// CHECK:STDOUT: !34 = !DILocation(line: 6, column: 3, scope: !31) +// CHECK:STDOUT: !35 = !{!32, !33} +// CHECK:STDOUT: !36 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !37 = !{!"omnipotent char", !36, i64 0} +// CHECK:STDOUT: !38 = !{!"any pointer", !37, i64 0} +// CHECK:STDOUT: !39 = !{!"p1 _ZTSN6Carbon6OneArgE", !38, i64 0} +// CHECK:STDOUT: !40 = !{!39, !39, i64 0} +// CHECK:STDOUT: !41 = !{!"int", !37, i64 0} +// CHECK:STDOUT: !42 = !{!41, !41, i64 0} +// CHECK:STDOUT: !43 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !44 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !45 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !46 = !{!"__libc_errno", !41, i64 0} +// CHECK:STDOUT: !47 = !{!46, !41, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/function/export/generic.carbon b/toolchain/lower/testdata/interop/cpp/function/export/generic.carbon index 0e56fb03e83c..3449c4649f2b 100644 --- a/toolchain/lower/testdata/interop/cpp/function/export/generic.carbon +++ b/toolchain/lower/testdata/interop/cpp/function/export/generic.carbon @@ -142,7 +142,7 @@ fn Run() { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN6Carbon1AD2Ev(ptr noundef nonnull align 1 %this) unnamed_addr #3 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !71 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !83 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: call void @"_C__destroy_thunk:thunk.A.Main"(ptr noundef nonnull align 1 %this1) // CHECK:STDOUT: ret void @@ -160,7 +160,7 @@ fn Run() { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN6Carbon1BD2Ev(ptr noundef nonnull align 1 %this) unnamed_addr #3 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !73 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !85 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: call void @"_C__destroy_thunk:thunk.B.Main"(ptr noundef nonnull align 1 %this1) // CHECK:STDOUT: ret void @@ -184,62 +184,82 @@ fn Run() { // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind // CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.A.Main"(ptr %self) #5 !dbg !28 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @"_COp.5a23cc09585c55d2:core.Destroy.Core"(ptr %self), !dbg !30 +// CHECK:STDOUT: call void @"_CSelfDestruct.5a23cc09585c55d2:core.Destroy.Core"(ptr %self), !dbg !30 // CHECK:STDOUT: ret void, !dbg !30 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.5a23cc09585c55d2:core.Destroy.Core"(ptr %self) #4 !dbg !32 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %self) #4 !dbg !32 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !34 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.B.Main"(ptr %self) #5 !dbg !36 { +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.5a23cc09585c55d2:core.Destroy.Core"(ptr %self) #4 !dbg !36 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @"_COp.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %self), !dbg !38 // CHECK:STDOUT: ret void, !dbg !38 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %self) #4 !dbg !40 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.5a23cc09585c55d2:core.Destroy.Core"(ptr %self) #4 !dbg !40 { // CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.5a23cc09585c55d2:core.Destroy.Core"(ptr %self), !dbg !42 // CHECK:STDOUT: ret void, !dbg !42 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF__carbon_thunk.26f2099a79512a5d.Main(ptr %_) #4 !dbg !44 { +// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind +// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.B.Main"(ptr %self) #5 !dbg !44 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CF.Main.6662a1ffb773360a(ptr %_), !dbg !46 +// CHECK:STDOUT: call void @"_CSelfDestruct.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %self), !dbg !46 // CHECK:STDOUT: ret void, !dbg !46 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF__carbon_thunk.7a3b9f04ddf4269e.Main(ptr %_) #4 !dbg !48 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %self) #4 !dbg !48 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CF.Main.d53b17eed3ce903c(ptr %_), !dbg !50 // CHECK:STDOUT: ret void, !dbg !50 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @main() #4 !dbg !52 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %self) #4 !dbg !52 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z1Gv(), !dbg !53 -// CHECK:STDOUT: ret i32 0, !dbg !54 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %self), !dbg !54 +// CHECK:STDOUT: ret void, !dbg !54 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CF.Main.6662a1ffb773360a(ptr %t) #4 !dbg !55 { +// CHECK:STDOUT: define void @_CF__carbon_thunk.26f2099a79512a5d.Main(ptr %_) #4 !dbg !56 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @"_CDoit.A.Main:I.Main"(ptr %t), !dbg !58 -// CHECK:STDOUT: ret void, !dbg !59 +// CHECK:STDOUT: call void @_CF.Main.6662a1ffb773360a(ptr %_), !dbg !58 +// CHECK:STDOUT: ret void, !dbg !58 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CF.Main.d53b17eed3ce903c(ptr %t) #4 !dbg !61 { +// CHECK:STDOUT: define void @_CF__carbon_thunk.7a3b9f04ddf4269e.Main(ptr %_) #4 !dbg !60 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @"_CDoit.B.Main:I.Main"(ptr %t), !dbg !64 -// CHECK:STDOUT: ret void, !dbg !65 +// CHECK:STDOUT: call void @_CF.Main.d53b17eed3ce903c(ptr %_), !dbg !62 +// CHECK:STDOUT: ret void, !dbg !62 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define i32 @main() #4 !dbg !64 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @_Z1Gv(), !dbg !65 +// CHECK:STDOUT: ret i32 0, !dbg !66 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @_CF.Main.6662a1ffb773360a(ptr %t) #4 !dbg !67 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CDoit.A.Main:I.Main"(ptr %t), !dbg !70 +// CHECK:STDOUT: ret void, !dbg !71 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @_CF.Main.d53b17eed3ce903c(ptr %t) #4 !dbg !73 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CDoit.B.Main:I.Main"(ptr %t), !dbg !76 +// CHECK:STDOUT: ret void, !dbg !77 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -256,8 +276,8 @@ fn Run() { // CHECK:STDOUT: attributes #5 = { alwaysinline nounwind } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!9} -// CHECK:STDOUT: !llvm.module.flags = !{!74, !75, !76, !4, !5} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!79} +// CHECK:STDOUT: !llvm.module.flags = !{!86, !87, !88, !4, !5} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!91} // CHECK:STDOUT: // CHECK:STDOUT: !4 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !5 = !{i32 2, !"Debug Info Version", i32 3} @@ -281,50 +301,62 @@ fn Run() { // CHECK:STDOUT: !29 = !DILocalVariable(arg: 1, scope: !28, type: !10) // CHECK:STDOUT: !30 = !DILocation(line: 8, column: 1, scope: !28) // CHECK:STDOUT: !31 = !{!29} -// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5a23cc09585c55d2:core.Destroy.Core", scope: null, file: !8, line: 8, type: !12, spFlags: DISPFlagDefinition, unit: !9, retainedNodes: !35) +// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !8, line: 8, type: !12, spFlags: DISPFlagDefinition, unit: !9, retainedNodes: !35) // CHECK:STDOUT: !33 = !DILocalVariable(arg: 1, scope: !32, type: !10) // CHECK:STDOUT: !34 = !DILocation(line: 8, column: 1, scope: !32) // CHECK:STDOUT: !35 = !{!33} -// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.B.Main", scope: null, file: !8, line: 13, type: !12, spFlags: DISPFlagDefinition, unit: !9, retainedNodes: !39) +// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.5a23cc09585c55d2:core.Destroy.Core", scope: null, file: !8, line: 8, type: !12, spFlags: DISPFlagDefinition, unit: !9, retainedNodes: !39) // CHECK:STDOUT: !37 = !DILocalVariable(arg: 1, scope: !36, type: !10) -// CHECK:STDOUT: !38 = !DILocation(line: 13, column: 1, scope: !36) +// CHECK:STDOUT: !38 = !DILocation(line: 8, column: 1, scope: !36) // CHECK:STDOUT: !39 = !{!37} -// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "Op", linkageName: "_COp.8c4b83ecd900f1ea:core.Destroy.Core", scope: null, file: !8, line: 13, type: !12, spFlags: DISPFlagDefinition, unit: !9, retainedNodes: !43) +// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.5a23cc09585c55d2:core.Destroy.Core", scope: null, file: !8, line: 8, type: !12, spFlags: DISPFlagDefinition, unit: !9, retainedNodes: !43) // CHECK:STDOUT: !41 = !DILocalVariable(arg: 1, scope: !40, type: !10) -// CHECK:STDOUT: !42 = !DILocation(line: 13, column: 1, scope: !40) +// CHECK:STDOUT: !42 = !DILocation(line: 8, column: 1, scope: !40) // CHECK:STDOUT: !43 = !{!41} -// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "F__carbon_thunk.26f2099a79512a5d", linkageName: "_CF__carbon_thunk.26f2099a79512a5d.Main", scope: null, file: !8, line: 19, type: !12, spFlags: DISPFlagDefinition, unit: !9, retainedNodes: !47) +// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.B.Main", scope: null, file: !8, line: 13, type: !12, spFlags: DISPFlagDefinition, unit: !9, retainedNodes: !47) // CHECK:STDOUT: !45 = !DILocalVariable(arg: 1, scope: !44, type: !10) -// CHECK:STDOUT: !46 = !DILocation(line: 19, column: 1, scope: !44) +// CHECK:STDOUT: !46 = !DILocation(line: 13, column: 1, scope: !44) // CHECK:STDOUT: !47 = !{!45} -// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "F__carbon_thunk.7a3b9f04ddf4269e", linkageName: "_CF__carbon_thunk.7a3b9f04ddf4269e.Main", scope: null, file: !8, line: 19, type: !12, spFlags: DISPFlagDefinition, unit: !9, retainedNodes: !51) +// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.8c4b83ecd900f1ea:core.Destroy.Core", scope: null, file: !8, line: 13, type: !12, spFlags: DISPFlagDefinition, unit: !9, retainedNodes: !51) // CHECK:STDOUT: !49 = !DILocalVariable(arg: 1, scope: !48, type: !10) -// CHECK:STDOUT: !50 = !DILocation(line: 19, column: 1, scope: !48) +// CHECK:STDOUT: !50 = !DILocation(line: 13, column: 1, scope: !48) // CHECK:STDOUT: !51 = !{!49} -// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "Run", linkageName: "main", scope: null, file: !8, line: 32, type: !15, spFlags: DISPFlagDefinition, unit: !9) -// CHECK:STDOUT: !53 = !DILocation(line: 33, column: 3, scope: !52) -// CHECK:STDOUT: !54 = !DILocation(line: 32, column: 1, scope: !52) -// CHECK:STDOUT: !55 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.6662a1ffb773360a", scope: null, file: !8, line: 19, type: !12, spFlags: DISPFlagDefinition, unit: !9, retainedNodes: !60) -// CHECK:STDOUT: !56 = !DILocalVariable(arg: 1, scope: !55, type: !10) -// CHECK:STDOUT: !58 = !DILocation(line: 20, column: 3, scope: !55) -// CHECK:STDOUT: !59 = !DILocation(line: 19, column: 1, scope: !55) -// CHECK:STDOUT: !60 = !{!56} -// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.d53b17eed3ce903c", scope: null, file: !8, line: 19, type: !12, spFlags: DISPFlagDefinition, unit: !9, retainedNodes: !66) -// CHECK:STDOUT: !62 = !DILocalVariable(arg: 1, scope: !61, type: !10) -// CHECK:STDOUT: !64 = !DILocation(line: 20, column: 3, scope: !61) -// CHECK:STDOUT: !65 = !DILocation(line: 19, column: 1, scope: !61) -// CHECK:STDOUT: !66 = !{!62} -// CHECK:STDOUT: !67 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !68 = !{!"omnipotent char", !67, i64 0} -// CHECK:STDOUT: !69 = !{!"any pointer", !68, i64 0} -// CHECK:STDOUT: !70 = !{!"p1 _ZTSN6Carbon1AE", !69, i64 0} -// CHECK:STDOUT: !71 = !{!70, !70, i64 0} -// CHECK:STDOUT: !72 = !{!"p1 _ZTSN6Carbon1BE", !69, i64 0} -// CHECK:STDOUT: !73 = !{!72, !72, i64 0} -// CHECK:STDOUT: !74 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !75 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !76 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !77 = !{!"int", !68, i64 0} -// CHECK:STDOUT: !78 = !{!"__libc_errno", !77, i64 0} -// CHECK:STDOUT: !79 = !{!78, !77, i64 0} +// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.8c4b83ecd900f1ea:core.Destroy.Core", scope: null, file: !8, line: 13, type: !12, spFlags: DISPFlagDefinition, unit: !9, retainedNodes: !55) +// CHECK:STDOUT: !53 = !DILocalVariable(arg: 1, scope: !52, type: !10) +// CHECK:STDOUT: !54 = !DILocation(line: 13, column: 1, scope: !52) +// CHECK:STDOUT: !55 = !{!53} +// CHECK:STDOUT: !56 = distinct !DISubprogram(name: "F__carbon_thunk.26f2099a79512a5d", linkageName: "_CF__carbon_thunk.26f2099a79512a5d.Main", scope: null, file: !8, line: 19, type: !12, spFlags: DISPFlagDefinition, unit: !9, retainedNodes: !59) +// CHECK:STDOUT: !57 = !DILocalVariable(arg: 1, scope: !56, type: !10) +// CHECK:STDOUT: !58 = !DILocation(line: 19, column: 1, scope: !56) +// CHECK:STDOUT: !59 = !{!57} +// CHECK:STDOUT: !60 = distinct !DISubprogram(name: "F__carbon_thunk.7a3b9f04ddf4269e", linkageName: "_CF__carbon_thunk.7a3b9f04ddf4269e.Main", scope: null, file: !8, line: 19, type: !12, spFlags: DISPFlagDefinition, unit: !9, retainedNodes: !63) +// CHECK:STDOUT: !61 = !DILocalVariable(arg: 1, scope: !60, type: !10) +// CHECK:STDOUT: !62 = !DILocation(line: 19, column: 1, scope: !60) +// CHECK:STDOUT: !63 = !{!61} +// CHECK:STDOUT: !64 = distinct !DISubprogram(name: "Run", linkageName: "main", scope: null, file: !8, line: 32, type: !15, spFlags: DISPFlagDefinition, unit: !9) +// CHECK:STDOUT: !65 = !DILocation(line: 33, column: 3, scope: !64) +// CHECK:STDOUT: !66 = !DILocation(line: 32, column: 1, scope: !64) +// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.6662a1ffb773360a", scope: null, file: !8, line: 19, type: !12, spFlags: DISPFlagDefinition, unit: !9, retainedNodes: !72) +// CHECK:STDOUT: !68 = !DILocalVariable(arg: 1, scope: !67, type: !10) +// CHECK:STDOUT: !70 = !DILocation(line: 20, column: 3, scope: !67) +// CHECK:STDOUT: !71 = !DILocation(line: 19, column: 1, scope: !67) +// CHECK:STDOUT: !72 = !{!68} +// CHECK:STDOUT: !73 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.d53b17eed3ce903c", scope: null, file: !8, line: 19, type: !12, spFlags: DISPFlagDefinition, unit: !9, retainedNodes: !78) +// CHECK:STDOUT: !74 = !DILocalVariable(arg: 1, scope: !73, type: !10) +// CHECK:STDOUT: !76 = !DILocation(line: 20, column: 3, scope: !73) +// CHECK:STDOUT: !77 = !DILocation(line: 19, column: 1, scope: !73) +// CHECK:STDOUT: !78 = !{!74} +// CHECK:STDOUT: !79 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !80 = !{!"omnipotent char", !79, i64 0} +// CHECK:STDOUT: !81 = !{!"any pointer", !80, i64 0} +// CHECK:STDOUT: !82 = !{!"p1 _ZTSN6Carbon1AE", !81, i64 0} +// CHECK:STDOUT: !83 = !{!82, !82, i64 0} +// CHECK:STDOUT: !84 = !{!"p1 _ZTSN6Carbon1BE", !81, i64 0} +// CHECK:STDOUT: !85 = !{!84, !84, i64 0} +// CHECK:STDOUT: !86 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !87 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !88 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !89 = !{!"int", !80, i64 0} +// CHECK:STDOUT: !90 = !{!"__libc_errno", !89, i64 0} +// CHECK:STDOUT: !91 = !{!90, !89, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/function/import/function_decl.carbon b/toolchain/lower/testdata/interop/cpp/function/import/function_decl.carbon index 4a462ff7ec77..247357c6eec7 100644 --- a/toolchain/lower/testdata/interop/cpp/function/import/function_decl.carbon +++ b/toolchain/lower/testdata/interop/cpp/function/import/function_decl.carbon @@ -412,7 +412,7 @@ fn MyF() -> i32 { // CHECK:STDOUT: %SimpleReturnValue.call = call i32 @_Z17SimpleReturnValueii(i32 3, i32 4), !dbg !80 // CHECK:STDOUT: store i32 %SimpleReturnValue.call, ptr %value.var, align 4, !dbg !79 // CHECK:STDOUT: %.loc14 = load i32, ptr %value.var, align 4, !dbg !81 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %value.var), !dbg !74 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %value.var), !dbg !74 // CHECK:STDOUT: ret i32 %.loc14, !dbg !82 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -427,8 +427,8 @@ fn MyF() -> i32 { // CHECK:STDOUT: define internal void @_Z13NoReturnValueii.carbon_thunk._(i32 noundef %a) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %a.addr = alloca i32, align 4 -// CHECK:STDOUT: store i32 %a, ptr %a.addr, align 4, !tbaa !87 -// CHECK:STDOUT: %0 = load i32, ptr %a.addr, align 4, !tbaa !87 +// CHECK:STDOUT: store i32 %a, ptr %a.addr, align 4, !tbaa !95 +// CHECK:STDOUT: %0 = load i32, ptr %a.addr, align 4, !tbaa !95 // CHECK:STDOUT: call void @_Z13NoReturnValueii(i32 noundef %0, i32 noundef 2) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -446,8 +446,8 @@ fn MyF() -> i32 { // CHECK:STDOUT: define internal noundef i32 @_Z17SimpleReturnValueii.carbon_thunk._(i32 noundef %a) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %a.addr = alloca i32, align 4 -// CHECK:STDOUT: store i32 %a, ptr %a.addr, align 4, !tbaa !87 -// CHECK:STDOUT: %0 = load i32, ptr %a.addr, align 4, !tbaa !87 +// CHECK:STDOUT: store i32 %a, ptr %a.addr, align 4, !tbaa !95 +// CHECK:STDOUT: %0 = load i32, ptr %a.addr, align 4, !tbaa !95 // CHECK:STDOUT: %call = call noundef i32 @_Z17SimpleReturnValueii(i32 noundef %0, i32 noundef 2) // CHECK:STDOUT: ret i32 %call // CHECK:STDOUT: } @@ -455,11 +455,24 @@ fn MyF() -> i32 { // CHECK:STDOUT: declare noundef i32 @_Z17SimpleReturnValueii(i32 noundef, i32 noundef) #2 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !83 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !83 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !85 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !87 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !89 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !91 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !93 +// CHECK:STDOUT: ret void, !dbg !93 +// 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)) #3 // CHECK:STDOUT: @@ -505,9 +518,17 @@ fn MyF() -> i32 { // CHECK:STDOUT: !80 = !DILocation(line: 13, column: 11, scope: !68) // CHECK:STDOUT: !81 = !DILocation(line: 14, column: 10, scope: !68) // CHECK:STDOUT: !82 = !DILocation(line: 14, column: 3, scope: !68) -// CHECK:STDOUT: !83 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !55, line: 11, type: !61, spFlags: DISPFlagDefinition, unit: !56, retainedNodes: !86) +// CHECK:STDOUT: !83 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !55, line: 11, type: !61, spFlags: DISPFlagDefinition, unit: !56, retainedNodes: !86) // CHECK:STDOUT: !84 = !DILocalVariable(arg: 1, scope: !83, type: !57) // CHECK:STDOUT: !85 = !DILocation(line: 11, column: 3, scope: !83) // CHECK:STDOUT: !86 = !{!84} -// CHECK:STDOUT: !87 = !{!30, !30, i64 0} +// CHECK:STDOUT: !87 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !55, line: 11, type: !61, spFlags: DISPFlagDefinition, unit: !56, retainedNodes: !90) +// CHECK:STDOUT: !88 = !DILocalVariable(arg: 1, scope: !87, type: !57) +// CHECK:STDOUT: !89 = !DILocation(line: 11, column: 3, scope: !87) +// CHECK:STDOUT: !90 = !{!88} +// CHECK:STDOUT: !91 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !55, line: 11, type: !61, spFlags: DISPFlagDefinition, unit: !56, retainedNodes: !94) +// CHECK:STDOUT: !92 = !DILocalVariable(arg: 1, scope: !91, type: !57) +// CHECK:STDOUT: !93 = !DILocation(line: 11, column: 3, scope: !91) +// CHECK:STDOUT: !94 = !{!92} +// CHECK:STDOUT: !95 = !{!30, !30, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/function/import/import_inline.carbon b/toolchain/lower/testdata/interop/cpp/function/import/import_inline.carbon index d3bf740d0c9a..7c7f2a641b03 100644 --- a/toolchain/lower/testdata/interop/cpp/function/import/import_inline.carbon +++ b/toolchain/lower/testdata/interop/cpp/function/import/import_inline.carbon @@ -48,16 +48,29 @@ fn Call() -> i32 { // CHECK:STDOUT: store i32 0, ptr %n.var, align 4, !dbg !38 // CHECK:STDOUT: call void @_Z1FPi(ptr %n.var), !dbg !42 // CHECK:STDOUT: %.loc24 = load i32, ptr %n.var, align 4, !dbg !43 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %n.var), !dbg !38 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %n.var), !dbg !38 // CHECK:STDOUT: ret i32 %.loc24, !dbg !44 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #1 !dbg !45 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #1 !dbg !45 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !47 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #1 !dbg !49 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !51 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #1 !dbg !53 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !55 +// CHECK:STDOUT: ret void, !dbg !55 +// 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)) #2 // CHECK:STDOUT: @@ -66,8 +79,8 @@ fn Call() -> i32 { // CHECK:STDOUT: attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!26} -// CHECK:STDOUT: !llvm.module.flags = !{!49, !50, !51, !9, !10} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!53} +// CHECK:STDOUT: !llvm.module.flags = !{!57, !58, !59, !9, !10} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!61} // CHECK:STDOUT: // CHECK:STDOUT: !0 = !{!"Simple C++ TBAA"} // CHECK:STDOUT: !1 = !{!"omnipotent char", !0, i64 0} @@ -90,13 +103,21 @@ fn Call() -> i32 { // CHECK:STDOUT: !42 = !DILocation(line: 23, column: 3, scope: !35) // CHECK:STDOUT: !43 = !DILocation(line: 24, column: 10, scope: !35) // CHECK:STDOUT: !44 = !DILocation(line: 24, column: 3, scope: !35) -// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !25, line: 22, type: !34, spFlags: DISPFlagDefinition, unit: !26, retainedNodes: !48) +// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !25, line: 22, type: !34, spFlags: DISPFlagDefinition, unit: !26, retainedNodes: !48) // CHECK:STDOUT: !46 = !DILocalVariable(arg: 1, scope: !45, type: !27) // CHECK:STDOUT: !47 = !DILocation(line: 22, column: 3, scope: !45) // CHECK:STDOUT: !48 = !{!46} -// CHECK:STDOUT: !49 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !50 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !51 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !52 = !{!"__libc_errno", !2, i64 0} -// CHECK:STDOUT: !53 = !{!52, !2, i64 0} +// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !25, line: 22, type: !34, spFlags: DISPFlagDefinition, unit: !26, retainedNodes: !52) +// CHECK:STDOUT: !50 = !DILocalVariable(arg: 1, scope: !49, type: !27) +// CHECK:STDOUT: !51 = !DILocation(line: 22, column: 3, scope: !49) +// CHECK:STDOUT: !52 = !{!50} +// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !25, line: 22, type: !34, spFlags: DISPFlagDefinition, unit: !26, retainedNodes: !56) +// CHECK:STDOUT: !54 = !DILocalVariable(arg: 1, scope: !53, type: !27) +// CHECK:STDOUT: !55 = !DILocation(line: 22, column: 3, scope: !53) +// CHECK:STDOUT: !56 = !{!54} +// CHECK:STDOUT: !57 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !58 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !59 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !60 = !{!"__libc_errno", !2, i64 0} +// CHECK:STDOUT: !61 = !{!60, !2, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/function/import/parameters.carbon b/toolchain/lower/testdata/interop/cpp/function/import/parameters.carbon index dcce6ff9c078..6df4f50c4547 100644 --- a/toolchain/lower/testdata/interop/cpp/function/import/parameters.carbon +++ b/toolchain/lower/testdata/interop/cpp/function/import/parameters.carbon @@ -131,13 +131,13 @@ fn PassValueExpr(y: Cpp.Y) { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_19.3.temp), !dbg !62 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_22.3.temp), !dbg !63 // CHECK:STDOUT: call void @_Z11pass_signedasil.carbon_thunk.____(ptr @int_1.f1e, ptr @int_2.5c2, i32 3, i64 4), !dbg !64 -// CHECK:STDOUT: call void @"_COp.d57cb32fcf12ec07:core.Destroy.Core"(ptr @int_2.5c2), !dbg !63 -// CHECK:STDOUT: call void @"_COp.4954785a8b134801:core.Destroy.Core"(ptr @int_1.f1e), !dbg !62 +// CHECK:STDOUT: call void @"_CSelfDestruct.d57cb32fcf12ec07:core.Destroy.Core"(ptr @int_2.5c2), !dbg !63 +// CHECK:STDOUT: call void @"_CSelfDestruct.4954785a8b134801:core.Destroy.Core"(ptr @int_1.f1e), !dbg !62 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_21.3.temp), !dbg !65 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_24.3.temp), !dbg !66 // CHECK:STDOUT: call void @_Z13pass_unsignedhtjm.carbon_thunk.____(ptr @int_1.067, ptr @int_2.ec3, i32 3, i64 4), !dbg !67 -// CHECK:STDOUT: call void @"_COp.3bc9e5dacf328f74:core.Destroy.Core"(ptr @int_2.ec3), !dbg !66 -// CHECK:STDOUT: call void @"_COp.be60742f00557eec:core.Destroy.Core"(ptr @int_1.067), !dbg !65 +// CHECK:STDOUT: call void @"_CSelfDestruct.3bc9e5dacf328f74:core.Destroy.Core"(ptr @int_2.ec3), !dbg !66 +// CHECK:STDOUT: call void @"_CSelfDestruct.be60742f00557eec:core.Destroy.Core"(ptr @int_1.067), !dbg !65 // CHECK:STDOUT: ret void, !dbg !68 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -148,32 +148,58 @@ fn PassValueExpr(y: Cpp.Y) { // CHECK:STDOUT: %.addr1 = alloca ptr, align 8 // CHECK:STDOUT: %.addr2 = alloca i32, align 4 // CHECK:STDOUT: %.addr3 = alloca i64, align 8 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !108 -// CHECK:STDOUT: store ptr %1, ptr %.addr1, align 8, !tbaa !111 -// CHECK:STDOUT: store i32 %2, ptr %.addr2, align 4, !tbaa !113 -// CHECK:STDOUT: store i64 %3, ptr %.addr3, align 8, !tbaa !115 -// CHECK:STDOUT: %4 = load ptr, ptr %.addr, align 8, !tbaa !108 -// CHECK:STDOUT: %5 = load i8, ptr %4, align 1, !tbaa !116 -// CHECK:STDOUT: %6 = load ptr, ptr %.addr1, align 8, !tbaa !111 -// CHECK:STDOUT: %7 = load i16, ptr %6, align 2, !tbaa !117 -// CHECK:STDOUT: %8 = load i32, ptr %.addr2, align 4, !tbaa !113 -// CHECK:STDOUT: %9 = load i64, ptr %.addr3, align 8, !tbaa !115 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !140 +// CHECK:STDOUT: store ptr %1, ptr %.addr1, align 8, !tbaa !143 +// CHECK:STDOUT: store i32 %2, ptr %.addr2, align 4, !tbaa !145 +// CHECK:STDOUT: store i64 %3, ptr %.addr3, align 8, !tbaa !147 +// CHECK:STDOUT: %4 = load ptr, ptr %.addr, align 8, !tbaa !140 +// CHECK:STDOUT: %5 = load i8, ptr %4, align 1, !tbaa !148 +// CHECK:STDOUT: %6 = load ptr, ptr %.addr1, align 8, !tbaa !143 +// CHECK:STDOUT: %7 = load i16, ptr %6, align 2, !tbaa !149 +// CHECK:STDOUT: %8 = load i32, ptr %.addr2, align 4, !tbaa !145 +// CHECK:STDOUT: %9 = load i64, ptr %.addr3, align 8, !tbaa !147 // CHECK:STDOUT: call void @_Z11pass_signedasil(i8 noundef signext %5, i16 noundef signext %7, i32 noundef %8, i64 noundef %9) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.d57cb32fcf12ec07:core.Destroy.Core"(ptr %self) #0 !dbg !69 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.ea6dff92ea7b44ef:core.Destroy.Core"(ptr %self) #0 !dbg !69 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !71 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.4954785a8b134801:core.Destroy.Core"(ptr %self) #0 !dbg !73 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.d57cb32fcf12ec07:core.Destroy.Core"(ptr %self) #0 !dbg !73 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !75 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.d57cb32fcf12ec07:core.Destroy.Core"(ptr %self) #0 !dbg !77 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.d57cb32fcf12ec07:core.Destroy.Core"(ptr %self), !dbg !79 +// CHECK:STDOUT: ret void, !dbg !79 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.c4a4fcc00062c7f0:core.Destroy.Core"(ptr %self) #0 !dbg !81 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !83 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.4954785a8b134801:core.Destroy.Core"(ptr %self) #0 !dbg !85 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !87 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.4954785a8b134801:core.Destroy.Core"(ptr %self) #0 !dbg !89 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.4954785a8b134801:core.Destroy.Core"(ptr %self), !dbg !91 +// CHECK:STDOUT: ret void, !dbg !91 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define internal void @_Z13pass_unsignedhtjm.carbon_thunk.____(ptr noundef %0, ptr noundef %1, i32 noundef %2, i64 noundef %3) #1 { // CHECK:STDOUT: entry: @@ -181,70 +207,96 @@ fn PassValueExpr(y: Cpp.Y) { // CHECK:STDOUT: %.addr1 = alloca ptr, align 8 // CHECK:STDOUT: %.addr2 = alloca i32, align 4 // CHECK:STDOUT: %.addr3 = alloca i64, align 8 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !108 -// CHECK:STDOUT: store ptr %1, ptr %.addr1, align 8, !tbaa !111 -// CHECK:STDOUT: store i32 %2, ptr %.addr2, align 4, !tbaa !113 -// CHECK:STDOUT: store i64 %3, ptr %.addr3, align 8, !tbaa !115 -// CHECK:STDOUT: %4 = load ptr, ptr %.addr, align 8, !tbaa !108 -// CHECK:STDOUT: %5 = load i8, ptr %4, align 1, !tbaa !116 -// CHECK:STDOUT: %6 = load ptr, ptr %.addr1, align 8, !tbaa !111 -// CHECK:STDOUT: %7 = load i16, ptr %6, align 2, !tbaa !117 -// CHECK:STDOUT: %8 = load i32, ptr %.addr2, align 4, !tbaa !113 -// CHECK:STDOUT: %9 = load i64, ptr %.addr3, align 8, !tbaa !115 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !140 +// CHECK:STDOUT: store ptr %1, ptr %.addr1, align 8, !tbaa !143 +// CHECK:STDOUT: store i32 %2, ptr %.addr2, align 4, !tbaa !145 +// CHECK:STDOUT: store i64 %3, ptr %.addr3, align 8, !tbaa !147 +// CHECK:STDOUT: %4 = load ptr, ptr %.addr, align 8, !tbaa !140 +// CHECK:STDOUT: %5 = load i8, ptr %4, align 1, !tbaa !148 +// CHECK:STDOUT: %6 = load ptr, ptr %.addr1, align 8, !tbaa !143 +// CHECK:STDOUT: %7 = load i16, ptr %6, align 2, !tbaa !149 +// CHECK:STDOUT: %8 = load i32, ptr %.addr2, align 4, !tbaa !145 +// CHECK:STDOUT: %9 = load i64, ptr %.addr3, align 8, !tbaa !147 // CHECK:STDOUT: call void @_Z13pass_unsignedhtjm(i8 noundef zeroext %5, i16 noundef zeroext %7, i32 noundef %8, i64 noundef %9) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.3bc9e5dacf328f74:core.Destroy.Core"(ptr %self) #0 !dbg !77 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.99892fadd247b492:core.Destroy.Core"(ptr %self) #0 !dbg !93 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !79 +// CHECK:STDOUT: ret void, !dbg !95 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.be60742f00557eec:core.Destroy.Core"(ptr %self) #0 !dbg !81 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.3bc9e5dacf328f74:core.Destroy.Core"(ptr %self) #0 !dbg !97 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !83 +// CHECK:STDOUT: ret void, !dbg !99 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.3bc9e5dacf328f74:core.Destroy.Core"(ptr %self) #0 !dbg !101 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.3bc9e5dacf328f74:core.Destroy.Core"(ptr %self), !dbg !103 +// CHECK:STDOUT: ret void, !dbg !103 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.04514f1c5a56b0cb:core.Destroy.Core"(ptr %self) #0 !dbg !105 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !107 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.be60742f00557eec:core.Destroy.Core"(ptr %self) #0 !dbg !109 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !111 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.be60742f00557eec:core.Destroy.Core"(ptr %self) #0 !dbg !113 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.be60742f00557eec:core.Destroy.Core"(ptr %self), !dbg !115 +// CHECK:STDOUT: ret void, !dbg !115 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare i16 @_CMakeShort.Main() // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassShort.Main(i16 %a, ptr %b) #0 !dbg !85 { +// CHECK:STDOUT: define void @_CPassShort.Main(i16 %a, ptr %b) #0 !dbg !117 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc17_18.1.temp = alloca i16, align 2, !dbg !90 -// CHECK:STDOUT: %.loc18_18.3.temp = alloca i16, align 2, !dbg !93 -// CHECK:STDOUT: %.loc19_18.2.temp = alloca i16, align 2, !dbg !95 -// CHECK:STDOUT: %.loc20_28.3.temp = alloca i16, align 2, !dbg !97 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc17_18.1.temp), !dbg !90 -// CHECK:STDOUT: store i16 %a, ptr %.loc17_18.1.temp, align 2, !dbg !90 -// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk._(ptr %.loc17_18.1.temp), !dbg !91 -// CHECK:STDOUT: call void @"_COp.d57cb32fcf12ec07:core.Destroy.Core"(ptr %.loc17_18.1.temp), !dbg !90 -// CHECK:STDOUT: %.loc18_18.2 = load i16, ptr %b, align 2, !dbg !93 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_18.3.temp), !dbg !93 -// CHECK:STDOUT: store i16 %.loc18_18.2, ptr %.loc18_18.3.temp, align 2, !dbg !93 -// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk._(ptr %.loc18_18.3.temp), !dbg !94 -// CHECK:STDOUT: call void @"_COp.d57cb32fcf12ec07:core.Destroy.Core"(ptr %.loc18_18.3.temp), !dbg !93 -// CHECK:STDOUT: %.loc19_18.1 = load i16, ptr @_Cc.Main, align 2, !dbg !95 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc19_18.2.temp), !dbg !95 -// CHECK:STDOUT: store i16 %.loc19_18.1, ptr %.loc19_18.2.temp, align 2, !dbg !95 -// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk._(ptr %.loc19_18.2.temp), !dbg !96 -// CHECK:STDOUT: call void @"_COp.d57cb32fcf12ec07:core.Destroy.Core"(ptr %.loc19_18.2.temp), !dbg !95 -// CHECK:STDOUT: %MakeShort.call = call i16 @_CMakeShort.Main(), !dbg !97 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_28.3.temp), !dbg !97 -// CHECK:STDOUT: store i16 %MakeShort.call, ptr %.loc20_28.3.temp, align 2, !dbg !97 -// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk._(ptr %.loc20_28.3.temp), !dbg !98 -// CHECK:STDOUT: call void @"_COp.d57cb32fcf12ec07:core.Destroy.Core"(ptr %.loc20_28.3.temp), !dbg !97 -// CHECK:STDOUT: ret void, !dbg !99 +// CHECK:STDOUT: %.loc17_18.1.temp = alloca i16, align 2, !dbg !122 +// CHECK:STDOUT: %.loc18_18.3.temp = alloca i16, align 2, !dbg !125 +// CHECK:STDOUT: %.loc19_18.2.temp = alloca i16, align 2, !dbg !127 +// CHECK:STDOUT: %.loc20_28.3.temp = alloca i16, align 2, !dbg !129 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc17_18.1.temp), !dbg !122 +// CHECK:STDOUT: store i16 %a, ptr %.loc17_18.1.temp, align 2, !dbg !122 +// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk._(ptr %.loc17_18.1.temp), !dbg !123 +// CHECK:STDOUT: call void @"_CSelfDestruct.d57cb32fcf12ec07:core.Destroy.Core"(ptr %.loc17_18.1.temp), !dbg !122 +// CHECK:STDOUT: %.loc18_18.2 = load i16, ptr %b, align 2, !dbg !125 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_18.3.temp), !dbg !125 +// CHECK:STDOUT: store i16 %.loc18_18.2, ptr %.loc18_18.3.temp, align 2, !dbg !125 +// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk._(ptr %.loc18_18.3.temp), !dbg !126 +// CHECK:STDOUT: call void @"_CSelfDestruct.d57cb32fcf12ec07:core.Destroy.Core"(ptr %.loc18_18.3.temp), !dbg !125 +// CHECK:STDOUT: %.loc19_18.1 = load i16, ptr @_Cc.Main, align 2, !dbg !127 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc19_18.2.temp), !dbg !127 +// CHECK:STDOUT: store i16 %.loc19_18.1, ptr %.loc19_18.2.temp, align 2, !dbg !127 +// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk._(ptr %.loc19_18.2.temp), !dbg !128 +// CHECK:STDOUT: call void @"_CSelfDestruct.d57cb32fcf12ec07:core.Destroy.Core"(ptr %.loc19_18.2.temp), !dbg !127 +// CHECK:STDOUT: %MakeShort.call = call i16 @_CMakeShort.Main(), !dbg !129 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_28.3.temp), !dbg !129 +// CHECK:STDOUT: store i16 %MakeShort.call, ptr %.loc20_28.3.temp, align 2, !dbg !129 +// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk._(ptr %.loc20_28.3.temp), !dbg !130 +// CHECK:STDOUT: call void @"_CSelfDestruct.d57cb32fcf12ec07:core.Destroy.Core"(ptr %.loc20_28.3.temp), !dbg !129 +// CHECK:STDOUT: ret void, !dbg !131 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define internal void @_Z10pass_shorts.carbon_thunk._(ptr noundef %0) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !111 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !111 -// CHECK:STDOUT: %2 = load i16, ptr %1, align 2, !tbaa !117 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !143 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !143 +// CHECK:STDOUT: %2 = load i16, ptr %1, align 2, !tbaa !149 // CHECK:STDOUT: call void @_Z10pass_shorts(i16 noundef signext %2) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -253,10 +305,10 @@ fn PassValueExpr(y: Cpp.Y) { // CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #2 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define internal void @_C__global_init.Main() #0 !dbg !101 { +// CHECK:STDOUT: define internal void @_C__global_init.Main() #0 !dbg !133 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: store i16 poison, ptr @_Cc.Main, align 2, !dbg !102 -// CHECK:STDOUT: ret void, !dbg !103 +// CHECK:STDOUT: store i16 poison, ptr @_Cc.Main, align 2, !dbg !134 +// CHECK:STDOUT: ret void, !dbg !135 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z11pass_signedasil(i8 noundef signext, i16 noundef signext, i32 noundef, i64 noundef) #3 @@ -275,8 +327,8 @@ fn PassValueExpr(y: Cpp.Y) { // CHECK:STDOUT: attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!33} -// CHECK:STDOUT: !llvm.module.flags = !{!118, !119, !120, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!122} +// CHECK:STDOUT: !llvm.module.flags = !{!150, !151, !152, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!154} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -307,57 +359,89 @@ fn PassValueExpr(y: Cpp.Y) { // CHECK:STDOUT: !66 = !DILocation(line: 9, column: 24, scope: !61) // CHECK:STDOUT: !67 = !DILocation(line: 9, column: 3, scope: !61) // CHECK:STDOUT: !68 = !DILocation(line: 6, column: 1, scope: !61) -// CHECK:STDOUT: !69 = distinct !DISubprogram(name: "Op", linkageName: "_COp.d57cb32fcf12ec07:core.Destroy.Core", scope: null, file: !32, line: 7, type: !46, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !72) +// CHECK:STDOUT: !69 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.ea6dff92ea7b44ef:core.Destroy.Core", scope: null, file: !32, line: 7, type: !46, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !72) // CHECK:STDOUT: !70 = !DILocalVariable(arg: 1, scope: !69, type: !37) // CHECK:STDOUT: !71 = !DILocation(line: 7, column: 22, scope: !69) // CHECK:STDOUT: !72 = !{!70} -// CHECK:STDOUT: !73 = distinct !DISubprogram(name: "Op", linkageName: "_COp.4954785a8b134801:core.Destroy.Core", scope: null, file: !32, line: 7, type: !48, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !76) -// CHECK:STDOUT: !74 = !DILocalVariable(arg: 1, scope: !73, type: !36) -// CHECK:STDOUT: !75 = !DILocation(line: 7, column: 19, scope: !73) +// CHECK:STDOUT: !73 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.d57cb32fcf12ec07:core.Destroy.Core", scope: null, file: !32, line: 7, type: !46, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !76) +// CHECK:STDOUT: !74 = !DILocalVariable(arg: 1, scope: !73, type: !37) +// CHECK:STDOUT: !75 = !DILocation(line: 7, column: 22, scope: !73) // CHECK:STDOUT: !76 = !{!74} -// CHECK:STDOUT: !77 = distinct !DISubprogram(name: "Op", linkageName: "_COp.3bc9e5dacf328f74:core.Destroy.Core", scope: null, file: !32, line: 9, type: !52, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !80) -// CHECK:STDOUT: !78 = !DILocalVariable(arg: 1, scope: !77, type: !39) -// CHECK:STDOUT: !79 = !DILocation(line: 9, column: 24, scope: !77) +// CHECK:STDOUT: !77 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.d57cb32fcf12ec07:core.Destroy.Core", scope: null, file: !32, line: 7, type: !46, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !80) +// CHECK:STDOUT: !78 = !DILocalVariable(arg: 1, scope: !77, type: !37) +// CHECK:STDOUT: !79 = !DILocation(line: 7, column: 22, scope: !77) // CHECK:STDOUT: !80 = !{!78} -// CHECK:STDOUT: !81 = distinct !DISubprogram(name: "Op", linkageName: "_COp.be60742f00557eec:core.Destroy.Core", scope: null, file: !32, line: 9, type: !54, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !84) -// CHECK:STDOUT: !82 = !DILocalVariable(arg: 1, scope: !81, type: !8) -// CHECK:STDOUT: !83 = !DILocation(line: 9, column: 21, scope: !81) +// CHECK:STDOUT: !81 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.c4a4fcc00062c7f0:core.Destroy.Core", scope: null, file: !32, line: 7, type: !48, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !84) +// CHECK:STDOUT: !82 = !DILocalVariable(arg: 1, scope: !81, type: !36) +// CHECK:STDOUT: !83 = !DILocation(line: 7, column: 19, scope: !81) // CHECK:STDOUT: !84 = !{!82} -// CHECK:STDOUT: !85 = distinct !DISubprogram(name: "PassShort", linkageName: "_CPassShort.Main", scope: null, file: !32, line: 16, type: !58, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !100) -// CHECK:STDOUT: !86 = !DILocalVariable(arg: 1, scope: !85, type: !37) -// CHECK:STDOUT: !87 = !DILocalVariable(arg: 2, scope: !85, type: !42) -// CHECK:STDOUT: !90 = !DILocation(line: 17, column: 18, scope: !85) -// CHECK:STDOUT: !91 = !DILocation(line: 17, column: 3, scope: !85) -// CHECK:STDOUT: !93 = !DILocation(line: 18, column: 18, scope: !85) -// CHECK:STDOUT: !94 = !DILocation(line: 18, column: 3, scope: !85) -// CHECK:STDOUT: !95 = !DILocation(line: 19, column: 18, scope: !85) -// CHECK:STDOUT: !96 = !DILocation(line: 19, column: 3, scope: !85) -// CHECK:STDOUT: !97 = !DILocation(line: 20, column: 18, scope: !85) -// CHECK:STDOUT: !98 = !DILocation(line: 20, column: 3, scope: !85) -// CHECK:STDOUT: !99 = !DILocation(line: 16, column: 1, scope: !85) -// CHECK:STDOUT: !100 = !{!86, !87} -// CHECK:STDOUT: !101 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !32, type: !41, spFlags: DISPFlagDefinition, unit: !33) -// CHECK:STDOUT: !102 = !DILocation(line: 14, column: 1, scope: !101) -// CHECK:STDOUT: !103 = !DILocation(line: 0, scope: !101) -// CHECK:STDOUT: !104 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !105 = !{!"omnipotent char", !104, i64 0} -// CHECK:STDOUT: !106 = !{!"any pointer", !105, i64 0} -// CHECK:STDOUT: !107 = !{!"p1 omnipotent char", !106, i64 0} -// CHECK:STDOUT: !108 = !{!107, !107, i64 0} -// CHECK:STDOUT: !109 = !{!"short", !105, i64 0} -// CHECK:STDOUT: !110 = !{!"p1 short", !106, i64 0} -// CHECK:STDOUT: !111 = !{!110, !110, i64 0} -// CHECK:STDOUT: !112 = !{!"int", !105, i64 0} -// CHECK:STDOUT: !113 = !{!112, !112, i64 0} -// CHECK:STDOUT: !114 = !{!"long", !105, i64 0} -// CHECK:STDOUT: !115 = !{!114, !114, i64 0} -// CHECK:STDOUT: !116 = !{!105, !105, i64 0} -// CHECK:STDOUT: !117 = !{!109, !109, i64 0} -// CHECK:STDOUT: !118 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !119 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !120 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !121 = !{!"__libc_errno", !112, i64 0} -// CHECK:STDOUT: !122 = !{!121, !112, i64 0} +// CHECK:STDOUT: !85 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.4954785a8b134801:core.Destroy.Core", scope: null, file: !32, line: 7, type: !48, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !88) +// CHECK:STDOUT: !86 = !DILocalVariable(arg: 1, scope: !85, type: !36) +// CHECK:STDOUT: !87 = !DILocation(line: 7, column: 19, scope: !85) +// CHECK:STDOUT: !88 = !{!86} +// CHECK:STDOUT: !89 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.4954785a8b134801:core.Destroy.Core", scope: null, file: !32, line: 7, type: !48, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !92) +// CHECK:STDOUT: !90 = !DILocalVariable(arg: 1, scope: !89, type: !36) +// CHECK:STDOUT: !91 = !DILocation(line: 7, column: 19, scope: !89) +// CHECK:STDOUT: !92 = !{!90} +// CHECK:STDOUT: !93 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.99892fadd247b492:core.Destroy.Core", scope: null, file: !32, line: 9, type: !52, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !96) +// CHECK:STDOUT: !94 = !DILocalVariable(arg: 1, scope: !93, type: !39) +// CHECK:STDOUT: !95 = !DILocation(line: 9, column: 24, scope: !93) +// CHECK:STDOUT: !96 = !{!94} +// CHECK:STDOUT: !97 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.3bc9e5dacf328f74:core.Destroy.Core", scope: null, file: !32, line: 9, type: !52, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !100) +// CHECK:STDOUT: !98 = !DILocalVariable(arg: 1, scope: !97, type: !39) +// CHECK:STDOUT: !99 = !DILocation(line: 9, column: 24, scope: !97) +// CHECK:STDOUT: !100 = !{!98} +// CHECK:STDOUT: !101 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.3bc9e5dacf328f74:core.Destroy.Core", scope: null, file: !32, line: 9, type: !52, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !104) +// CHECK:STDOUT: !102 = !DILocalVariable(arg: 1, scope: !101, type: !39) +// CHECK:STDOUT: !103 = !DILocation(line: 9, column: 24, scope: !101) +// CHECK:STDOUT: !104 = !{!102} +// CHECK:STDOUT: !105 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.04514f1c5a56b0cb:core.Destroy.Core", scope: null, file: !32, line: 9, type: !54, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !108) +// CHECK:STDOUT: !106 = !DILocalVariable(arg: 1, scope: !105, type: !8) +// CHECK:STDOUT: !107 = !DILocation(line: 9, column: 21, scope: !105) +// CHECK:STDOUT: !108 = !{!106} +// CHECK:STDOUT: !109 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.be60742f00557eec:core.Destroy.Core", scope: null, file: !32, line: 9, type: !54, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !112) +// CHECK:STDOUT: !110 = !DILocalVariable(arg: 1, scope: !109, type: !8) +// CHECK:STDOUT: !111 = !DILocation(line: 9, column: 21, scope: !109) +// CHECK:STDOUT: !112 = !{!110} +// CHECK:STDOUT: !113 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.be60742f00557eec:core.Destroy.Core", scope: null, file: !32, line: 9, type: !54, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !116) +// CHECK:STDOUT: !114 = !DILocalVariable(arg: 1, scope: !113, type: !8) +// CHECK:STDOUT: !115 = !DILocation(line: 9, column: 21, scope: !113) +// CHECK:STDOUT: !116 = !{!114} +// CHECK:STDOUT: !117 = distinct !DISubprogram(name: "PassShort", linkageName: "_CPassShort.Main", scope: null, file: !32, line: 16, type: !58, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !132) +// CHECK:STDOUT: !118 = !DILocalVariable(arg: 1, scope: !117, type: !37) +// CHECK:STDOUT: !119 = !DILocalVariable(arg: 2, scope: !117, type: !42) +// CHECK:STDOUT: !122 = !DILocation(line: 17, column: 18, scope: !117) +// CHECK:STDOUT: !123 = !DILocation(line: 17, column: 3, scope: !117) +// CHECK:STDOUT: !125 = !DILocation(line: 18, column: 18, scope: !117) +// CHECK:STDOUT: !126 = !DILocation(line: 18, column: 3, scope: !117) +// CHECK:STDOUT: !127 = !DILocation(line: 19, column: 18, scope: !117) +// CHECK:STDOUT: !128 = !DILocation(line: 19, column: 3, scope: !117) +// CHECK:STDOUT: !129 = !DILocation(line: 20, column: 18, scope: !117) +// CHECK:STDOUT: !130 = !DILocation(line: 20, column: 3, scope: !117) +// CHECK:STDOUT: !131 = !DILocation(line: 16, column: 1, scope: !117) +// CHECK:STDOUT: !132 = !{!118, !119} +// CHECK:STDOUT: !133 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !32, type: !41, spFlags: DISPFlagDefinition, unit: !33) +// CHECK:STDOUT: !134 = !DILocation(line: 14, column: 1, scope: !133) +// CHECK:STDOUT: !135 = !DILocation(line: 0, scope: !133) +// CHECK:STDOUT: !136 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !137 = !{!"omnipotent char", !136, i64 0} +// CHECK:STDOUT: !138 = !{!"any pointer", !137, i64 0} +// CHECK:STDOUT: !139 = !{!"p1 omnipotent char", !138, i64 0} +// CHECK:STDOUT: !140 = !{!139, !139, i64 0} +// CHECK:STDOUT: !141 = !{!"short", !137, i64 0} +// CHECK:STDOUT: !142 = !{!"p1 short", !138, i64 0} +// CHECK:STDOUT: !143 = !{!142, !142, i64 0} +// CHECK:STDOUT: !144 = !{!"int", !137, i64 0} +// CHECK:STDOUT: !145 = !{!144, !144, i64 0} +// CHECK:STDOUT: !146 = !{!"long", !137, i64 0} +// CHECK:STDOUT: !147 = !{!146, !146, i64 0} +// CHECK:STDOUT: !148 = !{!137, !137, i64 0} +// CHECK:STDOUT: !149 = !{!141, !141, i64 0} +// CHECK:STDOUT: !150 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !151 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !152 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !153 = !{!"__libc_errno", !144, i64 0} +// CHECK:STDOUT: !154 = !{!153, !144, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'import_struct.carbon' @@ -368,35 +452,36 @@ fn PassValueExpr(y: Cpp.Y) { // CHECK:STDOUT: %struct.X = type { i32, i32, i32 } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CTest.Main() #0 !dbg !127 { +// CHECK:STDOUT: define void @_CTest.Main() #0 !dbg !159 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %x.var = alloca [12 x i8], align 4, !dbg !128 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %x.var), !dbg !128 -// CHECK:STDOUT: call void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.102476b7ae87d0a1"(ptr %x.var), !dbg !128 -// CHECK:STDOUT: %.loc8_4.a = getelementptr inbounds nuw [12 x i8], ptr %x.var, i32 0, i32 0, !dbg !130 -// CHECK:STDOUT: store i32 1, ptr %.loc8_4.a, align 4, !dbg !130 -// CHECK:STDOUT: %.loc9_4.b = getelementptr inbounds nuw [12 x i8], ptr %x.var, i32 0, i32 4, !dbg !131 -// CHECK:STDOUT: store i32 2, ptr %.loc9_4.b, align 4, !dbg !131 -// CHECK:STDOUT: %.loc10_4.c = getelementptr inbounds nuw [12 x i8], ptr %x.var, i32 0, i32 8, !dbg !132 -// CHECK:STDOUT: store i32 3, ptr %.loc10_4.c, align 4, !dbg !132 -// CHECK:STDOUT: call void @_Z11pass_struct1X.carbon_thunk._(ptr %x.var), !dbg !134 -// CHECK:STDOUT: ret void, !dbg !135 +// CHECK:STDOUT: %x.var = alloca [12 x i8], align 4, !dbg !160 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %x.var), !dbg !160 +// CHECK:STDOUT: call void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.102476b7ae87d0a1"(ptr %x.var), !dbg !160 +// CHECK:STDOUT: %.loc8_4.a = getelementptr inbounds nuw [12 x i8], ptr %x.var, i32 0, i32 0, !dbg !162 +// CHECK:STDOUT: store i32 1, ptr %.loc8_4.a, align 4, !dbg !162 +// CHECK:STDOUT: %.loc9_4.b = getelementptr inbounds nuw [12 x i8], ptr %x.var, i32 0, i32 4, !dbg !163 +// CHECK:STDOUT: store i32 2, ptr %.loc9_4.b, align 4, !dbg !163 +// CHECK:STDOUT: %.loc10_4.c = getelementptr inbounds nuw [12 x i8], ptr %x.var, i32 0, i32 8, !dbg !164 +// CHECK:STDOUT: store i32 3, ptr %.loc10_4.c, align 4, !dbg !164 +// CHECK:STDOUT: call void @_Z11pass_struct1X.carbon_thunk._(ptr %x.var), !dbg !166 +// CHECK:STDOUT: call void @"_CSelfDestruct.3d7b8a41b4c67e71:core.Destroy.Core"(ptr %x.var), !dbg !160 +// CHECK:STDOUT: ret void, !dbg !167 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable // CHECK:STDOUT: define internal void @_ZN1XC1Ev.carbon_thunk.(ptr noundef %return) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !145 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !145 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !181 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !181 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Default.eed9ddf3aaac414a.Core:X.Cpp"(ptr sret([12 x i8]) %return) #2 !dbg !137 { +// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Default.eed9ddf3aaac414a.Core:X.Cpp"(ptr sret([12 x i8]) %return) #2 !dbg !169 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_ZN1XC1Ev.carbon_thunk.(ptr %return), !dbg !138 -// CHECK:STDOUT: ret void, !dbg !138 +// CHECK:STDOUT: call void @_ZN1XC1Ev.carbon_thunk.(ptr %return), !dbg !170 +// CHECK:STDOUT: ret void, !dbg !170 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -405,9 +490,9 @@ fn PassValueExpr(y: Cpp.Y) { // CHECK:STDOUT: %.addr = alloca ptr, align 8 // CHECK:STDOUT: %agg.tmp = alloca %struct.X, align 4 // CHECK:STDOUT: %agg.tmp.coerce = alloca { i64, i32 }, align 4 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !145 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !145 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %1, i64 12, i1 false), !tbaa.struct !147 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !181 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !181 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %1, i64 12, i1 false), !tbaa.struct !183 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp.coerce, ptr align 4 %agg.tmp, i64 12, i1 false) // CHECK:STDOUT: %2 = getelementptr inbounds nuw { i64, i32 }, ptr %agg.tmp.coerce, i32 0, i32 0 // CHECK:STDOUT: %3 = load i64, ptr %2, align 4 @@ -417,13 +502,19 @@ fn PassValueExpr(y: Cpp.Y) { // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.3d7b8a41b4c67e71:core.Destroy.Core"(ptr %self) #0 !dbg !171 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !173 +// 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)) #4 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.102476b7ae87d0a1"(ptr sret([12 x i8]) %return) #0 !dbg !139 { -// CHECK:STDOUT: call void @"_COp:thunk:Default.eed9ddf3aaac414a.Core:X.Cpp"(ptr %return), !dbg !142 -// CHECK:STDOUT: ret void, !dbg !143 +// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.102476b7ae87d0a1"(ptr sret([12 x i8]) %return) #0 !dbg !175 { +// CHECK:STDOUT: call void @"_COp:thunk:Default.eed9ddf3aaac414a.Core:X.Cpp"(ptr %return), !dbg !178 +// CHECK:STDOUT: ret void, !dbg !179 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z11pass_struct1X(i64, i32) #5 @@ -441,9 +532,9 @@ fn PassValueExpr(y: Cpp.Y) { // CHECK:STDOUT: attributes #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: attributes #5 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!124} -// CHECK:STDOUT: !llvm.module.flags = !{!118, !119, !120, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!122} +// CHECK:STDOUT: !llvm.dbg.cu = !{!156} +// CHECK:STDOUT: !llvm.module.flags = !{!150, !151, !152, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!154} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -451,36 +542,42 @@ fn PassValueExpr(y: Cpp.Y) { // CHECK:STDOUT: !40 = !{null} // CHECK:STDOUT: !41 = !DISubroutineType(types: !40) // CHECK:STDOUT: !42 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !104 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !105 = !{!"omnipotent char", !104, i64 0} -// CHECK:STDOUT: !106 = !{!"any pointer", !105, i64 0} -// CHECK:STDOUT: !112 = !{!"int", !105, i64 0} -// CHECK:STDOUT: !113 = !{!112, !112, i64 0} -// CHECK:STDOUT: !118 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !119 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !120 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !121 = !{!"__libc_errno", !112, i64 0} -// CHECK:STDOUT: !122 = !{!121, !112, i64 0} -// CHECK:STDOUT: !123 = !DIFile(filename: "import_struct.carbon", directory: "") -// CHECK:STDOUT: !124 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !123, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !125 = !{!42} -// CHECK:STDOUT: !126 = !DISubroutineType(types: !125) -// CHECK:STDOUT: !127 = distinct !DISubprogram(name: "Test", linkageName: "_CTest.Main", scope: null, file: !123, line: 6, type: !41, spFlags: DISPFlagDefinition, unit: !124) -// CHECK:STDOUT: !128 = !DILocation(line: 7, column: 3, scope: !127) -// CHECK:STDOUT: !130 = !DILocation(line: 8, column: 3, scope: !127) -// CHECK:STDOUT: !131 = !DILocation(line: 9, column: 3, scope: !127) -// CHECK:STDOUT: !132 = !DILocation(line: 10, column: 3, scope: !127) -// CHECK:STDOUT: !134 = !DILocation(line: 11, column: 3, scope: !127) -// CHECK:STDOUT: !135 = !DILocation(line: 6, column: 1, scope: !127) -// CHECK:STDOUT: !136 = !DIFile(filename: "./struct.h", directory: "") -// CHECK:STDOUT: !137 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.eed9ddf3aaac414a.Core:X.Cpp", scope: null, file: !136, line: 2, type: !126, spFlags: DISPFlagDefinition, unit: !124) -// CHECK:STDOUT: !138 = !DILocation(line: 2, column: 8, scope: !137) -// CHECK:STDOUT: !139 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.102476b7ae87d0a1", scope: null, file: !26, line: 9, type: !126, spFlags: DISPFlagDefinition, unit: !124) -// CHECK:STDOUT: !142 = !DILocation(line: 9, column: 28, scope: !139) -// CHECK:STDOUT: !143 = !DILocation(line: 9, column: 21, scope: !139) -// CHECK:STDOUT: !144 = !{!"p1 _ZTS1X", !106, i64 0} +// CHECK:STDOUT: !59 = !{null, !42} +// CHECK:STDOUT: !60 = !DISubroutineType(types: !59) +// CHECK:STDOUT: !136 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !137 = !{!"omnipotent char", !136, i64 0} +// CHECK:STDOUT: !138 = !{!"any pointer", !137, i64 0} +// CHECK:STDOUT: !144 = !{!"int", !137, i64 0} // CHECK:STDOUT: !145 = !{!144, !144, i64 0} -// CHECK:STDOUT: !147 = !{i64 0, i64 4, !113, i64 4, i64 4, !113, i64 8, i64 4, !113} +// CHECK:STDOUT: !150 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !151 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !152 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !153 = !{!"__libc_errno", !144, i64 0} +// CHECK:STDOUT: !154 = !{!153, !144, i64 0} +// CHECK:STDOUT: !155 = !DIFile(filename: "import_struct.carbon", directory: "") +// CHECK:STDOUT: !156 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !155, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !157 = !{!42} +// CHECK:STDOUT: !158 = !DISubroutineType(types: !157) +// CHECK:STDOUT: !159 = distinct !DISubprogram(name: "Test", linkageName: "_CTest.Main", scope: null, file: !155, line: 6, type: !41, spFlags: DISPFlagDefinition, unit: !156) +// CHECK:STDOUT: !160 = !DILocation(line: 7, column: 3, scope: !159) +// CHECK:STDOUT: !162 = !DILocation(line: 8, column: 3, scope: !159) +// CHECK:STDOUT: !163 = !DILocation(line: 9, column: 3, scope: !159) +// CHECK:STDOUT: !164 = !DILocation(line: 10, column: 3, scope: !159) +// CHECK:STDOUT: !166 = !DILocation(line: 11, column: 3, scope: !159) +// CHECK:STDOUT: !167 = !DILocation(line: 6, column: 1, scope: !159) +// CHECK:STDOUT: !168 = !DIFile(filename: "./struct.h", directory: "") +// CHECK:STDOUT: !169 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.eed9ddf3aaac414a.Core:X.Cpp", scope: null, file: !168, line: 2, type: !158, spFlags: DISPFlagDefinition, unit: !156) +// CHECK:STDOUT: !170 = !DILocation(line: 2, column: 8, scope: !169) +// CHECK:STDOUT: !171 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.3d7b8a41b4c67e71:core.Destroy.Core", scope: null, file: !155, line: 7, type: !60, spFlags: DISPFlagDefinition, unit: !156, retainedNodes: !174) +// CHECK:STDOUT: !172 = !DILocalVariable(arg: 1, scope: !171, type: !42) +// CHECK:STDOUT: !173 = !DILocation(line: 7, column: 3, scope: !171) +// CHECK:STDOUT: !174 = !{!172} +// CHECK:STDOUT: !175 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.102476b7ae87d0a1", scope: null, file: !26, line: 9, type: !158, spFlags: DISPFlagDefinition, unit: !156) +// CHECK:STDOUT: !178 = !DILocation(line: 9, column: 28, scope: !175) +// CHECK:STDOUT: !179 = !DILocation(line: 9, column: 21, scope: !175) +// CHECK:STDOUT: !180 = !{!"p1 _ZTS1X", !138, i64 0} +// CHECK:STDOUT: !181 = !{!180, !180, i64 0} +// CHECK:STDOUT: !183 = !{i64 0, i64 4, !145, i64 4, i64 4, !145, i64 8, i64 4, !145} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'import_class_with_nontrivial_copy.carbon' @@ -491,18 +588,19 @@ fn PassValueExpr(y: Cpp.Y) { // CHECK:STDOUT: %class.Y = type { i32, i32, i32 } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassRefExpr.Main() #0 !dbg !150 { +// CHECK:STDOUT: define void @_CPassRefExpr.Main() #0 !dbg !186 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %y.var = alloca [12 x i8], align 4, !dbg !151 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %y.var), !dbg !151 -// CHECK:STDOUT: %.loc8_4.a = getelementptr inbounds nuw [12 x i8], ptr %y.var, i32 0, i32 0, !dbg !153 -// CHECK:STDOUT: store i32 1, ptr %.loc8_4.a, align 4, !dbg !153 -// CHECK:STDOUT: %.loc9_4.b = getelementptr inbounds nuw [12 x i8], ptr %y.var, i32 0, i32 4, !dbg !154 -// CHECK:STDOUT: store i32 2, ptr %.loc9_4.b, align 4, !dbg !154 -// CHECK:STDOUT: %.loc10_4.c = getelementptr inbounds nuw [12 x i8], ptr %y.var, i32 0, i32 8, !dbg !155 -// CHECK:STDOUT: store i32 3, ptr %.loc10_4.c, align 4, !dbg !155 -// CHECK:STDOUT: call void @_Z11pass_struct1Y.carbon_thunk._(ptr %y.var), !dbg !157 -// CHECK:STDOUT: ret void, !dbg !158 +// CHECK:STDOUT: %y.var = alloca [12 x i8], align 4, !dbg !187 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %y.var), !dbg !187 +// CHECK:STDOUT: %.loc8_4.a = getelementptr inbounds nuw [12 x i8], ptr %y.var, i32 0, i32 0, !dbg !189 +// CHECK:STDOUT: store i32 1, ptr %.loc8_4.a, align 4, !dbg !189 +// CHECK:STDOUT: %.loc9_4.b = getelementptr inbounds nuw [12 x i8], ptr %y.var, i32 0, i32 4, !dbg !190 +// CHECK:STDOUT: store i32 2, ptr %.loc9_4.b, align 4, !dbg !190 +// CHECK:STDOUT: %.loc10_4.c = getelementptr inbounds nuw [12 x i8], ptr %y.var, i32 0, i32 8, !dbg !191 +// CHECK:STDOUT: store i32 3, ptr %.loc10_4.c, align 4, !dbg !191 +// CHECK:STDOUT: call void @_Z11pass_struct1Y.carbon_thunk._(ptr %y.var), !dbg !193 +// CHECK:STDOUT: call void @"_CSelfDestruct.988e3d50a7ba5577:core.Destroy.Core"(ptr %y.var), !dbg !187 +// CHECK:STDOUT: ret void, !dbg !194 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -510,30 +608,37 @@ fn PassValueExpr(y: Cpp.Y) { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 // CHECK:STDOUT: %agg.tmp = alloca %class.Y, align 4 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !171 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !171 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !211 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !211 // CHECK:STDOUT: call void @_ZN1YC1ERKS_(ptr noundef nonnull align 4 dereferenceable(12) %agg.tmp, ptr noundef nonnull align 4 dereferenceable(12) %1) // CHECK:STDOUT: call void @_Z11pass_struct1Y(ptr nofreeobj noundef align 4 dead_on_return dereferenceable(12) %agg.tmp) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.988e3d50a7ba5577:core.Destroy.Core"(ptr %self) #0 !dbg !195 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !197 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: declare void @_CMake.Main(ptr sret([12 x i8])) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassInitExpr.Main() #0 !dbg !159 { +// CHECK:STDOUT: define void @_CPassInitExpr.Main() #0 !dbg !199 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc17_24.1.temp = alloca [12 x i8], align 4, !dbg !160 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc17_24.1.temp), !dbg !160 -// CHECK:STDOUT: call void @_CMake.Main(ptr %.loc17_24.1.temp), !dbg !160 -// CHECK:STDOUT: call void @_Z11pass_struct1Y.carbon_thunk._(ptr %.loc17_24.1.temp), !dbg !161 -// CHECK:STDOUT: ret void, !dbg !162 +// CHECK:STDOUT: %.loc17_24.1.temp = alloca [12 x i8], align 4, !dbg !200 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc17_24.1.temp), !dbg !200 +// CHECK:STDOUT: call void @_CMake.Main(ptr %.loc17_24.1.temp), !dbg !200 +// CHECK:STDOUT: call void @_Z11pass_struct1Y.carbon_thunk._(ptr %.loc17_24.1.temp), !dbg !201 +// CHECK:STDOUT: call void @"_CSelfDestruct.988e3d50a7ba5577:core.Destroy.Core"(ptr %.loc17_24.1.temp), !dbg !200 +// CHECK:STDOUT: ret void, !dbg !202 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassValueExpr.Main(ptr %y) #0 !dbg !163 { +// CHECK:STDOUT: define void @_CPassValueExpr.Main(ptr %y) #0 !dbg !203 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z11pass_struct1Y.carbon_thunk._(ptr %y), !dbg !167 -// CHECK:STDOUT: ret void, !dbg !168 +// CHECK:STDOUT: call void @_Z11pass_struct1Y.carbon_thunk._(ptr %y), !dbg !207 +// CHECK:STDOUT: ret void, !dbg !208 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -551,9 +656,9 @@ fn PassValueExpr(y: Cpp.Y) { // CHECK:STDOUT: attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!149} -// CHECK:STDOUT: !llvm.module.flags = !{!118, !119, !120, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!122} +// CHECK:STDOUT: !llvm.dbg.cu = !{!185} +// CHECK:STDOUT: !llvm.module.flags = !{!150, !151, !152, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!154} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -562,33 +667,37 @@ fn PassValueExpr(y: Cpp.Y) { // CHECK:STDOUT: !42 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) // CHECK:STDOUT: !59 = !{null, !42} // CHECK:STDOUT: !60 = !DISubroutineType(types: !59) -// CHECK:STDOUT: !104 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !105 = !{!"omnipotent char", !104, i64 0} -// CHECK:STDOUT: !106 = !{!"any pointer", !105, i64 0} -// CHECK:STDOUT: !112 = !{!"int", !105, i64 0} -// CHECK:STDOUT: !118 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !119 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !120 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !121 = !{!"__libc_errno", !112, i64 0} -// CHECK:STDOUT: !122 = !{!121, !112, i64 0} -// CHECK:STDOUT: !148 = !DIFile(filename: "import_class_with_nontrivial_copy.carbon", directory: "") -// CHECK:STDOUT: !149 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !148, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !150 = distinct !DISubprogram(name: "PassRefExpr", linkageName: "_CPassRefExpr.Main", scope: null, file: !148, line: 6, type: !41, spFlags: DISPFlagDefinition, unit: !149) -// CHECK:STDOUT: !151 = !DILocation(line: 7, column: 3, scope: !150) -// CHECK:STDOUT: !153 = !DILocation(line: 8, column: 3, scope: !150) -// CHECK:STDOUT: !154 = !DILocation(line: 9, column: 3, scope: !150) -// CHECK:STDOUT: !155 = !DILocation(line: 10, column: 3, scope: !150) -// CHECK:STDOUT: !157 = !DILocation(line: 11, column: 3, scope: !150) -// CHECK:STDOUT: !158 = !DILocation(line: 6, column: 1, scope: !150) -// CHECK:STDOUT: !159 = distinct !DISubprogram(name: "PassInitExpr", linkageName: "_CPassInitExpr.Main", scope: null, file: !148, line: 16, type: !41, spFlags: DISPFlagDefinition, unit: !149) -// CHECK:STDOUT: !160 = !DILocation(line: 17, column: 19, scope: !159) -// CHECK:STDOUT: !161 = !DILocation(line: 17, column: 3, scope: !159) -// CHECK:STDOUT: !162 = !DILocation(line: 16, column: 1, scope: !159) -// CHECK:STDOUT: !163 = distinct !DISubprogram(name: "PassValueExpr", linkageName: "_CPassValueExpr.Main", scope: null, file: !148, line: 20, type: !60, spFlags: DISPFlagDefinition, unit: !149, retainedNodes: !169) -// CHECK:STDOUT: !164 = !DILocalVariable(arg: 1, scope: !163, type: !42) -// CHECK:STDOUT: !167 = !DILocation(line: 21, column: 3, scope: !163) -// CHECK:STDOUT: !168 = !DILocation(line: 20, column: 1, scope: !163) -// CHECK:STDOUT: !169 = !{!164} -// CHECK:STDOUT: !170 = !{!"p1 _ZTS1Y", !106, i64 0} -// CHECK:STDOUT: !171 = !{!170, !170, i64 0} +// CHECK:STDOUT: !136 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !137 = !{!"omnipotent char", !136, i64 0} +// CHECK:STDOUT: !138 = !{!"any pointer", !137, i64 0} +// CHECK:STDOUT: !144 = !{!"int", !137, i64 0} +// CHECK:STDOUT: !150 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !151 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !152 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !153 = !{!"__libc_errno", !144, i64 0} +// CHECK:STDOUT: !154 = !{!153, !144, i64 0} +// CHECK:STDOUT: !184 = !DIFile(filename: "import_class_with_nontrivial_copy.carbon", directory: "") +// CHECK:STDOUT: !185 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !184, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !186 = distinct !DISubprogram(name: "PassRefExpr", linkageName: "_CPassRefExpr.Main", scope: null, file: !184, line: 6, type: !41, spFlags: DISPFlagDefinition, unit: !185) +// CHECK:STDOUT: !187 = !DILocation(line: 7, column: 3, scope: !186) +// CHECK:STDOUT: !189 = !DILocation(line: 8, column: 3, scope: !186) +// CHECK:STDOUT: !190 = !DILocation(line: 9, column: 3, scope: !186) +// CHECK:STDOUT: !191 = !DILocation(line: 10, column: 3, scope: !186) +// CHECK:STDOUT: !193 = !DILocation(line: 11, column: 3, scope: !186) +// CHECK:STDOUT: !194 = !DILocation(line: 6, column: 1, scope: !186) +// CHECK:STDOUT: !195 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.988e3d50a7ba5577:core.Destroy.Core", scope: null, file: !184, line: 7, type: !60, spFlags: DISPFlagDefinition, unit: !185, retainedNodes: !198) +// CHECK:STDOUT: !196 = !DILocalVariable(arg: 1, scope: !195, type: !42) +// CHECK:STDOUT: !197 = !DILocation(line: 7, column: 3, scope: !195) +// CHECK:STDOUT: !198 = !{!196} +// CHECK:STDOUT: !199 = distinct !DISubprogram(name: "PassInitExpr", linkageName: "_CPassInitExpr.Main", scope: null, file: !184, line: 16, type: !41, spFlags: DISPFlagDefinition, unit: !185) +// CHECK:STDOUT: !200 = !DILocation(line: 17, column: 19, scope: !199) +// CHECK:STDOUT: !201 = !DILocation(line: 17, column: 3, scope: !199) +// CHECK:STDOUT: !202 = !DILocation(line: 16, column: 1, scope: !199) +// CHECK:STDOUT: !203 = distinct !DISubprogram(name: "PassValueExpr", linkageName: "_CPassValueExpr.Main", scope: null, file: !184, line: 20, type: !60, spFlags: DISPFlagDefinition, unit: !185, retainedNodes: !209) +// CHECK:STDOUT: !204 = !DILocalVariable(arg: 1, scope: !203, type: !42) +// CHECK:STDOUT: !207 = !DILocation(line: 21, column: 3, scope: !203) +// CHECK:STDOUT: !208 = !DILocation(line: 20, column: 1, scope: !203) +// CHECK:STDOUT: !209 = !{!204} +// CHECK:STDOUT: !210 = !{!"p1 _ZTS1Y", !138, i64 0} +// CHECK:STDOUT: !211 = !{!210, !210, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/function/import/return.carbon b/toolchain/lower/testdata/interop/cpp/function/import/return.carbon index cdb3cfe0c9ea..85ad83de157d 100644 --- a/toolchain/lower/testdata/interop/cpp/function/import/return.carbon +++ b/toolchain/lower/testdata/interop/cpp/function/import/return.carbon @@ -132,10 +132,10 @@ fn Call(x: Cpp.D) -> Cpp.C { // CHECK:STDOUT: define internal void @_Z8ReturnU8v.carbon_thunk.(ptr noundef %return) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !199 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !199 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !263 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !263 // CHECK:STDOUT: %call = call noundef zeroext i8 @_Z8ReturnU8v() -// CHECK:STDOUT: store i8 %call, ptr %0, align 1, !tbaa !200 +// CHECK:STDOUT: store i8 %call, ptr %0, align 1, !tbaa !264 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: @@ -153,10 +153,10 @@ fn Call(x: Cpp.D) -> Cpp.C { // CHECK:STDOUT: define internal void @_Z9ReturnU16v.carbon_thunk.(ptr noundef %return) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !203 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !203 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !267 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !267 // CHECK:STDOUT: %call = call noundef zeroext i16 @_Z9ReturnU16v() -// CHECK:STDOUT: store i16 %call, ptr %0, align 2, !tbaa !204 +// CHECK:STDOUT: store i16 %call, ptr %0, align 2, !tbaa !268 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: @@ -192,10 +192,10 @@ fn Call(x: Cpp.D) -> Cpp.C { // CHECK:STDOUT: define internal void @_Z8ReturnI8v.carbon_thunk.(ptr noundef %return) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !199 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !199 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !263 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !263 // CHECK:STDOUT: %call = call noundef signext i8 @_Z8ReturnI8v() -// CHECK:STDOUT: store i8 %call, ptr %0, align 1, !tbaa !200 +// CHECK:STDOUT: store i8 %call, ptr %0, align 1, !tbaa !264 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: @@ -213,10 +213,10 @@ fn Call(x: Cpp.D) -> Cpp.C { // CHECK:STDOUT: define internal void @_Z9ReturnI16v.carbon_thunk.(ptr noundef %return) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !203 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !203 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !267 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !267 // CHECK:STDOUT: %call = call noundef signext i16 @_Z9ReturnI16v() -// CHECK:STDOUT: store i16 %call, ptr %0, align 2, !tbaa !204 +// CHECK:STDOUT: store i16 %call, ptr %0, align 2, !tbaa !268 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: @@ -264,110 +264,214 @@ fn Call(x: Cpp.D) -> Cpp.C { // CHECK:STDOUT: %ReturnI32.call = call i32 @_Z9ReturnI32v(), !dbg !112 // CHECK:STDOUT: %ReturnI64.call = call i64 @_Z9ReturnI64v(), !dbg !115 // CHECK:STDOUT: call void @_CUse.Main(i8 %.loc19_32.4, i16 %.loc20_35.4, i32 %ReturnU32.call, i64 %ReturnU64.call, i8 %.loc24_32.4, i16 %.loc25_35.4, i32 %ReturnI32.call, i64 %ReturnI64.call), !dbg !126 -// CHECK:STDOUT: call void @"_COp.d57cb32fcf12ec07:core.Destroy.Core"(ptr %.loc25_35.1.temp), !dbg !109 -// CHECK:STDOUT: call void @"_COp.4954785a8b134801:core.Destroy.Core"(ptr %.loc24_32.1.temp), !dbg !106 -// CHECK:STDOUT: call void @"_COp.3bc9e5dacf328f74:core.Destroy.Core"(ptr %.loc20_35.1.temp), !dbg !97 -// CHECK:STDOUT: call void @"_COp.be60742f00557eec:core.Destroy.Core"(ptr %.loc19_32.1.temp), !dbg !94 +// CHECK:STDOUT: call void @"_CSelfDestruct.d57cb32fcf12ec07:core.Destroy.Core"(ptr %.loc25_35.1.temp), !dbg !109 +// CHECK:STDOUT: call void @"_CSelfDestruct.4954785a8b134801:core.Destroy.Core"(ptr %.loc24_32.1.temp), !dbg !106 +// CHECK:STDOUT: call void @"_CSelfDestruct.3bc9e5dacf328f74:core.Destroy.Core"(ptr %.loc20_35.1.temp), !dbg !97 +// CHECK:STDOUT: call void @"_CSelfDestruct.be60742f00557eec:core.Destroy.Core"(ptr %.loc19_32.1.temp), !dbg !94 // CHECK:STDOUT: ret void, !dbg !127 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.d57cb32fcf12ec07:core.Destroy.Core"(ptr %self) #0 !dbg !128 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.ea6dff92ea7b44ef:core.Destroy.Core"(ptr %self) #0 !dbg !128 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !130 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.4954785a8b134801:core.Destroy.Core"(ptr %self) #0 !dbg !132 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.d57cb32fcf12ec07:core.Destroy.Core"(ptr %self) #0 !dbg !132 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !134 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.3bc9e5dacf328f74:core.Destroy.Core"(ptr %self) #0 !dbg !136 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.d57cb32fcf12ec07:core.Destroy.Core"(ptr %self) #0 !dbg !136 { // CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.d57cb32fcf12ec07:core.Destroy.Core"(ptr %self), !dbg !138 // CHECK:STDOUT: ret void, !dbg !138 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.be60742f00557eec:core.Destroy.Core"(ptr %self) #0 !dbg !140 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.c4a4fcc00062c7f0:core.Destroy.Core"(ptr %self) #0 !dbg !140 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !142 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CVars.Main() #0 !dbg !144 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.4954785a8b134801:core.Destroy.Core"(ptr %self) #0 !dbg !144 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %my_u8.var = alloca i8, align 1, !dbg !145 -// CHECK:STDOUT: %my_u16.var = alloca i16, align 2, !dbg !148 -// CHECK:STDOUT: %my_u32.var = alloca i32, align 4, !dbg !151 -// CHECK:STDOUT: %my_u64.var = alloca i64, align 8, !dbg !154 -// CHECK:STDOUT: %my_i8.var = alloca i8, align 1, !dbg !157 -// CHECK:STDOUT: %my_i16.var = alloca i16, align 2, !dbg !160 -// CHECK:STDOUT: %my_i32.var = alloca i32, align 4, !dbg !163 -// CHECK:STDOUT: %my_i64.var = alloca i64, align 8, !dbg !166 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u8.var), !dbg !145 -// CHECK:STDOUT: call void @_Z8ReturnU8v.carbon_thunk.(ptr %my_u8.var), !dbg !146 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u16.var), !dbg !148 -// CHECK:STDOUT: call void @_Z9ReturnU16v.carbon_thunk.(ptr %my_u16.var), !dbg !149 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u32.var), !dbg !151 -// CHECK:STDOUT: %ReturnU32.call = call i32 @_Z9ReturnU32v(), !dbg !152 -// CHECK:STDOUT: store i32 %ReturnU32.call, ptr %my_u32.var, align 4, !dbg !151 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u64.var), !dbg !154 -// CHECK:STDOUT: %ReturnU64.call = call i64 @_Z9ReturnU64v(), !dbg !155 -// CHECK:STDOUT: store i64 %ReturnU64.call, ptr %my_u64.var, align 8, !dbg !154 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i8.var), !dbg !157 -// CHECK:STDOUT: call void @_Z8ReturnI8v.carbon_thunk.(ptr %my_i8.var), !dbg !158 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i16.var), !dbg !160 -// CHECK:STDOUT: call void @_Z9ReturnI16v.carbon_thunk.(ptr %my_i16.var), !dbg !161 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i32.var), !dbg !163 -// CHECK:STDOUT: %ReturnI32.call = call i32 @_Z9ReturnI32v(), !dbg !164 -// CHECK:STDOUT: store i32 %ReturnI32.call, ptr %my_i32.var, align 4, !dbg !163 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i64.var), !dbg !166 -// CHECK:STDOUT: %ReturnI64.call = call i64 @_Z9ReturnI64v(), !dbg !167 -// CHECK:STDOUT: store i64 %ReturnI64.call, ptr %my_i64.var, align 8, !dbg !166 -// CHECK:STDOUT: %.loc43_7 = load i8, ptr %my_u8.var, align 1, !dbg !169 -// CHECK:STDOUT: %.loc43_14 = load i16, ptr %my_u16.var, align 2, !dbg !170 -// CHECK:STDOUT: %.loc43_22 = load i32, ptr %my_u32.var, align 4, !dbg !171 -// CHECK:STDOUT: %.loc43_30 = load i64, ptr %my_u64.var, align 8, !dbg !172 -// CHECK:STDOUT: %.loc43_38 = load i8, ptr %my_i8.var, align 1, !dbg !173 -// CHECK:STDOUT: %.loc43_45 = load i16, ptr %my_i16.var, align 2, !dbg !174 -// CHECK:STDOUT: %.loc43_53 = load i32, ptr %my_i32.var, align 4, !dbg !175 -// CHECK:STDOUT: %.loc43_61 = load i64, ptr %my_i64.var, align 8, !dbg !176 -// CHECK:STDOUT: call void @_CUse.Main(i8 %.loc43_7, i16 %.loc43_14, i32 %.loc43_22, i64 %.loc43_30, i8 %.loc43_38, i16 %.loc43_45, i32 %.loc43_53, i64 %.loc43_61), !dbg !177 -// CHECK:STDOUT: call void @"_COp.5aacfd7dcc330b17:core.Destroy.Core"(ptr %my_i64.var), !dbg !166 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %my_i32.var), !dbg !163 -// CHECK:STDOUT: call void @"_COp.d57cb32fcf12ec07:core.Destroy.Core"(ptr %my_i16.var), !dbg !160 -// CHECK:STDOUT: call void @"_COp.4954785a8b134801:core.Destroy.Core"(ptr %my_i8.var), !dbg !157 -// CHECK:STDOUT: call void @"_COp.18a2a1ac0d16cf80:core.Destroy.Core"(ptr %my_u64.var), !dbg !154 -// CHECK:STDOUT: call void @"_COp.ea3ccedbd6a1c75d:core.Destroy.Core"(ptr %my_u32.var), !dbg !151 -// CHECK:STDOUT: call void @"_COp.3bc9e5dacf328f74:core.Destroy.Core"(ptr %my_u16.var), !dbg !148 -// CHECK:STDOUT: call void @"_COp.be60742f00557eec:core.Destroy.Core"(ptr %my_u8.var), !dbg !145 -// CHECK:STDOUT: ret void, !dbg !178 +// CHECK:STDOUT: ret void, !dbg !146 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.5aacfd7dcc330b17:core.Destroy.Core"(ptr %self) #0 !dbg !179 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.4954785a8b134801:core.Destroy.Core"(ptr %self) #0 !dbg !148 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !181 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.4954785a8b134801:core.Destroy.Core"(ptr %self), !dbg !150 +// CHECK:STDOUT: ret void, !dbg !150 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !183 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.99892fadd247b492:core.Destroy.Core"(ptr %self) #0 !dbg !152 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !185 +// CHECK:STDOUT: ret void, !dbg !154 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.18a2a1ac0d16cf80:core.Destroy.Core"(ptr %self) #0 !dbg !187 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.3bc9e5dacf328f74:core.Destroy.Core"(ptr %self) #0 !dbg !156 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !189 +// CHECK:STDOUT: ret void, !dbg !158 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.ea3ccedbd6a1c75d:core.Destroy.Core"(ptr %self) #0 !dbg !191 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.3bc9e5dacf328f74:core.Destroy.Core"(ptr %self) #0 !dbg !160 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !193 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.3bc9e5dacf328f74:core.Destroy.Core"(ptr %self), !dbg !162 +// CHECK:STDOUT: ret void, !dbg !162 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.04514f1c5a56b0cb:core.Destroy.Core"(ptr %self) #0 !dbg !164 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !166 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.be60742f00557eec:core.Destroy.Core"(ptr %self) #0 !dbg !168 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !170 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.be60742f00557eec:core.Destroy.Core"(ptr %self) #0 !dbg !172 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.be60742f00557eec:core.Destroy.Core"(ptr %self), !dbg !174 +// CHECK:STDOUT: ret void, !dbg !174 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CVars.Main() #0 !dbg !176 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %my_u8.var = alloca i8, align 1, !dbg !177 +// CHECK:STDOUT: %my_u16.var = alloca i16, align 2, !dbg !180 +// CHECK:STDOUT: %my_u32.var = alloca i32, align 4, !dbg !183 +// CHECK:STDOUT: %my_u64.var = alloca i64, align 8, !dbg !186 +// CHECK:STDOUT: %my_i8.var = alloca i8, align 1, !dbg !189 +// CHECK:STDOUT: %my_i16.var = alloca i16, align 2, !dbg !192 +// CHECK:STDOUT: %my_i32.var = alloca i32, align 4, !dbg !195 +// CHECK:STDOUT: %my_i64.var = alloca i64, align 8, !dbg !198 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u8.var), !dbg !177 +// CHECK:STDOUT: call void @_Z8ReturnU8v.carbon_thunk.(ptr %my_u8.var), !dbg !178 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u16.var), !dbg !180 +// CHECK:STDOUT: call void @_Z9ReturnU16v.carbon_thunk.(ptr %my_u16.var), !dbg !181 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u32.var), !dbg !183 +// CHECK:STDOUT: %ReturnU32.call = call i32 @_Z9ReturnU32v(), !dbg !184 +// CHECK:STDOUT: store i32 %ReturnU32.call, ptr %my_u32.var, align 4, !dbg !183 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u64.var), !dbg !186 +// CHECK:STDOUT: %ReturnU64.call = call i64 @_Z9ReturnU64v(), !dbg !187 +// CHECK:STDOUT: store i64 %ReturnU64.call, ptr %my_u64.var, align 8, !dbg !186 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i8.var), !dbg !189 +// CHECK:STDOUT: call void @_Z8ReturnI8v.carbon_thunk.(ptr %my_i8.var), !dbg !190 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i16.var), !dbg !192 +// CHECK:STDOUT: call void @_Z9ReturnI16v.carbon_thunk.(ptr %my_i16.var), !dbg !193 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i32.var), !dbg !195 +// CHECK:STDOUT: %ReturnI32.call = call i32 @_Z9ReturnI32v(), !dbg !196 +// CHECK:STDOUT: store i32 %ReturnI32.call, ptr %my_i32.var, align 4, !dbg !195 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i64.var), !dbg !198 +// CHECK:STDOUT: %ReturnI64.call = call i64 @_Z9ReturnI64v(), !dbg !199 +// CHECK:STDOUT: store i64 %ReturnI64.call, ptr %my_i64.var, align 8, !dbg !198 +// CHECK:STDOUT: %.loc43_7 = load i8, ptr %my_u8.var, align 1, !dbg !201 +// CHECK:STDOUT: %.loc43_14 = load i16, ptr %my_u16.var, align 2, !dbg !202 +// CHECK:STDOUT: %.loc43_22 = load i32, ptr %my_u32.var, align 4, !dbg !203 +// CHECK:STDOUT: %.loc43_30 = load i64, ptr %my_u64.var, align 8, !dbg !204 +// CHECK:STDOUT: %.loc43_38 = load i8, ptr %my_i8.var, align 1, !dbg !205 +// CHECK:STDOUT: %.loc43_45 = load i16, ptr %my_i16.var, align 2, !dbg !206 +// CHECK:STDOUT: %.loc43_53 = load i32, ptr %my_i32.var, align 4, !dbg !207 +// CHECK:STDOUT: %.loc43_61 = load i64, ptr %my_i64.var, align 8, !dbg !208 +// CHECK:STDOUT: call void @_CUse.Main(i8 %.loc43_7, i16 %.loc43_14, i32 %.loc43_22, i64 %.loc43_30, i8 %.loc43_38, i16 %.loc43_45, i32 %.loc43_53, i64 %.loc43_61), !dbg !209 +// CHECK:STDOUT: call void @"_CSelfDestruct.5aacfd7dcc330b17:core.Destroy.Core"(ptr %my_i64.var), !dbg !198 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %my_i32.var), !dbg !195 +// CHECK:STDOUT: call void @"_CSelfDestruct.d57cb32fcf12ec07:core.Destroy.Core"(ptr %my_i16.var), !dbg !192 +// CHECK:STDOUT: call void @"_CSelfDestruct.4954785a8b134801:core.Destroy.Core"(ptr %my_i8.var), !dbg !189 +// CHECK:STDOUT: call void @"_CSelfDestruct.18a2a1ac0d16cf80:core.Destroy.Core"(ptr %my_u64.var), !dbg !186 +// CHECK:STDOUT: call void @"_CSelfDestruct.ea3ccedbd6a1c75d:core.Destroy.Core"(ptr %my_u32.var), !dbg !183 +// CHECK:STDOUT: call void @"_CSelfDestruct.3bc9e5dacf328f74:core.Destroy.Core"(ptr %my_u16.var), !dbg !180 +// CHECK:STDOUT: call void @"_CSelfDestruct.be60742f00557eec:core.Destroy.Core"(ptr %my_u8.var), !dbg !177 +// CHECK:STDOUT: ret void, !dbg !210 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6e5a4ef51c9e705a:core.Destroy.Core"(ptr %self) #0 !dbg !211 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !213 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.5aacfd7dcc330b17:core.Destroy.Core"(ptr %self) #0 !dbg !215 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !217 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.5aacfd7dcc330b17:core.Destroy.Core"(ptr %self) #0 !dbg !219 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.5aacfd7dcc330b17:core.Destroy.Core"(ptr %self), !dbg !221 +// CHECK:STDOUT: ret void, !dbg !221 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !223 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !225 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !227 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !229 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !231 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !233 +// CHECK:STDOUT: ret void, !dbg !233 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.98b8c1354df43b20:core.Destroy.Core"(ptr %self) #0 !dbg !235 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !237 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.18a2a1ac0d16cf80:core.Destroy.Core"(ptr %self) #0 !dbg !239 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !241 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.18a2a1ac0d16cf80:core.Destroy.Core"(ptr %self) #0 !dbg !243 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.18a2a1ac0d16cf80:core.Destroy.Core"(ptr %self), !dbg !245 +// CHECK:STDOUT: ret void, !dbg !245 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.b18ca5df050aa3af:core.Destroy.Core"(ptr %self) #0 !dbg !247 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !249 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.ea3ccedbd6a1c75d:core.Destroy.Core"(ptr %self) #0 !dbg !251 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !253 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.ea3ccedbd6a1c75d:core.Destroy.Core"(ptr %self) #0 !dbg !255 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.ea3ccedbd6a1c75d:core.Destroy.Core"(ptr %self), !dbg !257 +// CHECK:STDOUT: ret void, !dbg !257 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -390,8 +494,8 @@ fn Call(x: Cpp.D) -> Cpp.C { // CHECK:STDOUT: attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!5} -// CHECK:STDOUT: !llvm.module.flags = !{!205, !206, !207, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!210} +// CHECK:STDOUT: !llvm.module.flags = !{!269, !270, !271, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!274} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -474,81 +578,145 @@ fn Call(x: Cpp.D) -> Cpp.C { // CHECK:STDOUT: !115 = !DILocation(line: 27, column: 21, scope: !93) // CHECK:STDOUT: !126 = !DILocation(line: 29, column: 3, scope: !93) // CHECK:STDOUT: !127 = !DILocation(line: 18, column: 1, scope: !93) -// CHECK:STDOUT: !128 = distinct !DISubprogram(name: "Op", linkageName: "_COp.d57cb32fcf12ec07:core.Destroy.Core", scope: null, file: !4, line: 25, type: !38, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !131) +// CHECK:STDOUT: !128 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.ea6dff92ea7b44ef:core.Destroy.Core", scope: null, file: !4, line: 25, type: !38, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !131) // CHECK:STDOUT: !129 = !DILocalVariable(arg: 1, scope: !128, type: !11) // CHECK:STDOUT: !130 = !DILocation(line: 25, column: 21, scope: !128) // CHECK:STDOUT: !131 = !{!129} -// CHECK:STDOUT: !132 = distinct !DISubprogram(name: "Op", linkageName: "_COp.4954785a8b134801:core.Destroy.Core", scope: null, file: !4, line: 24, type: !40, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !135) -// CHECK:STDOUT: !133 = !DILocalVariable(arg: 1, scope: !132, type: !10) -// CHECK:STDOUT: !134 = !DILocation(line: 24, column: 19, scope: !132) +// CHECK:STDOUT: !132 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.d57cb32fcf12ec07:core.Destroy.Core", scope: null, file: !4, line: 25, type: !38, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !135) +// CHECK:STDOUT: !133 = !DILocalVariable(arg: 1, scope: !132, type: !11) +// CHECK:STDOUT: !134 = !DILocation(line: 25, column: 21, scope: !132) // CHECK:STDOUT: !135 = !{!133} -// CHECK:STDOUT: !136 = distinct !DISubprogram(name: "Op", linkageName: "_COp.3bc9e5dacf328f74:core.Destroy.Core", scope: null, file: !4, line: 20, type: !42, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !139) -// CHECK:STDOUT: !137 = !DILocalVariable(arg: 1, scope: !136, type: !7) -// CHECK:STDOUT: !138 = !DILocation(line: 20, column: 21, scope: !136) +// CHECK:STDOUT: !136 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.d57cb32fcf12ec07:core.Destroy.Core", scope: null, file: !4, line: 25, type: !38, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !139) +// CHECK:STDOUT: !137 = !DILocalVariable(arg: 1, scope: !136, type: !11) +// CHECK:STDOUT: !138 = !DILocation(line: 25, column: 21, scope: !136) // CHECK:STDOUT: !139 = !{!137} -// CHECK:STDOUT: !140 = distinct !DISubprogram(name: "Op", linkageName: "_COp.be60742f00557eec:core.Destroy.Core", scope: null, file: !4, line: 19, type: !44, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !143) -// CHECK:STDOUT: !141 = !DILocalVariable(arg: 1, scope: !140, type: !6) -// CHECK:STDOUT: !142 = !DILocation(line: 19, column: 19, scope: !140) +// CHECK:STDOUT: !140 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.c4a4fcc00062c7f0:core.Destroy.Core", scope: null, file: !4, line: 24, type: !40, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !143) +// CHECK:STDOUT: !141 = !DILocalVariable(arg: 1, scope: !140, type: !10) +// CHECK:STDOUT: !142 = !DILocation(line: 24, column: 19, scope: !140) // CHECK:STDOUT: !143 = !{!141} -// CHECK:STDOUT: !144 = distinct !DISubprogram(name: "Vars", linkageName: "_CVars.Main", scope: null, file: !4, line: 32, type: !36, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !145 = !DILocation(line: 33, column: 3, scope: !144) -// CHECK:STDOUT: !146 = !DILocation(line: 33, column: 19, scope: !144) -// CHECK:STDOUT: !148 = !DILocation(line: 34, column: 3, scope: !144) -// CHECK:STDOUT: !149 = !DILocation(line: 34, column: 21, scope: !144) -// CHECK:STDOUT: !151 = !DILocation(line: 35, column: 3, scope: !144) -// CHECK:STDOUT: !152 = !DILocation(line: 35, column: 21, scope: !144) -// CHECK:STDOUT: !154 = !DILocation(line: 36, column: 3, scope: !144) -// CHECK:STDOUT: !155 = !DILocation(line: 36, column: 21, scope: !144) -// CHECK:STDOUT: !157 = !DILocation(line: 38, column: 3, scope: !144) -// CHECK:STDOUT: !158 = !DILocation(line: 38, column: 19, scope: !144) -// CHECK:STDOUT: !160 = !DILocation(line: 39, column: 3, scope: !144) -// CHECK:STDOUT: !161 = !DILocation(line: 39, column: 21, scope: !144) -// CHECK:STDOUT: !163 = !DILocation(line: 40, column: 3, scope: !144) -// CHECK:STDOUT: !164 = !DILocation(line: 40, column: 21, scope: !144) -// CHECK:STDOUT: !166 = !DILocation(line: 41, column: 3, scope: !144) -// CHECK:STDOUT: !167 = !DILocation(line: 41, column: 21, scope: !144) -// CHECK:STDOUT: !169 = !DILocation(line: 43, column: 7, scope: !144) -// CHECK:STDOUT: !170 = !DILocation(line: 43, column: 14, scope: !144) -// CHECK:STDOUT: !171 = !DILocation(line: 43, column: 22, scope: !144) -// CHECK:STDOUT: !172 = !DILocation(line: 43, column: 30, scope: !144) -// CHECK:STDOUT: !173 = !DILocation(line: 43, column: 38, scope: !144) -// CHECK:STDOUT: !174 = !DILocation(line: 43, column: 45, scope: !144) -// CHECK:STDOUT: !175 = !DILocation(line: 43, column: 53, scope: !144) -// CHECK:STDOUT: !176 = !DILocation(line: 43, column: 61, scope: !144) -// CHECK:STDOUT: !177 = !DILocation(line: 43, column: 3, scope: !144) -// CHECK:STDOUT: !178 = !DILocation(line: 32, column: 1, scope: !144) -// CHECK:STDOUT: !179 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5aacfd7dcc330b17:core.Destroy.Core", scope: null, file: !4, line: 41, type: !46, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !182) -// CHECK:STDOUT: !180 = !DILocalVariable(arg: 1, scope: !179, type: !13) -// CHECK:STDOUT: !181 = !DILocation(line: 41, column: 3, scope: !179) -// CHECK:STDOUT: !182 = !{!180} -// CHECK:STDOUT: !183 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 40, type: !48, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !186) -// CHECK:STDOUT: !184 = !DILocalVariable(arg: 1, scope: !183, type: !12) -// CHECK:STDOUT: !185 = !DILocation(line: 40, column: 3, scope: !183) -// CHECK:STDOUT: !186 = !{!184} -// CHECK:STDOUT: !187 = distinct !DISubprogram(name: "Op", linkageName: "_COp.18a2a1ac0d16cf80:core.Destroy.Core", scope: null, file: !4, line: 36, type: !50, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !190) -// CHECK:STDOUT: !188 = !DILocalVariable(arg: 1, scope: !187, type: !9) -// CHECK:STDOUT: !189 = !DILocation(line: 36, column: 3, scope: !187) -// CHECK:STDOUT: !190 = !{!188} -// CHECK:STDOUT: !191 = distinct !DISubprogram(name: "Op", linkageName: "_COp.ea3ccedbd6a1c75d:core.Destroy.Core", scope: null, file: !4, line: 35, type: !52, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !194) -// CHECK:STDOUT: !192 = !DILocalVariable(arg: 1, scope: !191, type: !8) -// CHECK:STDOUT: !193 = !DILocation(line: 35, column: 3, scope: !191) -// CHECK:STDOUT: !194 = !{!192} -// CHECK:STDOUT: !195 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !196 = !{!"omnipotent char", !195, i64 0} -// CHECK:STDOUT: !197 = !{!"any pointer", !196, i64 0} -// CHECK:STDOUT: !198 = !{!"p1 omnipotent char", !197, i64 0} -// CHECK:STDOUT: !199 = !{!198, !198, i64 0} -// CHECK:STDOUT: !200 = !{!196, !196, i64 0} -// CHECK:STDOUT: !201 = !{!"short", !196, i64 0} -// CHECK:STDOUT: !202 = !{!"p1 short", !197, i64 0} -// CHECK:STDOUT: !203 = !{!202, !202, i64 0} -// CHECK:STDOUT: !204 = !{!201, !201, i64 0} -// CHECK:STDOUT: !205 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !206 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !207 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !208 = !{!"int", !196, i64 0} -// CHECK:STDOUT: !209 = !{!"__libc_errno", !208, i64 0} -// CHECK:STDOUT: !210 = !{!209, !208, i64 0} +// CHECK:STDOUT: !144 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.4954785a8b134801:core.Destroy.Core", scope: null, file: !4, line: 24, type: !40, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !147) +// CHECK:STDOUT: !145 = !DILocalVariable(arg: 1, scope: !144, type: !10) +// CHECK:STDOUT: !146 = !DILocation(line: 24, column: 19, scope: !144) +// CHECK:STDOUT: !147 = !{!145} +// CHECK:STDOUT: !148 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.4954785a8b134801:core.Destroy.Core", scope: null, file: !4, line: 24, type: !40, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !151) +// CHECK:STDOUT: !149 = !DILocalVariable(arg: 1, scope: !148, type: !10) +// CHECK:STDOUT: !150 = !DILocation(line: 24, column: 19, scope: !148) +// CHECK:STDOUT: !151 = !{!149} +// CHECK:STDOUT: !152 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.99892fadd247b492:core.Destroy.Core", scope: null, file: !4, line: 20, type: !42, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !155) +// CHECK:STDOUT: !153 = !DILocalVariable(arg: 1, scope: !152, type: !7) +// CHECK:STDOUT: !154 = !DILocation(line: 20, column: 21, scope: !152) +// CHECK:STDOUT: !155 = !{!153} +// CHECK:STDOUT: !156 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.3bc9e5dacf328f74:core.Destroy.Core", scope: null, file: !4, line: 20, type: !42, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !159) +// CHECK:STDOUT: !157 = !DILocalVariable(arg: 1, scope: !156, type: !7) +// CHECK:STDOUT: !158 = !DILocation(line: 20, column: 21, scope: !156) +// CHECK:STDOUT: !159 = !{!157} +// CHECK:STDOUT: !160 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.3bc9e5dacf328f74:core.Destroy.Core", scope: null, file: !4, line: 20, type: !42, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !163) +// CHECK:STDOUT: !161 = !DILocalVariable(arg: 1, scope: !160, type: !7) +// CHECK:STDOUT: !162 = !DILocation(line: 20, column: 21, scope: !160) +// CHECK:STDOUT: !163 = !{!161} +// CHECK:STDOUT: !164 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.04514f1c5a56b0cb:core.Destroy.Core", scope: null, file: !4, line: 19, type: !44, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !167) +// CHECK:STDOUT: !165 = !DILocalVariable(arg: 1, scope: !164, type: !6) +// CHECK:STDOUT: !166 = !DILocation(line: 19, column: 19, scope: !164) +// CHECK:STDOUT: !167 = !{!165} +// CHECK:STDOUT: !168 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.be60742f00557eec:core.Destroy.Core", scope: null, file: !4, line: 19, type: !44, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !171) +// CHECK:STDOUT: !169 = !DILocalVariable(arg: 1, scope: !168, type: !6) +// CHECK:STDOUT: !170 = !DILocation(line: 19, column: 19, scope: !168) +// CHECK:STDOUT: !171 = !{!169} +// CHECK:STDOUT: !172 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.be60742f00557eec:core.Destroy.Core", scope: null, file: !4, line: 19, type: !44, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !175) +// CHECK:STDOUT: !173 = !DILocalVariable(arg: 1, scope: !172, type: !6) +// CHECK:STDOUT: !174 = !DILocation(line: 19, column: 19, scope: !172) +// CHECK:STDOUT: !175 = !{!173} +// CHECK:STDOUT: !176 = distinct !DISubprogram(name: "Vars", linkageName: "_CVars.Main", scope: null, file: !4, line: 32, type: !36, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !177 = !DILocation(line: 33, column: 3, scope: !176) +// CHECK:STDOUT: !178 = !DILocation(line: 33, column: 19, scope: !176) +// CHECK:STDOUT: !180 = !DILocation(line: 34, column: 3, scope: !176) +// CHECK:STDOUT: !181 = !DILocation(line: 34, column: 21, scope: !176) +// CHECK:STDOUT: !183 = !DILocation(line: 35, column: 3, scope: !176) +// CHECK:STDOUT: !184 = !DILocation(line: 35, column: 21, scope: !176) +// CHECK:STDOUT: !186 = !DILocation(line: 36, column: 3, scope: !176) +// CHECK:STDOUT: !187 = !DILocation(line: 36, column: 21, scope: !176) +// CHECK:STDOUT: !189 = !DILocation(line: 38, column: 3, scope: !176) +// CHECK:STDOUT: !190 = !DILocation(line: 38, column: 19, scope: !176) +// CHECK:STDOUT: !192 = !DILocation(line: 39, column: 3, scope: !176) +// CHECK:STDOUT: !193 = !DILocation(line: 39, column: 21, scope: !176) +// CHECK:STDOUT: !195 = !DILocation(line: 40, column: 3, scope: !176) +// CHECK:STDOUT: !196 = !DILocation(line: 40, column: 21, scope: !176) +// CHECK:STDOUT: !198 = !DILocation(line: 41, column: 3, scope: !176) +// CHECK:STDOUT: !199 = !DILocation(line: 41, column: 21, scope: !176) +// CHECK:STDOUT: !201 = !DILocation(line: 43, column: 7, scope: !176) +// CHECK:STDOUT: !202 = !DILocation(line: 43, column: 14, scope: !176) +// CHECK:STDOUT: !203 = !DILocation(line: 43, column: 22, scope: !176) +// CHECK:STDOUT: !204 = !DILocation(line: 43, column: 30, scope: !176) +// CHECK:STDOUT: !205 = !DILocation(line: 43, column: 38, scope: !176) +// CHECK:STDOUT: !206 = !DILocation(line: 43, column: 45, scope: !176) +// CHECK:STDOUT: !207 = !DILocation(line: 43, column: 53, scope: !176) +// CHECK:STDOUT: !208 = !DILocation(line: 43, column: 61, scope: !176) +// CHECK:STDOUT: !209 = !DILocation(line: 43, column: 3, scope: !176) +// CHECK:STDOUT: !210 = !DILocation(line: 32, column: 1, scope: !176) +// CHECK:STDOUT: !211 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6e5a4ef51c9e705a:core.Destroy.Core", scope: null, file: !4, line: 41, type: !46, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !214) +// CHECK:STDOUT: !212 = !DILocalVariable(arg: 1, scope: !211, type: !13) +// CHECK:STDOUT: !213 = !DILocation(line: 41, column: 3, scope: !211) +// CHECK:STDOUT: !214 = !{!212} +// CHECK:STDOUT: !215 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.5aacfd7dcc330b17:core.Destroy.Core", scope: null, file: !4, line: 41, type: !46, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !218) +// CHECK:STDOUT: !216 = !DILocalVariable(arg: 1, scope: !215, type: !13) +// CHECK:STDOUT: !217 = !DILocation(line: 41, column: 3, scope: !215) +// CHECK:STDOUT: !218 = !{!216} +// CHECK:STDOUT: !219 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.5aacfd7dcc330b17:core.Destroy.Core", scope: null, file: !4, line: 41, type: !46, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !222) +// CHECK:STDOUT: !220 = !DILocalVariable(arg: 1, scope: !219, type: !13) +// CHECK:STDOUT: !221 = !DILocation(line: 41, column: 3, scope: !219) +// CHECK:STDOUT: !222 = !{!220} +// CHECK:STDOUT: !223 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !4, line: 40, type: !48, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !226) +// CHECK:STDOUT: !224 = !DILocalVariable(arg: 1, scope: !223, type: !12) +// CHECK:STDOUT: !225 = !DILocation(line: 40, column: 3, scope: !223) +// CHECK:STDOUT: !226 = !{!224} +// CHECK:STDOUT: !227 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 40, type: !48, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !230) +// CHECK:STDOUT: !228 = !DILocalVariable(arg: 1, scope: !227, type: !12) +// CHECK:STDOUT: !229 = !DILocation(line: 40, column: 3, scope: !227) +// CHECK:STDOUT: !230 = !{!228} +// CHECK:STDOUT: !231 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 40, type: !48, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !234) +// CHECK:STDOUT: !232 = !DILocalVariable(arg: 1, scope: !231, type: !12) +// CHECK:STDOUT: !233 = !DILocation(line: 40, column: 3, scope: !231) +// CHECK:STDOUT: !234 = !{!232} +// CHECK:STDOUT: !235 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.98b8c1354df43b20:core.Destroy.Core", scope: null, file: !4, line: 36, type: !50, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !238) +// CHECK:STDOUT: !236 = !DILocalVariable(arg: 1, scope: !235, type: !9) +// CHECK:STDOUT: !237 = !DILocation(line: 36, column: 3, scope: !235) +// CHECK:STDOUT: !238 = !{!236} +// CHECK:STDOUT: !239 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.18a2a1ac0d16cf80:core.Destroy.Core", scope: null, file: !4, line: 36, type: !50, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !242) +// CHECK:STDOUT: !240 = !DILocalVariable(arg: 1, scope: !239, type: !9) +// CHECK:STDOUT: !241 = !DILocation(line: 36, column: 3, scope: !239) +// CHECK:STDOUT: !242 = !{!240} +// CHECK:STDOUT: !243 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.18a2a1ac0d16cf80:core.Destroy.Core", scope: null, file: !4, line: 36, type: !50, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !246) +// CHECK:STDOUT: !244 = !DILocalVariable(arg: 1, scope: !243, type: !9) +// CHECK:STDOUT: !245 = !DILocation(line: 36, column: 3, scope: !243) +// CHECK:STDOUT: !246 = !{!244} +// CHECK:STDOUT: !247 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.b18ca5df050aa3af:core.Destroy.Core", scope: null, file: !4, line: 35, type: !52, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !250) +// CHECK:STDOUT: !248 = !DILocalVariable(arg: 1, scope: !247, type: !8) +// CHECK:STDOUT: !249 = !DILocation(line: 35, column: 3, scope: !247) +// CHECK:STDOUT: !250 = !{!248} +// CHECK:STDOUT: !251 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.ea3ccedbd6a1c75d:core.Destroy.Core", scope: null, file: !4, line: 35, type: !52, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !254) +// CHECK:STDOUT: !252 = !DILocalVariable(arg: 1, scope: !251, type: !8) +// CHECK:STDOUT: !253 = !DILocation(line: 35, column: 3, scope: !251) +// CHECK:STDOUT: !254 = !{!252} +// CHECK:STDOUT: !255 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.ea3ccedbd6a1c75d:core.Destroy.Core", scope: null, file: !4, line: 35, type: !52, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !258) +// CHECK:STDOUT: !256 = !DILocalVariable(arg: 1, scope: !255, type: !8) +// CHECK:STDOUT: !257 = !DILocation(line: 35, column: 3, scope: !255) +// CHECK:STDOUT: !258 = !{!256} +// CHECK:STDOUT: !259 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !260 = !{!"omnipotent char", !259, i64 0} +// CHECK:STDOUT: !261 = !{!"any pointer", !260, i64 0} +// CHECK:STDOUT: !262 = !{!"p1 omnipotent char", !261, i64 0} +// CHECK:STDOUT: !263 = !{!262, !262, i64 0} +// CHECK:STDOUT: !264 = !{!260, !260, i64 0} +// CHECK:STDOUT: !265 = !{!"short", !260, i64 0} +// CHECK:STDOUT: !266 = !{!"p1 short", !261, i64 0} +// CHECK:STDOUT: !267 = !{!266, !266, i64 0} +// CHECK:STDOUT: !268 = !{!265, !265, i64 0} +// CHECK:STDOUT: !269 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !270 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !271 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !272 = !{!"int", !260, i64 0} +// CHECK:STDOUT: !273 = !{!"__libc_errno", !272, i64 0} +// CHECK:STDOUT: !274 = !{!273, !272, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'import_class.carbon' @@ -559,43 +727,50 @@ fn Call(x: Cpp.D) -> Cpp.C { // CHECK:STDOUT: %struct.X = type { ptr, ptr } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CGetX.Main(ptr sret([16 x i8]) %return) #0 !dbg !215 { +// CHECK:STDOUT: define void @_CGetX.Main(ptr sret([16 x i8]) %return) #0 !dbg !279 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z4Makev.carbon_thunk.(ptr %return), !dbg !218 -// CHECK:STDOUT: ret void, !dbg !219 +// CHECK:STDOUT: call void @_Z4Makev.carbon_thunk.(ptr %return), !dbg !282 +// CHECK:STDOUT: ret void, !dbg !283 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define internal void @_Z4Makev.carbon_thunk.(ptr noundef %return) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !231 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !231 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !299 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !299 // CHECK:STDOUT: call void @_Z4Makev(ptr dead_on_unwind writable sret(%struct.X) align 8 %0) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CLet.Main() #0 !dbg !220 { +// CHECK:STDOUT: define void @_CLet.Main() #0 !dbg !284 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc9_27.1.temp = alloca [16 x i8], align 8, !dbg !221 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_27.1.temp), !dbg !221 -// CHECK:STDOUT: call void @_Z4Makev.carbon_thunk.(ptr %.loc9_27.1.temp), !dbg !221 -// CHECK:STDOUT: call void @_ZN1XD1Ev(ptr %.loc9_27.1.temp), !dbg !221 -// CHECK:STDOUT: ret void, !dbg !224 +// CHECK:STDOUT: %.loc9_27.1.temp = alloca [16 x i8], align 8, !dbg !285 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_27.1.temp), !dbg !285 +// CHECK:STDOUT: call void @_Z4Makev.carbon_thunk.(ptr %.loc9_27.1.temp), !dbg !285 +// CHECK:STDOUT: call void @"_CSelfDestruct.3d7b8a41b4c67e71:core.Destroy.Core"(ptr %.loc9_27.1.temp), !dbg !285 +// CHECK:STDOUT: ret void, !dbg !288 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind // CHECK:STDOUT: declare void @_ZN1XD1Ev(ptr noundef nonnull align 8 dead_on_return(16) dereferenceable(16)) unnamed_addr #2 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CVar.Main() #0 !dbg !225 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.3d7b8a41b4c67e71:core.Destroy.Core"(ptr %self) #0 !dbg !289 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca [16 x i8], align 8, !dbg !226 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !226 -// CHECK:STDOUT: call void @_Z4Makev.carbon_thunk.(ptr %_.var), !dbg !227 -// CHECK:STDOUT: call void @_ZN1XD1Ev(ptr %_.var), !dbg !226 -// CHECK:STDOUT: ret void, !dbg !229 +// CHECK:STDOUT: call void @_ZN1XD1Ev(ptr %self), !dbg !291 +// CHECK:STDOUT: ret void, !dbg !291 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CVar.Main() #0 !dbg !293 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %_.var = alloca [16 x i8], align 8, !dbg !294 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !294 +// CHECK:STDOUT: call void @_Z4Makev.carbon_thunk.(ptr %_.var), !dbg !295 +// CHECK:STDOUT: call void @"_CSelfDestruct.3d7b8a41b4c67e71:core.Destroy.Core"(ptr %_.var), !dbg !294 +// CHECK:STDOUT: ret void, !dbg !297 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -612,40 +787,46 @@ fn Call(x: Cpp.D) -> Cpp.C { // CHECK:STDOUT: attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!212} -// CHECK:STDOUT: !llvm.module.flags = !{!205, !206, !207, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!210} +// CHECK:STDOUT: !llvm.dbg.cu = !{!276} +// CHECK:STDOUT: !llvm.module.flags = !{!269, !270, !271, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!274} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !16 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !17 = !{null, !16} +// CHECK:STDOUT: !18 = !DISubroutineType(types: !17) // CHECK:STDOUT: !35 = !{null} // CHECK:STDOUT: !36 = !DISubroutineType(types: !35) -// CHECK:STDOUT: !195 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !196 = !{!"omnipotent char", !195, i64 0} -// CHECK:STDOUT: !197 = !{!"any pointer", !196, i64 0} -// CHECK:STDOUT: !205 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !206 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !207 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !208 = !{!"int", !196, i64 0} -// CHECK:STDOUT: !209 = !{!"__libc_errno", !208, i64 0} -// CHECK:STDOUT: !210 = !{!209, !208, i64 0} -// CHECK:STDOUT: !211 = !DIFile(filename: "import_class.carbon", directory: "") -// CHECK:STDOUT: !212 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !211, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !213 = !{!16} -// CHECK:STDOUT: !214 = !DISubroutineType(types: !213) -// CHECK:STDOUT: !215 = distinct !DISubprogram(name: "GetX", linkageName: "_CGetX.Main", scope: null, file: !211, line: 6, type: !214, spFlags: DISPFlagDefinition, unit: !212) -// CHECK:STDOUT: !218 = !DILocation(line: 6, column: 29, scope: !215) -// CHECK:STDOUT: !219 = !DILocation(line: 6, column: 22, scope: !215) -// CHECK:STDOUT: !220 = distinct !DISubprogram(name: "Let", linkageName: "_CLet.Main", scope: null, file: !211, line: 8, type: !36, spFlags: DISPFlagDefinition, unit: !212) -// CHECK:STDOUT: !221 = !DILocation(line: 9, column: 18, scope: !220) -// CHECK:STDOUT: !224 = !DILocation(line: 8, column: 1, scope: !220) -// CHECK:STDOUT: !225 = distinct !DISubprogram(name: "Var", linkageName: "_CVar.Main", scope: null, file: !211, line: 12, type: !36, spFlags: DISPFlagDefinition, unit: !212) -// CHECK:STDOUT: !226 = !DILocation(line: 13, column: 3, scope: !225) -// CHECK:STDOUT: !227 = !DILocation(line: 13, column: 18, scope: !225) -// CHECK:STDOUT: !229 = !DILocation(line: 12, column: 1, scope: !225) -// CHECK:STDOUT: !230 = !{!"p1 _ZTS1X", !197, i64 0} -// CHECK:STDOUT: !231 = !{!230, !230, i64 0} +// CHECK:STDOUT: !259 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !260 = !{!"omnipotent char", !259, i64 0} +// CHECK:STDOUT: !261 = !{!"any pointer", !260, i64 0} +// CHECK:STDOUT: !269 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !270 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !271 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !272 = !{!"int", !260, i64 0} +// CHECK:STDOUT: !273 = !{!"__libc_errno", !272, i64 0} +// CHECK:STDOUT: !274 = !{!273, !272, i64 0} +// CHECK:STDOUT: !275 = !DIFile(filename: "import_class.carbon", directory: "") +// CHECK:STDOUT: !276 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !275, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !277 = !{!16} +// CHECK:STDOUT: !278 = !DISubroutineType(types: !277) +// CHECK:STDOUT: !279 = distinct !DISubprogram(name: "GetX", linkageName: "_CGetX.Main", scope: null, file: !275, line: 6, type: !278, spFlags: DISPFlagDefinition, unit: !276) +// CHECK:STDOUT: !282 = !DILocation(line: 6, column: 29, scope: !279) +// CHECK:STDOUT: !283 = !DILocation(line: 6, column: 22, scope: !279) +// CHECK:STDOUT: !284 = distinct !DISubprogram(name: "Let", linkageName: "_CLet.Main", scope: null, file: !275, line: 8, type: !36, spFlags: DISPFlagDefinition, unit: !276) +// CHECK:STDOUT: !285 = !DILocation(line: 9, column: 18, scope: !284) +// CHECK:STDOUT: !288 = !DILocation(line: 8, column: 1, scope: !284) +// CHECK:STDOUT: !289 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.3d7b8a41b4c67e71:core.Destroy.Core", scope: null, file: !275, line: 9, type: !18, spFlags: DISPFlagDefinition, unit: !276, retainedNodes: !292) +// CHECK:STDOUT: !290 = !DILocalVariable(arg: 1, scope: !289, type: !16) +// CHECK:STDOUT: !291 = !DILocation(line: 9, column: 18, scope: !289) +// CHECK:STDOUT: !292 = !{!290} +// CHECK:STDOUT: !293 = distinct !DISubprogram(name: "Var", linkageName: "_CVar.Main", scope: null, file: !275, line: 12, type: !36, spFlags: DISPFlagDefinition, unit: !276) +// CHECK:STDOUT: !294 = !DILocation(line: 13, column: 3, scope: !293) +// CHECK:STDOUT: !295 = !DILocation(line: 13, column: 18, scope: !293) +// CHECK:STDOUT: !297 = !DILocation(line: 12, column: 1, scope: !293) +// CHECK:STDOUT: !298 = !{!"p1 _ZTS1X", !261, i64 0} +// CHECK:STDOUT: !299 = !{!298, !298, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'indirect_return_with_args.carbon' @@ -657,10 +838,10 @@ fn Call(x: Cpp.D) -> Cpp.C { // CHECK:STDOUT: %class.C = type { i8 } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CCall.Main(ptr sret({}) %return, ptr %x) #0 !dbg !239 { +// CHECK:STDOUT: define void @_CCall.Main(ptr sret({}) %return, ptr %x) #0 !dbg !307 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z1f1D.carbon_thunk._(ptr %x, ptr %return), !dbg !245 -// CHECK:STDOUT: ret void, !dbg !246 +// CHECK:STDOUT: call void @_Z1f1D.carbon_thunk._(ptr %x, ptr %return), !dbg !313 +// CHECK:STDOUT: ret void, !dbg !314 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -670,10 +851,10 @@ fn Call(x: Cpp.D) -> Cpp.C { // CHECK:STDOUT: %return.addr = alloca ptr, align 8 // CHECK:STDOUT: %agg.tmp = alloca %class.D, align 1 // CHECK:STDOUT: %undef.agg.tmp = alloca %class.C, align 1 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !249 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !251 -// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !251 -// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !249 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !317 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !319 +// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !319 +// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !317 // CHECK:STDOUT: call void @_Z1f1D() // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -684,33 +865,33 @@ fn Call(x: Cpp.D) -> Cpp.C { // CHECK:STDOUT: attributes #1 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } // CHECK:STDOUT: attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!234} -// CHECK:STDOUT: !llvm.module.flags = !{!205, !206, !207, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!210} +// CHECK:STDOUT: !llvm.dbg.cu = !{!302} +// CHECK:STDOUT: !llvm.module.flags = !{!269, !270, !271, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!274} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !16 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !195 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !196 = !{!"omnipotent char", !195, i64 0} -// CHECK:STDOUT: !197 = !{!"any pointer", !196, i64 0} -// CHECK:STDOUT: !205 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !206 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !207 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !208 = !{!"int", !196, i64 0} -// CHECK:STDOUT: !209 = !{!"__libc_errno", !208, i64 0} -// CHECK:STDOUT: !210 = !{!209, !208, i64 0} -// CHECK:STDOUT: !233 = !DIFile(filename: "indirect_return_with_args.carbon", directory: "") -// CHECK:STDOUT: !234 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !233, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !235 = !{!16, !16} -// CHECK:STDOUT: !236 = !DISubroutineType(types: !235) -// CHECK:STDOUT: !239 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !233, line: 10, type: !236, spFlags: DISPFlagDefinition, unit: !234, retainedNodes: !247) -// CHECK:STDOUT: !240 = !DILocalVariable(arg: 1, scope: !239, type: !16) -// CHECK:STDOUT: !245 = !DILocation(line: 11, column: 10, scope: !239) -// CHECK:STDOUT: !246 = !DILocation(line: 11, column: 3, scope: !239) -// CHECK:STDOUT: !247 = !{!240} -// CHECK:STDOUT: !248 = !{!"p1 _ZTS1D", !197, i64 0} -// CHECK:STDOUT: !249 = !{!248, !248, i64 0} -// CHECK:STDOUT: !250 = !{!"p1 _ZTS1C", !197, i64 0} -// CHECK:STDOUT: !251 = !{!250, !250, i64 0} +// CHECK:STDOUT: !259 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !260 = !{!"omnipotent char", !259, i64 0} +// CHECK:STDOUT: !261 = !{!"any pointer", !260, i64 0} +// CHECK:STDOUT: !269 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !270 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !271 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !272 = !{!"int", !260, i64 0} +// CHECK:STDOUT: !273 = !{!"__libc_errno", !272, i64 0} +// CHECK:STDOUT: !274 = !{!273, !272, i64 0} +// CHECK:STDOUT: !301 = !DIFile(filename: "indirect_return_with_args.carbon", directory: "") +// CHECK:STDOUT: !302 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !301, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !303 = !{!16, !16} +// CHECK:STDOUT: !304 = !DISubroutineType(types: !303) +// CHECK:STDOUT: !307 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !301, line: 10, type: !304, spFlags: DISPFlagDefinition, unit: !302, retainedNodes: !315) +// CHECK:STDOUT: !308 = !DILocalVariable(arg: 1, scope: !307, type: !16) +// CHECK:STDOUT: !313 = !DILocation(line: 11, column: 10, scope: !307) +// CHECK:STDOUT: !314 = !DILocation(line: 11, column: 3, scope: !307) +// CHECK:STDOUT: !315 = !{!308} +// CHECK:STDOUT: !316 = !{!"p1 _ZTS1D", !261, i64 0} +// CHECK:STDOUT: !317 = !{!316, !316, i64 0} +// CHECK:STDOUT: !318 = !{!"p1 _ZTS1C", !261, i64 0} +// CHECK:STDOUT: !319 = !{!318, !318, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/issue7142.carbon b/toolchain/lower/testdata/interop/cpp/issue7142.carbon index e0a514dd6518..20a5a700cf20 100644 --- a/toolchain/lower/testdata/interop/cpp/issue7142.carbon +++ b/toolchain/lower/testdata/interop/cpp/issue7142.carbon @@ -49,7 +49,7 @@ void f() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %call = call noundef ptr @_ZN6CarbonL3GetEv() // CHECK:STDOUT: %price = getelementptr inbounds nuw %"class.Carbon::A", ptr %call, i32 0, i32 0 -// CHECK:STDOUT: %0 = load i32, ptr %price, align 4, !tbaa !38 +// CHECK:STDOUT: %0 = load i32, ptr %price, align 4, !tbaa !54 // CHECK:STDOUT: ret i32 %0 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -66,28 +66,55 @@ void f() { // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind // CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.A.Main"(ptr %self) #2 !dbg !18 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @"_COp.5a23cc09585c55d2:core.Destroy.Core"(ptr %self), !dbg !20 +// CHECK:STDOUT: call void @"_CSelfDestruct.5a23cc09585c55d2:core.Destroy.Core"(ptr %self), !dbg !20 // CHECK:STDOUT: ret void, !dbg !20 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #1 !dbg !22 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #1 !dbg !22 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !24 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.a58e9b74ce410031:core.Destroy.Core"(ptr %self) #1 !dbg !26 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #1 !dbg !26 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !28 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.5a23cc09585c55d2:core.Destroy.Core"(ptr %self) #1 !dbg !30 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #1 !dbg !30 { // CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !32 // CHECK:STDOUT: ret void, !dbg !32 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.a58e9b74ce410031:core.Destroy.Core"(ptr %self) #1 !dbg !34 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !36 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.a58e9b74ce410031:core.Destroy.Core"(ptr %self) #1 !dbg !38 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.a58e9b74ce410031:core.Destroy.Core"(ptr %self), !dbg !40 +// CHECK:STDOUT: ret void, !dbg !40 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.5a23cc09585c55d2:core.Destroy.Core"(ptr %self) #1 !dbg !42 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !44 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.5a23cc09585c55d2:core.Destroy.Core"(ptr %self) #1 !dbg !46 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.5a23cc09585c55d2:core.Destroy.Core"(ptr %self), !dbg !48 +// CHECK:STDOUT: ret void, !dbg !48 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable // CHECK:STDOUT: define internal noundef ptr @_ZN6CarbonL3GetEv() #3 { // CHECK:STDOUT: entry: @@ -103,8 +130,8 @@ void f() { // CHECK:STDOUT: attributes #3 = { alwaysinline mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!5} -// CHECK:STDOUT: !llvm.module.flags = !{!41, !42, !43, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!45} +// CHECK:STDOUT: !llvm.module.flags = !{!57, !58, !59, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!61} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -124,26 +151,42 @@ void f() { // CHECK:STDOUT: !19 = !DILocalVariable(arg: 1, scope: !18, type: !7) // CHECK:STDOUT: !20 = !DILocation(line: 15, column: 1, scope: !18) // CHECK:STDOUT: !21 = !{!19} -// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 15, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !25) +// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !4, line: 15, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !25) // CHECK:STDOUT: !23 = !DILocalVariable(arg: 1, scope: !22, type: !6) // CHECK:STDOUT: !24 = !DILocation(line: 15, column: 1, scope: !22) // CHECK:STDOUT: !25 = !{!23} -// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "Op", linkageName: "_COp.a58e9b74ce410031:core.Destroy.Core", scope: null, file: !4, line: 15, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !29) -// CHECK:STDOUT: !27 = !DILocalVariable(arg: 1, scope: !26, type: !7) +// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 15, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !29) +// CHECK:STDOUT: !27 = !DILocalVariable(arg: 1, scope: !26, type: !6) // CHECK:STDOUT: !28 = !DILocation(line: 15, column: 1, scope: !26) // CHECK:STDOUT: !29 = !{!27} -// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5a23cc09585c55d2:core.Destroy.Core", scope: null, file: !4, line: 15, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !33) -// CHECK:STDOUT: !31 = !DILocalVariable(arg: 1, scope: !30, type: !7) +// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 15, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !33) +// CHECK:STDOUT: !31 = !DILocalVariable(arg: 1, scope: !30, type: !6) // CHECK:STDOUT: !32 = !DILocation(line: 15, column: 1, scope: !30) // CHECK:STDOUT: !33 = !{!31} -// CHECK:STDOUT: !34 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !35 = !{!"omnipotent char", !34, i64 0} -// CHECK:STDOUT: !36 = !{!"int", !35, i64 0} -// CHECK:STDOUT: !37 = !{!"_ZTSN6Carbon1AE", !36, i64 0} -// CHECK:STDOUT: !38 = !{!37, !36, i64 0} -// CHECK:STDOUT: !41 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !42 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !43 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !44 = !{!"__libc_errno", !36, i64 0} -// CHECK:STDOUT: !45 = !{!44, !36, i64 0} +// CHECK:STDOUT: !34 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.a58e9b74ce410031:core.Destroy.Core", scope: null, file: !4, line: 15, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !37) +// CHECK:STDOUT: !35 = !DILocalVariable(arg: 1, scope: !34, type: !7) +// CHECK:STDOUT: !36 = !DILocation(line: 15, column: 1, scope: !34) +// CHECK:STDOUT: !37 = !{!35} +// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.a58e9b74ce410031:core.Destroy.Core", scope: null, file: !4, line: 15, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !41) +// CHECK:STDOUT: !39 = !DILocalVariable(arg: 1, scope: !38, type: !7) +// CHECK:STDOUT: !40 = !DILocation(line: 15, column: 1, scope: !38) +// CHECK:STDOUT: !41 = !{!39} +// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.5a23cc09585c55d2:core.Destroy.Core", scope: null, file: !4, line: 15, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !45) +// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !42, type: !7) +// CHECK:STDOUT: !44 = !DILocation(line: 15, column: 1, scope: !42) +// CHECK:STDOUT: !45 = !{!43} +// CHECK:STDOUT: !46 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.5a23cc09585c55d2:core.Destroy.Core", scope: null, file: !4, line: 15, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !49) +// CHECK:STDOUT: !47 = !DILocalVariable(arg: 1, scope: !46, type: !7) +// CHECK:STDOUT: !48 = !DILocation(line: 15, column: 1, scope: !46) +// CHECK:STDOUT: !49 = !{!47} +// CHECK:STDOUT: !50 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !51 = !{!"omnipotent char", !50, i64 0} +// CHECK:STDOUT: !52 = !{!"int", !51, i64 0} +// CHECK:STDOUT: !53 = !{!"_ZTSN6Carbon1AE", !52, i64 0} +// CHECK:STDOUT: !54 = !{!53, !52, i64 0} +// CHECK:STDOUT: !57 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !58 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !59 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !60 = !{!"__libc_errno", !52, i64 0} +// CHECK:STDOUT: !61 = !{!60, !52, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/nullptr.carbon b/toolchain/lower/testdata/interop/cpp/nullptr.carbon index 4ecb6286f888..f54763f5c7f9 100644 --- a/toolchain/lower/testdata/interop/cpp/nullptr.carbon +++ b/toolchain/lower/testdata/interop/cpp/nullptr.carbon @@ -65,41 +65,70 @@ fn ConvertNullptrConstant() -> Core.Optional(i32*) { // CHECK:STDOUT: store ptr %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call, ptr %.loc12_18.2.temp, align 8, !dbg !17 // CHECK:STDOUT: %.loc12_18.4 = load ptr, ptr %.loc12_18.2.temp, align 8, !dbg !17 // CHECK:STDOUT: call void @_Z7TakePtrPi(ptr %.loc12_18.4), !dbg !18 -// CHECK:STDOUT: call void @"_COp.5b309895020f658e:core.Destroy.Core"(ptr %.loc12_18.2.temp), !dbg !17 +// CHECK:STDOUT: call void @"_CSelfDestruct.5b309895020f658e:core.Destroy.Core"(ptr %.loc12_18.2.temp), !dbg !17 // CHECK:STDOUT: %Cpp.nullptr_t.as.Copy.impl.Op.call = call ptr @"_COp.NullptrT.CppCompat.Core:Copy.Core"(ptr poison), !dbg !19 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc14_22.1.temp), !dbg !19 // CHECK:STDOUT: store ptr %Cpp.nullptr_t.as.Copy.impl.Op.call, ptr %.loc14_22.1.temp, align 8, !dbg !19 // CHECK:STDOUT: call void @_Z11TakeNullptrDn.carbon_thunk._(ptr %.loc14_22.1.temp), !dbg !20 -// CHECK:STDOUT: call void @"_COp.826ebaace97974ae:core.Destroy.Core"(ptr %.loc14_22.1.temp), !dbg !19 +// CHECK:STDOUT: call void @"_CSelfDestruct.826ebaace97974ae:core.Destroy.Core"(ptr %.loc14_22.1.temp), !dbg !19 // CHECK:STDOUT: ret void, !dbg !21 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: declare void @"_CSelfDestruct.00ac8ef5084ea134:core.Destroy.Core"(ptr) +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.d088c7eb746488be:core.Destroy.Core"(ptr %self) #0 !dbg !23 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !25 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z7TakePtrPi(ptr noundef) #1 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.0f866e2c9731ba7d:core.Destroy.Core"(ptr %self) #0 !dbg !22 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.0f866e2c9731ba7d:core.Destroy.Core"(ptr %self) #0 !dbg !27 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !24 +// CHECK:STDOUT: ret void, !dbg !29 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.6204fc8d2f2baaa7:core.Destroy.Core"(ptr %self) #0 !dbg !26 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.0f866e2c9731ba7d:core.Destroy.Core"(ptr %self) #0 !dbg !31 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !28 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.0f866e2c9731ba7d:core.Destroy.Core"(ptr %self), !dbg !33 +// CHECK:STDOUT: ret void, !dbg !33 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.5b309895020f658e:core.Destroy.Core"(ptr %self) #0 !dbg !30 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.729fca203337f92a:core.Destroy.Core"(ptr %self) #0 !dbg !35 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !32 +// CHECK:STDOUT: ret void, !dbg !37 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.729fca203337f92a:core.Destroy.Core"(ptr %self) #0 !dbg !39 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.729fca203337f92a:core.Destroy.Core"(ptr %self), !dbg !41 +// CHECK:STDOUT: ret void, !dbg !41 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.5b309895020f658e:core.Destroy.Core"(ptr %self) #0 !dbg !43 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !45 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.5b309895020f658e:core.Destroy.Core"(ptr %self) #0 !dbg !47 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.5b309895020f658e:core.Destroy.Core"(ptr %self), !dbg !49 +// CHECK:STDOUT: ret void, !dbg !49 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define internal void @_Z11TakeNullptrDn.carbon_thunk._(ptr noundef %n) #2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %n.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %n, ptr %n.addr, align 8, !tbaa !96 -// CHECK:STDOUT: %0 = load ptr, ptr %n.addr, align 8, !tbaa !96 +// CHECK:STDOUT: store ptr %n, ptr %n.addr, align 8, !tbaa !124 +// CHECK:STDOUT: %0 = load ptr, ptr %n.addr, align 8, !tbaa !124 // CHECK:STDOUT: call void @_Z11TakeNullptrDn(ptr null) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -107,89 +136,110 @@ fn ConvertNullptrConstant() -> Core.Optional(i32*) { // CHECK:STDOUT: declare ptr @"_COp.NullptrT.CppCompat.Core:Copy.Core"(ptr) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.a7d1b77eb1279818:core.Destroy.Core"(ptr %self) #0 !dbg !34 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.a7d1b77eb1279818:core.Destroy.Core"(ptr %self) #0 !dbg !51 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !36 +// CHECK:STDOUT: ret void, !dbg !53 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.ddbd3dbdb388ab25:core.Destroy.Core"(ptr %self) #0 !dbg !38 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.a7d1b77eb1279818:core.Destroy.Core"(ptr %self) #0 !dbg !55 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !40 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.a7d1b77eb1279818:core.Destroy.Core"(ptr %self), !dbg !57 +// CHECK:STDOUT: ret void, !dbg !57 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.826ebaace97974ae:core.Destroy.Core"(ptr %self) #0 !dbg !42 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.174120d4d03791b0:core.Destroy.Core"(ptr %self) #0 !dbg !59 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !44 +// CHECK:STDOUT: ret void, !dbg !61 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define ptr @_CReturnNullptr.Main() #0 !dbg !46 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.174120d4d03791b0:core.Destroy.Core"(ptr %self) #0 !dbg !63 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Cpp.nullptr_t.as.Copy.impl.Op.call = call ptr @"_COp.NullptrT.CppCompat.Core:Copy.Core"(ptr poison), !dbg !49 -// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.Copy.impl.Op.call, !dbg !50 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.174120d4d03791b0:core.Destroy.Core"(ptr %self), !dbg !65 +// CHECK:STDOUT: ret void, !dbg !65 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define ptr @_CReturnNullptrCopy.Main() #0 !dbg !51 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.826ebaace97974ae:core.Destroy.Core"(ptr %self) #0 !dbg !67 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %a.var = alloca ptr, align 8, !dbg !54 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !54 -// CHECK:STDOUT: %Cpp.nullptr_t.as.Copy.impl.Op.call.loc22 = call ptr @"_COp.NullptrT.CppCompat.Core:Copy.Core"(ptr poison), !dbg !55 -// CHECK:STDOUT: store ptr %Cpp.nullptr_t.as.Copy.impl.Op.call.loc22, ptr %a.var, align 8, !dbg !54 -// CHECK:STDOUT: %.loc23 = load ptr, ptr %a.var, align 8, !dbg !57 -// CHECK:STDOUT: %Cpp.nullptr_t.as.Copy.impl.Op.call.loc23 = call ptr @"_COp.NullptrT.CppCompat.Core:Copy.Core"(ptr %.loc23), !dbg !57 -// CHECK:STDOUT: call void @"_COp.826ebaace97974ae:core.Destroy.Core"(ptr %a.var), !dbg !54 -// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.Copy.impl.Op.call.loc23, !dbg !58 +// CHECK:STDOUT: ret void, !dbg !69 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define ptr @_CReturnConvertedNullptrIndirectly.Main() #0 !dbg !59 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.826ebaace97974ae:core.Destroy.Core"(ptr %self) #0 !dbg !71 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %a.var = alloca ptr, align 8, !dbg !62 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !62 -// CHECK:STDOUT: call void @_Z13ReturnNullptrv.carbon_thunk.(ptr %a.var), !dbg !63 -// CHECK:STDOUT: %.loc28_10 = load ptr, ptr %a.var, align 8, !dbg !65 -// CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.49279a15ecfc119b.Core.84588f41d61dafba"(ptr %.loc28_10), !dbg !66 -// CHECK:STDOUT: call void @"_COp.826ebaace97974ae:core.Destroy.Core"(ptr %a.var), !dbg !62 -// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call, !dbg !66 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.826ebaace97974ae:core.Destroy.Core"(ptr %self), !dbg !73 +// CHECK:STDOUT: ret void, !dbg !73 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define ptr @_CReturnNullptr.Main() #0 !dbg !75 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %Cpp.nullptr_t.as.Copy.impl.Op.call = call ptr @"_COp.NullptrT.CppCompat.Core:Copy.Core"(ptr poison), !dbg !78 +// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.Copy.impl.Op.call, !dbg !79 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define ptr @_CReturnNullptrCopy.Main() #0 !dbg !80 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %a.var = alloca ptr, align 8, !dbg !83 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !83 +// CHECK:STDOUT: %Cpp.nullptr_t.as.Copy.impl.Op.call.loc22 = call ptr @"_COp.NullptrT.CppCompat.Core:Copy.Core"(ptr poison), !dbg !84 +// CHECK:STDOUT: store ptr %Cpp.nullptr_t.as.Copy.impl.Op.call.loc22, ptr %a.var, align 8, !dbg !83 +// CHECK:STDOUT: %.loc23 = load ptr, ptr %a.var, align 8, !dbg !86 +// CHECK:STDOUT: %Cpp.nullptr_t.as.Copy.impl.Op.call.loc23 = call ptr @"_COp.NullptrT.CppCompat.Core:Copy.Core"(ptr %.loc23), !dbg !86 +// CHECK:STDOUT: call void @"_CSelfDestruct.826ebaace97974ae:core.Destroy.Core"(ptr %a.var), !dbg !83 +// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.Copy.impl.Op.call.loc23, !dbg !87 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define ptr @_CReturnConvertedNullptrIndirectly.Main() #0 !dbg !88 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %a.var = alloca ptr, align 8, !dbg !91 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !91 +// CHECK:STDOUT: call void @_Z13ReturnNullptrv.carbon_thunk.(ptr %a.var), !dbg !92 +// CHECK:STDOUT: %.loc28_10 = load ptr, ptr %a.var, align 8, !dbg !94 +// CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.49279a15ecfc119b.Core.84588f41d61dafba"(ptr %.loc28_10), !dbg !95 +// CHECK:STDOUT: call void @"_CSelfDestruct.826ebaace97974ae:core.Destroy.Core"(ptr %a.var), !dbg !91 +// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call, !dbg !95 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define internal void @_Z13ReturnNullptrv.carbon_thunk.(ptr noundef %return) #2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !96 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !96 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !124 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !124 // CHECK:STDOUT: %call = call ptr @_Z13ReturnNullptrv() -// CHECK:STDOUT: store ptr %call, ptr %0, align 8, !tbaa !97 +// CHECK:STDOUT: store ptr %call, ptr %0, align 8, !tbaa !125 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define ptr @_CReturnConvertedNullptrDirectly.Main() #0 !dbg !67 { +// CHECK:STDOUT: define ptr @_CReturnConvertedNullptrDirectly.Main() #0 !dbg !96 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc32_28.1.temp = alloca ptr, align 8, !dbg !70 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc32_28.1.temp), !dbg !70 -// CHECK:STDOUT: call void @_Z13ReturnNullptrv.carbon_thunk.(ptr %.loc32_28.1.temp), !dbg !70 -// CHECK:STDOUT: %.loc32_28.4 = load ptr, ptr %.loc32_28.1.temp, align 8, !dbg !70 -// CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.49279a15ecfc119b.Core.84588f41d61dafba"(ptr %.loc32_28.4), !dbg !71 -// CHECK:STDOUT: call void @"_COp.826ebaace97974ae:core.Destroy.Core"(ptr %.loc32_28.1.temp), !dbg !70 -// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call, !dbg !71 +// CHECK:STDOUT: %.loc32_28.1.temp = alloca ptr, align 8, !dbg !99 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc32_28.1.temp), !dbg !99 +// CHECK:STDOUT: call void @_Z13ReturnNullptrv.carbon_thunk.(ptr %.loc32_28.1.temp), !dbg !99 +// CHECK:STDOUT: %.loc32_28.4 = load ptr, ptr %.loc32_28.1.temp, align 8, !dbg !99 +// CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.49279a15ecfc119b.Core.84588f41d61dafba"(ptr %.loc32_28.4), !dbg !100 +// CHECK:STDOUT: call void @"_CSelfDestruct.826ebaace97974ae:core.Destroy.Core"(ptr %.loc32_28.1.temp), !dbg !99 +// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call, !dbg !100 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define ptr @_CConvertNullptrConstant.Main() #0 !dbg !72 { +// CHECK:STDOUT: define ptr @_CConvertNullptrConstant.Main() #0 !dbg !101 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.49279a15ecfc119b.Core.84588f41d61dafba"(ptr poison), !dbg !75 -// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call, !dbg !75 +// CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.49279a15ecfc119b.Core.84588f41d61dafba"(ptr poison), !dbg !104 +// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call, !dbg !104 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.49279a15ecfc119b.Core.84588f41d61dafba"(ptr %self) #0 !dbg !77 { -// CHECK:STDOUT: %1 = call ptr @_CNone.Optional.Core.6e9e957697159b53(), !dbg !82 -// CHECK:STDOUT: ret ptr %1, !dbg !83 +// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.49279a15ecfc119b.Core.84588f41d61dafba"(ptr %self) #0 !dbg !106 { +// CHECK:STDOUT: %1 = call ptr @_CNone.Optional.Core.6e9e957697159b53(), !dbg !111 +// CHECK:STDOUT: ret ptr %1, !dbg !112 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -198,8 +248,8 @@ fn ConvertNullptrConstant() -> Core.Optional(i32*) { // CHECK:STDOUT: declare ptr @_CMake.NullptrT.CppCompat.Core() // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CNone.Optional.Core.6e9e957697159b53() #0 !dbg !86 { -// CHECK:STDOUT: ret ptr null, !dbg !90 +// CHECK:STDOUT: define linkonce_odr ptr @_CNone.Optional.Core.6e9e957697159b53() #0 !dbg !114 { +// CHECK:STDOUT: ret ptr null, !dbg !118 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z11TakeNullptrDn(ptr) #1 @@ -216,8 +266,8 @@ fn ConvertNullptrConstant() -> Core.Optional(i32*) { // CHECK:STDOUT: attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!5} -// CHECK:STDOUT: !llvm.module.flags = !{!98, !99, !100, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!103} +// CHECK:STDOUT: !llvm.module.flags = !{!126, !127, !128, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!131} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -238,68 +288,96 @@ fn ConvertNullptrConstant() -> Core.Optional(i32*) { // CHECK:STDOUT: !19 = !DILocation(line: 14, column: 19, scope: !16) // CHECK:STDOUT: !20 = !DILocation(line: 14, column: 3, scope: !16) // CHECK:STDOUT: !21 = !DILocation(line: 11, column: 1, scope: !16) -// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "Op", linkageName: "_COp.0f866e2c9731ba7d:core.Destroy.Core", scope: null, file: !4, line: 12, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !25) -// CHECK:STDOUT: !23 = !DILocalVariable(arg: 1, scope: !22, type: !9) -// CHECK:STDOUT: !24 = !DILocation(line: 12, column: 15, scope: !22) -// CHECK:STDOUT: !25 = !{!23} -// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "Op", linkageName: "_COp.6204fc8d2f2baaa7:core.Destroy.Core", scope: null, file: !4, line: 12, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !29) -// CHECK:STDOUT: !27 = !DILocalVariable(arg: 1, scope: !26, type: !9) -// CHECK:STDOUT: !28 = !DILocation(line: 12, column: 15, scope: !26) -// CHECK:STDOUT: !29 = !{!27} -// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5b309895020f658e:core.Destroy.Core", scope: null, file: !4, line: 12, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !33) -// CHECK:STDOUT: !31 = !DILocalVariable(arg: 1, scope: !30, type: !9) -// CHECK:STDOUT: !32 = !DILocation(line: 12, column: 15, scope: !30) -// CHECK:STDOUT: !33 = !{!31} -// CHECK:STDOUT: !34 = distinct !DISubprogram(name: "Op", linkageName: "_COp.a7d1b77eb1279818:core.Destroy.Core", scope: null, file: !4, line: 14, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !37) -// CHECK:STDOUT: !35 = !DILocalVariable(arg: 1, scope: !34, type: !9) -// CHECK:STDOUT: !36 = !DILocation(line: 14, column: 19, scope: !34) -// CHECK:STDOUT: !37 = !{!35} -// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "Op", linkageName: "_COp.ddbd3dbdb388ab25:core.Destroy.Core", scope: null, file: !4, line: 14, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !41) -// CHECK:STDOUT: !39 = !DILocalVariable(arg: 1, scope: !38, type: !9) -// CHECK:STDOUT: !40 = !DILocation(line: 14, column: 19, scope: !38) -// CHECK:STDOUT: !41 = !{!39} -// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "Op", linkageName: "_COp.826ebaace97974ae:core.Destroy.Core", scope: null, file: !4, line: 14, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !45) -// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !42, type: !9) -// CHECK:STDOUT: !44 = !DILocation(line: 14, column: 19, scope: !42) -// CHECK:STDOUT: !45 = !{!43} -// CHECK:STDOUT: !46 = distinct !DISubprogram(name: "ReturnNullptr", linkageName: "_CReturnNullptr.Main", scope: null, file: !4, line: 17, type: !15, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !49 = !DILocation(line: 18, column: 10, scope: !46) -// CHECK:STDOUT: !50 = !DILocation(line: 18, column: 3, scope: !46) -// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "ReturnNullptrCopy", linkageName: "_CReturnNullptrCopy.Main", scope: null, file: !4, line: 21, type: !15, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !54 = !DILocation(line: 22, column: 3, scope: !51) -// CHECK:STDOUT: !55 = !DILocation(line: 22, column: 26, scope: !51) -// CHECK:STDOUT: !57 = !DILocation(line: 23, column: 10, scope: !51) -// CHECK:STDOUT: !58 = !DILocation(line: 23, column: 3, scope: !51) -// CHECK:STDOUT: !59 = distinct !DISubprogram(name: "ReturnConvertedNullptrIndirectly", linkageName: "_CReturnConvertedNullptrIndirectly.Main", scope: null, file: !4, line: 26, type: !15, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !62 = !DILocation(line: 27, column: 3, scope: !59) -// CHECK:STDOUT: !63 = !DILocation(line: 27, column: 26, scope: !59) -// CHECK:STDOUT: !65 = !DILocation(line: 28, column: 10, scope: !59) -// CHECK:STDOUT: !66 = !DILocation(line: 28, column: 3, scope: !59) -// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "ReturnConvertedNullptrDirectly", linkageName: "_CReturnConvertedNullptrDirectly.Main", scope: null, file: !4, line: 31, type: !15, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !70 = !DILocation(line: 32, column: 10, scope: !67) -// CHECK:STDOUT: !71 = !DILocation(line: 32, column: 3, scope: !67) -// CHECK:STDOUT: !72 = distinct !DISubprogram(name: "ConvertNullptrConstant", linkageName: "_CConvertNullptrConstant.Main", scope: null, file: !4, line: 35, type: !15, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !75 = !DILocation(line: 36, column: 3, scope: !72) -// CHECK:STDOUT: !76 = !DIFile(filename: "{{.*}}/prelude/types/cpp/nullptr.carbon", directory: "") -// CHECK:STDOUT: !77 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.NullptrT.CppCompat.Core:ImplicitAs.49279a15ecfc119b.Core.84588f41d61dafba", scope: null, file: !76, line: 51, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !84) -// CHECK:STDOUT: !78 = !DILocalVariable(arg: 1, scope: !77, type: !9) -// CHECK:STDOUT: !82 = !DILocation(line: 52, column: 14, scope: !77) -// CHECK:STDOUT: !83 = !DILocation(line: 52, column: 7, scope: !77) -// CHECK:STDOUT: !84 = !{!78} -// CHECK:STDOUT: !85 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") -// CHECK:STDOUT: !86 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.6e9e957697159b53", scope: null, file: !85, line: 30, type: !15, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !90 = !DILocation(line: 31, column: 5, scope: !86) -// CHECK:STDOUT: !91 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !92 = !{!"omnipotent char", !91, i64 0} -// CHECK:STDOUT: !93 = !{!"std::nullptr_t", !92, i64 0} -// CHECK:STDOUT: !94 = !{!"any pointer", !92, i64 0} -// CHECK:STDOUT: !95 = !{!"p1 std::nullptr_t", !94, i64 0} -// CHECK:STDOUT: !96 = !{!95, !95, i64 0} -// CHECK:STDOUT: !97 = !{!93, !93, i64 0} -// CHECK:STDOUT: !98 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !99 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !100 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !101 = !{!"int", !92, i64 0} -// CHECK:STDOUT: !102 = !{!"__libc_errno", !101, i64 0} -// CHECK:STDOUT: !103 = !{!102, !101, i64 0} +// CHECK:STDOUT: !22 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") +// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.d088c7eb746488be:core.Destroy.Core", scope: null, file: !22, line: 164, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !26) +// CHECK:STDOUT: !24 = !DILocalVariable(arg: 1, scope: !23, type: !9) +// CHECK:STDOUT: !25 = !DILocation(line: 164, column: 19, scope: !23) +// CHECK:STDOUT: !26 = !{!24} +// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.0f866e2c9731ba7d:core.Destroy.Core", scope: null, file: !4, line: 12, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !30) +// CHECK:STDOUT: !28 = !DILocalVariable(arg: 1, scope: !27, type: !9) +// CHECK:STDOUT: !29 = !DILocation(line: 12, column: 15, scope: !27) +// CHECK:STDOUT: !30 = !{!28} +// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.0f866e2c9731ba7d:core.Destroy.Core", scope: null, file: !4, line: 12, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !34) +// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !31, type: !9) +// CHECK:STDOUT: !33 = !DILocation(line: 12, column: 15, scope: !31) +// CHECK:STDOUT: !34 = !{!32} +// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.729fca203337f92a:core.Destroy.Core", scope: null, file: !4, line: 12, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !38) +// CHECK:STDOUT: !36 = !DILocalVariable(arg: 1, scope: !35, type: !9) +// CHECK:STDOUT: !37 = !DILocation(line: 12, column: 15, scope: !35) +// CHECK:STDOUT: !38 = !{!36} +// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.729fca203337f92a:core.Destroy.Core", scope: null, file: !4, line: 12, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !42) +// CHECK:STDOUT: !40 = !DILocalVariable(arg: 1, scope: !39, type: !9) +// CHECK:STDOUT: !41 = !DILocation(line: 12, column: 15, scope: !39) +// CHECK:STDOUT: !42 = !{!40} +// CHECK:STDOUT: !43 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.5b309895020f658e:core.Destroy.Core", scope: null, file: !4, line: 12, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !46) +// CHECK:STDOUT: !44 = !DILocalVariable(arg: 1, scope: !43, type: !9) +// CHECK:STDOUT: !45 = !DILocation(line: 12, column: 15, scope: !43) +// CHECK:STDOUT: !46 = !{!44} +// CHECK:STDOUT: !47 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.5b309895020f658e:core.Destroy.Core", scope: null, file: !4, line: 12, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !50) +// CHECK:STDOUT: !48 = !DILocalVariable(arg: 1, scope: !47, type: !9) +// CHECK:STDOUT: !49 = !DILocation(line: 12, column: 15, scope: !47) +// CHECK:STDOUT: !50 = !{!48} +// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.a7d1b77eb1279818:core.Destroy.Core", scope: null, file: !4, line: 14, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !54) +// CHECK:STDOUT: !52 = !DILocalVariable(arg: 1, scope: !51, type: !9) +// CHECK:STDOUT: !53 = !DILocation(line: 14, column: 19, scope: !51) +// CHECK:STDOUT: !54 = !{!52} +// CHECK:STDOUT: !55 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.a7d1b77eb1279818:core.Destroy.Core", scope: null, file: !4, line: 14, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !58) +// CHECK:STDOUT: !56 = !DILocalVariable(arg: 1, scope: !55, type: !9) +// CHECK:STDOUT: !57 = !DILocation(line: 14, column: 19, scope: !55) +// CHECK:STDOUT: !58 = !{!56} +// CHECK:STDOUT: !59 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.174120d4d03791b0:core.Destroy.Core", scope: null, file: !4, line: 14, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !62) +// CHECK:STDOUT: !60 = !DILocalVariable(arg: 1, scope: !59, type: !9) +// CHECK:STDOUT: !61 = !DILocation(line: 14, column: 19, scope: !59) +// CHECK:STDOUT: !62 = !{!60} +// CHECK:STDOUT: !63 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.174120d4d03791b0:core.Destroy.Core", scope: null, file: !4, line: 14, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !66) +// CHECK:STDOUT: !64 = !DILocalVariable(arg: 1, scope: !63, type: !9) +// CHECK:STDOUT: !65 = !DILocation(line: 14, column: 19, scope: !63) +// CHECK:STDOUT: !66 = !{!64} +// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.826ebaace97974ae:core.Destroy.Core", scope: null, file: !4, line: 14, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !70) +// CHECK:STDOUT: !68 = !DILocalVariable(arg: 1, scope: !67, type: !9) +// CHECK:STDOUT: !69 = !DILocation(line: 14, column: 19, scope: !67) +// CHECK:STDOUT: !70 = !{!68} +// CHECK:STDOUT: !71 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.826ebaace97974ae:core.Destroy.Core", scope: null, file: !4, line: 14, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !74) +// CHECK:STDOUT: !72 = !DILocalVariable(arg: 1, scope: !71, type: !9) +// CHECK:STDOUT: !73 = !DILocation(line: 14, column: 19, scope: !71) +// CHECK:STDOUT: !74 = !{!72} +// CHECK:STDOUT: !75 = distinct !DISubprogram(name: "ReturnNullptr", linkageName: "_CReturnNullptr.Main", scope: null, file: !4, line: 17, type: !15, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !78 = !DILocation(line: 18, column: 10, scope: !75) +// CHECK:STDOUT: !79 = !DILocation(line: 18, column: 3, scope: !75) +// CHECK:STDOUT: !80 = distinct !DISubprogram(name: "ReturnNullptrCopy", linkageName: "_CReturnNullptrCopy.Main", scope: null, file: !4, line: 21, type: !15, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !83 = !DILocation(line: 22, column: 3, scope: !80) +// CHECK:STDOUT: !84 = !DILocation(line: 22, column: 26, scope: !80) +// CHECK:STDOUT: !86 = !DILocation(line: 23, column: 10, scope: !80) +// CHECK:STDOUT: !87 = !DILocation(line: 23, column: 3, scope: !80) +// CHECK:STDOUT: !88 = distinct !DISubprogram(name: "ReturnConvertedNullptrIndirectly", linkageName: "_CReturnConvertedNullptrIndirectly.Main", scope: null, file: !4, line: 26, type: !15, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !91 = !DILocation(line: 27, column: 3, scope: !88) +// CHECK:STDOUT: !92 = !DILocation(line: 27, column: 26, scope: !88) +// CHECK:STDOUT: !94 = !DILocation(line: 28, column: 10, scope: !88) +// CHECK:STDOUT: !95 = !DILocation(line: 28, column: 3, scope: !88) +// CHECK:STDOUT: !96 = distinct !DISubprogram(name: "ReturnConvertedNullptrDirectly", linkageName: "_CReturnConvertedNullptrDirectly.Main", scope: null, file: !4, line: 31, type: !15, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !99 = !DILocation(line: 32, column: 10, scope: !96) +// CHECK:STDOUT: !100 = !DILocation(line: 32, column: 3, scope: !96) +// CHECK:STDOUT: !101 = distinct !DISubprogram(name: "ConvertNullptrConstant", linkageName: "_CConvertNullptrConstant.Main", scope: null, file: !4, line: 35, type: !15, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !104 = !DILocation(line: 36, column: 3, scope: !101) +// CHECK:STDOUT: !105 = !DIFile(filename: "{{.*}}/prelude/types/cpp/nullptr.carbon", directory: "") +// CHECK:STDOUT: !106 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.NullptrT.CppCompat.Core:ImplicitAs.49279a15ecfc119b.Core.84588f41d61dafba", scope: null, file: !105, line: 51, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !113) +// CHECK:STDOUT: !107 = !DILocalVariable(arg: 1, scope: !106, type: !9) +// CHECK:STDOUT: !111 = !DILocation(line: 52, column: 14, scope: !106) +// CHECK:STDOUT: !112 = !DILocation(line: 52, column: 7, scope: !106) +// CHECK:STDOUT: !113 = !{!107} +// CHECK:STDOUT: !114 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.6e9e957697159b53", scope: null, file: !22, line: 30, type: !15, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !118 = !DILocation(line: 31, column: 5, scope: !114) +// CHECK:STDOUT: !119 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !120 = !{!"omnipotent char", !119, i64 0} +// CHECK:STDOUT: !121 = !{!"std::nullptr_t", !120, i64 0} +// CHECK:STDOUT: !122 = !{!"any pointer", !120, i64 0} +// CHECK:STDOUT: !123 = !{!"p1 std::nullptr_t", !122, i64 0} +// CHECK:STDOUT: !124 = !{!123, !123, i64 0} +// CHECK:STDOUT: !125 = !{!121, !121, i64 0} +// CHECK:STDOUT: !126 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !127 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !128 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !129 = !{!"int", !120, i64 0} +// CHECK:STDOUT: !130 = !{!"__libc_errno", !129, i64 0} +// CHECK:STDOUT: !131 = !{!130, !129, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/pointer.carbon b/toolchain/lower/testdata/interop/cpp/pointer.carbon index f80835f3029c..f546129f9bf1 100644 --- a/toolchain/lower/testdata/interop/cpp/pointer.carbon +++ b/toolchain/lower/testdata/interop/cpp/pointer.carbon @@ -215,87 +215,114 @@ fn Convert() { // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassPtr.Main(ptr %_) #0 !dbg !48 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.51fa064adaeb8681:core.Destroy.Core"(ptr %self) #0 !dbg !49 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !51 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassNonnullPtr.Main(ptr %p) #0 !dbg !53 { +// CHECK:STDOUT: define void @_CPassPtr.Main(ptr %_) #0 !dbg !53 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc22_23.2.temp = alloca ptr, align 8, !dbg !56 -// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.75a9143bcbb84fa5"(ptr %p), !dbg !56 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc22_23.2.temp), !dbg !56 -// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc22_23.2.temp, align 8, !dbg !56 -// CHECK:STDOUT: %.loc22_23.4 = load ptr, ptr %.loc22_23.2.temp, align 8, !dbg !56 -// CHECK:STDOUT: call void @_Z15TakeNullablePtrP9NullableC(ptr %.loc22_23.4), !dbg !59 -// CHECK:STDOUT: call void @"_COp.574ea10b2e6709a0:core.Destroy.Core"(ptr %.loc22_23.2.temp), !dbg !56 -// CHECK:STDOUT: ret void, !dbg !60 +// CHECK:STDOUT: ret void, !dbg !56 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CPassNonnullPtr.Main(ptr %p) #0 !dbg !58 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %.loc22_23.2.temp = alloca ptr, align 8, !dbg !61 +// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.75a9143bcbb84fa5"(ptr %p), !dbg !61 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc22_23.2.temp), !dbg !61 +// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc22_23.2.temp, align 8, !dbg !61 +// CHECK:STDOUT: %.loc22_23.4 = load ptr, ptr %.loc22_23.2.temp, align 8, !dbg !61 +// CHECK:STDOUT: call void @_Z15TakeNullablePtrP9NullableC(ptr %.loc22_23.4), !dbg !64 +// CHECK:STDOUT: call void @"_CSelfDestruct.574ea10b2e6709a0:core.Destroy.Core"(ptr %.loc22_23.2.temp), !dbg !61 +// CHECK:STDOUT: ret void, !dbg !65 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z15TakeNullablePtrP9NullableC(ptr noundef) #1 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.6789a803c53632c0:core.Destroy.Core"(ptr %self) #0 !dbg !62 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.6789a803c53632c0:core.Destroy.Core"(ptr %self) #0 !dbg !67 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !64 +// CHECK:STDOUT: ret void, !dbg !69 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.d2847b010e2ea8b6:core.Destroy.Core"(ptr %self) #0 !dbg !66 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6789a803c53632c0:core.Destroy.Core"(ptr %self) #0 !dbg !71 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !68 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.6789a803c53632c0:core.Destroy.Core"(ptr %self), !dbg !73 +// CHECK:STDOUT: ret void, !dbg !73 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.574ea10b2e6709a0:core.Destroy.Core"(ptr %self) #0 !dbg !70 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.5cf0c9a25f98a429:core.Destroy.Core"(ptr %self) #0 !dbg !75 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !72 +// CHECK:STDOUT: ret void, !dbg !77 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define ptr @_CReturnPtr.Main() #0 !dbg !74 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.5cf0c9a25f98a429:core.Destroy.Core"(ptr %self) #0 !dbg !79 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %ReturnNullablePtr.call = call ptr @_Z17ReturnNullablePtrv(), !dbg !77 -// CHECK:STDOUT: ret ptr %ReturnNullablePtr.call, !dbg !78 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.5cf0c9a25f98a429:core.Destroy.Core"(ptr %self), !dbg !81 +// CHECK:STDOUT: ret void, !dbg !81 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.574ea10b2e6709a0:core.Destroy.Core"(ptr %self) #0 !dbg !83 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !85 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.574ea10b2e6709a0:core.Destroy.Core"(ptr %self) #0 !dbg !87 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.574ea10b2e6709a0:core.Destroy.Core"(ptr %self), !dbg !89 +// CHECK:STDOUT: ret void, !dbg !89 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define ptr @_CReturnPtr.Main() #0 !dbg !91 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %ReturnNullablePtr.call = call ptr @_Z17ReturnNullablePtrv(), !dbg !94 +// CHECK:STDOUT: ret ptr %ReturnNullablePtr.call, !dbg !95 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare noundef ptr @_Z17ReturnNullablePtrv() #1 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassPtrWithThunk.Main(ptr %_) #0 !dbg !79 { +// CHECK:STDOUT: define void @_CPassPtrWithThunk.Main(ptr %_) #0 !dbg !96 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !82 +// CHECK:STDOUT: ret void, !dbg !99 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassNonnullPtrWithThunk.Main(ptr %p) #0 !dbg !84 { +// CHECK:STDOUT: define void @_CPassNonnullPtrWithThunk.Main(ptr %p) #0 !dbg !101 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc35_32.2.temp = alloca ptr, align 8, !dbg !87 -// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.75a9143bcbb84fa5"(ptr %p), !dbg !87 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc35_32.2.temp), !dbg !87 -// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc35_32.2.temp, align 8, !dbg !87 -// CHECK:STDOUT: %.loc35_32.4 = load ptr, ptr %.loc35_32.2.temp, align 8, !dbg !87 -// CHECK:STDOUT: call void @_Z24TakeNullablePtrWithThunkP9NullableCi.carbon_thunk._(ptr %.loc35_32.4), !dbg !88 -// CHECK:STDOUT: call void @"_COp.574ea10b2e6709a0:core.Destroy.Core"(ptr %.loc35_32.2.temp), !dbg !87 -// CHECK:STDOUT: ret void, !dbg !89 +// CHECK:STDOUT: %.loc35_32.2.temp = alloca ptr, align 8, !dbg !104 +// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.75a9143bcbb84fa5"(ptr %p), !dbg !104 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc35_32.2.temp), !dbg !104 +// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc35_32.2.temp, align 8, !dbg !104 +// CHECK:STDOUT: %.loc35_32.4 = load ptr, ptr %.loc35_32.2.temp, align 8, !dbg !104 +// CHECK:STDOUT: call void @_Z24TakeNullablePtrWithThunkP9NullableCi.carbon_thunk._(ptr %.loc35_32.4), !dbg !105 +// CHECK:STDOUT: call void @"_CSelfDestruct.574ea10b2e6709a0:core.Destroy.Core"(ptr %.loc35_32.2.temp), !dbg !104 +// CHECK:STDOUT: ret void, !dbg !106 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define internal void @_Z24TakeNullablePtrWithThunkP9NullableCi.carbon_thunk._(ptr noundef %0) #2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !136 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !136 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !152 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !152 // CHECK:STDOUT: call void @_Z24TakeNullablePtrWithThunkP9NullableCi(ptr noundef %1, i32 noundef 0) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define ptr @_CReturnPtrWithThunk.Main() #0 !dbg !91 { +// CHECK:STDOUT: define ptr @_CReturnPtrWithThunk.Main() #0 !dbg !108 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %ReturnNullablePtrWithThunk__carbon_thunk.call = call ptr @_Z26ReturnNullablePtrWithThunki.carbon_thunk.(), !dbg !94 -// CHECK:STDOUT: ret ptr %ReturnNullablePtrWithThunk__carbon_thunk.call, !dbg !95 +// CHECK:STDOUT: %ReturnNullablePtrWithThunk__carbon_thunk.call = call ptr @_Z26ReturnNullablePtrWithThunki.carbon_thunk.(), !dbg !111 +// CHECK:STDOUT: ret ptr %ReturnNullablePtrWithThunk__carbon_thunk.call, !dbg !112 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -306,35 +333,35 @@ fn Convert() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.75a9143bcbb84fa5"(ptr %self) #0 !dbg !97 { -// CHECK:STDOUT: %1 = call ptr @"_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.e83c25d1d2fd22c2"(ptr %self), !dbg !102 -// CHECK:STDOUT: ret ptr %1, !dbg !103 +// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.75a9143bcbb84fa5"(ptr %self) #0 !dbg !113 { +// CHECK:STDOUT: %1 = call ptr @"_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.e83c25d1d2fd22c2"(ptr %self), !dbg !118 +// CHECK:STDOUT: ret ptr %1, !dbg !119 // 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)) #3 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.e83c25d1d2fd22c2"(ptr %self) #0 !dbg !105 { -// CHECK:STDOUT: %1 = call ptr @_CSome.Optional.Core.e83c25d1d2fd22c2(ptr %self), !dbg !111 -// CHECK:STDOUT: ret ptr %1, !dbg !112 +// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.e83c25d1d2fd22c2"(ptr %self) #0 !dbg !121 { +// CHECK:STDOUT: %1 = call ptr @_CSome.Optional.Core.e83c25d1d2fd22c2(ptr %self), !dbg !127 +// CHECK:STDOUT: ret ptr %1, !dbg !128 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CSome.Optional.Core.e83c25d1d2fd22c2(ptr %value) #0 !dbg !114 { -// CHECK:STDOUT: %1 = call ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.77dd513e5db6ef8d"(ptr %value), !dbg !119 -// CHECK:STDOUT: ret ptr %1, !dbg !120 +// CHECK:STDOUT: define linkonce_odr ptr @_CSome.Optional.Core.e83c25d1d2fd22c2(ptr %value) #0 !dbg !130 { +// CHECK:STDOUT: %1 = call ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.77dd513e5db6ef8d"(ptr %value), !dbg !135 +// CHECK:STDOUT: ret ptr %1, !dbg !136 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.77dd513e5db6ef8d"(ptr %self) #0 !dbg !122 { -// CHECK:STDOUT: %1 = alloca ptr, align 8, !dbg !127 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !127 -// CHECK:STDOUT: store ptr poison, ptr %1, align 8, !dbg !127 -// CHECK:STDOUT: store ptr %self, ptr %1, align 8, !dbg !131 -// CHECK:STDOUT: %2 = load ptr, ptr %1, align 8, !dbg !129 -// CHECK:STDOUT: call void @"_COp.d2847b010e2ea8b6:core.Destroy.Core"(ptr %1), !dbg !127 -// CHECK:STDOUT: ret ptr %2, !dbg !133 +// CHECK:STDOUT: define linkonce_odr ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.77dd513e5db6ef8d"(ptr %self) #0 !dbg !138 { +// CHECK:STDOUT: %1 = alloca ptr, align 8, !dbg !143 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !143 +// CHECK:STDOUT: store ptr poison, ptr %1, align 8, !dbg !143 +// CHECK:STDOUT: store ptr %self, ptr %1, align 8, !dbg !147 +// CHECK:STDOUT: %2 = load ptr, ptr %1, align 8, !dbg !145 +// CHECK:STDOUT: call void @"_CSelfDestruct.5cf0c9a25f98a429:core.Destroy.Core"(ptr %1), !dbg !143 +// CHECK:STDOUT: ret ptr %2, !dbg !149 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z24TakeNullablePtrWithThunkP9NullableCi(ptr noundef, i32 noundef) #1 @@ -372,71 +399,87 @@ fn Convert() { // CHECK:STDOUT: !45 = !{!44, !43, i64 0} // CHECK:STDOUT: !46 = !DIFile(filename: "nullable.carbon", directory: "") // CHECK:STDOUT: !47 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !46, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "PassPtr", linkageName: "_CPassPtr.Main", scope: null, file: !46, line: 14, type: !8, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !52) -// CHECK:STDOUT: !49 = !DILocalVariable(arg: 1, scope: !48, type: !6) -// CHECK:STDOUT: !51 = !DILocation(line: 14, column: 1, scope: !48) -// CHECK:STDOUT: !52 = !{!49} -// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "PassNonnullPtr", linkageName: "_CPassNonnullPtr.Main", scope: null, file: !46, line: 19, type: !8, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !61) +// CHECK:STDOUT: !48 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") +// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.51fa064adaeb8681:core.Destroy.Core", scope: null, file: !48, line: 164, type: !8, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !52) +// CHECK:STDOUT: !50 = !DILocalVariable(arg: 1, scope: !49, type: !6) +// CHECK:STDOUT: !51 = !DILocation(line: 164, column: 19, scope: !49) +// CHECK:STDOUT: !52 = !{!50} +// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "PassPtr", linkageName: "_CPassPtr.Main", scope: null, file: !46, line: 14, type: !8, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !57) // CHECK:STDOUT: !54 = !DILocalVariable(arg: 1, scope: !53, type: !6) -// CHECK:STDOUT: !56 = !DILocation(line: 22, column: 23, scope: !53) -// CHECK:STDOUT: !57 = !{!6, !6} -// CHECK:STDOUT: !58 = !DISubroutineType(types: !57) -// CHECK:STDOUT: !59 = !DILocation(line: 22, column: 3, scope: !53) -// CHECK:STDOUT: !60 = !DILocation(line: 19, column: 1, scope: !53) -// CHECK:STDOUT: !61 = !{!54} -// CHECK:STDOUT: !62 = distinct !DISubprogram(name: "Op", linkageName: "_COp.6789a803c53632c0:core.Destroy.Core", scope: null, file: !46, line: 22, type: !8, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !65) -// CHECK:STDOUT: !63 = !DILocalVariable(arg: 1, scope: !62, type: !6) -// CHECK:STDOUT: !64 = !DILocation(line: 22, column: 23, scope: !62) -// CHECK:STDOUT: !65 = !{!63} -// CHECK:STDOUT: !66 = distinct !DISubprogram(name: "Op", linkageName: "_COp.d2847b010e2ea8b6:core.Destroy.Core", scope: null, file: !46, line: 22, type: !8, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !69) -// CHECK:STDOUT: !67 = !DILocalVariable(arg: 1, scope: !66, type: !6) -// CHECK:STDOUT: !68 = !DILocation(line: 22, column: 23, scope: !66) -// CHECK:STDOUT: !69 = !{!67} -// CHECK:STDOUT: !70 = distinct !DISubprogram(name: "Op", linkageName: "_COp.574ea10b2e6709a0:core.Destroy.Core", scope: null, file: !46, line: 22, type: !8, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !73) -// CHECK:STDOUT: !71 = !DILocalVariable(arg: 1, scope: !70, type: !6) -// CHECK:STDOUT: !72 = !DILocation(line: 22, column: 23, scope: !70) -// CHECK:STDOUT: !73 = !{!71} -// CHECK:STDOUT: !74 = distinct !DISubprogram(name: "ReturnPtr", linkageName: "_CReturnPtr.Main", scope: null, file: !46, line: 25, type: !10, spFlags: DISPFlagDefinition, unit: !47) -// CHECK:STDOUT: !77 = !DILocation(line: 26, column: 10, scope: !74) -// CHECK:STDOUT: !78 = !DILocation(line: 26, column: 3, scope: !74) -// CHECK:STDOUT: !79 = distinct !DISubprogram(name: "PassPtrWithThunk", linkageName: "_CPassPtrWithThunk.Main", scope: null, file: !46, line: 29, type: !8, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !83) +// CHECK:STDOUT: !56 = !DILocation(line: 14, column: 1, scope: !53) +// CHECK:STDOUT: !57 = !{!54} +// CHECK:STDOUT: !58 = distinct !DISubprogram(name: "PassNonnullPtr", linkageName: "_CPassNonnullPtr.Main", scope: null, file: !46, line: 19, type: !8, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !66) +// CHECK:STDOUT: !59 = !DILocalVariable(arg: 1, scope: !58, type: !6) +// CHECK:STDOUT: !61 = !DILocation(line: 22, column: 23, scope: !58) +// CHECK:STDOUT: !62 = !{!6, !6} +// CHECK:STDOUT: !63 = !DISubroutineType(types: !62) +// CHECK:STDOUT: !64 = !DILocation(line: 22, column: 3, scope: !58) +// CHECK:STDOUT: !65 = !DILocation(line: 19, column: 1, scope: !58) +// CHECK:STDOUT: !66 = !{!59} +// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.6789a803c53632c0:core.Destroy.Core", scope: null, file: !46, line: 22, type: !8, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !70) +// CHECK:STDOUT: !68 = !DILocalVariable(arg: 1, scope: !67, type: !6) +// CHECK:STDOUT: !69 = !DILocation(line: 22, column: 23, scope: !67) +// CHECK:STDOUT: !70 = !{!68} +// CHECK:STDOUT: !71 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6789a803c53632c0:core.Destroy.Core", scope: null, file: !46, line: 22, type: !8, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !74) +// CHECK:STDOUT: !72 = !DILocalVariable(arg: 1, scope: !71, type: !6) +// CHECK:STDOUT: !73 = !DILocation(line: 22, column: 23, scope: !71) +// CHECK:STDOUT: !74 = !{!72} +// CHECK:STDOUT: !75 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.5cf0c9a25f98a429:core.Destroy.Core", scope: null, file: !46, line: 22, type: !8, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !78) +// CHECK:STDOUT: !76 = !DILocalVariable(arg: 1, scope: !75, type: !6) +// CHECK:STDOUT: !77 = !DILocation(line: 22, column: 23, scope: !75) +// CHECK:STDOUT: !78 = !{!76} +// CHECK:STDOUT: !79 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.5cf0c9a25f98a429:core.Destroy.Core", scope: null, file: !46, line: 22, type: !8, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !82) // CHECK:STDOUT: !80 = !DILocalVariable(arg: 1, scope: !79, type: !6) -// CHECK:STDOUT: !82 = !DILocation(line: 29, column: 1, scope: !79) -// CHECK:STDOUT: !83 = !{!80} -// CHECK:STDOUT: !84 = distinct !DISubprogram(name: "PassNonnullPtrWithThunk", linkageName: "_CPassNonnullPtrWithThunk.Main", scope: null, file: !46, line: 34, type: !8, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !90) -// CHECK:STDOUT: !85 = !DILocalVariable(arg: 1, scope: !84, type: !6) -// CHECK:STDOUT: !87 = !DILocation(line: 35, column: 32, scope: !84) -// CHECK:STDOUT: !88 = !DILocation(line: 35, column: 3, scope: !84) -// CHECK:STDOUT: !89 = !DILocation(line: 34, column: 1, scope: !84) -// CHECK:STDOUT: !90 = !{!85} -// CHECK:STDOUT: !91 = distinct !DISubprogram(name: "ReturnPtrWithThunk", linkageName: "_CReturnPtrWithThunk.Main", scope: null, file: !46, line: 38, type: !10, spFlags: DISPFlagDefinition, unit: !47) -// CHECK:STDOUT: !94 = !DILocation(line: 39, column: 10, scope: !91) -// CHECK:STDOUT: !95 = !DILocation(line: 39, column: 3, scope: !91) -// CHECK:STDOUT: !96 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") -// CHECK:STDOUT: !97 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.75a9143bcbb84fa5", scope: null, file: !96, line: 105, type: !58, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !104) -// CHECK:STDOUT: !98 = !DILocalVariable(arg: 1, scope: !97, type: !6) -// CHECK:STDOUT: !102 = !DILocation(line: 106, column: 12, scope: !97) -// CHECK:STDOUT: !103 = !DILocation(line: 106, column: 5, scope: !97) -// CHECK:STDOUT: !104 = !{!98} -// CHECK:STDOUT: !105 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.e83c25d1d2fd22c2", scope: null, file: !96, line: 80, type: !58, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !113) -// CHECK:STDOUT: !106 = !DILocalVariable(arg: 1, scope: !105, type: !6) -// CHECK:STDOUT: !111 = !DILocation(line: 81, column: 12, scope: !105) -// CHECK:STDOUT: !112 = !DILocation(line: 81, column: 5, scope: !105) -// CHECK:STDOUT: !113 = !{!106} -// CHECK:STDOUT: !114 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.e83c25d1d2fd22c2", scope: null, file: !96, line: 33, type: !58, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !121) -// CHECK:STDOUT: !115 = !DILocalVariable(arg: 1, scope: !114, type: !6) -// CHECK:STDOUT: !119 = !DILocation(line: 34, column: 12, scope: !114) -// CHECK:STDOUT: !120 = !DILocation(line: 34, column: 5, scope: !114) -// CHECK:STDOUT: !121 = !{!115} -// CHECK:STDOUT: !122 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.e8f8f92d3d08d149:OptionalStorage.Core.77dd513e5db6ef8d", scope: null, file: !96, line: 166, type: !58, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !134) -// CHECK:STDOUT: !123 = !DILocalVariable(arg: 1, scope: !122, type: !6) -// CHECK:STDOUT: !127 = !DILocation(line: 167, column: 14, scope: !122) -// CHECK:STDOUT: !129 = !DILocation(line: 167, column: 18, scope: !122) -// CHECK:STDOUT: !131 = !DILocation(line: 169, column: 5, scope: !122) -// CHECK:STDOUT: !133 = !DILocation(line: 170, column: 5, scope: !122) -// CHECK:STDOUT: !134 = !{!123} -// CHECK:STDOUT: !135 = !{!"p1 _ZTS9NullableC", !37, i64 0} -// CHECK:STDOUT: !136 = !{!135, !135, i64 0} +// CHECK:STDOUT: !81 = !DILocation(line: 22, column: 23, scope: !79) +// CHECK:STDOUT: !82 = !{!80} +// CHECK:STDOUT: !83 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.574ea10b2e6709a0:core.Destroy.Core", scope: null, file: !46, line: 22, type: !8, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !86) +// CHECK:STDOUT: !84 = !DILocalVariable(arg: 1, scope: !83, type: !6) +// CHECK:STDOUT: !85 = !DILocation(line: 22, column: 23, scope: !83) +// CHECK:STDOUT: !86 = !{!84} +// CHECK:STDOUT: !87 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.574ea10b2e6709a0:core.Destroy.Core", scope: null, file: !46, line: 22, type: !8, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !90) +// CHECK:STDOUT: !88 = !DILocalVariable(arg: 1, scope: !87, type: !6) +// CHECK:STDOUT: !89 = !DILocation(line: 22, column: 23, scope: !87) +// CHECK:STDOUT: !90 = !{!88} +// CHECK:STDOUT: !91 = distinct !DISubprogram(name: "ReturnPtr", linkageName: "_CReturnPtr.Main", scope: null, file: !46, line: 25, type: !10, spFlags: DISPFlagDefinition, unit: !47) +// CHECK:STDOUT: !94 = !DILocation(line: 26, column: 10, scope: !91) +// CHECK:STDOUT: !95 = !DILocation(line: 26, column: 3, scope: !91) +// CHECK:STDOUT: !96 = distinct !DISubprogram(name: "PassPtrWithThunk", linkageName: "_CPassPtrWithThunk.Main", scope: null, file: !46, line: 29, type: !8, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !100) +// CHECK:STDOUT: !97 = !DILocalVariable(arg: 1, scope: !96, type: !6) +// CHECK:STDOUT: !99 = !DILocation(line: 29, column: 1, scope: !96) +// CHECK:STDOUT: !100 = !{!97} +// CHECK:STDOUT: !101 = distinct !DISubprogram(name: "PassNonnullPtrWithThunk", linkageName: "_CPassNonnullPtrWithThunk.Main", scope: null, file: !46, line: 34, type: !8, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !107) +// CHECK:STDOUT: !102 = !DILocalVariable(arg: 1, scope: !101, type: !6) +// CHECK:STDOUT: !104 = !DILocation(line: 35, column: 32, scope: !101) +// CHECK:STDOUT: !105 = !DILocation(line: 35, column: 3, scope: !101) +// CHECK:STDOUT: !106 = !DILocation(line: 34, column: 1, scope: !101) +// CHECK:STDOUT: !107 = !{!102} +// CHECK:STDOUT: !108 = distinct !DISubprogram(name: "ReturnPtrWithThunk", linkageName: "_CReturnPtrWithThunk.Main", scope: null, file: !46, line: 38, type: !10, spFlags: DISPFlagDefinition, unit: !47) +// CHECK:STDOUT: !111 = !DILocation(line: 39, column: 10, scope: !108) +// CHECK:STDOUT: !112 = !DILocation(line: 39, column: 3, scope: !108) +// CHECK:STDOUT: !113 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.75a9143bcbb84fa5", scope: null, file: !48, line: 105, type: !63, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !120) +// CHECK:STDOUT: !114 = !DILocalVariable(arg: 1, scope: !113, type: !6) +// CHECK:STDOUT: !118 = !DILocation(line: 106, column: 12, scope: !113) +// CHECK:STDOUT: !119 = !DILocation(line: 106, column: 5, scope: !113) +// CHECK:STDOUT: !120 = !{!114} +// CHECK:STDOUT: !121 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.e83c25d1d2fd22c2", scope: null, file: !48, line: 80, type: !63, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !129) +// CHECK:STDOUT: !122 = !DILocalVariable(arg: 1, scope: !121, type: !6) +// CHECK:STDOUT: !127 = !DILocation(line: 81, column: 12, scope: !121) +// CHECK:STDOUT: !128 = !DILocation(line: 81, column: 5, scope: !121) +// CHECK:STDOUT: !129 = !{!122} +// CHECK:STDOUT: !130 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.e83c25d1d2fd22c2", scope: null, file: !48, line: 33, type: !63, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !137) +// CHECK:STDOUT: !131 = !DILocalVariable(arg: 1, scope: !130, type: !6) +// CHECK:STDOUT: !135 = !DILocation(line: 34, column: 12, scope: !130) +// CHECK:STDOUT: !136 = !DILocation(line: 34, column: 5, scope: !130) +// CHECK:STDOUT: !137 = !{!131} +// CHECK:STDOUT: !138 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.e8f8f92d3d08d149:OptionalStorage.Core.77dd513e5db6ef8d", scope: null, file: !48, line: 166, type: !63, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !150) +// CHECK:STDOUT: !139 = !DILocalVariable(arg: 1, scope: !138, type: !6) +// CHECK:STDOUT: !143 = !DILocation(line: 167, column: 14, scope: !138) +// CHECK:STDOUT: !145 = !DILocation(line: 167, column: 18, scope: !138) +// CHECK:STDOUT: !147 = !DILocation(line: 169, column: 5, scope: !138) +// CHECK:STDOUT: !149 = !DILocation(line: 170, column: 5, scope: !138) +// CHECK:STDOUT: !150 = !{!139} +// CHECK:STDOUT: !151 = !{!"p1 _ZTS9NullableC", !37, i64 0} +// CHECK:STDOUT: !152 = !{!151, !151, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'add_const.carbon' @@ -445,140 +488,196 @@ fn Convert() { // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CConvert.Main() #0 !dbg !141 { +// CHECK:STDOUT: define void @_CConvert.Main() #0 !dbg !157 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc11_21.1.temp = alloca ptr, align 8, !dbg !142 -// CHECK:STDOUT: %.loc11_21.5.temp = alloca ptr, align 8, !dbg !142 -// CHECK:STDOUT: %make.call = call ptr @_Z4makev(), !dbg !142 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc11_21.1.temp), !dbg !142 -// CHECK:STDOUT: store ptr %make.call, ptr %.loc11_21.1.temp, align 8, !dbg !142 -// CHECK:STDOUT: %.loc11_21.3 = load ptr, ptr %.loc11_21.1.temp, align 8, !dbg !142 -// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.773fefc3ed9265ca"(ptr %.loc11_21.3), !dbg !142 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc11_21.5.temp), !dbg !142 -// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc11_21.5.temp, align 8, !dbg !142 -// CHECK:STDOUT: %.loc11_21.7 = load ptr, ptr %.loc11_21.5.temp, align 8, !dbg !142 -// CHECK:STDOUT: call void @_Z4takePK6ConstC(ptr %.loc11_21.7), !dbg !143 -// CHECK:STDOUT: call void @"_COp.19661d0961df889d:core.Destroy.Core"(ptr %.loc11_21.5.temp), !dbg !142 -// CHECK:STDOUT: call void @"_COp.78fd6ee82eacbbc3:core.Destroy.Core"(ptr %.loc11_21.1.temp), !dbg !142 -// CHECK:STDOUT: ret void, !dbg !144 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: declare noundef ptr @_Z4makev() #1 -// CHECK:STDOUT: -// CHECK:STDOUT: declare void @_Z4takePK6ConstC(ptr noundef) #1 -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.bdb5ffe218b7af7d:core.Destroy.Core"(ptr %self) #0 !dbg !145 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !147 +// CHECK:STDOUT: %.loc11_21.1.temp = alloca ptr, align 8, !dbg !158 +// CHECK:STDOUT: %.loc11_21.5.temp = alloca ptr, align 8, !dbg !158 +// CHECK:STDOUT: %make.call = call ptr @_Z4makev(), !dbg !158 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc11_21.1.temp), !dbg !158 +// CHECK:STDOUT: store ptr %make.call, ptr %.loc11_21.1.temp, align 8, !dbg !158 +// CHECK:STDOUT: %.loc11_21.3 = load ptr, ptr %.loc11_21.1.temp, align 8, !dbg !158 +// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.7d29ea9e6f62bf96"(ptr %.loc11_21.3), !dbg !158 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc11_21.5.temp), !dbg !158 +// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc11_21.5.temp, align 8, !dbg !158 +// CHECK:STDOUT: %.loc11_21.7 = load ptr, ptr %.loc11_21.5.temp, align 8, !dbg !158 +// CHECK:STDOUT: call void @_Z4takePK6ConstC(ptr %.loc11_21.7), !dbg !159 +// CHECK:STDOUT: call void @"_CSelfDestruct.19661d0961df889d:core.Destroy.Core"(ptr %.loc11_21.5.temp), !dbg !158 +// CHECK:STDOUT: call void @"_CSelfDestruct.78fd6ee82eacbbc3:core.Destroy.Core"(ptr %.loc11_21.1.temp), !dbg !158 +// CHECK:STDOUT: ret void, !dbg !160 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.7865857458566fb7:core.Destroy.Core"(ptr %self) #0 !dbg !149 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !151 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.19661d0961df889d:core.Destroy.Core"(ptr %self) #0 !dbg !153 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !155 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.e3602e7640dfb844:core.Destroy.Core"(ptr %self) #0 !dbg !157 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !159 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.67387c5c416bcd0b:core.Destroy.Core"(ptr %self) #0 !dbg !161 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.23bb4d554c74e0f1:core.Destroy.Core"(ptr %self) #0 !dbg !161 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !163 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: declare noundef ptr @_Z4makev() #1 +// CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.78fd6ee82eacbbc3:core.Destroy.Core"(ptr %self) #0 !dbg !165 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.131ece8d9a7a4272:core.Destroy.Core"(ptr %self) #0 !dbg !165 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !167 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: declare void @_Z4takePK6ConstC(ptr noundef) #1 +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.bdb5ffe218b7af7d:core.Destroy.Core"(ptr %self) #0 !dbg !169 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !171 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.bdb5ffe218b7af7d:core.Destroy.Core"(ptr %self) #0 !dbg !173 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.bdb5ffe218b7af7d:core.Destroy.Core"(ptr %self), !dbg !175 +// CHECK:STDOUT: ret void, !dbg !175 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f914f15dcbbdbae9:core.Destroy.Core"(ptr %self) #0 !dbg !177 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !179 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f914f15dcbbdbae9:core.Destroy.Core"(ptr %self) #0 !dbg !181 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f914f15dcbbdbae9:core.Destroy.Core"(ptr %self), !dbg !183 +// CHECK:STDOUT: ret void, !dbg !183 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.19661d0961df889d:core.Destroy.Core"(ptr %self) #0 !dbg !185 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !187 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.19661d0961df889d:core.Destroy.Core"(ptr %self) #0 !dbg !189 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.19661d0961df889d:core.Destroy.Core"(ptr %self), !dbg !191 +// CHECK:STDOUT: ret void, !dbg !191 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.e3602e7640dfb844:core.Destroy.Core"(ptr %self) #0 !dbg !193 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !195 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.e3602e7640dfb844:core.Destroy.Core"(ptr %self) #0 !dbg !197 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.e3602e7640dfb844:core.Destroy.Core"(ptr %self), !dbg !199 +// CHECK:STDOUT: ret void, !dbg !199 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.bc918cd0012c1190:core.Destroy.Core"(ptr %self) #0 !dbg !201 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !203 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.bc918cd0012c1190:core.Destroy.Core"(ptr %self) #0 !dbg !205 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.bc918cd0012c1190:core.Destroy.Core"(ptr %self), !dbg !207 +// CHECK:STDOUT: ret void, !dbg !207 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.78fd6ee82eacbbc3:core.Destroy.Core"(ptr %self) #0 !dbg !209 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !211 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.78fd6ee82eacbbc3:core.Destroy.Core"(ptr %self) #0 !dbg !213 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.78fd6ee82eacbbc3:core.Destroy.Core"(ptr %self), !dbg !215 +// CHECK:STDOUT: ret void, !dbg !215 +// 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)) #2 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.773fefc3ed9265ca"(ptr %self) #0 !dbg !169 { -// CHECK:STDOUT: %1 = call ptr @"_CConvert.Optional.c661605f12aa337a.Core:OptionalAs.1dac4564233fecd1.Core.9e559524fb018133"(ptr %self), !dbg !174 -// CHECK:STDOUT: ret ptr %1, !dbg !175 +// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.7d29ea9e6f62bf96"(ptr %self) #0 !dbg !217 { +// CHECK:STDOUT: %1 = call ptr @"_CConvert.Optional.c661605f12aa337a.Core:OptionalAs.1dac4564233fecd1.Core.c5881e9a6965c8a5"(ptr %self), !dbg !222 +// CHECK:STDOUT: ret ptr %1, !dbg !223 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.Optional.c661605f12aa337a.Core:OptionalAs.1dac4564233fecd1.Core.9e559524fb018133"(ptr %self) #0 !dbg !177 { -// CHECK:STDOUT: %temp = alloca ptr, align 8, !dbg !184 -// CHECK:STDOUT: %temp1 = alloca ptr, align 8, !dbg !184 -// CHECK:STDOUT: %1 = call i1 @_CHasValue.Optional.Core.0c3518913b4fb338(ptr %self), !dbg !182 -// CHECK:STDOUT: br i1 %1, label %2, label %7, !dbg !183 +// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.Optional.c661605f12aa337a.Core:OptionalAs.1dac4564233fecd1.Core.c5881e9a6965c8a5"(ptr %self) #0 !dbg !225 { +// CHECK:STDOUT: %temp = alloca ptr, align 8, !dbg !232 +// CHECK:STDOUT: %temp1 = alloca ptr, align 8, !dbg !232 +// CHECK:STDOUT: %1 = call i1 @_CHasValue.Optional.Core.0c3518913b4fb338(ptr %self), !dbg !230 +// CHECK:STDOUT: br i1 %1, label %2, label %7, !dbg !231 // CHECK:STDOUT: // CHECK:STDOUT: 2: ; preds = %0 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp), !dbg !184 -// CHECK:STDOUT: %3 = call ptr @_CGet.Optional.Core.0c3518913b4fb338(ptr %self), !dbg !184 -// CHECK:STDOUT: store ptr %3, ptr %temp, align 8, !dbg !184 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp1), !dbg !184 -// CHECK:STDOUT: %4 = load ptr, ptr %temp, align 8, !dbg !184 -// CHECK:STDOUT: store ptr %4, ptr %temp1, align 8, !dbg !184 -// CHECK:STDOUT: %5 = load ptr, ptr %temp1, align 8, !dbg !184 -// CHECK:STDOUT: %6 = call ptr @_CSome.Optional.Core.305e266058820aa4(ptr %5), !dbg !185 -// CHECK:STDOUT: ret ptr %6, !dbg !186 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp), !dbg !232 +// CHECK:STDOUT: %3 = call ptr @_CGet.Optional.Core.0c3518913b4fb338(ptr %self), !dbg !232 +// CHECK:STDOUT: store ptr %3, ptr %temp, align 8, !dbg !232 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp1), !dbg !232 +// CHECK:STDOUT: %4 = load ptr, ptr %temp, align 8, !dbg !232 +// CHECK:STDOUT: store ptr %4, ptr %temp1, align 8, !dbg !232 +// CHECK:STDOUT: %5 = load ptr, ptr %temp1, align 8, !dbg !232 +// CHECK:STDOUT: %6 = call ptr @_CSome.Optional.Core.305e266058820aa4(ptr %5), !dbg !233 +// CHECK:STDOUT: call void @"_CSelfDestruct.131ece8d9a7a4272:core.Destroy.Core"(ptr %temp1), !dbg !232 +// CHECK:STDOUT: call void @"_CSelfDestruct.23bb4d554c74e0f1:core.Destroy.Core"(ptr %temp), !dbg !232 +// CHECK:STDOUT: ret ptr %6, !dbg !234 // CHECK:STDOUT: // CHECK:STDOUT: 7: ; preds = %0 -// CHECK:STDOUT: %8 = call ptr @_CNone.Optional.Core.305e266058820aa4(), !dbg !187 -// CHECK:STDOUT: ret ptr %8, !dbg !188 +// CHECK:STDOUT: %8 = call ptr @_CNone.Optional.Core.305e266058820aa4(), !dbg !235 +// CHECK:STDOUT: ret ptr %8, !dbg !236 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.0c3518913b4fb338(ptr %self) #0 !dbg !190 { -// CHECK:STDOUT: %1 = call i1 @"_CHas.e8f8f92d3d08d149:OptionalStorage.Core.21c65d90918a10a4"(ptr %self), !dbg !196 -// CHECK:STDOUT: ret i1 %1, !dbg !197 +// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.0c3518913b4fb338(ptr %self) #0 !dbg !238 { +// CHECK:STDOUT: %1 = call i1 @"_CHas.e8f8f92d3d08d149:OptionalStorage.Core.21c65d90918a10a4"(ptr %self), !dbg !244 +// CHECK:STDOUT: ret i1 %1, !dbg !245 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CGet.Optional.Core.0c3518913b4fb338(ptr %self) #0 !dbg !199 { -// CHECK:STDOUT: %1 = call ptr @"_CGet.e8f8f92d3d08d149:OptionalStorage.Core.21c65d90918a10a4"(ptr %self), !dbg !205 -// CHECK:STDOUT: ret ptr %1, !dbg !206 +// CHECK:STDOUT: define linkonce_odr ptr @_CGet.Optional.Core.0c3518913b4fb338(ptr %self) #0 !dbg !247 { +// CHECK:STDOUT: %1 = call ptr @"_CGet.e8f8f92d3d08d149:OptionalStorage.Core.21c65d90918a10a4"(ptr %self), !dbg !253 +// CHECK:STDOUT: ret ptr %1, !dbg !254 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CSome.Optional.Core.305e266058820aa4(ptr %value) #0 !dbg !208 { -// CHECK:STDOUT: %1 = call ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.35c29317da7de352"(ptr %value), !dbg !213 -// CHECK:STDOUT: ret ptr %1, !dbg !214 +// CHECK:STDOUT: define linkonce_odr ptr @_CSome.Optional.Core.305e266058820aa4(ptr %value) #0 !dbg !256 { +// CHECK:STDOUT: %1 = call ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.35c29317da7de352"(ptr %value), !dbg !261 +// CHECK:STDOUT: ret ptr %1, !dbg !262 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CNone.Optional.Core.305e266058820aa4() #0 !dbg !216 { -// CHECK:STDOUT: ret ptr null, !dbg !220 +// CHECK:STDOUT: define linkonce_odr ptr @_CNone.Optional.Core.305e266058820aa4() #0 !dbg !264 { +// CHECK:STDOUT: ret ptr null, !dbg !268 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @"_CHas.e8f8f92d3d08d149:OptionalStorage.Core.21c65d90918a10a4"(ptr %value) #0 !dbg !221 { -// CHECK:STDOUT: %1 = icmp eq ptr %value, null, !dbg !227 -// CHECK:STDOUT: %2 = xor i1 %1, true, !dbg !228 -// CHECK:STDOUT: ret i1 %2, !dbg !229 +// CHECK:STDOUT: define linkonce_odr i1 @"_CHas.e8f8f92d3d08d149:OptionalStorage.Core.21c65d90918a10a4"(ptr %value) #0 !dbg !269 { +// CHECK:STDOUT: %1 = icmp eq ptr %value, null, !dbg !275 +// CHECK:STDOUT: %2 = xor i1 %1, true, !dbg !276 +// CHECK:STDOUT: ret i1 %2, !dbg !277 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CGet.e8f8f92d3d08d149:OptionalStorage.Core.21c65d90918a10a4"(ptr %value) #0 !dbg !231 { -// CHECK:STDOUT: ret ptr %value, !dbg !237 +// CHECK:STDOUT: define linkonce_odr ptr @"_CGet.e8f8f92d3d08d149:OptionalStorage.Core.21c65d90918a10a4"(ptr %value) #0 !dbg !279 { +// CHECK:STDOUT: ret ptr %value, !dbg !285 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.35c29317da7de352"(ptr %self) #0 !dbg !239 { -// CHECK:STDOUT: %1 = alloca ptr, align 8, !dbg !244 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !244 -// CHECK:STDOUT: store ptr poison, ptr %1, align 8, !dbg !244 -// CHECK:STDOUT: store ptr %self, ptr %1, align 8, !dbg !248 -// CHECK:STDOUT: %2 = load ptr, ptr %1, align 8, !dbg !246 -// CHECK:STDOUT: call void @"_COp.7865857458566fb7:core.Destroy.Core"(ptr %1), !dbg !244 -// CHECK:STDOUT: ret ptr %2, !dbg !250 +// CHECK:STDOUT: define linkonce_odr ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.35c29317da7de352"(ptr %self) #0 !dbg !287 { +// CHECK:STDOUT: %1 = alloca ptr, align 8, !dbg !292 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !292 +// CHECK:STDOUT: store ptr poison, ptr %1, align 8, !dbg !292 +// CHECK:STDOUT: store ptr %self, ptr %1, align 8, !dbg !296 +// CHECK:STDOUT: %2 = load ptr, ptr %1, align 8, !dbg !294 +// CHECK:STDOUT: call void @"_CSelfDestruct.f914f15dcbbdbae9:core.Destroy.Core"(ptr %1), !dbg !292 +// CHECK:STDOUT: ret ptr %2, !dbg !298 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -588,7 +687,7 @@ fn Convert() { // CHECK:STDOUT: attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } // CHECK:STDOUT: attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!138} +// CHECK:STDOUT: !llvm.dbg.cu = !{!154} // CHECK:STDOUT: !llvm.module.flags = !{!40, !41, !42, !2, !3} // CHECK:STDOUT: !llvm.errno.tbaa = !{!45} // CHECK:STDOUT: @@ -607,88 +706,120 @@ fn Convert() { // CHECK:STDOUT: !43 = !{!"int", !36, i64 0} // CHECK:STDOUT: !44 = !{!"__libc_errno", !43, i64 0} // CHECK:STDOUT: !45 = !{!44, !43, i64 0} -// CHECK:STDOUT: !57 = !{!6, !6} -// CHECK:STDOUT: !58 = !DISubroutineType(types: !57) -// CHECK:STDOUT: !96 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") -// CHECK:STDOUT: !137 = !DIFile(filename: "add_const.carbon", directory: "") -// CHECK:STDOUT: !138 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !137, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !139 = !{null} -// CHECK:STDOUT: !140 = !DISubroutineType(types: !139) -// CHECK:STDOUT: !141 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.Main", scope: null, file: !137, line: 10, type: !140, spFlags: DISPFlagDefinition, unit: !138) -// CHECK:STDOUT: !142 = !DILocation(line: 11, column: 12, scope: !141) -// CHECK:STDOUT: !143 = !DILocation(line: 11, column: 3, scope: !141) -// CHECK:STDOUT: !144 = !DILocation(line: 10, column: 1, scope: !141) -// CHECK:STDOUT: !145 = distinct !DISubprogram(name: "Op", linkageName: "_COp.bdb5ffe218b7af7d:core.Destroy.Core", scope: null, file: !137, line: 11, type: !8, spFlags: DISPFlagDefinition, unit: !138, retainedNodes: !148) -// CHECK:STDOUT: !146 = !DILocalVariable(arg: 1, scope: !145, type: !6) -// CHECK:STDOUT: !147 = !DILocation(line: 11, column: 12, scope: !145) -// CHECK:STDOUT: !148 = !{!146} -// CHECK:STDOUT: !149 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7865857458566fb7:core.Destroy.Core", scope: null, file: !137, line: 11, type: !8, spFlags: DISPFlagDefinition, unit: !138, retainedNodes: !152) -// CHECK:STDOUT: !150 = !DILocalVariable(arg: 1, scope: !149, type: !6) -// CHECK:STDOUT: !151 = !DILocation(line: 11, column: 12, scope: !149) -// CHECK:STDOUT: !152 = !{!150} -// CHECK:STDOUT: !153 = distinct !DISubprogram(name: "Op", linkageName: "_COp.19661d0961df889d:core.Destroy.Core", scope: null, file: !137, line: 11, type: !8, spFlags: DISPFlagDefinition, unit: !138, retainedNodes: !156) -// CHECK:STDOUT: !154 = !DILocalVariable(arg: 1, scope: !153, type: !6) -// CHECK:STDOUT: !155 = !DILocation(line: 11, column: 12, scope: !153) -// CHECK:STDOUT: !156 = !{!154} -// CHECK:STDOUT: !157 = distinct !DISubprogram(name: "Op", linkageName: "_COp.e3602e7640dfb844:core.Destroy.Core", scope: null, file: !137, line: 11, type: !8, spFlags: DISPFlagDefinition, unit: !138, retainedNodes: !160) -// CHECK:STDOUT: !158 = !DILocalVariable(arg: 1, scope: !157, type: !6) -// CHECK:STDOUT: !159 = !DILocation(line: 11, column: 12, scope: !157) -// CHECK:STDOUT: !160 = !{!158} -// CHECK:STDOUT: !161 = distinct !DISubprogram(name: "Op", linkageName: "_COp.67387c5c416bcd0b:core.Destroy.Core", scope: null, file: !137, line: 11, type: !8, spFlags: DISPFlagDefinition, unit: !138, retainedNodes: !164) +// CHECK:STDOUT: !48 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") +// CHECK:STDOUT: !62 = !{!6, !6} +// CHECK:STDOUT: !63 = !DISubroutineType(types: !62) +// CHECK:STDOUT: !153 = !DIFile(filename: "add_const.carbon", directory: "") +// CHECK:STDOUT: !154 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !153, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !155 = !{null} +// CHECK:STDOUT: !156 = !DISubroutineType(types: !155) +// CHECK:STDOUT: !157 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.Main", scope: null, file: !153, line: 10, type: !156, spFlags: DISPFlagDefinition, unit: !154) +// CHECK:STDOUT: !158 = !DILocation(line: 11, column: 12, scope: !157) +// CHECK:STDOUT: !159 = !DILocation(line: 11, column: 3, scope: !157) +// CHECK:STDOUT: !160 = !DILocation(line: 10, column: 1, scope: !157) +// CHECK:STDOUT: !161 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.23bb4d554c74e0f1:core.Destroy.Core", scope: null, file: !48, line: 164, type: !8, spFlags: DISPFlagDefinition, unit: !154, retainedNodes: !164) // CHECK:STDOUT: !162 = !DILocalVariable(arg: 1, scope: !161, type: !6) -// CHECK:STDOUT: !163 = !DILocation(line: 11, column: 12, scope: !161) +// CHECK:STDOUT: !163 = !DILocation(line: 164, column: 19, scope: !161) // CHECK:STDOUT: !164 = !{!162} -// CHECK:STDOUT: !165 = distinct !DISubprogram(name: "Op", linkageName: "_COp.78fd6ee82eacbbc3:core.Destroy.Core", scope: null, file: !137, line: 11, type: !8, spFlags: DISPFlagDefinition, unit: !138, retainedNodes: !168) +// CHECK:STDOUT: !165 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.131ece8d9a7a4272:core.Destroy.Core", scope: null, file: !48, line: 164, type: !8, spFlags: DISPFlagDefinition, unit: !154, retainedNodes: !168) // CHECK:STDOUT: !166 = !DILocalVariable(arg: 1, scope: !165, type: !6) -// CHECK:STDOUT: !167 = !DILocation(line: 11, column: 12, scope: !165) +// CHECK:STDOUT: !167 = !DILocation(line: 164, column: 19, scope: !165) // CHECK:STDOUT: !168 = !{!166} -// CHECK:STDOUT: !169 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.773fefc3ed9265ca", scope: null, file: !96, line: 105, type: !58, spFlags: DISPFlagDefinition, unit: !138, retainedNodes: !176) +// CHECK:STDOUT: !169 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.bdb5ffe218b7af7d:core.Destroy.Core", scope: null, file: !153, line: 11, type: !8, spFlags: DISPFlagDefinition, unit: !154, retainedNodes: !172) // CHECK:STDOUT: !170 = !DILocalVariable(arg: 1, scope: !169, type: !6) -// CHECK:STDOUT: !174 = !DILocation(line: 106, column: 12, scope: !169) -// CHECK:STDOUT: !175 = !DILocation(line: 106, column: 5, scope: !169) -// CHECK:STDOUT: !176 = !{!170} -// CHECK:STDOUT: !177 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.Optional.c661605f12aa337a.Core:OptionalAs.1dac4564233fecd1.Core.9e559524fb018133", scope: null, file: !96, line: 95, type: !58, spFlags: DISPFlagDefinition, unit: !138, retainedNodes: !189) +// CHECK:STDOUT: !171 = !DILocation(line: 11, column: 12, scope: !169) +// CHECK:STDOUT: !172 = !{!170} +// CHECK:STDOUT: !173 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.bdb5ffe218b7af7d:core.Destroy.Core", scope: null, file: !153, line: 11, type: !8, spFlags: DISPFlagDefinition, unit: !154, retainedNodes: !176) +// CHECK:STDOUT: !174 = !DILocalVariable(arg: 1, scope: !173, type: !6) +// CHECK:STDOUT: !175 = !DILocation(line: 11, column: 12, scope: !173) +// CHECK:STDOUT: !176 = !{!174} +// CHECK:STDOUT: !177 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f914f15dcbbdbae9:core.Destroy.Core", scope: null, file: !153, line: 11, type: !8, spFlags: DISPFlagDefinition, unit: !154, retainedNodes: !180) // CHECK:STDOUT: !178 = !DILocalVariable(arg: 1, scope: !177, type: !6) -// CHECK:STDOUT: !182 = !DILocation(line: 96, column: 9, scope: !177) -// CHECK:STDOUT: !183 = !DILocation(line: 96, column: 8, scope: !177) -// CHECK:STDOUT: !184 = !DILocation(line: 97, column: 31, scope: !177) -// CHECK:STDOUT: !185 = !DILocation(line: 97, column: 14, scope: !177) -// CHECK:STDOUT: !186 = !DILocation(line: 97, column: 7, scope: !177) -// CHECK:STDOUT: !187 = !DILocation(line: 99, column: 12, scope: !177) -// CHECK:STDOUT: !188 = !DILocation(line: 99, column: 5, scope: !177) -// CHECK:STDOUT: !189 = !{!178} -// CHECK:STDOUT: !190 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.0c3518913b4fb338", scope: null, file: !96, line: 36, type: !58, spFlags: DISPFlagDefinition, unit: !138, retainedNodes: !198) -// CHECK:STDOUT: !191 = !DILocalVariable(arg: 1, scope: !190, type: !6) -// CHECK:STDOUT: !196 = !DILocation(line: 37, column: 12, scope: !190) -// CHECK:STDOUT: !197 = !DILocation(line: 37, column: 5, scope: !190) -// CHECK:STDOUT: !198 = !{!191} -// CHECK:STDOUT: !199 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.0c3518913b4fb338", scope: null, file: !96, line: 39, type: !58, spFlags: DISPFlagDefinition, unit: !138, retainedNodes: !207) -// CHECK:STDOUT: !200 = !DILocalVariable(arg: 1, scope: !199, type: !6) -// CHECK:STDOUT: !205 = !DILocation(line: 40, column: 12, scope: !199) -// CHECK:STDOUT: !206 = !DILocation(line: 40, column: 5, scope: !199) -// CHECK:STDOUT: !207 = !{!200} -// CHECK:STDOUT: !208 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.305e266058820aa4", scope: null, file: !96, line: 33, type: !58, spFlags: DISPFlagDefinition, unit: !138, retainedNodes: !215) -// CHECK:STDOUT: !209 = !DILocalVariable(arg: 1, scope: !208, type: !6) -// CHECK:STDOUT: !213 = !DILocation(line: 34, column: 12, scope: !208) -// CHECK:STDOUT: !214 = !DILocation(line: 34, column: 5, scope: !208) -// CHECK:STDOUT: !215 = !{!209} -// CHECK:STDOUT: !216 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.305e266058820aa4", scope: null, file: !96, line: 30, type: !10, spFlags: DISPFlagDefinition, unit: !138) -// CHECK:STDOUT: !220 = !DILocation(line: 31, column: 5, scope: !216) -// CHECK:STDOUT: !221 = distinct !DISubprogram(name: "Has", linkageName: "_CHas.e8f8f92d3d08d149:OptionalStorage.Core.21c65d90918a10a4", scope: null, file: !96, line: 172, type: !58, spFlags: DISPFlagDefinition, unit: !138, retainedNodes: !230) -// CHECK:STDOUT: !222 = !DILocalVariable(arg: 1, scope: !221, type: !6) -// CHECK:STDOUT: !227 = !DILocation(line: 173, column: 16, scope: !221) -// CHECK:STDOUT: !228 = !DILocation(line: 173, column: 12, scope: !221) -// CHECK:STDOUT: !229 = !DILocation(line: 173, column: 5, scope: !221) -// CHECK:STDOUT: !230 = !{!222} -// CHECK:STDOUT: !231 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.e8f8f92d3d08d149:OptionalStorage.Core.21c65d90918a10a4", scope: null, file: !96, line: 175, type: !58, spFlags: DISPFlagDefinition, unit: !138, retainedNodes: !238) -// CHECK:STDOUT: !232 = !DILocalVariable(arg: 1, scope: !231, type: !6) -// CHECK:STDOUT: !237 = !DILocation(line: 176, column: 5, scope: !231) -// CHECK:STDOUT: !238 = !{!232} -// CHECK:STDOUT: !239 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.e8f8f92d3d08d149:OptionalStorage.Core.35c29317da7de352", scope: null, file: !96, line: 166, type: !58, spFlags: DISPFlagDefinition, unit: !138, retainedNodes: !251) -// CHECK:STDOUT: !240 = !DILocalVariable(arg: 1, scope: !239, type: !6) -// CHECK:STDOUT: !244 = !DILocation(line: 167, column: 14, scope: !239) -// CHECK:STDOUT: !246 = !DILocation(line: 167, column: 18, scope: !239) -// CHECK:STDOUT: !248 = !DILocation(line: 169, column: 5, scope: !239) -// CHECK:STDOUT: !250 = !DILocation(line: 170, column: 5, scope: !239) -// CHECK:STDOUT: !251 = !{!240} +// CHECK:STDOUT: !179 = !DILocation(line: 11, column: 12, scope: !177) +// CHECK:STDOUT: !180 = !{!178} +// CHECK:STDOUT: !181 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f914f15dcbbdbae9:core.Destroy.Core", scope: null, file: !153, line: 11, type: !8, spFlags: DISPFlagDefinition, unit: !154, retainedNodes: !184) +// CHECK:STDOUT: !182 = !DILocalVariable(arg: 1, scope: !181, type: !6) +// CHECK:STDOUT: !183 = !DILocation(line: 11, column: 12, scope: !181) +// CHECK:STDOUT: !184 = !{!182} +// CHECK:STDOUT: !185 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.19661d0961df889d:core.Destroy.Core", scope: null, file: !153, line: 11, type: !8, spFlags: DISPFlagDefinition, unit: !154, retainedNodes: !188) +// CHECK:STDOUT: !186 = !DILocalVariable(arg: 1, scope: !185, type: !6) +// CHECK:STDOUT: !187 = !DILocation(line: 11, column: 12, scope: !185) +// CHECK:STDOUT: !188 = !{!186} +// CHECK:STDOUT: !189 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.19661d0961df889d:core.Destroy.Core", scope: null, file: !153, line: 11, type: !8, spFlags: DISPFlagDefinition, unit: !154, retainedNodes: !192) +// CHECK:STDOUT: !190 = !DILocalVariable(arg: 1, scope: !189, type: !6) +// CHECK:STDOUT: !191 = !DILocation(line: 11, column: 12, scope: !189) +// CHECK:STDOUT: !192 = !{!190} +// CHECK:STDOUT: !193 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.e3602e7640dfb844:core.Destroy.Core", scope: null, file: !153, line: 11, type: !8, spFlags: DISPFlagDefinition, unit: !154, retainedNodes: !196) +// CHECK:STDOUT: !194 = !DILocalVariable(arg: 1, scope: !193, type: !6) +// CHECK:STDOUT: !195 = !DILocation(line: 11, column: 12, scope: !193) +// CHECK:STDOUT: !196 = !{!194} +// CHECK:STDOUT: !197 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.e3602e7640dfb844:core.Destroy.Core", scope: null, file: !153, line: 11, type: !8, spFlags: DISPFlagDefinition, unit: !154, retainedNodes: !200) +// CHECK:STDOUT: !198 = !DILocalVariable(arg: 1, scope: !197, type: !6) +// CHECK:STDOUT: !199 = !DILocation(line: 11, column: 12, scope: !197) +// CHECK:STDOUT: !200 = !{!198} +// CHECK:STDOUT: !201 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.bc918cd0012c1190:core.Destroy.Core", scope: null, file: !153, line: 11, type: !8, spFlags: DISPFlagDefinition, unit: !154, retainedNodes: !204) +// CHECK:STDOUT: !202 = !DILocalVariable(arg: 1, scope: !201, type: !6) +// CHECK:STDOUT: !203 = !DILocation(line: 11, column: 12, scope: !201) +// CHECK:STDOUT: !204 = !{!202} +// CHECK:STDOUT: !205 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.bc918cd0012c1190:core.Destroy.Core", scope: null, file: !153, line: 11, type: !8, spFlags: DISPFlagDefinition, unit: !154, retainedNodes: !208) +// CHECK:STDOUT: !206 = !DILocalVariable(arg: 1, scope: !205, type: !6) +// CHECK:STDOUT: !207 = !DILocation(line: 11, column: 12, scope: !205) +// CHECK:STDOUT: !208 = !{!206} +// CHECK:STDOUT: !209 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.78fd6ee82eacbbc3:core.Destroy.Core", scope: null, file: !153, line: 11, type: !8, spFlags: DISPFlagDefinition, unit: !154, retainedNodes: !212) +// CHECK:STDOUT: !210 = !DILocalVariable(arg: 1, scope: !209, type: !6) +// CHECK:STDOUT: !211 = !DILocation(line: 11, column: 12, scope: !209) +// CHECK:STDOUT: !212 = !{!210} +// CHECK:STDOUT: !213 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.78fd6ee82eacbbc3:core.Destroy.Core", scope: null, file: !153, line: 11, type: !8, spFlags: DISPFlagDefinition, unit: !154, retainedNodes: !216) +// CHECK:STDOUT: !214 = !DILocalVariable(arg: 1, scope: !213, type: !6) +// CHECK:STDOUT: !215 = !DILocation(line: 11, column: 12, scope: !213) +// CHECK:STDOUT: !216 = !{!214} +// CHECK:STDOUT: !217 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.7d29ea9e6f62bf96", scope: null, file: !48, line: 105, type: !63, spFlags: DISPFlagDefinition, unit: !154, retainedNodes: !224) +// CHECK:STDOUT: !218 = !DILocalVariable(arg: 1, scope: !217, type: !6) +// CHECK:STDOUT: !222 = !DILocation(line: 106, column: 12, scope: !217) +// CHECK:STDOUT: !223 = !DILocation(line: 106, column: 5, scope: !217) +// CHECK:STDOUT: !224 = !{!218} +// CHECK:STDOUT: !225 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.Optional.c661605f12aa337a.Core:OptionalAs.1dac4564233fecd1.Core.c5881e9a6965c8a5", scope: null, file: !48, line: 95, type: !63, spFlags: DISPFlagDefinition, unit: !154, retainedNodes: !237) +// CHECK:STDOUT: !226 = !DILocalVariable(arg: 1, scope: !225, type: !6) +// CHECK:STDOUT: !230 = !DILocation(line: 96, column: 9, scope: !225) +// CHECK:STDOUT: !231 = !DILocation(line: 96, column: 8, scope: !225) +// CHECK:STDOUT: !232 = !DILocation(line: 97, column: 31, scope: !225) +// CHECK:STDOUT: !233 = !DILocation(line: 97, column: 14, scope: !225) +// CHECK:STDOUT: !234 = !DILocation(line: 97, column: 7, scope: !225) +// CHECK:STDOUT: !235 = !DILocation(line: 99, column: 12, scope: !225) +// CHECK:STDOUT: !236 = !DILocation(line: 99, column: 5, scope: !225) +// CHECK:STDOUT: !237 = !{!226} +// CHECK:STDOUT: !238 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.0c3518913b4fb338", scope: null, file: !48, line: 36, type: !63, spFlags: DISPFlagDefinition, unit: !154, retainedNodes: !246) +// CHECK:STDOUT: !239 = !DILocalVariable(arg: 1, scope: !238, type: !6) +// CHECK:STDOUT: !244 = !DILocation(line: 37, column: 12, scope: !238) +// CHECK:STDOUT: !245 = !DILocation(line: 37, column: 5, scope: !238) +// CHECK:STDOUT: !246 = !{!239} +// CHECK:STDOUT: !247 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.0c3518913b4fb338", scope: null, file: !48, line: 39, type: !63, spFlags: DISPFlagDefinition, unit: !154, retainedNodes: !255) +// CHECK:STDOUT: !248 = !DILocalVariable(arg: 1, scope: !247, type: !6) +// CHECK:STDOUT: !253 = !DILocation(line: 40, column: 12, scope: !247) +// CHECK:STDOUT: !254 = !DILocation(line: 40, column: 5, scope: !247) +// CHECK:STDOUT: !255 = !{!248} +// CHECK:STDOUT: !256 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.305e266058820aa4", scope: null, file: !48, line: 33, type: !63, spFlags: DISPFlagDefinition, unit: !154, retainedNodes: !263) +// CHECK:STDOUT: !257 = !DILocalVariable(arg: 1, scope: !256, type: !6) +// CHECK:STDOUT: !261 = !DILocation(line: 34, column: 12, scope: !256) +// CHECK:STDOUT: !262 = !DILocation(line: 34, column: 5, scope: !256) +// CHECK:STDOUT: !263 = !{!257} +// CHECK:STDOUT: !264 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.305e266058820aa4", scope: null, file: !48, line: 30, type: !10, spFlags: DISPFlagDefinition, unit: !154) +// CHECK:STDOUT: !268 = !DILocation(line: 31, column: 5, scope: !264) +// CHECK:STDOUT: !269 = distinct !DISubprogram(name: "Has", linkageName: "_CHas.e8f8f92d3d08d149:OptionalStorage.Core.21c65d90918a10a4", scope: null, file: !48, line: 172, type: !63, spFlags: DISPFlagDefinition, unit: !154, retainedNodes: !278) +// CHECK:STDOUT: !270 = !DILocalVariable(arg: 1, scope: !269, type: !6) +// CHECK:STDOUT: !275 = !DILocation(line: 173, column: 16, scope: !269) +// CHECK:STDOUT: !276 = !DILocation(line: 173, column: 12, scope: !269) +// CHECK:STDOUT: !277 = !DILocation(line: 173, column: 5, scope: !269) +// CHECK:STDOUT: !278 = !{!270} +// CHECK:STDOUT: !279 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.e8f8f92d3d08d149:OptionalStorage.Core.21c65d90918a10a4", scope: null, file: !48, line: 175, type: !63, spFlags: DISPFlagDefinition, unit: !154, retainedNodes: !286) +// CHECK:STDOUT: !280 = !DILocalVariable(arg: 1, scope: !279, type: !6) +// CHECK:STDOUT: !285 = !DILocation(line: 176, column: 5, scope: !279) +// CHECK:STDOUT: !286 = !{!280} +// CHECK:STDOUT: !287 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.e8f8f92d3d08d149:OptionalStorage.Core.35c29317da7de352", scope: null, file: !48, line: 166, type: !63, spFlags: DISPFlagDefinition, unit: !154, retainedNodes: !299) +// CHECK:STDOUT: !288 = !DILocalVariable(arg: 1, scope: !287, type: !6) +// CHECK:STDOUT: !292 = !DILocation(line: 167, column: 14, scope: !287) +// CHECK:STDOUT: !294 = !DILocation(line: 167, column: 18, scope: !287) +// CHECK:STDOUT: !296 = !DILocation(line: 169, column: 5, scope: !287) +// CHECK:STDOUT: !298 = !DILocation(line: 170, column: 5, scope: !287) +// CHECK:STDOUT: !299 = !{!288} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/reference.carbon b/toolchain/lower/testdata/interop/cpp/reference.carbon index 0fb13c63f8c1..b6664f37661a 100644 --- a/toolchain/lower/testdata/interop/cpp/reference.carbon +++ b/toolchain/lower/testdata/interop/cpp/reference.carbon @@ -150,6 +150,7 @@ fn GetRefs() { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.1), !dbg !36 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %_.var.1, ptr align 1 @C.val.loc19_20, i64 0, i1 false), !dbg !36 // CHECK:STDOUT: call void @_Z9TakeCRRefO1C.carbon_thunk.v(ptr %_.var.1), !dbg !37 +// CHECK:STDOUT: call void @"_CSelfDestruct.417eccf5eb8addbd:core.Destroy.Core"(ptr %_.var.1), !dbg !36 // CHECK:STDOUT: call void @_Z13TakeConstCRefRK1C.carbon_thunk._(ptr %c.var), !dbg !39 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %n.var), !dbg !40 // CHECK:STDOUT: store i32 poison, ptr %n.var, align 4, !dbg !40 @@ -157,13 +158,14 @@ fn GetRefs() { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.2), !dbg !45 // CHECK:STDOUT: store i32 42, ptr %_.var.2, align 4, !dbg !45 // CHECK:STDOUT: call void @_Z11TakeIntRRefOi.carbon_thunk.v(ptr %_.var.2), !dbg !46 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %_.var.2), !dbg !45 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %_.var.2), !dbg !45 // CHECK:STDOUT: %.loc25_23.1 = load i32, ptr %n.var, align 4, !dbg !47 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc25_23.2.temp), !dbg !47 // CHECK:STDOUT: store i32 %.loc25_23.1, ptr %.loc25_23.2.temp, align 4, !dbg !47 // CHECK:STDOUT: call void @_Z15TakeConstIntRefRKi.carbon_thunk._(ptr %.loc25_23.2.temp), !dbg !48 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %.loc25_23.2.temp), !dbg !47 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %n.var), !dbg !40 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %.loc25_23.2.temp), !dbg !47 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %n.var), !dbg !40 +// CHECK:STDOUT: call void @"_CSelfDestruct.417eccf5eb8addbd:core.Destroy.Core"(ptr %c.var), !dbg !31 // CHECK:STDOUT: ret void, !dbg !49 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -171,8 +173,8 @@ fn GetRefs() { // CHECK:STDOUT: define internal void @_ZN1CC1Ev.carbon_thunk.(ptr noundef %return) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !66 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !66 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !78 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !78 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: @@ -189,18 +191,24 @@ fn GetRefs() { // CHECK:STDOUT: define internal void @_Z9TakeCRRefO1C.carbon_thunk.v(ptr noundef %0) #4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !66 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !66 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !78 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !78 // CHECK:STDOUT: call void @_Z9TakeCRRefO1C(ptr noundef nonnull align 1 dereferenceable(1) %1) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.417eccf5eb8addbd:core.Destroy.Core"(ptr %self) #0 !dbg !53 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !55 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define internal void @_Z13TakeConstCRefRK1C.carbon_thunk._(ptr noundef %0) #4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !66 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !66 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !78 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !78 // CHECK:STDOUT: call void @_Z13TakeConstCRefRK1C(ptr noundef nonnull align 1 dereferenceable(1) %1) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -211,24 +219,37 @@ fn GetRefs() { // CHECK:STDOUT: define internal void @_Z11TakeIntRRefOi.carbon_thunk.v(ptr noundef %0) #4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !70 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !70 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !82 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !82 // CHECK:STDOUT: call void @_Z11TakeIntRRefOi(ptr noundef nonnull align 4 dereferenceable(4) %1) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !53 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !57 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !55 +// CHECK:STDOUT: ret void, !dbg !59 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !61 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !63 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !65 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !67 +// CHECK:STDOUT: ret void, !dbg !67 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define internal void @_Z15TakeConstIntRefRKi.carbon_thunk._(ptr noundef %0) #4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !70 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !70 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !82 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !82 // CHECK:STDOUT: call void @_Z15TakeConstIntRefRKi(ptr noundef nonnull align 4 dereferenceable(4) %1) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -237,9 +258,9 @@ fn GetRefs() { // CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #5 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c"(ptr sret({}) %return) #0 !dbg !57 { -// CHECK:STDOUT: call void @"_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp"(ptr %return), !dbg !60 -// CHECK:STDOUT: ret void, !dbg !61 +// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c"(ptr sret({}) %return) #0 !dbg !69 { +// CHECK:STDOUT: call void @"_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp"(ptr %return), !dbg !72 +// CHECK:STDOUT: ret void, !dbg !73 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -254,7 +275,8 @@ fn GetRefs() { // CHECK:STDOUT: declare void @_Z15TakeConstIntRefRKi(ptr noundef nonnull align 4 dereferenceable(4)) #3 // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives -// CHECK:STDOUT: uselistorder ptr @"_COp.f58524831c37807e:core.Destroy.Core", { 2, 1, 0 } +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.417eccf5eb8addbd:core.Destroy.Core", { 1, 0 } +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core", { 2, 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 4, 3, 2, 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -265,8 +287,8 @@ fn GetRefs() { // CHECK:STDOUT: attributes #5 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!19} -// CHECK:STDOUT: !llvm.module.flags = !{!71, !72, !73, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!75} +// CHECK:STDOUT: !llvm.module.flags = !{!83, !84, !85, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!87} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -277,6 +299,8 @@ fn GetRefs() { // CHECK:STDOUT: !21 = !{null} // CHECK:STDOUT: !22 = !DISubroutineType(types: !21) // CHECK:STDOUT: !23 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !24 = !{null, !23} +// CHECK:STDOUT: !25 = !DISubroutineType(types: !24) // CHECK:STDOUT: !26 = !{!23} // CHECK:STDOUT: !27 = !DISubroutineType(types: !26) // CHECK:STDOUT: !28 = !{null, !20} @@ -296,26 +320,38 @@ fn GetRefs() { // CHECK:STDOUT: !49 = !DILocation(line: 16, column: 1, scope: !30) // CHECK:STDOUT: !50 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp", scope: null, file: !18, line: 5, type: !27, spFlags: DISPFlagDefinition, unit: !19) // CHECK:STDOUT: !52 = !DILocation(line: 5, column: 7, scope: !50) -// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 12, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !56) -// CHECK:STDOUT: !54 = !DILocalVariable(arg: 1, scope: !53, type: !20) -// CHECK:STDOUT: !55 = !DILocation(line: 12, column: 23, scope: !53) +// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.417eccf5eb8addbd:core.Destroy.Core", scope: null, file: !18, line: 8, type: !25, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !56) +// CHECK:STDOUT: !54 = !DILocalVariable(arg: 1, scope: !53, type: !23) +// CHECK:STDOUT: !55 = !DILocation(line: 8, column: 19, scope: !53) // CHECK:STDOUT: !56 = !{!54} -// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c", scope: null, file: !12, line: 9, type: !27, spFlags: DISPFlagDefinition, unit: !19) -// CHECK:STDOUT: !60 = !DILocation(line: 9, column: 28, scope: !57) -// CHECK:STDOUT: !61 = !DILocation(line: 9, column: 21, scope: !57) -// CHECK:STDOUT: !62 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !63 = !{!"omnipotent char", !62, i64 0} -// CHECK:STDOUT: !64 = !{!"any pointer", !63, i64 0} -// CHECK:STDOUT: !65 = !{!"p1 _ZTS1C", !64, i64 0} -// CHECK:STDOUT: !66 = !{!65, !65, i64 0} -// CHECK:STDOUT: !68 = !{!"int", !63, i64 0} -// CHECK:STDOUT: !69 = !{!"p1 int", !64, i64 0} -// CHECK:STDOUT: !70 = !{!69, !69, i64 0} -// CHECK:STDOUT: !71 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !72 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !73 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !74 = !{!"__libc_errno", !68, i64 0} -// CHECK:STDOUT: !75 = !{!74, !68, i64 0} +// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !18, line: 12, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !60) +// CHECK:STDOUT: !58 = !DILocalVariable(arg: 1, scope: !57, type: !20) +// CHECK:STDOUT: !59 = !DILocation(line: 12, column: 23, scope: !57) +// CHECK:STDOUT: !60 = !{!58} +// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 12, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !64) +// CHECK:STDOUT: !62 = !DILocalVariable(arg: 1, scope: !61, type: !20) +// CHECK:STDOUT: !63 = !DILocation(line: 12, column: 23, scope: !61) +// CHECK:STDOUT: !64 = !{!62} +// CHECK:STDOUT: !65 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 12, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !68) +// CHECK:STDOUT: !66 = !DILocalVariable(arg: 1, scope: !65, type: !20) +// CHECK:STDOUT: !67 = !DILocation(line: 12, column: 23, scope: !65) +// CHECK:STDOUT: !68 = !{!66} +// CHECK:STDOUT: !69 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c", scope: null, file: !12, line: 9, type: !27, spFlags: DISPFlagDefinition, unit: !19) +// CHECK:STDOUT: !72 = !DILocation(line: 9, column: 28, scope: !69) +// CHECK:STDOUT: !73 = !DILocation(line: 9, column: 21, scope: !69) +// CHECK:STDOUT: !74 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !75 = !{!"omnipotent char", !74, i64 0} +// CHECK:STDOUT: !76 = !{!"any pointer", !75, i64 0} +// CHECK:STDOUT: !77 = !{!"p1 _ZTS1C", !76, i64 0} +// CHECK:STDOUT: !78 = !{!77, !77, i64 0} +// CHECK:STDOUT: !80 = !{!"int", !75, i64 0} +// CHECK:STDOUT: !81 = !{!"p1 int", !76, i64 0} +// CHECK:STDOUT: !82 = !{!81, !81, i64 0} +// CHECK:STDOUT: !83 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !84 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !85 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !86 = !{!"__libc_errno", !80, i64 0} +// CHECK:STDOUT: !87 = !{!86, !80, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'pass_references_via_thunk.carbon' @@ -329,49 +365,51 @@ fn GetRefs() { // CHECK:STDOUT: @C.val.loc20_20.3 = internal constant {} zeroinitializer // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassRefs.Main() #0 !dbg !78 { +// CHECK:STDOUT: define void @_CPassRefs.Main() #0 !dbg !90 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %c.var = alloca {}, align 1, !dbg !79 -// CHECK:STDOUT: %.loc20_18.2.temp = alloca {}, align 1, !dbg !84 -// CHECK:STDOUT: %n.var = alloca i32, align 4, !dbg !88 -// CHECK:STDOUT: %_.var = alloca i32, align 4, !dbg !93 -// CHECK:STDOUT: %.loc26_23.2.temp = alloca i32, align 4, !dbg !95 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !79 -// CHECK:STDOUT: call void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c"(ptr %c.var), !dbg !79 -// CHECK:STDOUT: call void @_Z8TakeCRefR1C10ForceThunk.carbon_thunk.r(ptr %c.var), !dbg !83 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_18.2.temp), !dbg !84 -// CHECK:STDOUT: call void @_Z9TakeCRRefRK1C10ForceThunk.carbon_thunk._(ptr @C.val.loc20_20.3), !dbg !85 -// CHECK:STDOUT: call void @_Z13TakeConstCRefRK1C10ForceThunk.carbon_thunk._(ptr %c.var), !dbg !87 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %n.var), !dbg !88 -// CHECK:STDOUT: store i32 poison, ptr %n.var, align 4, !dbg !88 -// CHECK:STDOUT: call void @_Z10TakeIntRefRi10ForceThunk.carbon_thunk.r(ptr %n.var), !dbg !92 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !93 -// CHECK:STDOUT: store i32 42, ptr %_.var, align 4, !dbg !93 -// CHECK:STDOUT: call void @_Z11TakeIntRRefOi10ForceThunk.carbon_thunk.v(ptr %_.var), !dbg !94 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %_.var), !dbg !93 -// CHECK:STDOUT: %.loc26_23.1 = load i32, ptr %n.var, align 4, !dbg !95 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc26_23.2.temp), !dbg !95 -// CHECK:STDOUT: store i32 %.loc26_23.1, ptr %.loc26_23.2.temp, align 4, !dbg !95 -// CHECK:STDOUT: call void @_Z15TakeConstIntRefRKi10ForceThunk.carbon_thunk._(ptr %.loc26_23.2.temp), !dbg !96 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %.loc26_23.2.temp), !dbg !95 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %n.var), !dbg !88 -// CHECK:STDOUT: ret void, !dbg !97 +// CHECK:STDOUT: %c.var = alloca {}, align 1, !dbg !91 +// CHECK:STDOUT: %.loc20_18.2.temp = alloca {}, align 1, !dbg !96 +// CHECK:STDOUT: %n.var = alloca i32, align 4, !dbg !100 +// CHECK:STDOUT: %_.var = alloca i32, align 4, !dbg !105 +// CHECK:STDOUT: %.loc26_23.2.temp = alloca i32, align 4, !dbg !107 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !91 +// CHECK:STDOUT: call void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c"(ptr %c.var), !dbg !91 +// CHECK:STDOUT: call void @_Z8TakeCRefR1C10ForceThunk.carbon_thunk.r(ptr %c.var), !dbg !95 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_18.2.temp), !dbg !96 +// CHECK:STDOUT: call void @_Z9TakeCRRefRK1C10ForceThunk.carbon_thunk._(ptr @C.val.loc20_20.3), !dbg !97 +// CHECK:STDOUT: call void @"_CSelfDestruct.417eccf5eb8addbd:core.Destroy.Core"(ptr @C.val), !dbg !96 +// CHECK:STDOUT: call void @_Z13TakeConstCRefRK1C10ForceThunk.carbon_thunk._(ptr %c.var), !dbg !99 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %n.var), !dbg !100 +// CHECK:STDOUT: store i32 poison, ptr %n.var, align 4, !dbg !100 +// CHECK:STDOUT: call void @_Z10TakeIntRefRi10ForceThunk.carbon_thunk.r(ptr %n.var), !dbg !104 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !105 +// CHECK:STDOUT: store i32 42, ptr %_.var, align 4, !dbg !105 +// CHECK:STDOUT: call void @_Z11TakeIntRRefOi10ForceThunk.carbon_thunk.v(ptr %_.var), !dbg !106 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %_.var), !dbg !105 +// CHECK:STDOUT: %.loc26_23.1 = load i32, ptr %n.var, align 4, !dbg !107 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc26_23.2.temp), !dbg !107 +// CHECK:STDOUT: store i32 %.loc26_23.1, ptr %.loc26_23.2.temp, align 4, !dbg !107 +// CHECK:STDOUT: call void @_Z15TakeConstIntRefRKi10ForceThunk.carbon_thunk._(ptr %.loc26_23.2.temp), !dbg !108 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %.loc26_23.2.temp), !dbg !107 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %n.var), !dbg !100 +// CHECK:STDOUT: call void @"_CSelfDestruct.417eccf5eb8addbd:core.Destroy.Core"(ptr %c.var), !dbg !91 +// CHECK:STDOUT: ret void, !dbg !109 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable // CHECK:STDOUT: define internal void @_ZN1CC1Ev.carbon_thunk.(ptr noundef %return) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !66 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !66 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !78 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !78 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp"(ptr sret({}) %return) #2 !dbg !98 { +// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp"(ptr sret({}) %return) #2 !dbg !110 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_ZN1CC1Ev.carbon_thunk.(ptr %return), !dbg !100 -// CHECK:STDOUT: ret void, !dbg !100 +// CHECK:STDOUT: call void @_ZN1CC1Ev.carbon_thunk.(ptr %return), !dbg !112 +// CHECK:STDOUT: ret void, !dbg !112 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -379,8 +417,8 @@ fn GetRefs() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 // CHECK:STDOUT: %agg.tmp = alloca %class.ForceThunk, align 1 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !66 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !66, !nonnull !110 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !78 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !78, !nonnull !134 // CHECK:STDOUT: call void @_Z8TakeCRefR1C10ForceThunk(ptr noundef nonnull align 1 dereferenceable(1) %1) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -390,19 +428,25 @@ fn GetRefs() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 // CHECK:STDOUT: %agg.tmp = alloca %class.ForceThunk, align 1 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !66 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !66 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !78 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !78 // CHECK:STDOUT: call void @_Z9TakeCRRefRK1C10ForceThunk(ptr noundef nonnull align 1 dereferenceable(1) %1) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.417eccf5eb8addbd:core.Destroy.Core"(ptr %self) #0 !dbg !113 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !115 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define internal void @_Z13TakeConstCRefRK1C10ForceThunk.carbon_thunk._(ptr noundef %0) #3 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 // CHECK:STDOUT: %agg.tmp = alloca %class.ForceThunk, align 1 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !66 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !66 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !78 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !78 // CHECK:STDOUT: call void @_Z13TakeConstCRefRK1C10ForceThunk(ptr noundef nonnull align 1 dereferenceable(1) %1) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -412,8 +456,8 @@ fn GetRefs() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 // CHECK:STDOUT: %agg.tmp = alloca %class.ForceThunk, align 1 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !70 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !70, !nonnull !110, !align !112 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !82 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !82, !nonnull !134, !align !136 // CHECK:STDOUT: call void @_Z10TakeIntRefRi10ForceThunk(ptr noundef nonnull align 4 dereferenceable(4) %1) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -423,16 +467,29 @@ fn GetRefs() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 // CHECK:STDOUT: %agg.tmp = alloca %class.ForceThunk, align 1 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !70 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !70 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !82 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !82 // CHECK:STDOUT: call void @_Z11TakeIntRRefOi10ForceThunk(ptr noundef nonnull align 4 dereferenceable(4) %1) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !101 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !117 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !103 +// CHECK:STDOUT: ret void, !dbg !119 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !121 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !123 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !125 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !127 +// CHECK:STDOUT: ret void, !dbg !127 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -440,8 +497,8 @@ fn GetRefs() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 // CHECK:STDOUT: %agg.tmp = alloca %class.ForceThunk, align 1 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !70 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !70 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !82 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !82 // CHECK:STDOUT: call void @_Z15TakeConstIntRefRKi10ForceThunk(ptr noundef nonnull align 4 dereferenceable(4) %1) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -450,9 +507,9 @@ fn GetRefs() { // CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #4 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c"(ptr sret({}) %return) #0 !dbg !105 { -// CHECK:STDOUT: call void @"_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp"(ptr %return), !dbg !108 -// CHECK:STDOUT: ret void, !dbg !109 +// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c"(ptr sret({}) %return) #0 !dbg !129 { +// CHECK:STDOUT: call void @"_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp"(ptr %return), !dbg !132 +// CHECK:STDOUT: ret void, !dbg !133 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z8TakeCRefR1C10ForceThunk(ptr noundef nonnull align 1 dereferenceable(1)) #5 @@ -468,7 +525,8 @@ fn GetRefs() { // CHECK:STDOUT: declare void @_Z15TakeConstIntRefRKi10ForceThunk(ptr noundef nonnull align 4 dereferenceable(4)) #5 // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives -// CHECK:STDOUT: uselistorder ptr @"_COp.f58524831c37807e:core.Destroy.Core", { 2, 1, 0 } +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.417eccf5eb8addbd:core.Destroy.Core", { 1, 0 } +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core", { 2, 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 4, 3, 2, 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -478,9 +536,9 @@ fn GetRefs() { // CHECK:STDOUT: attributes #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: attributes #5 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!77} -// CHECK:STDOUT: !llvm.module.flags = !{!71, !72, !73, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!75} +// CHECK:STDOUT: !llvm.dbg.cu = !{!89} +// CHECK:STDOUT: !llvm.module.flags = !{!83, !84, !85, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!87} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -489,49 +547,63 @@ fn GetRefs() { // CHECK:STDOUT: !21 = !{null} // CHECK:STDOUT: !22 = !DISubroutineType(types: !21) // CHECK:STDOUT: !23 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !24 = !{null, !23} +// CHECK:STDOUT: !25 = !DISubroutineType(types: !24) // CHECK:STDOUT: !26 = !{!23} // CHECK:STDOUT: !27 = !DISubroutineType(types: !26) // CHECK:STDOUT: !28 = !{null, !20} // CHECK:STDOUT: !29 = !DISubroutineType(types: !28) -// CHECK:STDOUT: !62 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !63 = !{!"omnipotent char", !62, i64 0} -// CHECK:STDOUT: !64 = !{!"any pointer", !63, i64 0} -// CHECK:STDOUT: !65 = !{!"p1 _ZTS1C", !64, i64 0} -// CHECK:STDOUT: !66 = !{!65, !65, i64 0} -// CHECK:STDOUT: !68 = !{!"int", !63, i64 0} -// CHECK:STDOUT: !69 = !{!"p1 int", !64, i64 0} -// CHECK:STDOUT: !70 = !{!69, !69, i64 0} -// CHECK:STDOUT: !71 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !72 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !73 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !74 = !{!"__libc_errno", !68, i64 0} -// CHECK:STDOUT: !75 = !{!74, !68, i64 0} -// CHECK:STDOUT: !76 = !DIFile(filename: "pass_references_via_thunk.carbon", directory: "") -// CHECK:STDOUT: !77 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !76, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !78 = distinct !DISubprogram(name: "PassRefs", linkageName: "_CPassRefs.Main", scope: null, file: !76, line: 17, type: !22, spFlags: DISPFlagDefinition, unit: !77) -// CHECK:STDOUT: !79 = !DILocation(line: 18, column: 3, scope: !78) -// CHECK:STDOUT: !83 = !DILocation(line: 19, column: 3, scope: !78) -// CHECK:STDOUT: !84 = !DILocation(line: 20, column: 17, scope: !78) -// CHECK:STDOUT: !85 = !DILocation(line: 20, column: 3, scope: !78) -// CHECK:STDOUT: !87 = !DILocation(line: 21, column: 3, scope: !78) -// CHECK:STDOUT: !88 = !DILocation(line: 23, column: 3, scope: !78) -// CHECK:STDOUT: !92 = !DILocation(line: 24, column: 3, scope: !78) -// CHECK:STDOUT: !93 = !DILocation(line: 13, column: 23, scope: !78) -// CHECK:STDOUT: !94 = !DILocation(line: 25, column: 3, scope: !78) -// CHECK:STDOUT: !95 = !DILocation(line: 26, column: 23, scope: !78) -// CHECK:STDOUT: !96 = !DILocation(line: 26, column: 3, scope: !78) -// CHECK:STDOUT: !97 = !DILocation(line: 17, column: 1, scope: !78) -// CHECK:STDOUT: !98 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp", scope: null, file: !76, line: 5, type: !27, spFlags: DISPFlagDefinition, unit: !77) -// CHECK:STDOUT: !100 = !DILocation(line: 5, column: 7, scope: !98) -// CHECK:STDOUT: !101 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !76, line: 13, type: !29, spFlags: DISPFlagDefinition, unit: !77, retainedNodes: !104) -// CHECK:STDOUT: !102 = !DILocalVariable(arg: 1, scope: !101, type: !20) -// CHECK:STDOUT: !103 = !DILocation(line: 13, column: 23, scope: !101) -// CHECK:STDOUT: !104 = !{!102} -// CHECK:STDOUT: !105 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c", scope: null, file: !12, line: 9, type: !27, spFlags: DISPFlagDefinition, unit: !77) -// CHECK:STDOUT: !108 = !DILocation(line: 9, column: 28, scope: !105) -// CHECK:STDOUT: !109 = !DILocation(line: 9, column: 21, scope: !105) -// CHECK:STDOUT: !110 = !{} -// CHECK:STDOUT: !112 = !{i64 4} +// CHECK:STDOUT: !74 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !75 = !{!"omnipotent char", !74, i64 0} +// CHECK:STDOUT: !76 = !{!"any pointer", !75, i64 0} +// CHECK:STDOUT: !77 = !{!"p1 _ZTS1C", !76, i64 0} +// CHECK:STDOUT: !78 = !{!77, !77, i64 0} +// CHECK:STDOUT: !80 = !{!"int", !75, i64 0} +// CHECK:STDOUT: !81 = !{!"p1 int", !76, i64 0} +// CHECK:STDOUT: !82 = !{!81, !81, i64 0} +// CHECK:STDOUT: !83 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !84 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !85 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !86 = !{!"__libc_errno", !80, i64 0} +// CHECK:STDOUT: !87 = !{!86, !80, i64 0} +// CHECK:STDOUT: !88 = !DIFile(filename: "pass_references_via_thunk.carbon", directory: "") +// CHECK:STDOUT: !89 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !88, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !90 = distinct !DISubprogram(name: "PassRefs", linkageName: "_CPassRefs.Main", scope: null, file: !88, line: 17, type: !22, spFlags: DISPFlagDefinition, unit: !89) +// CHECK:STDOUT: !91 = !DILocation(line: 18, column: 3, scope: !90) +// CHECK:STDOUT: !95 = !DILocation(line: 19, column: 3, scope: !90) +// CHECK:STDOUT: !96 = !DILocation(line: 20, column: 17, scope: !90) +// CHECK:STDOUT: !97 = !DILocation(line: 20, column: 3, scope: !90) +// CHECK:STDOUT: !99 = !DILocation(line: 21, column: 3, scope: !90) +// CHECK:STDOUT: !100 = !DILocation(line: 23, column: 3, scope: !90) +// CHECK:STDOUT: !104 = !DILocation(line: 24, column: 3, scope: !90) +// CHECK:STDOUT: !105 = !DILocation(line: 13, column: 23, scope: !90) +// CHECK:STDOUT: !106 = !DILocation(line: 25, column: 3, scope: !90) +// CHECK:STDOUT: !107 = !DILocation(line: 26, column: 23, scope: !90) +// CHECK:STDOUT: !108 = !DILocation(line: 26, column: 3, scope: !90) +// CHECK:STDOUT: !109 = !DILocation(line: 17, column: 1, scope: !90) +// CHECK:STDOUT: !110 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp", scope: null, file: !88, line: 5, type: !27, spFlags: DISPFlagDefinition, unit: !89) +// CHECK:STDOUT: !112 = !DILocation(line: 5, column: 7, scope: !110) +// CHECK:STDOUT: !113 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.417eccf5eb8addbd:core.Destroy.Core", scope: null, file: !88, line: 20, type: !25, spFlags: DISPFlagDefinition, unit: !89, retainedNodes: !116) +// CHECK:STDOUT: !114 = !DILocalVariable(arg: 1, scope: !113, type: !23) +// CHECK:STDOUT: !115 = !DILocation(line: 20, column: 17, scope: !113) +// CHECK:STDOUT: !116 = !{!114} +// CHECK:STDOUT: !117 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !88, line: 13, type: !29, spFlags: DISPFlagDefinition, unit: !89, retainedNodes: !120) +// CHECK:STDOUT: !118 = !DILocalVariable(arg: 1, scope: !117, type: !20) +// CHECK:STDOUT: !119 = !DILocation(line: 13, column: 23, scope: !117) +// CHECK:STDOUT: !120 = !{!118} +// CHECK:STDOUT: !121 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !88, line: 13, type: !29, spFlags: DISPFlagDefinition, unit: !89, retainedNodes: !124) +// CHECK:STDOUT: !122 = !DILocalVariable(arg: 1, scope: !121, type: !20) +// CHECK:STDOUT: !123 = !DILocation(line: 13, column: 23, scope: !121) +// CHECK:STDOUT: !124 = !{!122} +// CHECK:STDOUT: !125 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !88, line: 13, type: !29, spFlags: DISPFlagDefinition, unit: !89, retainedNodes: !128) +// CHECK:STDOUT: !126 = !DILocalVariable(arg: 1, scope: !125, type: !20) +// CHECK:STDOUT: !127 = !DILocation(line: 13, column: 23, scope: !125) +// CHECK:STDOUT: !128 = !{!126} +// CHECK:STDOUT: !129 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c", scope: null, file: !12, line: 9, type: !27, spFlags: DISPFlagDefinition, unit: !89) +// CHECK:STDOUT: !132 = !DILocation(line: 9, column: 28, scope: !129) +// CHECK:STDOUT: !133 = !DILocation(line: 9, column: 21, scope: !129) +// CHECK:STDOUT: !134 = !{} +// CHECK:STDOUT: !136 = !{i64 4} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'return_references.carbon' @@ -540,15 +612,15 @@ fn GetRefs() { // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CGetRefs.Main() #0 !dbg !115 { +// CHECK:STDOUT: define void @_CGetRefs.Main() #0 !dbg !139 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %ReturnCRef.call = call ptr @_Z10ReturnCRefv(), !dbg !116 -// CHECK:STDOUT: %ReturnCRRef.call = call ptr @_Z11ReturnCRRefv(), !dbg !119 -// CHECK:STDOUT: %ReturnConstCRef.call = call ptr @_Z15ReturnConstCRefv(), !dbg !122 -// CHECK:STDOUT: %ReturnIntRef.call = call ptr @_Z12ReturnIntRefv(), !dbg !125 -// CHECK:STDOUT: %ReturnIntRRef.call = call ptr @_Z13ReturnIntRRefv(), !dbg !128 -// CHECK:STDOUT: %ReturnConstIntRef.call = call ptr @_Z17ReturnConstIntRefv(), !dbg !131 -// CHECK:STDOUT: ret void, !dbg !134 +// CHECK:STDOUT: %ReturnCRef.call = call ptr @_Z10ReturnCRefv(), !dbg !140 +// CHECK:STDOUT: %ReturnCRRef.call = call ptr @_Z11ReturnCRRefv(), !dbg !143 +// CHECK:STDOUT: %ReturnConstCRef.call = call ptr @_Z15ReturnConstCRefv(), !dbg !146 +// CHECK:STDOUT: %ReturnIntRef.call = call ptr @_Z12ReturnIntRefv(), !dbg !149 +// CHECK:STDOUT: %ReturnIntRRef.call = call ptr @_Z13ReturnIntRRefv(), !dbg !152 +// CHECK:STDOUT: %ReturnConstIntRef.call = call ptr @_Z17ReturnConstIntRefv(), !dbg !155 +// CHECK:STDOUT: ret void, !dbg !158 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare noundef nonnull align 1 dereferenceable(1) ptr @_Z10ReturnCRefv() #1 @@ -566,32 +638,32 @@ fn GetRefs() { // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!114} -// CHECK:STDOUT: !llvm.module.flags = !{!71, !72, !73, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!75} +// CHECK:STDOUT: !llvm.dbg.cu = !{!138} +// CHECK:STDOUT: !llvm.module.flags = !{!83, !84, !85, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!87} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !21 = !{null} // CHECK:STDOUT: !22 = !DISubroutineType(types: !21) -// CHECK:STDOUT: !62 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !63 = !{!"omnipotent char", !62, i64 0} -// CHECK:STDOUT: !68 = !{!"int", !63, i64 0} -// CHECK:STDOUT: !71 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !72 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !73 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !74 = !{!"__libc_errno", !68, i64 0} -// CHECK:STDOUT: !75 = !{!74, !68, i64 0} -// CHECK:STDOUT: !113 = !DIFile(filename: "return_references.carbon", directory: "") -// CHECK:STDOUT: !114 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !113, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !115 = distinct !DISubprogram(name: "GetRefs", linkageName: "_CGetRefs.Main", scope: null, file: !113, line: 16, type: !22, spFlags: DISPFlagDefinition, unit: !114) -// CHECK:STDOUT: !116 = !DILocation(line: 17, column: 22, scope: !115) -// CHECK:STDOUT: !119 = !DILocation(line: 18, column: 22, scope: !115) -// CHECK:STDOUT: !122 = !DILocation(line: 19, column: 28, scope: !115) -// CHECK:STDOUT: !125 = !DILocation(line: 21, column: 20, scope: !115) -// CHECK:STDOUT: !128 = !DILocation(line: 22, column: 20, scope: !115) -// CHECK:STDOUT: !131 = !DILocation(line: 23, column: 26, scope: !115) -// CHECK:STDOUT: !134 = !DILocation(line: 16, column: 1, scope: !115) +// CHECK:STDOUT: !74 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !75 = !{!"omnipotent char", !74, i64 0} +// CHECK:STDOUT: !80 = !{!"int", !75, i64 0} +// CHECK:STDOUT: !83 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !84 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !85 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !86 = !{!"__libc_errno", !80, i64 0} +// CHECK:STDOUT: !87 = !{!86, !80, i64 0} +// CHECK:STDOUT: !137 = !DIFile(filename: "return_references.carbon", directory: "") +// CHECK:STDOUT: !138 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !137, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !139 = distinct !DISubprogram(name: "GetRefs", linkageName: "_CGetRefs.Main", scope: null, file: !137, line: 16, type: !22, spFlags: DISPFlagDefinition, unit: !138) +// CHECK:STDOUT: !140 = !DILocation(line: 17, column: 22, scope: !139) +// CHECK:STDOUT: !143 = !DILocation(line: 18, column: 22, scope: !139) +// CHECK:STDOUT: !146 = !DILocation(line: 19, column: 28, scope: !139) +// CHECK:STDOUT: !149 = !DILocation(line: 21, column: 20, scope: !139) +// CHECK:STDOUT: !152 = !DILocation(line: 22, column: 20, scope: !139) +// CHECK:STDOUT: !155 = !DILocation(line: 23, column: 26, scope: !139) +// CHECK:STDOUT: !158 = !DILocation(line: 16, column: 1, scope: !139) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'return_references_via_thunk.carbon' @@ -602,15 +674,15 @@ fn GetRefs() { // CHECK:STDOUT: %class.ForceThunk.23 = type { i8 } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CGetRefs.Main() #0 !dbg !137 { +// CHECK:STDOUT: define void @_CGetRefs.Main() #0 !dbg !161 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %ReturnCRef__carbon_thunk.call = call ptr @_Z10ReturnCRef10ForceThunk.carbon_thunk.(), !dbg !138 -// CHECK:STDOUT: %ReturnCRRef__carbon_thunk.call = call ptr @_Z11ReturnCRRef10ForceThunk.carbon_thunk.(), !dbg !141 -// CHECK:STDOUT: %ReturnConstCRef__carbon_thunk.call = call ptr @_Z15ReturnConstCRef10ForceThunk.carbon_thunk.(), !dbg !144 -// CHECK:STDOUT: %ReturnIntRef__carbon_thunk.call = call ptr @_Z12ReturnIntRef10ForceThunk.carbon_thunk.(), !dbg !147 -// CHECK:STDOUT: %ReturnIntRRef__carbon_thunk.call = call ptr @_Z13ReturnIntRRef10ForceThunk.carbon_thunk.(), !dbg !150 -// CHECK:STDOUT: %ReturnConstIntRef__carbon_thunk.call = call ptr @_Z17ReturnConstIntRef10ForceThunk.carbon_thunk.(), !dbg !153 -// CHECK:STDOUT: ret void, !dbg !156 +// CHECK:STDOUT: %ReturnCRef__carbon_thunk.call = call ptr @_Z10ReturnCRef10ForceThunk.carbon_thunk.(), !dbg !162 +// CHECK:STDOUT: %ReturnCRRef__carbon_thunk.call = call ptr @_Z11ReturnCRRef10ForceThunk.carbon_thunk.(), !dbg !165 +// CHECK:STDOUT: %ReturnConstCRef__carbon_thunk.call = call ptr @_Z15ReturnConstCRef10ForceThunk.carbon_thunk.(), !dbg !168 +// CHECK:STDOUT: %ReturnIntRef__carbon_thunk.call = call ptr @_Z12ReturnIntRef10ForceThunk.carbon_thunk.(), !dbg !171 +// CHECK:STDOUT: %ReturnIntRRef__carbon_thunk.call = call ptr @_Z13ReturnIntRRef10ForceThunk.carbon_thunk.(), !dbg !174 +// CHECK:STDOUT: %ReturnConstIntRef__carbon_thunk.call = call ptr @_Z17ReturnConstIntRef10ForceThunk.carbon_thunk.(), !dbg !177 +// CHECK:STDOUT: ret void, !dbg !180 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -677,30 +749,30 @@ fn GetRefs() { // CHECK:STDOUT: attributes #1 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } // CHECK:STDOUT: attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!136} -// CHECK:STDOUT: !llvm.module.flags = !{!71, !72, !73, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!75} +// CHECK:STDOUT: !llvm.dbg.cu = !{!160} +// CHECK:STDOUT: !llvm.module.flags = !{!83, !84, !85, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!87} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !21 = !{null} // CHECK:STDOUT: !22 = !DISubroutineType(types: !21) -// CHECK:STDOUT: !62 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !63 = !{!"omnipotent char", !62, i64 0} -// CHECK:STDOUT: !68 = !{!"int", !63, i64 0} -// CHECK:STDOUT: !71 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !72 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !73 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !74 = !{!"__libc_errno", !68, i64 0} -// CHECK:STDOUT: !75 = !{!74, !68, i64 0} -// CHECK:STDOUT: !135 = !DIFile(filename: "return_references_via_thunk.carbon", directory: "") -// CHECK:STDOUT: !136 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !135, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !137 = distinct !DISubprogram(name: "GetRefs", linkageName: "_CGetRefs.Main", scope: null, file: !135, line: 17, type: !22, spFlags: DISPFlagDefinition, unit: !136) -// CHECK:STDOUT: !138 = !DILocation(line: 18, column: 22, scope: !137) -// CHECK:STDOUT: !141 = !DILocation(line: 19, column: 22, scope: !137) -// CHECK:STDOUT: !144 = !DILocation(line: 20, column: 28, scope: !137) -// CHECK:STDOUT: !147 = !DILocation(line: 22, column: 20, scope: !137) -// CHECK:STDOUT: !150 = !DILocation(line: 23, column: 20, scope: !137) -// CHECK:STDOUT: !153 = !DILocation(line: 24, column: 26, scope: !137) -// CHECK:STDOUT: !156 = !DILocation(line: 17, column: 1, scope: !137) +// CHECK:STDOUT: !74 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !75 = !{!"omnipotent char", !74, i64 0} +// CHECK:STDOUT: !80 = !{!"int", !75, i64 0} +// CHECK:STDOUT: !83 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !84 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !85 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !86 = !{!"__libc_errno", !80, i64 0} +// CHECK:STDOUT: !87 = !{!86, !80, i64 0} +// CHECK:STDOUT: !159 = !DIFile(filename: "return_references_via_thunk.carbon", directory: "") +// CHECK:STDOUT: !160 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !159, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !161 = distinct !DISubprogram(name: "GetRefs", linkageName: "_CGetRefs.Main", scope: null, file: !159, line: 17, type: !22, spFlags: DISPFlagDefinition, unit: !160) +// CHECK:STDOUT: !162 = !DILocation(line: 18, column: 22, scope: !161) +// CHECK:STDOUT: !165 = !DILocation(line: 19, column: 22, scope: !161) +// CHECK:STDOUT: !168 = !DILocation(line: 20, column: 28, scope: !161) +// CHECK:STDOUT: !171 = !DILocation(line: 22, column: 20, scope: !161) +// CHECK:STDOUT: !174 = !DILocation(line: 23, column: 20, scope: !161) +// CHECK:STDOUT: !177 = !DILocation(line: 24, column: 26, scope: !161) +// CHECK:STDOUT: !180 = !DILocation(line: 17, column: 1, scope: !161) // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/share_ast.carbon b/toolchain/lower/testdata/interop/cpp/share_ast.carbon index 1227f97aff23..8a2ff80195a7 100644 --- a/toolchain/lower/testdata/interop/cpp/share_ast.carbon +++ b/toolchain/lower/testdata/interop/cpp/share_ast.carbon @@ -98,6 +98,7 @@ fn CallGeneric() -> i32 { // CHECK:STDOUT: call void @_Z6make_av.carbon_thunk.(ptr %a.var), !dbg !52 // CHECK:STDOUT: %.loc6_11.1.b = getelementptr inbounds nuw [8 x i8], ptr %a.var, i32 0, i32 4, !dbg !54 // CHECK:STDOUT: %.loc6_11.2 = load i32, ptr %.loc6_11.1.b, align 4, !dbg !54 +// CHECK:STDOUT: call void @"_CSelfDestruct.f2cd4feee22137a3:core.Destroy.Core"(ptr %a.var), !dbg !51 // CHECK:STDOUT: ret i32 %.loc6_11.2, !dbg !55 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -105,13 +106,19 @@ fn CallGeneric() -> i32 { // CHECK:STDOUT: define internal void @_Z6make_av.carbon_thunk.(ptr noundef %return) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !58 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !58 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !62 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !62 // CHECK:STDOUT: %call = call i64 @_Z6make_av() // CHECK:STDOUT: store i64 %call, ptr %0, align 4 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f2cd4feee22137a3:core.Destroy.Core"(ptr %self) #0 !dbg !56 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !58 +// 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)) #2 // CHECK:STDOUT: @@ -120,9 +127,9 @@ fn CallGeneric() -> i32 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %retval = alloca %struct.A, align 4 // CHECK:STDOUT: %a = getelementptr inbounds nuw %struct.A, ptr %retval, i32 0, i32 0 -// CHECK:STDOUT: store i32 1, ptr %a, align 4, !tbaa !60 +// CHECK:STDOUT: store i32 1, ptr %a, align 4, !tbaa !64 // CHECK:STDOUT: %b = getelementptr inbounds nuw %struct.A, ptr %retval, i32 0, i32 1 -// CHECK:STDOUT: store i32 2, ptr %b, align 4, !tbaa !61 +// CHECK:STDOUT: store i32 2, ptr %b, align 4, !tbaa !65 // CHECK:STDOUT: %0 = load i64, ptr %retval, align 4 // CHECK:STDOUT: ret i64 %0 // CHECK:STDOUT: } @@ -151,17 +158,24 @@ fn CallGeneric() -> i32 { // CHECK:STDOUT: !42 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) // CHECK:STDOUT: !43 = !{!42} // CHECK:STDOUT: !44 = !DISubroutineType(types: !43) +// CHECK:STDOUT: !45 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !46 = !{null, !45} +// CHECK:STDOUT: !47 = !DISubroutineType(types: !46) // CHECK:STDOUT: !48 = distinct !DISubprogram(name: "Test", linkageName: "_CTest.Main", scope: null, file: !40, line: 4, type: !44, spFlags: DISPFlagDefinition, unit: !41) // CHECK:STDOUT: !51 = !DILocation(line: 5, column: 3, scope: !48) // CHECK:STDOUT: !52 = !DILocation(line: 5, column: 18, scope: !48) // CHECK:STDOUT: !54 = !DILocation(line: 6, column: 10, scope: !48) // CHECK:STDOUT: !55 = !DILocation(line: 6, column: 3, scope: !48) -// CHECK:STDOUT: !56 = !{!"any pointer", !6, i64 0} -// CHECK:STDOUT: !57 = !{!"p1 _ZTS1A", !56, i64 0} -// CHECK:STDOUT: !58 = !{!57, !57, i64 0} -// CHECK:STDOUT: !59 = !{!"_ZTS1A", !7, i64 0, !7, i64 4} -// CHECK:STDOUT: !60 = !{!59, !7, i64 0} -// CHECK:STDOUT: !61 = !{!59, !7, i64 4} +// CHECK:STDOUT: !56 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f2cd4feee22137a3:core.Destroy.Core", scope: null, file: !40, line: 5, type: !47, spFlags: DISPFlagDefinition, unit: !41, retainedNodes: !59) +// CHECK:STDOUT: !57 = !DILocalVariable(arg: 1, scope: !56, type: !45) +// CHECK:STDOUT: !58 = !DILocation(line: 5, column: 3, scope: !56) +// CHECK:STDOUT: !59 = !{!57} +// CHECK:STDOUT: !60 = !{!"any pointer", !6, i64 0} +// CHECK:STDOUT: !61 = !{!"p1 _ZTS1A", !60, i64 0} +// CHECK:STDOUT: !62 = !{!61, !61, i64 0} +// CHECK:STDOUT: !63 = !{!"_ZTS1A", !7, i64 0, !7, i64 4} +// CHECK:STDOUT: !64 = !{!63, !7, i64 0} +// CHECK:STDOUT: !65 = !{!63, !7, i64 4} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'use_b.carbon' @@ -174,27 +188,34 @@ fn CallGeneric() -> i32 { // CHECK:STDOUT: $_Z6make_bv = comdat any // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CTest.Main() #0 !dbg !64 { +// CHECK:STDOUT: define i32 @_CTest.Main() #0 !dbg !68 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %b.var = alloca [8 x i8], align 4, !dbg !67 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %b.var), !dbg !67 -// CHECK:STDOUT: call void @_Z6make_bv.carbon_thunk.(ptr %b.var), !dbg !68 -// CHECK:STDOUT: %.loc6_11.1.x = getelementptr inbounds nuw [8 x i8], ptr %b.var, i32 0, i32 0, !dbg !70 -// CHECK:STDOUT: %.loc6_11.2 = load i32, ptr %.loc6_11.1.x, align 4, !dbg !70 -// CHECK:STDOUT: ret i32 %.loc6_11.2, !dbg !71 +// CHECK:STDOUT: %b.var = alloca [8 x i8], align 4, !dbg !71 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %b.var), !dbg !71 +// CHECK:STDOUT: call void @_Z6make_bv.carbon_thunk.(ptr %b.var), !dbg !72 +// CHECK:STDOUT: %.loc6_11.1.x = getelementptr inbounds nuw [8 x i8], ptr %b.var, i32 0, i32 0, !dbg !74 +// CHECK:STDOUT: %.loc6_11.2 = load i32, ptr %.loc6_11.1.x, align 4, !dbg !74 +// CHECK:STDOUT: call void @"_CSelfDestruct.d4378aa76ca99c88:core.Destroy.Core"(ptr %b.var), !dbg !71 +// CHECK:STDOUT: ret i32 %.loc6_11.2, !dbg !75 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define internal void @_Z6make_bv.carbon_thunk.(ptr noundef %return) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !73 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !73 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !81 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !81 // CHECK:STDOUT: %call = call i64 @_Z6make_bv() // CHECK:STDOUT: store i64 %call, ptr %0, align 4 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.d4378aa76ca99c88:core.Destroy.Core"(ptr %self) #0 !dbg !76 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !78 +// 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)) #2 // CHECK:STDOUT: @@ -203,9 +224,9 @@ fn CallGeneric() -> i32 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %retval = alloca %struct.B, align 4 // CHECK:STDOUT: %x = getelementptr inbounds nuw %struct.B, ptr %retval, i32 0, i32 0 -// CHECK:STDOUT: store i32 3, ptr %x, align 4, !tbaa !75 +// CHECK:STDOUT: store i32 3, ptr %x, align 4, !tbaa !83 // CHECK:STDOUT: %y = getelementptr inbounds nuw %struct.B, ptr %retval, i32 0, i32 1 -// CHECK:STDOUT: store i32 4, ptr %y, align 4, !tbaa !76 +// CHECK:STDOUT: store i32 4, ptr %y, align 4, !tbaa !84 // CHECK:STDOUT: %0 = load i64, ptr %retval, align 4 // CHECK:STDOUT: ret i64 %0 // CHECK:STDOUT: } @@ -215,288 +236,7 @@ fn CallGeneric() -> i32 { // CHECK:STDOUT: attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!63} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3, !4, !10, !11} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!9} -// CHECK:STDOUT: -// CHECK:STDOUT: !2 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !3 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !5 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !6 = !{!"omnipotent char", !5, i64 0} -// CHECK:STDOUT: !7 = !{!"int", !6, i64 0} -// CHECK:STDOUT: !8 = !{!"__libc_errno", !7, i64 0} -// CHECK:STDOUT: !9 = !{!8, !7, i64 0} -// CHECK:STDOUT: !10 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !11 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !42 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !43 = !{!42} -// CHECK:STDOUT: !44 = !DISubroutineType(types: !43) -// CHECK:STDOUT: !56 = !{!"any pointer", !6, i64 0} -// CHECK:STDOUT: !62 = !DIFile(filename: "use_b.carbon", directory: "") -// CHECK:STDOUT: !63 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !62, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !64 = distinct !DISubprogram(name: "Test", linkageName: "_CTest.Main", scope: null, file: !62, line: 4, type: !44, spFlags: DISPFlagDefinition, unit: !63) -// CHECK:STDOUT: !67 = !DILocation(line: 5, column: 3, scope: !64) -// CHECK:STDOUT: !68 = !DILocation(line: 5, column: 18, scope: !64) -// CHECK:STDOUT: !70 = !DILocation(line: 6, column: 10, scope: !64) -// CHECK:STDOUT: !71 = !DILocation(line: 6, column: 3, scope: !64) -// CHECK:STDOUT: !72 = !{!"p1 _ZTS1B", !56, i64 0} -// CHECK:STDOUT: !73 = !{!72, !72, i64 0} -// CHECK:STDOUT: !74 = !{!"_ZTS1B", !7, i64 0, !7, i64 4} -// CHECK:STDOUT: !75 = !{!74, !7, i64 0} -// CHECK:STDOUT: !76 = !{!74, !7, i64 4} -// CHECK:STDOUT: -// CHECK:STDOUT: ; --- -// CHECK:STDOUT: ; ModuleID = 'use_both.carbon' -// CHECK:STDOUT: source_filename = "use_both.carbon" -// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" -// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" -// CHECK:STDOUT: -// CHECK:STDOUT: %struct.A.32 = type { i32, i32 } -// CHECK:STDOUT: %struct.B.33 = type { i32, i32 } -// CHECK:STDOUT: -// CHECK:STDOUT: $_Z6make_av = comdat any -// CHECK:STDOUT: -// CHECK:STDOUT: $_Z6make_bv = comdat any -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CTestA.Main() #0 !dbg !79 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: %a.var = alloca [8 x i8], align 4, !dbg !82 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !82 -// CHECK:STDOUT: call void @_Z6make_av.carbon_thunk.(ptr %a.var), !dbg !83 -// CHECK:STDOUT: %.loc7_11.1.b = getelementptr inbounds nuw [8 x i8], ptr %a.var, i32 0, i32 4, !dbg !85 -// CHECK:STDOUT: %.loc7_11.2 = load i32, ptr %.loc7_11.1.b, align 4, !dbg !85 -// CHECK:STDOUT: ret i32 %.loc7_11.2, !dbg !86 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable -// CHECK:STDOUT: define internal void @_Z6make_av.carbon_thunk.(ptr noundef %return) #1 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !58 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !58 -// CHECK:STDOUT: %call = call i64 @_Z6make_av() -// CHECK:STDOUT: store i64 %call, ptr %0, align 4 -// CHECK:STDOUT: ret void -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CTestB.Main() #0 !dbg !87 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: %b.var = alloca [8 x i8], align 4, !dbg !90 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %b.var), !dbg !90 -// CHECK:STDOUT: call void @_Z6make_bv.carbon_thunk.(ptr %b.var), !dbg !91 -// CHECK:STDOUT: %.loc12_11.1.x = getelementptr inbounds nuw [8 x i8], ptr %b.var, i32 0, i32 0, !dbg !93 -// CHECK:STDOUT: %.loc12_11.2 = load i32, ptr %.loc12_11.1.x, align 4, !dbg !93 -// CHECK:STDOUT: ret i32 %.loc12_11.2, !dbg !94 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable -// CHECK:STDOUT: define internal void @_Z6make_bv.carbon_thunk.(ptr noundef %return) #1 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !73 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !73 -// CHECK:STDOUT: %call = call i64 @_Z6make_bv() -// CHECK:STDOUT: store i64 %call, ptr %0, align 4 -// CHECK:STDOUT: ret void -// 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)) #2 -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress nounwind uwtable -// CHECK:STDOUT: define linkonce_odr dso_local i64 @_Z6make_av() #3 comdat { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: %retval = alloca %struct.A.32, align 4 -// CHECK:STDOUT: %a = getelementptr inbounds nuw %struct.A.32, ptr %retval, i32 0, i32 0 -// CHECK:STDOUT: store i32 1, ptr %a, align 4, !tbaa !60 -// CHECK:STDOUT: %b = getelementptr inbounds nuw %struct.A.32, ptr %retval, i32 0, i32 1 -// CHECK:STDOUT: store i32 2, ptr %b, align 4, !tbaa !61 -// CHECK:STDOUT: %0 = load i64, ptr %retval, align 4 -// CHECK:STDOUT: ret i64 %0 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress nounwind uwtable -// CHECK:STDOUT: define linkonce_odr dso_local i64 @_Z6make_bv() #3 comdat { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: %retval = alloca %struct.B.33, align 4 -// CHECK:STDOUT: %x = getelementptr inbounds nuw %struct.B.33, ptr %retval, i32 0, i32 0 -// CHECK:STDOUT: store i32 3, ptr %x, align 4, !tbaa !75 -// CHECK:STDOUT: %y = getelementptr inbounds nuw %struct.B.33, ptr %retval, i32 0, i32 1 -// CHECK:STDOUT: store i32 4, ptr %y, align 4, !tbaa !76 -// CHECK:STDOUT: %0 = load i64, ptr %retval, align 4 -// CHECK:STDOUT: ret i64 %0 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; uselistorder directives -// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 1, 0 } -// CHECK:STDOUT: -// CHECK:STDOUT: attributes #0 = { nounwind } -// CHECK:STDOUT: attributes #1 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } -// CHECK:STDOUT: attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } -// CHECK:STDOUT: attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } -// CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!78} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3, !4, !10, !11} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!9} -// CHECK:STDOUT: -// CHECK:STDOUT: !2 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !3 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !5 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !6 = !{!"omnipotent char", !5, i64 0} -// CHECK:STDOUT: !7 = !{!"int", !6, i64 0} -// CHECK:STDOUT: !8 = !{!"__libc_errno", !7, i64 0} -// CHECK:STDOUT: !9 = !{!8, !7, i64 0} -// CHECK:STDOUT: !10 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !11 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !42 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !43 = !{!42} -// CHECK:STDOUT: !44 = !DISubroutineType(types: !43) -// CHECK:STDOUT: !56 = !{!"any pointer", !6, i64 0} -// CHECK:STDOUT: !57 = !{!"p1 _ZTS1A", !56, i64 0} -// CHECK:STDOUT: !58 = !{!57, !57, i64 0} -// CHECK:STDOUT: !59 = !{!"_ZTS1A", !7, i64 0, !7, i64 4} -// CHECK:STDOUT: !60 = !{!59, !7, i64 0} -// CHECK:STDOUT: !61 = !{!59, !7, i64 4} -// CHECK:STDOUT: !72 = !{!"p1 _ZTS1B", !56, i64 0} -// CHECK:STDOUT: !73 = !{!72, !72, i64 0} -// CHECK:STDOUT: !74 = !{!"_ZTS1B", !7, i64 0, !7, i64 4} -// CHECK:STDOUT: !75 = !{!74, !7, i64 0} -// CHECK:STDOUT: !76 = !{!74, !7, i64 4} -// CHECK:STDOUT: !77 = !DIFile(filename: "use_both.carbon", directory: "") -// CHECK:STDOUT: !78 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !77, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !79 = distinct !DISubprogram(name: "TestA", linkageName: "_CTestA.Main", scope: null, file: !77, line: 5, type: !44, spFlags: DISPFlagDefinition, unit: !78) -// CHECK:STDOUT: !82 = !DILocation(line: 6, column: 3, scope: !79) -// CHECK:STDOUT: !83 = !DILocation(line: 6, column: 18, scope: !79) -// CHECK:STDOUT: !85 = !DILocation(line: 7, column: 10, scope: !79) -// CHECK:STDOUT: !86 = !DILocation(line: 7, column: 3, scope: !79) -// CHECK:STDOUT: !87 = distinct !DISubprogram(name: "TestB", linkageName: "_CTestB.Main", scope: null, file: !77, line: 10, type: !44, spFlags: DISPFlagDefinition, unit: !78) -// CHECK:STDOUT: !90 = !DILocation(line: 11, column: 3, scope: !87) -// CHECK:STDOUT: !91 = !DILocation(line: 11, column: 18, scope: !87) -// CHECK:STDOUT: !93 = !DILocation(line: 12, column: 10, scope: !87) -// CHECK:STDOUT: !94 = !DILocation(line: 12, column: 3, scope: !87) -// CHECK:STDOUT: -// CHECK:STDOUT: ; --- -// CHECK:STDOUT: ; ModuleID = 'generic_lib.carbon' -// CHECK:STDOUT: source_filename = "generic_lib.carbon" -// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" -// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" -// CHECK:STDOUT: -// CHECK:STDOUT: %struct.A.36 = type { i32, i32 } -// CHECK:STDOUT: -// CHECK:STDOUT: $_Z6make_av = comdat any -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable -// CHECK:STDOUT: define internal void @_Z6make_av.carbon_thunk.(ptr noundef %return) #0 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !58 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !58 -// CHECK:STDOUT: %call = call i64 @_Z6make_av() -// CHECK:STDOUT: store i64 %call, ptr %0, align 4 -// CHECK:STDOUT: ret void -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress nounwind uwtable -// CHECK:STDOUT: define linkonce_odr dso_local i64 @_Z6make_av() #1 comdat { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: %retval = alloca %struct.A.36, align 4 -// CHECK:STDOUT: %a = getelementptr inbounds nuw %struct.A.36, ptr %retval, i32 0, i32 0 -// CHECK:STDOUT: store i32 1, ptr %a, align 4, !tbaa !60 -// CHECK:STDOUT: %b = getelementptr inbounds nuw %struct.A.36, ptr %retval, i32 0, i32 1 -// CHECK:STDOUT: store i32 2, ptr %b, align 4, !tbaa !61 -// CHECK:STDOUT: %0 = load i64, ptr %retval, align 4 -// CHECK:STDOUT: ret i64 %0 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: attributes #0 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } -// CHECK:STDOUT: attributes #1 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } -// CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!96} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3, !4, !10, !11} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!9} -// CHECK:STDOUT: -// CHECK:STDOUT: !2 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !3 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !5 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !6 = !{!"omnipotent char", !5, i64 0} -// CHECK:STDOUT: !7 = !{!"int", !6, i64 0} -// CHECK:STDOUT: !8 = !{!"__libc_errno", !7, i64 0} -// CHECK:STDOUT: !9 = !{!8, !7, i64 0} -// CHECK:STDOUT: !10 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !11 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !56 = !{!"any pointer", !6, i64 0} -// CHECK:STDOUT: !57 = !{!"p1 _ZTS1A", !56, i64 0} -// CHECK:STDOUT: !58 = !{!57, !57, i64 0} -// CHECK:STDOUT: !59 = !{!"_ZTS1A", !7, i64 0, !7, i64 4} -// CHECK:STDOUT: !60 = !{!59, !7, i64 0} -// CHECK:STDOUT: !61 = !{!59, !7, i64 4} -// CHECK:STDOUT: !95 = !DIFile(filename: "generic_lib.carbon", directory: "") -// CHECK:STDOUT: !96 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !95, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: -// CHECK:STDOUT: ; --- -// CHECK:STDOUT: ; ModuleID = 'no_cpp_imports.carbon' -// CHECK:STDOUT: source_filename = "no_cpp_imports.carbon" -// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" -// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" -// CHECK:STDOUT: -// CHECK:STDOUT: %struct.A.39 = type { i32, i32 } -// CHECK:STDOUT: -// CHECK:STDOUT: $_Z6make_av = comdat any -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CCallGeneric.Main() #0 !dbg !99 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: %MakeA.call = call i32 @_CMakeA.Main.084a2801e0f5d754({} zeroinitializer), !dbg !102 -// CHECK:STDOUT: ret i32 %MakeA.call, !dbg !105 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CMakeA.Main.084a2801e0f5d754({} %x) #0 !dbg !106 { -// CHECK:STDOUT: %1 = alloca [8 x i8], align 4, !dbg !111 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !111 -// CHECK:STDOUT: call void @_Z6make_av.carbon_thunk.(ptr %1), !dbg !112 -// CHECK:STDOUT: %b = getelementptr inbounds nuw [8 x i8], ptr %1, i32 0, i32 4, !dbg !114 -// CHECK:STDOUT: %2 = load i32, ptr %b, align 4, !dbg !114 -// CHECK:STDOUT: ret i32 %2, !dbg !115 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable -// CHECK:STDOUT: define internal void @_Z6make_av.carbon_thunk.(ptr noundef %return) #1 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !58 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !58 -// CHECK:STDOUT: %call = call i64 @_Z6make_av() -// CHECK:STDOUT: store i64 %call, ptr %0, align 4 -// CHECK:STDOUT: ret void -// 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)) #2 -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress nounwind uwtable -// CHECK:STDOUT: define linkonce_odr dso_local i64 @_Z6make_av() #3 comdat { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: %retval = alloca %struct.A.39, align 4 -// CHECK:STDOUT: %a = getelementptr inbounds nuw %struct.A.39, ptr %retval, i32 0, i32 0 -// CHECK:STDOUT: store i32 1, ptr %a, align 4, !tbaa !60 -// CHECK:STDOUT: %b = getelementptr inbounds nuw %struct.A.39, ptr %retval, i32 0, i32 1 -// CHECK:STDOUT: store i32 2, ptr %b, align 4, !tbaa !61 -// CHECK:STDOUT: %0 = load i64, ptr %retval, align 4 -// CHECK:STDOUT: ret i64 %0 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: attributes #0 = { nounwind } -// CHECK:STDOUT: attributes #1 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } -// CHECK:STDOUT: attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } -// CHECK:STDOUT: attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } -// CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!98} +// CHECK:STDOUT: !llvm.dbg.cu = !{!67} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3, !4, !10, !11} // CHECK:STDOUT: !llvm.errno.tbaa = !{!9} // CHECK:STDOUT: @@ -514,25 +254,355 @@ fn CallGeneric() -> i32 { // CHECK:STDOUT: !43 = !{!42} // CHECK:STDOUT: !44 = !DISubroutineType(types: !43) // CHECK:STDOUT: !45 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !56 = !{!"any pointer", !6, i64 0} -// CHECK:STDOUT: !57 = !{!"p1 _ZTS1A", !56, i64 0} -// CHECK:STDOUT: !58 = !{!57, !57, i64 0} -// CHECK:STDOUT: !59 = !{!"_ZTS1A", !7, i64 0, !7, i64 4} -// CHECK:STDOUT: !60 = !{!59, !7, i64 0} -// CHECK:STDOUT: !61 = !{!59, !7, i64 4} -// CHECK:STDOUT: !95 = !DIFile(filename: "generic_lib.carbon", directory: "") -// CHECK:STDOUT: !97 = !DIFile(filename: "no_cpp_imports.carbon", directory: "") -// CHECK:STDOUT: !98 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !97, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !99 = distinct !DISubprogram(name: "CallGeneric", linkageName: "_CCallGeneric.Main", scope: null, file: !97, line: 4, type: !44, spFlags: DISPFlagDefinition, unit: !98) -// CHECK:STDOUT: !102 = !DILocation(line: 5, column: 10, scope: !99) -// CHECK:STDOUT: !103 = !{!42, !45} -// CHECK:STDOUT: !104 = !DISubroutineType(types: !103) -// CHECK:STDOUT: !105 = !DILocation(line: 5, column: 3, scope: !99) -// CHECK:STDOUT: !106 = distinct !DISubprogram(name: "MakeA", linkageName: "_CMakeA.Main.084a2801e0f5d754", scope: null, file: !95, line: 4, type: !104, spFlags: DISPFlagDefinition, unit: !98, retainedNodes: !116) -// CHECK:STDOUT: !107 = !DILocalVariable(arg: 1, scope: !106, type: !45) -// CHECK:STDOUT: !111 = !DILocation(line: 5, column: 3, scope: !106) -// CHECK:STDOUT: !112 = !DILocation(line: 5, column: 18, scope: !106) -// CHECK:STDOUT: !114 = !DILocation(line: 6, column: 10, scope: !106) -// CHECK:STDOUT: !115 = !DILocation(line: 6, column: 3, scope: !106) -// CHECK:STDOUT: !116 = !{!107} +// CHECK:STDOUT: !46 = !{null, !45} +// CHECK:STDOUT: !47 = !DISubroutineType(types: !46) +// CHECK:STDOUT: !60 = !{!"any pointer", !6, i64 0} +// CHECK:STDOUT: !66 = !DIFile(filename: "use_b.carbon", directory: "") +// CHECK:STDOUT: !67 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !66, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !68 = distinct !DISubprogram(name: "Test", linkageName: "_CTest.Main", scope: null, file: !66, line: 4, type: !44, spFlags: DISPFlagDefinition, unit: !67) +// CHECK:STDOUT: !71 = !DILocation(line: 5, column: 3, scope: !68) +// CHECK:STDOUT: !72 = !DILocation(line: 5, column: 18, scope: !68) +// CHECK:STDOUT: !74 = !DILocation(line: 6, column: 10, scope: !68) +// CHECK:STDOUT: !75 = !DILocation(line: 6, column: 3, scope: !68) +// CHECK:STDOUT: !76 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.d4378aa76ca99c88:core.Destroy.Core", scope: null, file: !66, line: 5, type: !47, spFlags: DISPFlagDefinition, unit: !67, retainedNodes: !79) +// CHECK:STDOUT: !77 = !DILocalVariable(arg: 1, scope: !76, type: !45) +// CHECK:STDOUT: !78 = !DILocation(line: 5, column: 3, scope: !76) +// CHECK:STDOUT: !79 = !{!77} +// CHECK:STDOUT: !80 = !{!"p1 _ZTS1B", !60, i64 0} +// CHECK:STDOUT: !81 = !{!80, !80, i64 0} +// CHECK:STDOUT: !82 = !{!"_ZTS1B", !7, i64 0, !7, i64 4} +// CHECK:STDOUT: !83 = !{!82, !7, i64 0} +// CHECK:STDOUT: !84 = !{!82, !7, i64 4} +// CHECK:STDOUT: +// CHECK:STDOUT: ; --- +// CHECK:STDOUT: ; ModuleID = 'use_both.carbon' +// CHECK:STDOUT: source_filename = "use_both.carbon" +// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" +// CHECK:STDOUT: +// CHECK:STDOUT: %struct.A.32 = type { i32, i32 } +// CHECK:STDOUT: %struct.B.33 = type { i32, i32 } +// CHECK:STDOUT: +// CHECK:STDOUT: $_Z6make_av = comdat any +// CHECK:STDOUT: +// CHECK:STDOUT: $_Z6make_bv = comdat any +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define i32 @_CTestA.Main() #0 !dbg !87 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %a.var = alloca [8 x i8], align 4, !dbg !90 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !90 +// CHECK:STDOUT: call void @_Z6make_av.carbon_thunk.(ptr %a.var), !dbg !91 +// CHECK:STDOUT: %.loc7_11.1.b = getelementptr inbounds nuw [8 x i8], ptr %a.var, i32 0, i32 4, !dbg !93 +// CHECK:STDOUT: %.loc7_11.2 = load i32, ptr %.loc7_11.1.b, align 4, !dbg !93 +// CHECK:STDOUT: call void @"_CSelfDestruct.f2cd4feee22137a3:core.Destroy.Core"(ptr %a.var), !dbg !90 +// CHECK:STDOUT: ret i32 %.loc7_11.2, !dbg !94 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable +// CHECK:STDOUT: define internal void @_Z6make_av.carbon_thunk.(ptr noundef %return) #1 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %return.addr = alloca ptr, align 8 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !62 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !62 +// CHECK:STDOUT: %call = call i64 @_Z6make_av() +// CHECK:STDOUT: store i64 %call, ptr %0, align 4 +// CHECK:STDOUT: ret void +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f2cd4feee22137a3:core.Destroy.Core"(ptr %self) #0 !dbg !95 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !97 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define i32 @_CTestB.Main() #0 !dbg !99 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %b.var = alloca [8 x i8], align 4, !dbg !102 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %b.var), !dbg !102 +// CHECK:STDOUT: call void @_Z6make_bv.carbon_thunk.(ptr %b.var), !dbg !103 +// CHECK:STDOUT: %.loc12_11.1.x = getelementptr inbounds nuw [8 x i8], ptr %b.var, i32 0, i32 0, !dbg !105 +// CHECK:STDOUT: %.loc12_11.2 = load i32, ptr %.loc12_11.1.x, align 4, !dbg !105 +// CHECK:STDOUT: call void @"_CSelfDestruct.d4378aa76ca99c88:core.Destroy.Core"(ptr %b.var), !dbg !102 +// CHECK:STDOUT: ret i32 %.loc12_11.2, !dbg !106 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable +// CHECK:STDOUT: define internal void @_Z6make_bv.carbon_thunk.(ptr noundef %return) #1 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %return.addr = alloca ptr, align 8 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !81 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !81 +// CHECK:STDOUT: %call = call i64 @_Z6make_bv() +// CHECK:STDOUT: store i64 %call, ptr %0, align 4 +// CHECK:STDOUT: ret void +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.d4378aa76ca99c88:core.Destroy.Core"(ptr %self) #0 !dbg !107 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !109 +// 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)) #2 +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress nounwind uwtable +// CHECK:STDOUT: define linkonce_odr dso_local i64 @_Z6make_av() #3 comdat { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %retval = alloca %struct.A.32, align 4 +// CHECK:STDOUT: %a = getelementptr inbounds nuw %struct.A.32, ptr %retval, i32 0, i32 0 +// CHECK:STDOUT: store i32 1, ptr %a, align 4, !tbaa !64 +// CHECK:STDOUT: %b = getelementptr inbounds nuw %struct.A.32, ptr %retval, i32 0, i32 1 +// CHECK:STDOUT: store i32 2, ptr %b, align 4, !tbaa !65 +// CHECK:STDOUT: %0 = load i64, ptr %retval, align 4 +// CHECK:STDOUT: ret i64 %0 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress nounwind uwtable +// CHECK:STDOUT: define linkonce_odr dso_local i64 @_Z6make_bv() #3 comdat { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %retval = alloca %struct.B.33, align 4 +// CHECK:STDOUT: %x = getelementptr inbounds nuw %struct.B.33, ptr %retval, i32 0, i32 0 +// CHECK:STDOUT: store i32 3, ptr %x, align 4, !tbaa !83 +// CHECK:STDOUT: %y = getelementptr inbounds nuw %struct.B.33, ptr %retval, i32 0, i32 1 +// CHECK:STDOUT: store i32 4, ptr %y, align 4, !tbaa !84 +// CHECK:STDOUT: %0 = load i64, ptr %retval, align 4 +// CHECK:STDOUT: ret i64 %0 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; uselistorder directives +// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 1, 0 } +// CHECK:STDOUT: +// CHECK:STDOUT: attributes #0 = { nounwind } +// CHECK:STDOUT: attributes #1 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } +// CHECK:STDOUT: attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!86} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3, !4, !10, !11} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!9} +// CHECK:STDOUT: +// CHECK:STDOUT: !2 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !3 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !5 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !6 = !{!"omnipotent char", !5, i64 0} +// CHECK:STDOUT: !7 = !{!"int", !6, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !7, i64 0} +// CHECK:STDOUT: !9 = !{!8, !7, i64 0} +// CHECK:STDOUT: !10 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !11 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !42 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !43 = !{!42} +// CHECK:STDOUT: !44 = !DISubroutineType(types: !43) +// CHECK:STDOUT: !45 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !46 = !{null, !45} +// CHECK:STDOUT: !47 = !DISubroutineType(types: !46) +// CHECK:STDOUT: !60 = !{!"any pointer", !6, i64 0} +// CHECK:STDOUT: !61 = !{!"p1 _ZTS1A", !60, i64 0} +// CHECK:STDOUT: !62 = !{!61, !61, i64 0} +// CHECK:STDOUT: !63 = !{!"_ZTS1A", !7, i64 0, !7, i64 4} +// CHECK:STDOUT: !64 = !{!63, !7, i64 0} +// CHECK:STDOUT: !65 = !{!63, !7, i64 4} +// CHECK:STDOUT: !80 = !{!"p1 _ZTS1B", !60, i64 0} +// CHECK:STDOUT: !81 = !{!80, !80, i64 0} +// CHECK:STDOUT: !82 = !{!"_ZTS1B", !7, i64 0, !7, i64 4} +// CHECK:STDOUT: !83 = !{!82, !7, i64 0} +// CHECK:STDOUT: !84 = !{!82, !7, i64 4} +// CHECK:STDOUT: !85 = !DIFile(filename: "use_both.carbon", directory: "") +// CHECK:STDOUT: !86 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !85, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !87 = distinct !DISubprogram(name: "TestA", linkageName: "_CTestA.Main", scope: null, file: !85, line: 5, type: !44, spFlags: DISPFlagDefinition, unit: !86) +// CHECK:STDOUT: !90 = !DILocation(line: 6, column: 3, scope: !87) +// CHECK:STDOUT: !91 = !DILocation(line: 6, column: 18, scope: !87) +// CHECK:STDOUT: !93 = !DILocation(line: 7, column: 10, scope: !87) +// CHECK:STDOUT: !94 = !DILocation(line: 7, column: 3, scope: !87) +// CHECK:STDOUT: !95 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f2cd4feee22137a3:core.Destroy.Core", scope: null, file: !85, line: 6, type: !47, spFlags: DISPFlagDefinition, unit: !86, retainedNodes: !98) +// CHECK:STDOUT: !96 = !DILocalVariable(arg: 1, scope: !95, type: !45) +// CHECK:STDOUT: !97 = !DILocation(line: 6, column: 3, scope: !95) +// CHECK:STDOUT: !98 = !{!96} +// CHECK:STDOUT: !99 = distinct !DISubprogram(name: "TestB", linkageName: "_CTestB.Main", scope: null, file: !85, line: 10, type: !44, spFlags: DISPFlagDefinition, unit: !86) +// CHECK:STDOUT: !102 = !DILocation(line: 11, column: 3, scope: !99) +// CHECK:STDOUT: !103 = !DILocation(line: 11, column: 18, scope: !99) +// CHECK:STDOUT: !105 = !DILocation(line: 12, column: 10, scope: !99) +// CHECK:STDOUT: !106 = !DILocation(line: 12, column: 3, scope: !99) +// CHECK:STDOUT: !107 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.d4378aa76ca99c88:core.Destroy.Core", scope: null, file: !85, line: 11, type: !47, spFlags: DISPFlagDefinition, unit: !86, retainedNodes: !110) +// CHECK:STDOUT: !108 = !DILocalVariable(arg: 1, scope: !107, type: !45) +// CHECK:STDOUT: !109 = !DILocation(line: 11, column: 3, scope: !107) +// CHECK:STDOUT: !110 = !{!108} +// CHECK:STDOUT: +// CHECK:STDOUT: ; --- +// CHECK:STDOUT: ; ModuleID = 'generic_lib.carbon' +// CHECK:STDOUT: source_filename = "generic_lib.carbon" +// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" +// CHECK:STDOUT: +// CHECK:STDOUT: %struct.A.36 = type { i32, i32 } +// CHECK:STDOUT: +// CHECK:STDOUT: $_Z6make_av = comdat any +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable +// CHECK:STDOUT: define internal void @_Z6make_av.carbon_thunk.(ptr noundef %return) #0 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %return.addr = alloca ptr, align 8 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !62 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !62 +// CHECK:STDOUT: %call = call i64 @_Z6make_av() +// CHECK:STDOUT: store i64 %call, ptr %0, align 4 +// CHECK:STDOUT: ret void +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f2cd4feee22137a3:core.Destroy.Core"(ptr %self) #1 !dbg !113 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !115 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress nounwind uwtable +// CHECK:STDOUT: define linkonce_odr dso_local i64 @_Z6make_av() #2 comdat { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %retval = alloca %struct.A.36, align 4 +// CHECK:STDOUT: %a = getelementptr inbounds nuw %struct.A.36, ptr %retval, i32 0, i32 0 +// CHECK:STDOUT: store i32 1, ptr %a, align 4, !tbaa !64 +// CHECK:STDOUT: %b = getelementptr inbounds nuw %struct.A.36, ptr %retval, i32 0, i32 1 +// CHECK:STDOUT: store i32 2, ptr %b, align 4, !tbaa !65 +// CHECK:STDOUT: %0 = load i64, ptr %retval, align 4 +// CHECK:STDOUT: ret i64 %0 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: attributes #0 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } +// CHECK:STDOUT: attributes #1 = { nounwind } +// CHECK:STDOUT: attributes #2 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!112} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3, !4, !10, !11} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!9} +// CHECK:STDOUT: +// CHECK:STDOUT: !2 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !3 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !5 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !6 = !{!"omnipotent char", !5, i64 0} +// CHECK:STDOUT: !7 = !{!"int", !6, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !7, i64 0} +// CHECK:STDOUT: !9 = !{!8, !7, i64 0} +// CHECK:STDOUT: !10 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !11 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !45 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !46 = !{null, !45} +// CHECK:STDOUT: !47 = !DISubroutineType(types: !46) +// CHECK:STDOUT: !60 = !{!"any pointer", !6, i64 0} +// CHECK:STDOUT: !61 = !{!"p1 _ZTS1A", !60, i64 0} +// CHECK:STDOUT: !62 = !{!61, !61, i64 0} +// CHECK:STDOUT: !63 = !{!"_ZTS1A", !7, i64 0, !7, i64 4} +// CHECK:STDOUT: !64 = !{!63, !7, i64 0} +// CHECK:STDOUT: !65 = !{!63, !7, i64 4} +// CHECK:STDOUT: !111 = !DIFile(filename: "generic_lib.carbon", directory: "") +// CHECK:STDOUT: !112 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !111, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !113 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f2cd4feee22137a3:core.Destroy.Core", scope: null, file: !111, line: 5, type: !47, spFlags: DISPFlagDefinition, unit: !112, retainedNodes: !116) +// CHECK:STDOUT: !114 = !DILocalVariable(arg: 1, scope: !113, type: !45) +// CHECK:STDOUT: !115 = !DILocation(line: 5, column: 3, scope: !113) +// CHECK:STDOUT: !116 = !{!114} +// CHECK:STDOUT: +// CHECK:STDOUT: ; --- +// CHECK:STDOUT: ; ModuleID = 'no_cpp_imports.carbon' +// CHECK:STDOUT: source_filename = "no_cpp_imports.carbon" +// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" +// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" +// CHECK:STDOUT: +// CHECK:STDOUT: %struct.A.39 = type { i32, i32 } +// CHECK:STDOUT: +// CHECK:STDOUT: $_Z6make_av = comdat any +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define i32 @_CCallGeneric.Main() #0 !dbg !119 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %MakeA.call = call i32 @_CMakeA.Main.084a2801e0f5d754({} zeroinitializer), !dbg !122 +// CHECK:STDOUT: ret i32 %MakeA.call, !dbg !125 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr i32 @_CMakeA.Main.084a2801e0f5d754({} %x) #0 !dbg !126 { +// CHECK:STDOUT: %1 = alloca [8 x i8], align 4, !dbg !131 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !131 +// CHECK:STDOUT: call void @_Z6make_av.carbon_thunk.(ptr %1), !dbg !132 +// CHECK:STDOUT: %b = getelementptr inbounds nuw [8 x i8], ptr %1, i32 0, i32 4, !dbg !134 +// CHECK:STDOUT: %2 = load i32, ptr %b, align 4, !dbg !134 +// CHECK:STDOUT: call void @"_CSelfDestruct.f2cd4feee22137a3:core.Destroy.Core"(ptr %1), !dbg !131 +// CHECK:STDOUT: ret i32 %2, !dbg !135 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable +// CHECK:STDOUT: define internal void @_Z6make_av.carbon_thunk.(ptr noundef %return) #1 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %return.addr = alloca ptr, align 8 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !62 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !62 +// CHECK:STDOUT: %call = call i64 @_Z6make_av() +// CHECK:STDOUT: store i64 %call, ptr %0, align 4 +// CHECK:STDOUT: ret void +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: declare void @"_CSelfDestruct.f2cd4feee22137a3:core.Destroy.Core"(ptr) +// 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)) #2 +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress nounwind uwtable +// CHECK:STDOUT: define linkonce_odr dso_local i64 @_Z6make_av() #3 comdat { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %retval = alloca %struct.A.39, align 4 +// CHECK:STDOUT: %a = getelementptr inbounds nuw %struct.A.39, ptr %retval, i32 0, i32 0 +// CHECK:STDOUT: store i32 1, ptr %a, align 4, !tbaa !64 +// CHECK:STDOUT: %b = getelementptr inbounds nuw %struct.A.39, ptr %retval, i32 0, i32 1 +// CHECK:STDOUT: store i32 2, ptr %b, align 4, !tbaa !65 +// CHECK:STDOUT: %0 = load i64, ptr %retval, align 4 +// CHECK:STDOUT: ret i64 %0 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: attributes #0 = { nounwind } +// CHECK:STDOUT: attributes #1 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } +// CHECK:STDOUT: attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!118} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3, !4, !10, !11} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!9} +// CHECK:STDOUT: +// CHECK:STDOUT: !2 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !3 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !5 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !6 = !{!"omnipotent char", !5, i64 0} +// CHECK:STDOUT: !7 = !{!"int", !6, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !7, i64 0} +// CHECK:STDOUT: !9 = !{!8, !7, i64 0} +// CHECK:STDOUT: !10 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !11 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !42 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !43 = !{!42} +// CHECK:STDOUT: !44 = !DISubroutineType(types: !43) +// CHECK:STDOUT: !45 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !60 = !{!"any pointer", !6, i64 0} +// CHECK:STDOUT: !61 = !{!"p1 _ZTS1A", !60, i64 0} +// CHECK:STDOUT: !62 = !{!61, !61, i64 0} +// CHECK:STDOUT: !63 = !{!"_ZTS1A", !7, i64 0, !7, i64 4} +// CHECK:STDOUT: !64 = !{!63, !7, i64 0} +// CHECK:STDOUT: !65 = !{!63, !7, i64 4} +// CHECK:STDOUT: !111 = !DIFile(filename: "generic_lib.carbon", directory: "") +// CHECK:STDOUT: !117 = !DIFile(filename: "no_cpp_imports.carbon", directory: "") +// CHECK:STDOUT: !118 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !117, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !119 = distinct !DISubprogram(name: "CallGeneric", linkageName: "_CCallGeneric.Main", scope: null, file: !117, line: 4, type: !44, spFlags: DISPFlagDefinition, unit: !118) +// CHECK:STDOUT: !122 = !DILocation(line: 5, column: 10, scope: !119) +// CHECK:STDOUT: !123 = !{!42, !45} +// CHECK:STDOUT: !124 = !DISubroutineType(types: !123) +// CHECK:STDOUT: !125 = !DILocation(line: 5, column: 3, scope: !119) +// CHECK:STDOUT: !126 = distinct !DISubprogram(name: "MakeA", linkageName: "_CMakeA.Main.084a2801e0f5d754", scope: null, file: !111, line: 4, type: !124, spFlags: DISPFlagDefinition, unit: !118, retainedNodes: !136) +// CHECK:STDOUT: !127 = !DILocalVariable(arg: 1, scope: !126, type: !45) +// CHECK:STDOUT: !131 = !DILocation(line: 5, column: 3, scope: !126) +// CHECK:STDOUT: !132 = !DILocation(line: 5, column: 18, scope: !126) +// CHECK:STDOUT: !134 = !DILocation(line: 6, column: 10, scope: !126) +// CHECK:STDOUT: !135 = !DILocation(line: 6, column: 3, scope: !126) +// CHECK:STDOUT: !136 = !{!127} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/std_initializer_list_pointer_pointer.carbon b/toolchain/lower/testdata/interop/cpp/std_initializer_list_pointer_pointer.carbon index a3b6cd08b940..b8072abb8f2a 100644 --- a/toolchain/lower/testdata/interop/cpp/std_initializer_list_pointer_pointer.carbon +++ b/toolchain/lower/testdata/interop/cpp/std_initializer_list_pointer_pointer.carbon @@ -100,43 +100,77 @@ fn InitNontrivialDtor() { // CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.end = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 8, !dbg !17 // CHECK:STDOUT: store ptr getelementptr inbounds ([3 x i32], ptr @array.loc13_50.15, i32 1), ptr %initializer_list.initializer_list.call.init_list.end, align 8, !dbg !17 // CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !20 -// CHECK:STDOUT: call void @"_COp.dc7dedd104b837b2:core.Destroy.Core"(ptr @array), !dbg !18 +// CHECK:STDOUT: call void @"_CSelfDestruct.dc7dedd104b837b2:core.Destroy.Core"(ptr @array), !dbg !18 +// CHECK:STDOUT: call void @"_CSelfDestruct.9e47f6d7a7c1f630:core.Destroy.Core"(ptr %_.var), !dbg !17 // CHECK:STDOUT: ret void, !dbg !21 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !22 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.d088c7eb746488be:core.Destroy.Core"(ptr %self) #0 !dbg !23 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !24 +// CHECK:STDOUT: ret void, !dbg !25 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.dc7dedd104b837b2:core.Destroy.Core"(ptr %self) #0 !dbg !26 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !27 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !28 +// CHECK:STDOUT: ret void, !dbg !29 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CInitVectorLike.Main() #0 !dbg !30 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !31 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca [1 x i8], align 1, !dbg !31 -// CHECK:STDOUT: %.loc18_36.3.temp = alloca [16 x i8], align 8, !dbg !32 -// CHECK:STDOUT: %.loc18_36.5.temp = alloca [3 x i32], align 4, !dbg !32 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !31 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_36.3.temp), !dbg !32 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_36.5.temp), !dbg !32 -// CHECK:STDOUT: %.loc18_36.6.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.5.temp, i32 0, i64 0, !dbg !32 -// CHECK:STDOUT: %.loc18_36.9.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.5.temp, i32 0, i64 1, !dbg !32 -// CHECK:STDOUT: %.loc18_36.12.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.5.temp, i32 0, i64 2, !dbg !32 -// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %.loc18_36.3.temp, i32 0, i32 0, !dbg !32 -// CHECK:STDOUT: store ptr @array.loc13_50.15, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !32 -// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.end = getelementptr inbounds nuw [16 x i8], ptr %.loc18_36.3.temp, i32 0, i32 8, !dbg !32 -// CHECK:STDOUT: store ptr getelementptr inbounds ([3 x i32], ptr @array.loc13_50.15, i32 1), ptr %initializer_list.initializer_list.call.init_list.end, align 8, !dbg !32 -// CHECK:STDOUT: call void @_ZN11vector_likeC1ESt16initializer_listIiE.carbon_thunk._(ptr %.loc18_36.3.temp, ptr %_.var), !dbg !31 -// CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !34 -// CHECK:STDOUT: call void @"_COp.dc7dedd104b837b2:core.Destroy.Core"(ptr @array), !dbg !32 -// CHECK:STDOUT: call void @_ZN11vector_likeD2Ev(ptr %_.var), !dbg !31 -// CHECK:STDOUT: ret void, !dbg !35 +// CHECK:STDOUT: ret void, !dbg !33 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !35 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !37 +// CHECK:STDOUT: ret void, !dbg !37 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.dc7dedd104b837b2:core.Destroy.Core"(ptr %self) #0 !dbg !39 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !41 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.dc7dedd104b837b2:core.Destroy.Core"(ptr %self) #0 !dbg !43 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.dc7dedd104b837b2:core.Destroy.Core"(ptr %self), !dbg !45 +// CHECK:STDOUT: ret void, !dbg !45 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.9e47f6d7a7c1f630:core.Destroy.Core"(ptr %self) #0 !dbg !47 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !49 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CInitVectorLike.Main() #0 !dbg !51 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %_.var = alloca [1 x i8], align 1, !dbg !52 +// CHECK:STDOUT: %.loc18_36.3.temp = alloca [16 x i8], align 8, !dbg !53 +// CHECK:STDOUT: %.loc18_36.5.temp = alloca [3 x i32], align 4, !dbg !53 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !52 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_36.3.temp), !dbg !53 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_36.5.temp), !dbg !53 +// CHECK:STDOUT: %.loc18_36.6.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.5.temp, i32 0, i64 0, !dbg !53 +// CHECK:STDOUT: %.loc18_36.9.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.5.temp, i32 0, i64 1, !dbg !53 +// CHECK:STDOUT: %.loc18_36.12.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.5.temp, i32 0, i64 2, !dbg !53 +// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %.loc18_36.3.temp, i32 0, i32 0, !dbg !53 +// CHECK:STDOUT: store ptr @array.loc13_50.15, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !53 +// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.end = getelementptr inbounds nuw [16 x i8], ptr %.loc18_36.3.temp, i32 0, i32 8, !dbg !53 +// CHECK:STDOUT: store ptr getelementptr inbounds ([3 x i32], ptr @array.loc13_50.15, i32 1), ptr %initializer_list.initializer_list.call.init_list.end, align 8, !dbg !53 +// CHECK:STDOUT: call void @_ZN11vector_likeC1ESt16initializer_listIiE.carbon_thunk._(ptr %.loc18_36.3.temp, ptr %_.var), !dbg !52 +// CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !55 +// CHECK:STDOUT: call void @"_CSelfDestruct.9e47f6d7a7c1f630:core.Destroy.Core"(ptr %.loc18_36.3.temp), !dbg !53 +// CHECK:STDOUT: call void @"_CSelfDestruct.dc7dedd104b837b2:core.Destroy.Core"(ptr @array), !dbg !53 +// CHECK:STDOUT: call void @"_CSelfDestruct.c4943df79074f7d2:core.Destroy.Core"(ptr %_.var), !dbg !52 +// CHECK:STDOUT: ret void, !dbg !56 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -145,11 +179,11 @@ fn InitNontrivialDtor() { // CHECK:STDOUT: %list.addr = alloca ptr, align 8 // CHECK:STDOUT: %return.addr = alloca ptr, align 8 // CHECK:STDOUT: %agg.tmp = alloca %"class.std::initializer_list", align 8 -// CHECK:STDOUT: store ptr %list, ptr %list.addr, align 8, !tbaa !50 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !52 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !52 -// CHECK:STDOUT: %1 = load ptr, ptr %list.addr, align 8, !tbaa !50 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %agg.tmp, ptr align 8 %1, i64 16, i1 false), !tbaa.struct !57 +// CHECK:STDOUT: store ptr %list, ptr %list.addr, align 8, !tbaa !91 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !93 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !93 +// CHECK:STDOUT: %1 = load ptr, ptr %list.addr, align 8, !tbaa !91 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %agg.tmp, ptr align 8 %1, i64 16, i1 false), !tbaa.struct !98 // CHECK:STDOUT: %2 = getelementptr inbounds nuw { ptr, ptr }, ptr %agg.tmp, i32 0, i32 0 // CHECK:STDOUT: %3 = load ptr, ptr %2, align 8 // CHECK:STDOUT: %4 = getelementptr inbounds nuw { ptr, ptr }, ptr %agg.tmp, i32 0, i32 1 @@ -162,40 +196,54 @@ fn InitNontrivialDtor() { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN11vector_likeD2Ev(ptr noundef nonnull align 1 dereferenceable(1) %this) unnamed_addr #2 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !52 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !93 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CInitNontrivialDtor.Main() #0 !dbg !36 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.c4943df79074f7d2:core.Destroy.Core"(ptr %self) #0 !dbg !57 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca [16 x i8], align 8, !dbg !37 -// CHECK:STDOUT: %.loc23_69.17.temp = alloca [3 x [1 x i8]], align 1, !dbg !38 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !37 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc23_69.17.temp), !dbg !38 -// CHECK:STDOUT: %.loc23_69.18.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 0, !dbg !38 -// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr %.loc23_69.18.array.index), !dbg !38 -// CHECK:STDOUT: %.loc23_69.16.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 1, !dbg !38 -// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr %.loc23_69.16.array.index), !dbg !38 -// CHECK:STDOUT: %.loc23_69.15.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 2, !dbg !38 -// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr %.loc23_69.15.array.index), !dbg !38 -// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 0, !dbg !37 -// CHECK:STDOUT: store ptr %.loc23_69.17.temp, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !37 -// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.end = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 8, !dbg !37 -// CHECK:STDOUT: %initializer_list.initializer_list.call.array.end = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 1, !dbg !37 -// CHECK:STDOUT: store ptr %initializer_list.initializer_list.call.array.end, ptr %initializer_list.initializer_list.call.init_list.end, align 8, !dbg !37 -// CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !40 -// CHECK:STDOUT: call void @"_COp.71d86972d5684aff:core.Destroy.Core"(ptr %.loc23_69.17.temp), !dbg !38 -// CHECK:STDOUT: ret void, !dbg !41 +// CHECK:STDOUT: call void @_ZN11vector_likeD2Ev(ptr %self), !dbg !59 +// CHECK:STDOUT: ret void, !dbg !59 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CInitNontrivialDtor.Main() #0 !dbg !61 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %_.var = alloca [16 x i8], align 8, !dbg !62 +// CHECK:STDOUT: %.loc23_69.17.temp = alloca [3 x [1 x i8]], align 1, !dbg !63 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !62 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc23_69.17.temp), !dbg !63 +// CHECK:STDOUT: %.loc23_69.18.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 0, !dbg !63 +// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr %.loc23_69.18.array.index), !dbg !63 +// CHECK:STDOUT: %.loc23_69.16.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 1, !dbg !63 +// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr %.loc23_69.16.array.index), !dbg !63 +// CHECK:STDOUT: %.loc23_69.15.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 2, !dbg !63 +// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr %.loc23_69.15.array.index), !dbg !63 +// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 0, !dbg !62 +// CHECK:STDOUT: store ptr %.loc23_69.17.temp, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !62 +// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.end = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 8, !dbg !62 +// CHECK:STDOUT: %initializer_list.initializer_list.call.array.end = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 1, !dbg !62 +// CHECK:STDOUT: store ptr %initializer_list.initializer_list.call.array.end, ptr %initializer_list.initializer_list.call.init_list.end, align 8, !dbg !62 +// CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !65 +// CHECK:STDOUT: call void @"_CSelfDestruct.71d86972d5684aff:core.Destroy.Core"(ptr %.loc23_69.17.temp), !dbg !63 +// CHECK:STDOUT: call void @"_CSelfDestruct.b204467699306999:core.Destroy.Core"(ptr %_.var), !dbg !62 +// CHECK:STDOUT: ret void, !dbg !66 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.3acda3b20248cb70:core.Destroy.Core"(ptr %self) #0 !dbg !67 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !69 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define internal void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr noundef %return) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !59 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !59 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !100 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !100 // CHECK:STDOUT: call void @_ZN15nontrivial_dtorC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %0) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -204,15 +252,35 @@ fn InitNontrivialDtor() { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN15nontrivial_dtorD2Ev(ptr noundef nonnull align 1 dereferenceable(1) %this) unnamed_addr #2 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !59 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !100 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.71d86972d5684aff:core.Destroy.Core"(ptr %self) #0 !dbg !42 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cbb50137a92c3ee4:core.Destroy.Core"(ptr %self) #0 !dbg !71 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !44 +// CHECK:STDOUT: call void @_ZN15nontrivial_dtorD2Ev(ptr %self), !dbg !73 +// CHECK:STDOUT: ret void, !dbg !73 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.71d86972d5684aff:core.Destroy.Core"(ptr %self) #0 !dbg !75 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !77 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.71d86972d5684aff:core.Destroy.Core"(ptr %self) #0 !dbg !79 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.71d86972d5684aff:core.Destroy.Core"(ptr %self), !dbg !81 +// CHECK:STDOUT: ret void, !dbg !81 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.b204467699306999:core.Destroy.Core"(ptr %self) #0 !dbg !83 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !85 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -230,7 +298,7 @@ fn InitNontrivialDtor() { // CHECK:STDOUT: store ptr %list.coerce0, ptr %0, align 8 // CHECK:STDOUT: %1 = getelementptr inbounds nuw { ptr, ptr }, ptr %list, i32 0, i32 1 // CHECK:STDOUT: store ptr %list.coerce1, ptr %1, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !52 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !93 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -239,7 +307,7 @@ fn InitNontrivialDtor() { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN15nontrivial_dtorC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %this) unnamed_addr #2 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !59 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !100 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -254,8 +322,8 @@ fn InitNontrivialDtor() { // CHECK:STDOUT: attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!5} -// CHECK:STDOUT: !llvm.module.flags = !{!60, !61, !62, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!64} +// CHECK:STDOUT: !llvm.module.flags = !{!101, !102, !103, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!105} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -264,54 +332,95 @@ fn InitNontrivialDtor() { // CHECK:STDOUT: !6 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) // CHECK:STDOUT: !7 = !{null} // CHECK:STDOUT: !8 = !DISubroutineType(types: !7) -// CHECK:STDOUT: !9 = !{null, !6} -// CHECK:STDOUT: !10 = !DISubroutineType(types: !9) -// CHECK:STDOUT: !11 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !12 = !{null, !11} +// CHECK:STDOUT: !9 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !10 = !{null, !9} +// CHECK:STDOUT: !11 = !DISubroutineType(types: !10) +// CHECK:STDOUT: !12 = !{null, !6} // CHECK:STDOUT: !13 = !DISubroutineType(types: !12) // CHECK:STDOUT: !16 = distinct !DISubprogram(name: "InitDirectly", linkageName: "_CInitDirectly.Main", scope: null, file: !4, line: 12, type: !8, spFlags: DISPFlagDefinition, unit: !5) // CHECK:STDOUT: !17 = !DILocation(line: 13, column: 3, scope: !16) // CHECK:STDOUT: !18 = !DILocation(line: 13, column: 42, scope: !16) // CHECK:STDOUT: !20 = !DILocation(line: 14, column: 3, scope: !16) // CHECK:STDOUT: !21 = !DILocation(line: 12, column: 1, scope: !16) -// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 13, type: !10, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !25) -// CHECK:STDOUT: !23 = !DILocalVariable(arg: 1, scope: !22, type: !6) -// CHECK:STDOUT: !24 = !DILocation(line: 13, column: 42, scope: !22) -// CHECK:STDOUT: !25 = !{!23} -// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "Op", linkageName: "_COp.dc7dedd104b837b2:core.Destroy.Core", scope: null, file: !4, line: 13, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !29) -// CHECK:STDOUT: !27 = !DILocalVariable(arg: 1, scope: !26, type: !11) -// CHECK:STDOUT: !28 = !DILocation(line: 13, column: 42, scope: !26) -// CHECK:STDOUT: !29 = !{!27} -// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "InitVectorLike", linkageName: "_CInitVectorLike.Main", scope: null, file: !4, line: 17, type: !8, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !31 = !DILocation(line: 18, column: 3, scope: !30) -// CHECK:STDOUT: !32 = !DILocation(line: 18, column: 28, scope: !30) -// CHECK:STDOUT: !34 = !DILocation(line: 19, column: 3, scope: !30) -// CHECK:STDOUT: !35 = !DILocation(line: 17, column: 1, scope: !30) -// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "InitNontrivialDtor", linkageName: "_CInitNontrivialDtor.Main", scope: null, file: !4, line: 22, type: !8, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !37 = !DILocation(line: 23, column: 3, scope: !36) -// CHECK:STDOUT: !38 = !DILocation(line: 23, column: 58, scope: !36) -// CHECK:STDOUT: !40 = !DILocation(line: 24, column: 3, scope: !36) -// CHECK:STDOUT: !41 = !DILocation(line: 22, column: 1, scope: !36) -// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "Op", linkageName: "_COp.71d86972d5684aff:core.Destroy.Core", scope: null, file: !4, line: 23, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !45) -// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !42, type: !11) -// CHECK:STDOUT: !44 = !DILocation(line: 23, column: 58, scope: !42) -// CHECK:STDOUT: !45 = !{!43} -// CHECK:STDOUT: !46 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !47 = !{!"omnipotent char", !46, i64 0} -// CHECK:STDOUT: !48 = !{!"any pointer", !47, i64 0} -// CHECK:STDOUT: !49 = !{!"p1 _ZTSSt16initializer_listIiE", !48, i64 0} -// CHECK:STDOUT: !50 = !{!49, !49, i64 0} -// CHECK:STDOUT: !51 = !{!"p1 _ZTS11vector_like", !48, i64 0} -// CHECK:STDOUT: !52 = !{!51, !51, i64 0} -// CHECK:STDOUT: !53 = !{!"int", !47, i64 0} -// CHECK:STDOUT: !54 = !{!"p1 int", !48, i64 0} -// CHECK:STDOUT: !56 = !{!54, !54, i64 0} -// CHECK:STDOUT: !57 = !{i64 0, i64 8, !56, i64 8, i64 8, !56} -// CHECK:STDOUT: !58 = !{!"p1 _ZTS15nontrivial_dtor", !48, i64 0} -// CHECK:STDOUT: !59 = !{!58, !58, i64 0} -// CHECK:STDOUT: !60 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !61 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !62 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !63 = !{!"__libc_errno", !53, i64 0} -// CHECK:STDOUT: !64 = !{!63, !53, i64 0} +// CHECK:STDOUT: !22 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") +// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.d088c7eb746488be:core.Destroy.Core", scope: null, file: !22, line: 164, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !26) +// CHECK:STDOUT: !24 = !DILocalVariable(arg: 1, scope: !23, type: !9) +// CHECK:STDOUT: !25 = !DILocation(line: 164, column: 19, scope: !23) +// CHECK:STDOUT: !26 = !{!24} +// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !4, line: 13, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !30) +// CHECK:STDOUT: !28 = !DILocalVariable(arg: 1, scope: !27, type: !6) +// CHECK:STDOUT: !29 = !DILocation(line: 13, column: 42, scope: !27) +// CHECK:STDOUT: !30 = !{!28} +// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 13, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !34) +// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !31, type: !6) +// CHECK:STDOUT: !33 = !DILocation(line: 13, column: 42, scope: !31) +// CHECK:STDOUT: !34 = !{!32} +// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 13, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !38) +// CHECK:STDOUT: !36 = !DILocalVariable(arg: 1, scope: !35, type: !6) +// CHECK:STDOUT: !37 = !DILocation(line: 13, column: 42, scope: !35) +// CHECK:STDOUT: !38 = !{!36} +// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.dc7dedd104b837b2:core.Destroy.Core", scope: null, file: !4, line: 13, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !42) +// CHECK:STDOUT: !40 = !DILocalVariable(arg: 1, scope: !39, type: !9) +// CHECK:STDOUT: !41 = !DILocation(line: 13, column: 42, scope: !39) +// CHECK:STDOUT: !42 = !{!40} +// CHECK:STDOUT: !43 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.dc7dedd104b837b2:core.Destroy.Core", scope: null, file: !4, line: 13, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !46) +// CHECK:STDOUT: !44 = !DILocalVariable(arg: 1, scope: !43, type: !9) +// CHECK:STDOUT: !45 = !DILocation(line: 13, column: 42, scope: !43) +// CHECK:STDOUT: !46 = !{!44} +// CHECK:STDOUT: !47 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.9e47f6d7a7c1f630:core.Destroy.Core", scope: null, file: !4, line: 13, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !50) +// CHECK:STDOUT: !48 = !DILocalVariable(arg: 1, scope: !47, type: !9) +// CHECK:STDOUT: !49 = !DILocation(line: 13, column: 3, scope: !47) +// CHECK:STDOUT: !50 = !{!48} +// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "InitVectorLike", linkageName: "_CInitVectorLike.Main", scope: null, file: !4, line: 17, type: !8, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !52 = !DILocation(line: 18, column: 3, scope: !51) +// CHECK:STDOUT: !53 = !DILocation(line: 18, column: 28, scope: !51) +// CHECK:STDOUT: !55 = !DILocation(line: 19, column: 3, scope: !51) +// CHECK:STDOUT: !56 = !DILocation(line: 17, column: 1, scope: !51) +// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.c4943df79074f7d2:core.Destroy.Core", scope: null, file: !4, line: 18, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !60) +// CHECK:STDOUT: !58 = !DILocalVariable(arg: 1, scope: !57, type: !9) +// CHECK:STDOUT: !59 = !DILocation(line: 18, column: 3, scope: !57) +// CHECK:STDOUT: !60 = !{!58} +// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "InitNontrivialDtor", linkageName: "_CInitNontrivialDtor.Main", scope: null, file: !4, line: 22, type: !8, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !62 = !DILocation(line: 23, column: 3, scope: !61) +// CHECK:STDOUT: !63 = !DILocation(line: 23, column: 58, scope: !61) +// CHECK:STDOUT: !65 = !DILocation(line: 24, column: 3, scope: !61) +// CHECK:STDOUT: !66 = !DILocation(line: 22, column: 1, scope: !61) +// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.3acda3b20248cb70:core.Destroy.Core", scope: null, file: !22, line: 164, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !70) +// CHECK:STDOUT: !68 = !DILocalVariable(arg: 1, scope: !67, type: !9) +// CHECK:STDOUT: !69 = !DILocation(line: 164, column: 19, scope: !67) +// CHECK:STDOUT: !70 = !{!68} +// CHECK:STDOUT: !71 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cbb50137a92c3ee4:core.Destroy.Core", scope: null, file: !4, line: 23, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !74) +// CHECK:STDOUT: !72 = !DILocalVariable(arg: 1, scope: !71, type: !9) +// CHECK:STDOUT: !73 = !DILocation(line: 23, column: 58, scope: !71) +// CHECK:STDOUT: !74 = !{!72} +// CHECK:STDOUT: !75 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.71d86972d5684aff:core.Destroy.Core", scope: null, file: !4, line: 23, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !78) +// CHECK:STDOUT: !76 = !DILocalVariable(arg: 1, scope: !75, type: !9) +// CHECK:STDOUT: !77 = !DILocation(line: 23, column: 58, scope: !75) +// CHECK:STDOUT: !78 = !{!76} +// CHECK:STDOUT: !79 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.71d86972d5684aff:core.Destroy.Core", scope: null, file: !4, line: 23, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !82) +// CHECK:STDOUT: !80 = !DILocalVariable(arg: 1, scope: !79, type: !9) +// CHECK:STDOUT: !81 = !DILocation(line: 23, column: 58, scope: !79) +// CHECK:STDOUT: !82 = !{!80} +// CHECK:STDOUT: !83 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.b204467699306999:core.Destroy.Core", scope: null, file: !4, line: 23, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !86) +// CHECK:STDOUT: !84 = !DILocalVariable(arg: 1, scope: !83, type: !9) +// CHECK:STDOUT: !85 = !DILocation(line: 23, column: 3, scope: !83) +// CHECK:STDOUT: !86 = !{!84} +// CHECK:STDOUT: !87 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !88 = !{!"omnipotent char", !87, i64 0} +// CHECK:STDOUT: !89 = !{!"any pointer", !88, i64 0} +// CHECK:STDOUT: !90 = !{!"p1 _ZTSSt16initializer_listIiE", !89, i64 0} +// CHECK:STDOUT: !91 = !{!90, !90, i64 0} +// CHECK:STDOUT: !92 = !{!"p1 _ZTS11vector_like", !89, i64 0} +// CHECK:STDOUT: !93 = !{!92, !92, i64 0} +// CHECK:STDOUT: !94 = !{!"int", !88, i64 0} +// CHECK:STDOUT: !95 = !{!"p1 int", !89, i64 0} +// CHECK:STDOUT: !97 = !{!95, !95, i64 0} +// CHECK:STDOUT: !98 = !{i64 0, i64 8, !97, i64 8, i64 8, !97} +// CHECK:STDOUT: !99 = !{!"p1 _ZTS15nontrivial_dtor", !89, i64 0} +// CHECK:STDOUT: !100 = !{!99, !99, i64 0} +// CHECK:STDOUT: !101 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !102 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !103 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !104 = !{!"__libc_errno", !94, i64 0} +// CHECK:STDOUT: !105 = !{!104, !94, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/std_initializer_list_pointer_size.carbon b/toolchain/lower/testdata/interop/cpp/std_initializer_list_pointer_size.carbon index 8076984732aa..9b4d87b6d2ec 100644 --- a/toolchain/lower/testdata/interop/cpp/std_initializer_list_pointer_size.carbon +++ b/toolchain/lower/testdata/interop/cpp/std_initializer_list_pointer_size.carbon @@ -100,43 +100,77 @@ fn InitNontrivialDtor() { // CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.size = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 8, !dbg !18 // CHECK:STDOUT: store i64 3, ptr %initializer_list.initializer_list.call.init_list.size, align 8, !dbg !18 // CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !21 -// CHECK:STDOUT: call void @"_COp.dc7dedd104b837b2:core.Destroy.Core"(ptr @array), !dbg !19 +// CHECK:STDOUT: call void @"_CSelfDestruct.dc7dedd104b837b2:core.Destroy.Core"(ptr @array), !dbg !19 +// CHECK:STDOUT: call void @"_CSelfDestruct.9e47f6d7a7c1f630:core.Destroy.Core"(ptr %_.var), !dbg !18 // CHECK:STDOUT: ret void, !dbg !22 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !23 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.d088c7eb746488be:core.Destroy.Core"(ptr %self) #0 !dbg !24 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !25 +// CHECK:STDOUT: ret void, !dbg !26 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.dc7dedd104b837b2:core.Destroy.Core"(ptr %self) #0 !dbg !27 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !28 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !29 +// CHECK:STDOUT: ret void, !dbg !30 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CInitVectorLike.Main() #0 !dbg !31 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !32 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca [1 x i8], align 1, !dbg !32 -// CHECK:STDOUT: %.loc18_36.3.temp = alloca [16 x i8], align 8, !dbg !33 -// CHECK:STDOUT: %.loc18_36.5.temp = alloca [3 x i32], align 4, !dbg !33 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !32 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_36.3.temp), !dbg !33 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_36.5.temp), !dbg !33 -// CHECK:STDOUT: %.loc18_36.6.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.5.temp, i32 0, i64 0, !dbg !33 -// CHECK:STDOUT: %.loc18_36.9.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.5.temp, i32 0, i64 1, !dbg !33 -// CHECK:STDOUT: %.loc18_36.12.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.5.temp, i32 0, i64 2, !dbg !33 -// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %.loc18_36.3.temp, i32 0, i32 0, !dbg !33 -// CHECK:STDOUT: store ptr @array.loc13_50.15, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !33 -// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.size = getelementptr inbounds nuw [16 x i8], ptr %.loc18_36.3.temp, i32 0, i32 8, !dbg !33 -// CHECK:STDOUT: store i64 3, ptr %initializer_list.initializer_list.call.init_list.size, align 8, !dbg !33 -// CHECK:STDOUT: call void @_ZN11vector_likeC1ESt16initializer_listIiE.carbon_thunk._(ptr %.loc18_36.3.temp, ptr %_.var), !dbg !32 -// CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !35 -// CHECK:STDOUT: call void @"_COp.dc7dedd104b837b2:core.Destroy.Core"(ptr @array), !dbg !33 -// CHECK:STDOUT: call void @_ZN11vector_likeD2Ev(ptr %_.var), !dbg !32 -// CHECK:STDOUT: ret void, !dbg !36 +// CHECK:STDOUT: ret void, !dbg !34 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !36 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !38 +// CHECK:STDOUT: ret void, !dbg !38 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.dc7dedd104b837b2:core.Destroy.Core"(ptr %self) #0 !dbg !40 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !42 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.dc7dedd104b837b2:core.Destroy.Core"(ptr %self) #0 !dbg !44 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.dc7dedd104b837b2:core.Destroy.Core"(ptr %self), !dbg !46 +// CHECK:STDOUT: ret void, !dbg !46 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.9e47f6d7a7c1f630:core.Destroy.Core"(ptr %self) #0 !dbg !48 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !50 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CInitVectorLike.Main() #0 !dbg !52 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %_.var = alloca [1 x i8], align 1, !dbg !53 +// CHECK:STDOUT: %.loc18_36.3.temp = alloca [16 x i8], align 8, !dbg !54 +// CHECK:STDOUT: %.loc18_36.5.temp = alloca [3 x i32], align 4, !dbg !54 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !53 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_36.3.temp), !dbg !54 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_36.5.temp), !dbg !54 +// CHECK:STDOUT: %.loc18_36.6.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.5.temp, i32 0, i64 0, !dbg !54 +// CHECK:STDOUT: %.loc18_36.9.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.5.temp, i32 0, i64 1, !dbg !54 +// CHECK:STDOUT: %.loc18_36.12.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.5.temp, i32 0, i64 2, !dbg !54 +// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %.loc18_36.3.temp, i32 0, i32 0, !dbg !54 +// CHECK:STDOUT: store ptr @array.loc13_50.15, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !54 +// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.size = getelementptr inbounds nuw [16 x i8], ptr %.loc18_36.3.temp, i32 0, i32 8, !dbg !54 +// CHECK:STDOUT: store i64 3, ptr %initializer_list.initializer_list.call.init_list.size, align 8, !dbg !54 +// CHECK:STDOUT: call void @_ZN11vector_likeC1ESt16initializer_listIiE.carbon_thunk._(ptr %.loc18_36.3.temp, ptr %_.var), !dbg !53 +// CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !56 +// CHECK:STDOUT: call void @"_CSelfDestruct.9e47f6d7a7c1f630:core.Destroy.Core"(ptr %.loc18_36.3.temp), !dbg !54 +// CHECK:STDOUT: call void @"_CSelfDestruct.dc7dedd104b837b2:core.Destroy.Core"(ptr @array), !dbg !54 +// CHECK:STDOUT: call void @"_CSelfDestruct.c4943df79074f7d2:core.Destroy.Core"(ptr %_.var), !dbg !53 +// CHECK:STDOUT: ret void, !dbg !57 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -145,11 +179,11 @@ fn InitNontrivialDtor() { // CHECK:STDOUT: %list.addr = alloca ptr, align 8 // CHECK:STDOUT: %return.addr = alloca ptr, align 8 // CHECK:STDOUT: %agg.tmp = alloca %"class.std::initializer_list", align 8 -// CHECK:STDOUT: store ptr %list, ptr %list.addr, align 8, !tbaa !51 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !53 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !53 -// CHECK:STDOUT: %1 = load ptr, ptr %list.addr, align 8, !tbaa !51 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %agg.tmp, ptr align 8 %1, i64 16, i1 false), !tbaa.struct !60 +// CHECK:STDOUT: store ptr %list, ptr %list.addr, align 8, !tbaa !92 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !94 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !94 +// CHECK:STDOUT: %1 = load ptr, ptr %list.addr, align 8, !tbaa !92 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %agg.tmp, ptr align 8 %1, i64 16, i1 false), !tbaa.struct !101 // CHECK:STDOUT: %2 = getelementptr inbounds nuw { ptr, i64 }, ptr %agg.tmp, i32 0, i32 0 // CHECK:STDOUT: %3 = load ptr, ptr %2, align 8 // CHECK:STDOUT: %4 = getelementptr inbounds nuw { ptr, i64 }, ptr %agg.tmp, i32 0, i32 1 @@ -162,39 +196,53 @@ fn InitNontrivialDtor() { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN11vector_likeD2Ev(ptr noundef nonnull align 1 dereferenceable(1) %this) unnamed_addr #2 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !53 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !94 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CInitNontrivialDtor.Main() #0 !dbg !37 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.c4943df79074f7d2:core.Destroy.Core"(ptr %self) #0 !dbg !58 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca [16 x i8], align 8, !dbg !38 -// CHECK:STDOUT: %.loc23_69.17.temp = alloca [3 x [1 x i8]], align 1, !dbg !39 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !38 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc23_69.17.temp), !dbg !39 -// CHECK:STDOUT: %.loc23_69.18.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 0, !dbg !39 -// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr %.loc23_69.18.array.index), !dbg !39 -// CHECK:STDOUT: %.loc23_69.16.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 1, !dbg !39 -// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr %.loc23_69.16.array.index), !dbg !39 -// CHECK:STDOUT: %.loc23_69.15.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 2, !dbg !39 -// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr %.loc23_69.15.array.index), !dbg !39 -// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 0, !dbg !38 -// CHECK:STDOUT: store ptr %.loc23_69.17.temp, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !38 -// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.size = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 8, !dbg !38 -// CHECK:STDOUT: store i64 3, ptr %initializer_list.initializer_list.call.init_list.size, align 8, !dbg !38 -// CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !41 -// CHECK:STDOUT: call void @"_COp.71d86972d5684aff:core.Destroy.Core"(ptr %.loc23_69.17.temp), !dbg !39 -// CHECK:STDOUT: ret void, !dbg !42 +// CHECK:STDOUT: call void @_ZN11vector_likeD2Ev(ptr %self), !dbg !60 +// CHECK:STDOUT: ret void, !dbg !60 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CInitNontrivialDtor.Main() #0 !dbg !62 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %_.var = alloca [16 x i8], align 8, !dbg !63 +// CHECK:STDOUT: %.loc23_69.17.temp = alloca [3 x [1 x i8]], align 1, !dbg !64 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !63 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc23_69.17.temp), !dbg !64 +// CHECK:STDOUT: %.loc23_69.18.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 0, !dbg !64 +// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr %.loc23_69.18.array.index), !dbg !64 +// CHECK:STDOUT: %.loc23_69.16.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 1, !dbg !64 +// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr %.loc23_69.16.array.index), !dbg !64 +// CHECK:STDOUT: %.loc23_69.15.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 2, !dbg !64 +// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr %.loc23_69.15.array.index), !dbg !64 +// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 0, !dbg !63 +// CHECK:STDOUT: store ptr %.loc23_69.17.temp, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !63 +// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.size = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 8, !dbg !63 +// CHECK:STDOUT: store i64 3, ptr %initializer_list.initializer_list.call.init_list.size, align 8, !dbg !63 +// CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !66 +// CHECK:STDOUT: call void @"_CSelfDestruct.71d86972d5684aff:core.Destroy.Core"(ptr %.loc23_69.17.temp), !dbg !64 +// CHECK:STDOUT: call void @"_CSelfDestruct.b204467699306999:core.Destroy.Core"(ptr %_.var), !dbg !63 +// CHECK:STDOUT: ret void, !dbg !67 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.3acda3b20248cb70:core.Destroy.Core"(ptr %self) #0 !dbg !68 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !70 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define internal void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr noundef %return) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !62 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !62 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !103 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !103 // CHECK:STDOUT: call void @_ZN15nontrivial_dtorC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %0) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -203,15 +251,35 @@ fn InitNontrivialDtor() { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN15nontrivial_dtorD2Ev(ptr noundef nonnull align 1 dereferenceable(1) %this) unnamed_addr #2 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !62 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !103 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.71d86972d5684aff:core.Destroy.Core"(ptr %self) #0 !dbg !43 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cbb50137a92c3ee4:core.Destroy.Core"(ptr %self) #0 !dbg !72 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !45 +// CHECK:STDOUT: call void @_ZN15nontrivial_dtorD2Ev(ptr %self), !dbg !74 +// CHECK:STDOUT: ret void, !dbg !74 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.71d86972d5684aff:core.Destroy.Core"(ptr %self) #0 !dbg !76 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !78 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.71d86972d5684aff:core.Destroy.Core"(ptr %self) #0 !dbg !80 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.71d86972d5684aff:core.Destroy.Core"(ptr %self), !dbg !82 +// CHECK:STDOUT: ret void, !dbg !82 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.b204467699306999:core.Destroy.Core"(ptr %self) #0 !dbg !84 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !86 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -229,7 +297,7 @@ fn InitNontrivialDtor() { // CHECK:STDOUT: store ptr %list.coerce0, ptr %0, align 8 // CHECK:STDOUT: %1 = getelementptr inbounds nuw { ptr, i64 }, ptr %list, i32 0, i32 1 // CHECK:STDOUT: store i64 %list.coerce1, ptr %1, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !53 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !94 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -238,7 +306,7 @@ fn InitNontrivialDtor() { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN15nontrivial_dtorC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %this) unnamed_addr #2 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !62 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !103 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -253,8 +321,8 @@ fn InitNontrivialDtor() { // CHECK:STDOUT: attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!5} -// CHECK:STDOUT: !llvm.module.flags = !{!63, !64, !65, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!67} +// CHECK:STDOUT: !llvm.module.flags = !{!104, !105, !106, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!108} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -263,56 +331,97 @@ fn InitNontrivialDtor() { // CHECK:STDOUT: !6 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) // CHECK:STDOUT: !8 = !{null} // CHECK:STDOUT: !9 = !DISubroutineType(types: !8) -// CHECK:STDOUT: !10 = !{null, !6} -// CHECK:STDOUT: !11 = !DISubroutineType(types: !10) -// CHECK:STDOUT: !12 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !13 = !{null, !12} +// CHECK:STDOUT: !10 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !11 = !{null, !10} +// CHECK:STDOUT: !12 = !DISubroutineType(types: !11) +// CHECK:STDOUT: !13 = !{null, !6} // CHECK:STDOUT: !14 = !DISubroutineType(types: !13) // CHECK:STDOUT: !17 = distinct !DISubprogram(name: "InitDirectly", linkageName: "_CInitDirectly.Main", scope: null, file: !4, line: 12, type: !9, spFlags: DISPFlagDefinition, unit: !5) // CHECK:STDOUT: !18 = !DILocation(line: 13, column: 3, scope: !17) // CHECK:STDOUT: !19 = !DILocation(line: 13, column: 42, scope: !17) // CHECK:STDOUT: !21 = !DILocation(line: 14, column: 3, scope: !17) // CHECK:STDOUT: !22 = !DILocation(line: 12, column: 1, scope: !17) -// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 13, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !26) -// CHECK:STDOUT: !24 = !DILocalVariable(arg: 1, scope: !23, type: !6) -// CHECK:STDOUT: !25 = !DILocation(line: 13, column: 42, scope: !23) -// CHECK:STDOUT: !26 = !{!24} -// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "Op", linkageName: "_COp.dc7dedd104b837b2:core.Destroy.Core", scope: null, file: !4, line: 13, type: !14, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !30) -// CHECK:STDOUT: !28 = !DILocalVariable(arg: 1, scope: !27, type: !12) -// CHECK:STDOUT: !29 = !DILocation(line: 13, column: 42, scope: !27) -// CHECK:STDOUT: !30 = !{!28} -// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "InitVectorLike", linkageName: "_CInitVectorLike.Main", scope: null, file: !4, line: 17, type: !9, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !32 = !DILocation(line: 18, column: 3, scope: !31) -// CHECK:STDOUT: !33 = !DILocation(line: 18, column: 28, scope: !31) -// CHECK:STDOUT: !35 = !DILocation(line: 19, column: 3, scope: !31) -// CHECK:STDOUT: !36 = !DILocation(line: 17, column: 1, scope: !31) -// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "InitNontrivialDtor", linkageName: "_CInitNontrivialDtor.Main", scope: null, file: !4, line: 22, type: !9, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !38 = !DILocation(line: 23, column: 3, scope: !37) -// CHECK:STDOUT: !39 = !DILocation(line: 23, column: 58, scope: !37) -// CHECK:STDOUT: !41 = !DILocation(line: 24, column: 3, scope: !37) -// CHECK:STDOUT: !42 = !DILocation(line: 22, column: 1, scope: !37) -// CHECK:STDOUT: !43 = distinct !DISubprogram(name: "Op", linkageName: "_COp.71d86972d5684aff:core.Destroy.Core", scope: null, file: !4, line: 23, type: !14, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !46) -// CHECK:STDOUT: !44 = !DILocalVariable(arg: 1, scope: !43, type: !12) -// CHECK:STDOUT: !45 = !DILocation(line: 23, column: 58, scope: !43) -// CHECK:STDOUT: !46 = !{!44} -// CHECK:STDOUT: !47 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !48 = !{!"omnipotent char", !47, i64 0} -// CHECK:STDOUT: !49 = !{!"any pointer", !48, i64 0} -// CHECK:STDOUT: !50 = !{!"p1 _ZTSSt16initializer_listIiE", !49, i64 0} -// CHECK:STDOUT: !51 = !{!50, !50, i64 0} -// CHECK:STDOUT: !52 = !{!"p1 _ZTS11vector_like", !49, i64 0} -// CHECK:STDOUT: !53 = !{!52, !52, i64 0} -// CHECK:STDOUT: !54 = !{!"int", !48, i64 0} -// CHECK:STDOUT: !55 = !{!"p1 int", !49, i64 0} -// CHECK:STDOUT: !56 = !{!"long", !48, i64 0} -// CHECK:STDOUT: !58 = !{!55, !55, i64 0} -// CHECK:STDOUT: !59 = !{!56, !56, i64 0} -// CHECK:STDOUT: !60 = !{i64 0, i64 8, !58, i64 8, i64 8, !59} -// CHECK:STDOUT: !61 = !{!"p1 _ZTS15nontrivial_dtor", !49, i64 0} -// CHECK:STDOUT: !62 = !{!61, !61, i64 0} -// CHECK:STDOUT: !63 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !64 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !65 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !66 = !{!"__libc_errno", !54, i64 0} -// CHECK:STDOUT: !67 = !{!66, !54, i64 0} +// CHECK:STDOUT: !23 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") +// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.d088c7eb746488be:core.Destroy.Core", scope: null, file: !23, line: 164, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !27) +// CHECK:STDOUT: !25 = !DILocalVariable(arg: 1, scope: !24, type: !10) +// CHECK:STDOUT: !26 = !DILocation(line: 164, column: 19, scope: !24) +// CHECK:STDOUT: !27 = !{!25} +// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !4, line: 13, type: !14, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !31) +// CHECK:STDOUT: !29 = !DILocalVariable(arg: 1, scope: !28, type: !6) +// CHECK:STDOUT: !30 = !DILocation(line: 13, column: 42, scope: !28) +// CHECK:STDOUT: !31 = !{!29} +// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 13, type: !14, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !35) +// CHECK:STDOUT: !33 = !DILocalVariable(arg: 1, scope: !32, type: !6) +// CHECK:STDOUT: !34 = !DILocation(line: 13, column: 42, scope: !32) +// CHECK:STDOUT: !35 = !{!33} +// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 13, type: !14, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !39) +// CHECK:STDOUT: !37 = !DILocalVariable(arg: 1, scope: !36, type: !6) +// CHECK:STDOUT: !38 = !DILocation(line: 13, column: 42, scope: !36) +// CHECK:STDOUT: !39 = !{!37} +// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.dc7dedd104b837b2:core.Destroy.Core", scope: null, file: !4, line: 13, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !43) +// CHECK:STDOUT: !41 = !DILocalVariable(arg: 1, scope: !40, type: !10) +// CHECK:STDOUT: !42 = !DILocation(line: 13, column: 42, scope: !40) +// CHECK:STDOUT: !43 = !{!41} +// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.dc7dedd104b837b2:core.Destroy.Core", scope: null, file: !4, line: 13, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !47) +// CHECK:STDOUT: !45 = !DILocalVariable(arg: 1, scope: !44, type: !10) +// CHECK:STDOUT: !46 = !DILocation(line: 13, column: 42, scope: !44) +// CHECK:STDOUT: !47 = !{!45} +// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.9e47f6d7a7c1f630:core.Destroy.Core", scope: null, file: !4, line: 13, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !51) +// CHECK:STDOUT: !49 = !DILocalVariable(arg: 1, scope: !48, type: !10) +// CHECK:STDOUT: !50 = !DILocation(line: 13, column: 3, scope: !48) +// CHECK:STDOUT: !51 = !{!49} +// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "InitVectorLike", linkageName: "_CInitVectorLike.Main", scope: null, file: !4, line: 17, type: !9, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !53 = !DILocation(line: 18, column: 3, scope: !52) +// CHECK:STDOUT: !54 = !DILocation(line: 18, column: 28, scope: !52) +// CHECK:STDOUT: !56 = !DILocation(line: 19, column: 3, scope: !52) +// CHECK:STDOUT: !57 = !DILocation(line: 17, column: 1, scope: !52) +// CHECK:STDOUT: !58 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.c4943df79074f7d2:core.Destroy.Core", scope: null, file: !4, line: 18, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !61) +// CHECK:STDOUT: !59 = !DILocalVariable(arg: 1, scope: !58, type: !10) +// CHECK:STDOUT: !60 = !DILocation(line: 18, column: 3, scope: !58) +// CHECK:STDOUT: !61 = !{!59} +// CHECK:STDOUT: !62 = distinct !DISubprogram(name: "InitNontrivialDtor", linkageName: "_CInitNontrivialDtor.Main", scope: null, file: !4, line: 22, type: !9, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !63 = !DILocation(line: 23, column: 3, scope: !62) +// CHECK:STDOUT: !64 = !DILocation(line: 23, column: 58, scope: !62) +// CHECK:STDOUT: !66 = !DILocation(line: 24, column: 3, scope: !62) +// CHECK:STDOUT: !67 = !DILocation(line: 22, column: 1, scope: !62) +// CHECK:STDOUT: !68 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.3acda3b20248cb70:core.Destroy.Core", scope: null, file: !23, line: 164, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !71) +// CHECK:STDOUT: !69 = !DILocalVariable(arg: 1, scope: !68, type: !10) +// CHECK:STDOUT: !70 = !DILocation(line: 164, column: 19, scope: !68) +// CHECK:STDOUT: !71 = !{!69} +// CHECK:STDOUT: !72 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cbb50137a92c3ee4:core.Destroy.Core", scope: null, file: !4, line: 23, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !75) +// CHECK:STDOUT: !73 = !DILocalVariable(arg: 1, scope: !72, type: !10) +// CHECK:STDOUT: !74 = !DILocation(line: 23, column: 58, scope: !72) +// CHECK:STDOUT: !75 = !{!73} +// CHECK:STDOUT: !76 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.71d86972d5684aff:core.Destroy.Core", scope: null, file: !4, line: 23, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !79) +// CHECK:STDOUT: !77 = !DILocalVariable(arg: 1, scope: !76, type: !10) +// CHECK:STDOUT: !78 = !DILocation(line: 23, column: 58, scope: !76) +// CHECK:STDOUT: !79 = !{!77} +// CHECK:STDOUT: !80 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.71d86972d5684aff:core.Destroy.Core", scope: null, file: !4, line: 23, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !83) +// CHECK:STDOUT: !81 = !DILocalVariable(arg: 1, scope: !80, type: !10) +// CHECK:STDOUT: !82 = !DILocation(line: 23, column: 58, scope: !80) +// CHECK:STDOUT: !83 = !{!81} +// CHECK:STDOUT: !84 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.b204467699306999:core.Destroy.Core", scope: null, file: !4, line: 23, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !87) +// CHECK:STDOUT: !85 = !DILocalVariable(arg: 1, scope: !84, type: !10) +// CHECK:STDOUT: !86 = !DILocation(line: 23, column: 3, scope: !84) +// CHECK:STDOUT: !87 = !{!85} +// CHECK:STDOUT: !88 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !89 = !{!"omnipotent char", !88, i64 0} +// CHECK:STDOUT: !90 = !{!"any pointer", !89, i64 0} +// CHECK:STDOUT: !91 = !{!"p1 _ZTSSt16initializer_listIiE", !90, i64 0} +// CHECK:STDOUT: !92 = !{!91, !91, i64 0} +// CHECK:STDOUT: !93 = !{!"p1 _ZTS11vector_like", !90, i64 0} +// CHECK:STDOUT: !94 = !{!93, !93, i64 0} +// CHECK:STDOUT: !95 = !{!"int", !89, i64 0} +// CHECK:STDOUT: !96 = !{!"p1 int", !90, i64 0} +// CHECK:STDOUT: !97 = !{!"long", !89, i64 0} +// CHECK:STDOUT: !99 = !{!96, !96, i64 0} +// CHECK:STDOUT: !100 = !{!97, !97, i64 0} +// CHECK:STDOUT: !101 = !{i64 0, i64 8, !99, i64 8, i64 8, !100} +// CHECK:STDOUT: !102 = !{!"p1 _ZTS15nontrivial_dtor", !90, i64 0} +// CHECK:STDOUT: !103 = !{!102, !102, i64 0} +// CHECK:STDOUT: !104 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !105 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !106 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !107 = !{!"__libc_errno", !95, i64 0} +// CHECK:STDOUT: !108 = !{!107, !95, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/template.carbon b/toolchain/lower/testdata/interop/cpp/template.carbon index 76a79bde6832..be26211f4827 100644 --- a/toolchain/lower/testdata/interop/cpp/template.carbon +++ b/toolchain/lower/testdata/interop/cpp/template.carbon @@ -280,6 +280,7 @@ fn Call3() { // CHECK:STDOUT: %.loc12_12.2.temp = alloca {}, align 1, !dbg !96 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_12.2.temp), !dbg !96 // CHECK:STDOUT: call void @_Z3fooIJEEv1XDpT_.carbon_thunk._(ptr @X.val.loc12_14.3), !dbg !97 +// CHECK:STDOUT: call void @"_CSelfDestruct.3d7b8a41b4c67e71:core.Destroy.Core"(ptr @X.val), !dbg !96 // CHECK:STDOUT: ret void, !dbg !98 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -288,19 +289,26 @@ fn Call3() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 // CHECK:STDOUT: %agg.tmp = alloca %class.X, align 1 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !108 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !108 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !112 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !112 // CHECK:STDOUT: call void @_Z3fooIJEEv1XDpT_() // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CCall2.Main() #0 !dbg !99 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.3d7b8a41b4c67e71:core.Destroy.Core"(ptr %self) #0 !dbg !99 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc18_12.2.temp = alloca {}, align 1, !dbg !100 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_12.2.temp), !dbg !100 -// CHECK:STDOUT: call void @_Z3fooIJiEEv1XDpT_.carbon_thunk.__(ptr @X.val.loc12_14.3, i32 2), !dbg !101 -// CHECK:STDOUT: ret void, !dbg !102 +// CHECK:STDOUT: ret void, !dbg !101 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CCall2.Main() #0 !dbg !103 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %.loc18_12.2.temp = alloca {}, align 1, !dbg !104 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_12.2.temp), !dbg !104 +// CHECK:STDOUT: call void @_Z3fooIJiEEv1XDpT_.carbon_thunk.__(ptr @X.val.loc12_14.3, i32 2), !dbg !105 +// CHECK:STDOUT: call void @"_CSelfDestruct.3d7b8a41b4c67e71:core.Destroy.Core"(ptr @X.val), !dbg !104 +// CHECK:STDOUT: ret void, !dbg !106 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -309,21 +317,22 @@ fn Call3() { // CHECK:STDOUT: %.addr = alloca ptr, align 8 // CHECK:STDOUT: %.addr1 = alloca i32, align 4 // CHECK:STDOUT: %agg.tmp = alloca %class.X, align 1 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !108 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !112 // CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !58 -// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !108 +// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !112 // CHECK:STDOUT: %3 = load i32, ptr %.addr1, align 4, !tbaa !58 // CHECK:STDOUT: call void @_Z3fooIJiEEv1XDpT_(i32 noundef %3) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CCall3.Main() #0 !dbg !103 { +// CHECK:STDOUT: define void @_CCall3.Main() #0 !dbg !107 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc24_12.2.temp = alloca {}, align 1, !dbg !104 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc24_12.2.temp), !dbg !104 -// CHECK:STDOUT: call void @_Z3fooIJiiEEv1XDpT_.carbon_thunk.___(ptr @X.val.loc12_14.3, i32 2, i32 3), !dbg !105 -// CHECK:STDOUT: ret void, !dbg !106 +// CHECK:STDOUT: %.loc24_12.2.temp = alloca {}, align 1, !dbg !108 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc24_12.2.temp), !dbg !108 +// CHECK:STDOUT: call void @_Z3fooIJiiEEv1XDpT_.carbon_thunk.___(ptr @X.val.loc12_14.3, i32 2, i32 3), !dbg !109 +// CHECK:STDOUT: call void @"_CSelfDestruct.3d7b8a41b4c67e71:core.Destroy.Core"(ptr @X.val), !dbg !108 +// CHECK:STDOUT: ret void, !dbg !110 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -333,10 +342,10 @@ fn Call3() { // CHECK:STDOUT: %.addr1 = alloca i32, align 4 // CHECK:STDOUT: %.addr2 = alloca i32, align 4 // CHECK:STDOUT: %agg.tmp = alloca %class.X, align 1 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !108 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !112 // CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !58 // CHECK:STDOUT: store i32 %2, ptr %.addr2, align 4, !tbaa !58 -// CHECK:STDOUT: %3 = load ptr, ptr %.addr, align 8, !tbaa !108 +// CHECK:STDOUT: %3 = load ptr, ptr %.addr, align 8, !tbaa !112 // CHECK:STDOUT: %4 = load i32, ptr %.addr1, align 4, !tbaa !58 // CHECK:STDOUT: %5 = load i32, ptr %.addr2, align 4, !tbaa !58 // CHECK:STDOUT: call void @_Z3fooIJiiEEv1XDpT_(i32 noundef %4, i32 noundef %5) @@ -366,6 +375,7 @@ fn Call3() { // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !23 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) // CHECK:STDOUT: !55 = !{!"Simple C++ TBAA"} // CHECK:STDOUT: !56 = !{!"omnipotent char", !55, i64 0} // CHECK:STDOUT: !57 = !{!"int", !56, i64 0} @@ -380,18 +390,24 @@ fn Call3() { // CHECK:STDOUT: !71 = !DISubroutineType(types: !70) // CHECK:STDOUT: !87 = !DIFile(filename: "variadic_thunk.carbon", directory: "") // CHECK:STDOUT: !88 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !87, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !89 = !{null, !23} +// CHECK:STDOUT: !90 = !DISubroutineType(types: !89) // CHECK:STDOUT: !95 = distinct !DISubprogram(name: "Call1", linkageName: "_CCall1.Main", scope: null, file: !87, line: 10, type: !71, spFlags: DISPFlagDefinition, unit: !88) // CHECK:STDOUT: !96 = !DILocation(line: 12, column: 11, scope: !95) // CHECK:STDOUT: !97 = !DILocation(line: 12, column: 3, scope: !95) // CHECK:STDOUT: !98 = !DILocation(line: 10, column: 1, scope: !95) -// CHECK:STDOUT: !99 = distinct !DISubprogram(name: "Call2", linkageName: "_CCall2.Main", scope: null, file: !87, line: 16, type: !71, spFlags: DISPFlagDefinition, unit: !88) -// CHECK:STDOUT: !100 = !DILocation(line: 18, column: 11, scope: !99) -// CHECK:STDOUT: !101 = !DILocation(line: 18, column: 3, scope: !99) -// CHECK:STDOUT: !102 = !DILocation(line: 16, column: 1, scope: !99) -// CHECK:STDOUT: !103 = distinct !DISubprogram(name: "Call3", linkageName: "_CCall3.Main", scope: null, file: !87, line: 22, type: !71, spFlags: DISPFlagDefinition, unit: !88) -// CHECK:STDOUT: !104 = !DILocation(line: 24, column: 11, scope: !103) -// CHECK:STDOUT: !105 = !DILocation(line: 24, column: 3, scope: !103) -// CHECK:STDOUT: !106 = !DILocation(line: 22, column: 1, scope: !103) -// CHECK:STDOUT: !107 = !{!"p1 _ZTS1X", !59, i64 0} -// CHECK:STDOUT: !108 = !{!107, !107, i64 0} +// CHECK:STDOUT: !99 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.3d7b8a41b4c67e71:core.Destroy.Core", scope: null, file: !87, line: 12, type: !90, spFlags: DISPFlagDefinition, unit: !88, retainedNodes: !102) +// CHECK:STDOUT: !100 = !DILocalVariable(arg: 1, scope: !99, type: !23) +// CHECK:STDOUT: !101 = !DILocation(line: 12, column: 11, scope: !99) +// CHECK:STDOUT: !102 = !{!100} +// CHECK:STDOUT: !103 = distinct !DISubprogram(name: "Call2", linkageName: "_CCall2.Main", scope: null, file: !87, line: 16, type: !71, spFlags: DISPFlagDefinition, unit: !88) +// CHECK:STDOUT: !104 = !DILocation(line: 18, column: 11, scope: !103) +// CHECK:STDOUT: !105 = !DILocation(line: 18, column: 3, scope: !103) +// CHECK:STDOUT: !106 = !DILocation(line: 16, column: 1, scope: !103) +// CHECK:STDOUT: !107 = distinct !DISubprogram(name: "Call3", linkageName: "_CCall3.Main", scope: null, file: !87, line: 22, type: !71, spFlags: DISPFlagDefinition, unit: !88) +// CHECK:STDOUT: !108 = !DILocation(line: 24, column: 11, scope: !107) +// CHECK:STDOUT: !109 = !DILocation(line: 24, column: 3, scope: !107) +// CHECK:STDOUT: !110 = !DILocation(line: 22, column: 1, scope: !107) +// CHECK:STDOUT: !111 = !{!"p1 _ZTS1X", !59, i64 0} +// CHECK:STDOUT: !112 = !{!111, !111, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/thunks.carbon b/toolchain/lower/testdata/interop/cpp/thunks.carbon index b888d2273683..791a9188911d 100644 --- a/toolchain/lower/testdata/interop/cpp/thunks.carbon +++ b/toolchain/lower/testdata/interop/cpp/thunks.carbon @@ -111,6 +111,7 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %n2.var), !dbg !44 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_34.1.temp), !dbg !45 // CHECK:STDOUT: call void @_ZN9NeedThunkC1ERKS_.carbon_thunk._(ptr %n, ptr %n2.var), !dbg !45 +// CHECK:STDOUT: call void @"_CSelfDestruct.e015ef96e8aea788:core.Destroy.Core"(ptr %n2.var), !dbg !44 // CHECK:STDOUT: ret void, !dbg !47 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -119,10 +120,10 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !62 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !62 -// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !62 -// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !62 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !66 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !66 +// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !66 +// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !66 // CHECK:STDOUT: call void @_ZN9NeedThunkC1ERKS_(ptr noundef nonnull align 1 dereferenceable(1) %1, ptr noundef nonnull align 1 dereferenceable(1) %2) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -134,12 +135,18 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) { // CHECK:STDOUT: ret void, !dbg !52 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Destroy.092ad14c7174f642.Core:NeedThunk.Cpp"(ptr %self) #2 !dbg !54 { +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.e015ef96e8aea788:core.Destroy.Core"(ptr %self) #0 !dbg !54 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !56 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy:thunk:Destroy.092ad14c7174f642.Core:NeedThunk.Cpp"(ptr %self) #2 !dbg !58 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !60 +// 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)) #3 // CHECK:STDOUT: @@ -155,8 +162,8 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) { // CHECK:STDOUT: attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!33} -// CHECK:STDOUT: !llvm.module.flags = !{!64, !65, !66, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!69} +// CHECK:STDOUT: !llvm.module.flags = !{!68, !69, !70, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!73} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -178,21 +185,25 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) { // CHECK:STDOUT: !51 = !DILocalVariable(arg: 1, scope: !50, type: !34) // CHECK:STDOUT: !52 = !DILocation(line: 4, column: 3, scope: !50) // CHECK:STDOUT: !53 = !{!51} -// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Destroy.092ad14c7174f642.Core:NeedThunk.Cpp", scope: null, file: !49, line: 5, type: !36, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !57) +// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.e015ef96e8aea788:core.Destroy.Core", scope: null, file: !32, line: 9, type: !36, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !57) // CHECK:STDOUT: !55 = !DILocalVariable(arg: 1, scope: !54, type: !34) -// CHECK:STDOUT: !56 = !DILocation(line: 5, column: 3, scope: !54) +// CHECK:STDOUT: !56 = !DILocation(line: 9, column: 3, scope: !54) // CHECK:STDOUT: !57 = !{!55} -// CHECK:STDOUT: !58 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !59 = !{!"omnipotent char", !58, i64 0} -// CHECK:STDOUT: !60 = !{!"any pointer", !59, i64 0} -// CHECK:STDOUT: !61 = !{!"p1 _ZTS9NeedThunk", !60, i64 0} -// CHECK:STDOUT: !62 = !{!61, !61, i64 0} -// CHECK:STDOUT: !64 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !65 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !66 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !67 = !{!"int", !59, i64 0} -// CHECK:STDOUT: !68 = !{!"__libc_errno", !67, i64 0} -// CHECK:STDOUT: !69 = !{!68, !67, i64 0} +// CHECK:STDOUT: !58 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy:thunk:Destroy.092ad14c7174f642.Core:NeedThunk.Cpp", scope: null, file: !49, line: 5, type: !36, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !61) +// CHECK:STDOUT: !59 = !DILocalVariable(arg: 1, scope: !58, type: !34) +// CHECK:STDOUT: !60 = !DILocation(line: 5, column: 3, scope: !58) +// CHECK:STDOUT: !61 = !{!59} +// CHECK:STDOUT: !62 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !63 = !{!"omnipotent char", !62, i64 0} +// CHECK:STDOUT: !64 = !{!"any pointer", !63, i64 0} +// CHECK:STDOUT: !65 = !{!"p1 _ZTS9NeedThunk", !64, i64 0} +// CHECK:STDOUT: !66 = !{!65, !65, i64 0} +// CHECK:STDOUT: !68 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !69 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !70 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !71 = !{!"int", !63, i64 0} +// CHECK:STDOUT: !72 = !{!"__libc_errno", !71, i64 0} +// CHECK:STDOUT: !73 = !{!72, !71, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'thunks_for_distinct_specializations.carbon' @@ -201,21 +212,21 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) { // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CCall.Main(ptr %a, ptr %b) #0 !dbg !72 { +// CHECK:STDOUT: define void @_CCall.Main(ptr %a, ptr %b) #0 !dbg !76 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %a2.var = alloca [1 x i8], align 1, !dbg !77 -// CHECK:STDOUT: %.loc12_35.1.temp = alloca [1 x i8], align 1, !dbg !78 -// CHECK:STDOUT: %b2.var = alloca [1 x i8], align 1, !dbg !80 -// CHECK:STDOUT: %.loc13_35.1.temp = alloca [1 x i8], align 1, !dbg !81 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a2.var), !dbg !77 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_35.1.temp), !dbg !78 -// CHECK:STDOUT: call void @_ZN3BoxI1AEC1ERKS1_.carbon_thunk._(ptr %a, ptr %a2.var), !dbg !78 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %b2.var), !dbg !80 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc13_35.1.temp), !dbg !81 -// CHECK:STDOUT: call void @_ZN3BoxI1BEC1ERKS1_.carbon_thunk._(ptr %b, ptr %b2.var), !dbg !81 -// CHECK:STDOUT: call void @_ZN3BoxI1BED1Ev(ptr %b2.var), !dbg !80 -// CHECK:STDOUT: call void @_ZN3BoxI1AED1Ev(ptr %a2.var), !dbg !77 -// CHECK:STDOUT: ret void, !dbg !83 +// CHECK:STDOUT: %a2.var = alloca [1 x i8], align 1, !dbg !81 +// CHECK:STDOUT: %.loc12_35.1.temp = alloca [1 x i8], align 1, !dbg !82 +// CHECK:STDOUT: %b2.var = alloca [1 x i8], align 1, !dbg !84 +// CHECK:STDOUT: %.loc13_35.1.temp = alloca [1 x i8], align 1, !dbg !85 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a2.var), !dbg !81 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_35.1.temp), !dbg !82 +// CHECK:STDOUT: call void @_ZN3BoxI1AEC1ERKS1_.carbon_thunk._(ptr %a, ptr %a2.var), !dbg !82 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %b2.var), !dbg !84 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc13_35.1.temp), !dbg !85 +// CHECK:STDOUT: call void @_ZN3BoxI1BEC1ERKS1_.carbon_thunk._(ptr %b, ptr %b2.var), !dbg !85 +// CHECK:STDOUT: call void @"_CSelfDestruct.c6bde88ac44221c1:core.Destroy.Core"(ptr %b2.var), !dbg !84 +// CHECK:STDOUT: call void @"_CSelfDestruct.35d03e94f0115619:core.Destroy.Core"(ptr %a2.var), !dbg !81 +// CHECK:STDOUT: ret void, !dbg !87 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -223,19 +234,19 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !95 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !95 -// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !95 -// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !95 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !107 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !107 +// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !107 +// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !107 // CHECK:STDOUT: call void @_ZN3BoxI1AEC1ERKS1_(ptr noundef nonnull align 1 dereferenceable(1) %1, ptr noundef nonnull align 1 dereferenceable(1) %2) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Copy.c0735c73762b4d1c.Core:Box.Cpp"(ptr sret([1 x i8]) %return, ptr %self) #2 !dbg !86 { +// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Copy.c0735c73762b4d1c.Core:Box.Cpp"(ptr sret([1 x i8]) %return, ptr %self) #2 !dbg !90 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_ZN3BoxI1AEC1ERKS1_.carbon_thunk._(ptr %self, ptr %return), !dbg !88 -// CHECK:STDOUT: ret void, !dbg !88 +// CHECK:STDOUT: call void @_ZN3BoxI1AEC1ERKS1_.carbon_thunk._(ptr %self, ptr %return), !dbg !92 +// CHECK:STDOUT: ret void, !dbg !92 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -243,27 +254,41 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !99 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !99 -// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !99 -// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !99 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !111 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !111 +// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !111 +// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !111 // CHECK:STDOUT: call void @_ZN3BoxI1BEC1ERKS1_(ptr noundef nonnull align 1 dereferenceable(1) %1, ptr noundef nonnull align 1 dereferenceable(1) %2) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Copy.2c1dd62357f2b914.Core:Box.Cpp"(ptr sret([1 x i8]) %return, ptr %self) #2 !dbg !90 { +// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Copy.2c1dd62357f2b914.Core:Box.Cpp"(ptr sret([1 x i8]) %return, ptr %self) #2 !dbg !94 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_ZN3BoxI1BEC1ERKS1_.carbon_thunk._(ptr %self, ptr %return), !dbg !92 -// CHECK:STDOUT: ret void, !dbg !92 +// CHECK:STDOUT: call void @_ZN3BoxI1BEC1ERKS1_.carbon_thunk._(ptr %self, ptr %return), !dbg !96 +// CHECK:STDOUT: ret void, !dbg !96 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind // CHECK:STDOUT: declare void @_ZN3BoxI1BED1Ev(ptr noundef nonnull align 1 dead_on_return(1) dereferenceable(1)) unnamed_addr #3 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.c6bde88ac44221c1:core.Destroy.Core"(ptr %self) #0 !dbg !98 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @_ZN3BoxI1BED1Ev(ptr %self), !dbg !100 +// CHECK:STDOUT: ret void, !dbg !100 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind // CHECK:STDOUT: declare void @_ZN3BoxI1AED1Ev(ptr noundef nonnull align 1 dead_on_return(1) dereferenceable(1)) unnamed_addr #3 // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.35d03e94f0115619:core.Destroy.Core"(ptr %self) #0 !dbg !102 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @_ZN3BoxI1AED1Ev(ptr %self), !dbg !104 +// CHECK:STDOUT: ret void, !dbg !104 +// 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)) #4 // CHECK:STDOUT: @@ -281,50 +306,60 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) { // CHECK:STDOUT: attributes #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: attributes #5 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!71} -// CHECK:STDOUT: !llvm.module.flags = !{!64, !65, !66, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!69} +// CHECK:STDOUT: !llvm.dbg.cu = !{!75} +// CHECK:STDOUT: !llvm.module.flags = !{!68, !69, !70, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!73} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !34 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !35 = !{null, !34} +// CHECK:STDOUT: !36 = !DISubroutineType(types: !35) // CHECK:STDOUT: !37 = !{null, !34, !34} // CHECK:STDOUT: !38 = !DISubroutineType(types: !37) // CHECK:STDOUT: !39 = !{!34, !34} // CHECK:STDOUT: !40 = !DISubroutineType(types: !39) -// CHECK:STDOUT: !58 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !59 = !{!"omnipotent char", !58, i64 0} -// CHECK:STDOUT: !60 = !{!"any pointer", !59, i64 0} -// CHECK:STDOUT: !64 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !65 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !66 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !67 = !{!"int", !59, i64 0} -// CHECK:STDOUT: !68 = !{!"__libc_errno", !67, i64 0} -// CHECK:STDOUT: !69 = !{!68, !67, i64 0} -// CHECK:STDOUT: !70 = !DIFile(filename: "thunks_for_distinct_specializations.carbon", directory: "") -// CHECK:STDOUT: !71 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !70, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !72 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !70, line: 11, type: !38, spFlags: DISPFlagDefinition, unit: !71, retainedNodes: !84) -// CHECK:STDOUT: !73 = !DILocalVariable(arg: 1, scope: !72, type: !34) -// CHECK:STDOUT: !74 = !DILocalVariable(arg: 2, scope: !72, type: !34) -// CHECK:STDOUT: !77 = !DILocation(line: 12, column: 3, scope: !72) -// CHECK:STDOUT: !78 = !DILocation(line: 12, column: 35, scope: !72) -// CHECK:STDOUT: !80 = !DILocation(line: 13, column: 3, scope: !72) -// CHECK:STDOUT: !81 = !DILocation(line: 13, column: 35, scope: !72) -// CHECK:STDOUT: !83 = !DILocation(line: 11, column: 1, scope: !72) -// CHECK:STDOUT: !84 = !{!73, !74} -// CHECK:STDOUT: !85 = !DIFile(filename: "./box.h", directory: "") -// CHECK:STDOUT: !86 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Copy.c0735c73762b4d1c.Core:Box.Cpp", scope: null, file: !85, line: 8, type: !40, spFlags: DISPFlagDefinition, unit: !71, retainedNodes: !89) -// CHECK:STDOUT: !87 = !DILocalVariable(arg: 1, scope: !86, type: !34) -// CHECK:STDOUT: !88 = !DILocation(line: 8, column: 3, scope: !86) -// CHECK:STDOUT: !89 = !{!87} -// CHECK:STDOUT: !90 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Copy.2c1dd62357f2b914.Core:Box.Cpp", scope: null, file: !85, line: 8, type: !40, spFlags: DISPFlagDefinition, unit: !71, retainedNodes: !93) +// CHECK:STDOUT: !62 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !63 = !{!"omnipotent char", !62, i64 0} +// CHECK:STDOUT: !64 = !{!"any pointer", !63, i64 0} +// CHECK:STDOUT: !68 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !69 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !70 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !71 = !{!"int", !63, i64 0} +// CHECK:STDOUT: !72 = !{!"__libc_errno", !71, i64 0} +// CHECK:STDOUT: !73 = !{!72, !71, i64 0} +// CHECK:STDOUT: !74 = !DIFile(filename: "thunks_for_distinct_specializations.carbon", directory: "") +// CHECK:STDOUT: !75 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !74, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !76 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !74, line: 11, type: !38, spFlags: DISPFlagDefinition, unit: !75, retainedNodes: !88) +// CHECK:STDOUT: !77 = !DILocalVariable(arg: 1, scope: !76, type: !34) +// CHECK:STDOUT: !78 = !DILocalVariable(arg: 2, scope: !76, type: !34) +// CHECK:STDOUT: !81 = !DILocation(line: 12, column: 3, scope: !76) +// CHECK:STDOUT: !82 = !DILocation(line: 12, column: 35, scope: !76) +// CHECK:STDOUT: !84 = !DILocation(line: 13, column: 3, scope: !76) +// CHECK:STDOUT: !85 = !DILocation(line: 13, column: 35, scope: !76) +// CHECK:STDOUT: !87 = !DILocation(line: 11, column: 1, scope: !76) +// CHECK:STDOUT: !88 = !{!77, !78} +// CHECK:STDOUT: !89 = !DIFile(filename: "./box.h", directory: "") +// CHECK:STDOUT: !90 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Copy.c0735c73762b4d1c.Core:Box.Cpp", scope: null, file: !89, line: 8, type: !40, spFlags: DISPFlagDefinition, unit: !75, retainedNodes: !93) // CHECK:STDOUT: !91 = !DILocalVariable(arg: 1, scope: !90, type: !34) // CHECK:STDOUT: !92 = !DILocation(line: 8, column: 3, scope: !90) // CHECK:STDOUT: !93 = !{!91} -// CHECK:STDOUT: !94 = !{!"p1 _ZTS3BoxI1AE", !60, i64 0} -// CHECK:STDOUT: !95 = !{!94, !94, i64 0} -// CHECK:STDOUT: !98 = !{!"p1 _ZTS3BoxI1BE", !60, i64 0} -// CHECK:STDOUT: !99 = !{!98, !98, i64 0} +// CHECK:STDOUT: !94 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Copy.2c1dd62357f2b914.Core:Box.Cpp", scope: null, file: !89, line: 8, type: !40, spFlags: DISPFlagDefinition, unit: !75, retainedNodes: !97) +// CHECK:STDOUT: !95 = !DILocalVariable(arg: 1, scope: !94, type: !34) +// CHECK:STDOUT: !96 = !DILocation(line: 8, column: 3, scope: !94) +// CHECK:STDOUT: !97 = !{!95} +// CHECK:STDOUT: !98 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.c6bde88ac44221c1:core.Destroy.Core", scope: null, file: !74, line: 13, type: !36, spFlags: DISPFlagDefinition, unit: !75, retainedNodes: !101) +// CHECK:STDOUT: !99 = !DILocalVariable(arg: 1, scope: !98, type: !34) +// CHECK:STDOUT: !100 = !DILocation(line: 13, column: 3, scope: !98) +// CHECK:STDOUT: !101 = !{!99} +// CHECK:STDOUT: !102 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.35d03e94f0115619:core.Destroy.Core", scope: null, file: !74, line: 12, type: !36, spFlags: DISPFlagDefinition, unit: !75, retainedNodes: !105) +// CHECK:STDOUT: !103 = !DILocalVariable(arg: 1, scope: !102, type: !34) +// CHECK:STDOUT: !104 = !DILocation(line: 12, column: 3, scope: !102) +// CHECK:STDOUT: !105 = !{!103} +// CHECK:STDOUT: !106 = !{!"p1 _ZTS3BoxI1AE", !64, i64 0} +// CHECK:STDOUT: !107 = !{!106, !106, i64 0} +// CHECK:STDOUT: !110 = !{!"p1 _ZTS3BoxI1BE", !64, i64 0} +// CHECK:STDOUT: !111 = !{!110, !110, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'thunks_for_anonymous_namespace_collision.carbon' @@ -337,21 +372,21 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) { // CHECK:STDOUT: $_ZN7CollideC2ERKS_ = comdat any // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CCall.Main(ptr %a, ptr %b) #0 !dbg !104 { +// CHECK:STDOUT: define void @_CCall.Main(ptr %a, ptr %b) #0 !dbg !116 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %a2.var = alloca [1 x i8], align 1, !dbg !109 -// CHECK:STDOUT: %.loc12_32.1.temp = alloca [1 x i8], align 1, !dbg !110 -// CHECK:STDOUT: %b2.var = alloca [1 x i8], align 1, !dbg !112 -// CHECK:STDOUT: %.loc13_36.1.temp = alloca [1 x i8], align 1, !dbg !113 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a2.var), !dbg !109 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_32.1.temp), !dbg !110 -// CHECK:STDOUT: call void @_ZN7CollideC1ERKS_.carbon_thunk._(ptr %a, ptr %a2.var), !dbg !110 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %b2.var), !dbg !112 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc13_36.1.temp), !dbg !113 -// CHECK:STDOUT: call void @_ZN12_GLOBAL__N_17CollideC1ERKS0_.carbon_thunk._(ptr %b, ptr %b2.var), !dbg !113 -// CHECK:STDOUT: call void @_ZN12_GLOBAL__N_17CollideD2Ev(ptr %b2.var), !dbg !112 -// CHECK:STDOUT: call void @_ZN7CollideD2Ev(ptr %a2.var), !dbg !109 -// CHECK:STDOUT: ret void, !dbg !115 +// CHECK:STDOUT: %a2.var = alloca [1 x i8], align 1, !dbg !121 +// CHECK:STDOUT: %.loc12_32.1.temp = alloca [1 x i8], align 1, !dbg !122 +// CHECK:STDOUT: %b2.var = alloca [1 x i8], align 1, !dbg !124 +// CHECK:STDOUT: %.loc13_36.1.temp = alloca [1 x i8], align 1, !dbg !125 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a2.var), !dbg !121 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_32.1.temp), !dbg !122 +// CHECK:STDOUT: call void @_ZN7CollideC1ERKS_.carbon_thunk._(ptr %a, ptr %a2.var), !dbg !122 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %b2.var), !dbg !124 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc13_36.1.temp), !dbg !125 +// CHECK:STDOUT: call void @_ZN12_GLOBAL__N_17CollideC1ERKS0_.carbon_thunk._(ptr %b, ptr %b2.var), !dbg !125 +// CHECK:STDOUT: call void @"_CSelfDestruct.c4db6b78eb7f0546:core.Destroy.Core"(ptr %b2.var), !dbg !124 +// CHECK:STDOUT: call void @"_CSelfDestruct.3cee6f1426a47a6f:core.Destroy.Core"(ptr %a2.var), !dbg !121 +// CHECK:STDOUT: ret void, !dbg !127 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -359,19 +394,19 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !127 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !127 -// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !127 -// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !127 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !147 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !147 +// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !147 +// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !147 // CHECK:STDOUT: call void @_ZN7CollideC2ERKS_(ptr noundef nonnull align 1 dereferenceable(1) %1, ptr noundef nonnull align 1 dereferenceable(1) %2) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Copy.9e522bb4dbf82e5c.Core:Collide.Cpp"(ptr sret([1 x i8]) %return, ptr %self) #2 !dbg !118 { +// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Copy.9e522bb4dbf82e5c.Core:Collide.Cpp"(ptr sret([1 x i8]) %return, ptr %self) #2 !dbg !130 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_ZN7CollideC1ERKS_.carbon_thunk._(ptr %self, ptr %return), !dbg !120 -// CHECK:STDOUT: ret void, !dbg !120 +// CHECK:STDOUT: call void @_ZN7CollideC1ERKS_.carbon_thunk._(ptr %self, ptr %return), !dbg !132 +// CHECK:STDOUT: ret void, !dbg !132 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -379,39 +414,53 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !130 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !130 -// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !130 -// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !130 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !150 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !150 +// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !150 +// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !150 // CHECK:STDOUT: call void @_ZN12_GLOBAL__N_17CollideC2ERKS0_(ptr noundef nonnull align 1 dereferenceable(1) %1, ptr noundef nonnull align 1 dereferenceable(1) %2) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Copy.d1fe27f3241437fa.Core:Collide..Cpp"(ptr sret([1 x i8]) %return, ptr %self) #2 !dbg !122 { +// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Copy.d1fe27f3241437fa.Core:Collide..Cpp"(ptr sret([1 x i8]) %return, ptr %self) #2 !dbg !134 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_ZN12_GLOBAL__N_17CollideC1ERKS0_.carbon_thunk._(ptr %self, ptr %return), !dbg !124 -// CHECK:STDOUT: ret void, !dbg !124 +// CHECK:STDOUT: call void @_ZN12_GLOBAL__N_17CollideC1ERKS0_.carbon_thunk._(ptr %self, ptr %return), !dbg !136 +// CHECK:STDOUT: ret void, !dbg !136 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable // CHECK:STDOUT: define internal void @_ZN12_GLOBAL__N_17CollideD2Ev(ptr noundef nonnull align 1 dereferenceable(1) %this) unnamed_addr #3 align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !130 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !150 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.c4db6b78eb7f0546:core.Destroy.Core"(ptr %self) #0 !dbg !138 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @_ZN12_GLOBAL__N_17CollideD2Ev(ptr %self), !dbg !140 +// CHECK:STDOUT: ret void, !dbg !140 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN7CollideD2Ev(ptr noundef nonnull align 1 dereferenceable(1) %this) unnamed_addr #3 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !127 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !147 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.3cee6f1426a47a6f:core.Destroy.Core"(ptr %self) #0 !dbg !142 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @_ZN7CollideD2Ev(ptr %self), !dbg !144 +// CHECK:STDOUT: ret void, !dbg !144 +// 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)) #4 // CHECK:STDOUT: @@ -420,8 +469,8 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 // CHECK:STDOUT: %.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !127 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !127 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !147 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !147 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -431,8 +480,8 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 // CHECK:STDOUT: %.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !130 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !130 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !150 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !150 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -446,48 +495,58 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) { // CHECK:STDOUT: attributes #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } // CHECK:STDOUT: attributes #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!103} -// CHECK:STDOUT: !llvm.module.flags = !{!64, !65, !66, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!69} +// CHECK:STDOUT: !llvm.dbg.cu = !{!115} +// CHECK:STDOUT: !llvm.module.flags = !{!68, !69, !70, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!73} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !34 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !35 = !{null, !34} +// CHECK:STDOUT: !36 = !DISubroutineType(types: !35) // CHECK:STDOUT: !37 = !{null, !34, !34} // CHECK:STDOUT: !38 = !DISubroutineType(types: !37) // CHECK:STDOUT: !39 = !{!34, !34} // CHECK:STDOUT: !40 = !DISubroutineType(types: !39) -// CHECK:STDOUT: !58 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !59 = !{!"omnipotent char", !58, i64 0} -// CHECK:STDOUT: !60 = !{!"any pointer", !59, i64 0} -// CHECK:STDOUT: !64 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !65 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !66 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !67 = !{!"int", !59, i64 0} -// CHECK:STDOUT: !68 = !{!"__libc_errno", !67, i64 0} -// CHECK:STDOUT: !69 = !{!68, !67, i64 0} -// CHECK:STDOUT: !102 = !DIFile(filename: "thunks_for_anonymous_namespace_collision.carbon", directory: "") -// CHECK:STDOUT: !103 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !102, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !104 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !102, line: 11, type: !38, spFlags: DISPFlagDefinition, unit: !103, retainedNodes: !116) -// CHECK:STDOUT: !105 = !DILocalVariable(arg: 1, scope: !104, type: !34) -// CHECK:STDOUT: !106 = !DILocalVariable(arg: 2, scope: !104, type: !34) -// CHECK:STDOUT: !109 = !DILocation(line: 12, column: 3, scope: !104) -// CHECK:STDOUT: !110 = !DILocation(line: 12, column: 32, scope: !104) -// CHECK:STDOUT: !112 = !DILocation(line: 13, column: 3, scope: !104) -// CHECK:STDOUT: !113 = !DILocation(line: 13, column: 36, scope: !104) -// CHECK:STDOUT: !115 = !DILocation(line: 11, column: 1, scope: !104) -// CHECK:STDOUT: !116 = !{!105, !106} -// CHECK:STDOUT: !117 = !DIFile(filename: "./anonymous_namespace_collision.h", directory: "") -// CHECK:STDOUT: !118 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Copy.9e522bb4dbf82e5c.Core:Collide.Cpp", scope: null, file: !117, line: 17, type: !40, spFlags: DISPFlagDefinition, unit: !103, retainedNodes: !121) -// CHECK:STDOUT: !119 = !DILocalVariable(arg: 1, scope: !118, type: !34) -// CHECK:STDOUT: !120 = !DILocation(line: 17, column: 3, scope: !118) -// CHECK:STDOUT: !121 = !{!119} -// CHECK:STDOUT: !122 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Copy.d1fe27f3241437fa.Core:Collide..Cpp", scope: null, file: !117, line: 8, type: !40, spFlags: DISPFlagDefinition, unit: !103, retainedNodes: !125) -// CHECK:STDOUT: !123 = !DILocalVariable(arg: 1, scope: !122, type: !34) -// CHECK:STDOUT: !124 = !DILocation(line: 8, column: 3, scope: !122) -// CHECK:STDOUT: !125 = !{!123} -// CHECK:STDOUT: !126 = !{!"p1 _ZTS7Collide", !60, i64 0} -// CHECK:STDOUT: !127 = !{!126, !126, i64 0} -// CHECK:STDOUT: !129 = !{!"p1 _ZTSN12_GLOBAL__N_17CollideE", !60, i64 0} -// CHECK:STDOUT: !130 = !{!129, !129, i64 0} +// CHECK:STDOUT: !62 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !63 = !{!"omnipotent char", !62, i64 0} +// CHECK:STDOUT: !64 = !{!"any pointer", !63, i64 0} +// CHECK:STDOUT: !68 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !69 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !70 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !71 = !{!"int", !63, i64 0} +// CHECK:STDOUT: !72 = !{!"__libc_errno", !71, i64 0} +// CHECK:STDOUT: !73 = !{!72, !71, i64 0} +// CHECK:STDOUT: !114 = !DIFile(filename: "thunks_for_anonymous_namespace_collision.carbon", directory: "") +// CHECK:STDOUT: !115 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !114, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !116 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !114, line: 11, type: !38, spFlags: DISPFlagDefinition, unit: !115, retainedNodes: !128) +// CHECK:STDOUT: !117 = !DILocalVariable(arg: 1, scope: !116, type: !34) +// CHECK:STDOUT: !118 = !DILocalVariable(arg: 2, scope: !116, type: !34) +// CHECK:STDOUT: !121 = !DILocation(line: 12, column: 3, scope: !116) +// CHECK:STDOUT: !122 = !DILocation(line: 12, column: 32, scope: !116) +// CHECK:STDOUT: !124 = !DILocation(line: 13, column: 3, scope: !116) +// CHECK:STDOUT: !125 = !DILocation(line: 13, column: 36, scope: !116) +// CHECK:STDOUT: !127 = !DILocation(line: 11, column: 1, scope: !116) +// CHECK:STDOUT: !128 = !{!117, !118} +// CHECK:STDOUT: !129 = !DIFile(filename: "./anonymous_namespace_collision.h", directory: "") +// CHECK:STDOUT: !130 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Copy.9e522bb4dbf82e5c.Core:Collide.Cpp", scope: null, file: !129, line: 17, type: !40, spFlags: DISPFlagDefinition, unit: !115, retainedNodes: !133) +// CHECK:STDOUT: !131 = !DILocalVariable(arg: 1, scope: !130, type: !34) +// CHECK:STDOUT: !132 = !DILocation(line: 17, column: 3, scope: !130) +// CHECK:STDOUT: !133 = !{!131} +// CHECK:STDOUT: !134 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Copy.d1fe27f3241437fa.Core:Collide..Cpp", scope: null, file: !129, line: 8, type: !40, spFlags: DISPFlagDefinition, unit: !115, retainedNodes: !137) +// CHECK:STDOUT: !135 = !DILocalVariable(arg: 1, scope: !134, type: !34) +// CHECK:STDOUT: !136 = !DILocation(line: 8, column: 3, scope: !134) +// CHECK:STDOUT: !137 = !{!135} +// CHECK:STDOUT: !138 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.c4db6b78eb7f0546:core.Destroy.Core", scope: null, file: !114, line: 13, type: !36, spFlags: DISPFlagDefinition, unit: !115, retainedNodes: !141) +// CHECK:STDOUT: !139 = !DILocalVariable(arg: 1, scope: !138, type: !34) +// CHECK:STDOUT: !140 = !DILocation(line: 13, column: 3, scope: !138) +// CHECK:STDOUT: !141 = !{!139} +// CHECK:STDOUT: !142 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.3cee6f1426a47a6f:core.Destroy.Core", scope: null, file: !114, line: 12, type: !36, spFlags: DISPFlagDefinition, unit: !115, retainedNodes: !145) +// CHECK:STDOUT: !143 = !DILocalVariable(arg: 1, scope: !142, type: !34) +// CHECK:STDOUT: !144 = !DILocation(line: 12, column: 3, scope: !142) +// CHECK:STDOUT: !145 = !{!143} +// CHECK:STDOUT: !146 = !{!"p1 _ZTS7Collide", !64, i64 0} +// CHECK:STDOUT: !147 = !{!146, !146, i64 0} +// CHECK:STDOUT: !149 = !{!"p1 _ZTSN12_GLOBAL__N_17CollideE", !64, i64 0} +// CHECK:STDOUT: !150 = !{!149, !149, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/void.carbon b/toolchain/lower/testdata/interop/cpp/void.carbon index 6e9371c7b058..6f5c4aa255d0 100644 --- a/toolchain/lower/testdata/interop/cpp/void.carbon +++ b/toolchain/lower/testdata/interop/cpp/void.carbon @@ -71,179 +71,247 @@ fn ConvertFromConstVoidPtr(p: const Cpp.void*) -> const i32* { // CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc7_21.2.temp, align 8, !dbg !13 // CHECK:STDOUT: %.loc7_21.4 = load ptr, ptr %.loc7_21.2.temp, align 8, !dbg !13 // CHECK:STDOUT: call void @_Z13take_void_ptrPv(ptr %.loc7_21.4), !dbg !16 -// CHECK:STDOUT: call void @"_COp.14b4a412ddf73a96:core.Destroy.Core"(ptr %.loc7_21.2.temp), !dbg !13 +// CHECK:STDOUT: call void @"_CSelfDestruct.14b4a412ddf73a96:core.Destroy.Core"(ptr %.loc7_21.2.temp), !dbg !13 // CHECK:STDOUT: ret void, !dbg !17 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.00ac8ef5084ea134:core.Destroy.Core"(ptr %self) #0 !dbg !20 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !22 +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z13take_void_ptrPv(ptr noundef) #1 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.a7d1b77eb1279818:core.Destroy.Core"(ptr %self) #0 !dbg !19 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.a7d1b77eb1279818:core.Destroy.Core"(ptr %self) #0 !dbg !24 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !21 +// CHECK:STDOUT: ret void, !dbg !26 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.ddbd3dbdb388ab25:core.Destroy.Core"(ptr %self) #0 !dbg !23 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.a7d1b77eb1279818:core.Destroy.Core"(ptr %self) #0 !dbg !28 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !25 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.a7d1b77eb1279818:core.Destroy.Core"(ptr %self), !dbg !30 +// CHECK:STDOUT: ret void, !dbg !30 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.14b4a412ddf73a96:core.Destroy.Core"(ptr %self) #0 !dbg !27 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.174120d4d03791b0:core.Destroy.Core"(ptr %self) #0 !dbg !32 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !29 +// CHECK:STDOUT: ret void, !dbg !34 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassIntPtr.Main(ptr %a) #0 !dbg !31 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.174120d4d03791b0:core.Destroy.Core"(ptr %self) #0 !dbg !36 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc11_21.2.temp = alloca ptr, align 8, !dbg !34 -// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.743bdca835b10868"(ptr %a), !dbg !34 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc11_21.2.temp), !dbg !34 -// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc11_21.2.temp, align 8, !dbg !34 -// CHECK:STDOUT: %.loc11_21.4 = load ptr, ptr %.loc11_21.2.temp, align 8, !dbg !34 -// CHECK:STDOUT: call void @_Z13take_void_ptrPv(ptr %.loc11_21.4), !dbg !35 -// CHECK:STDOUT: call void @"_COp.14b4a412ddf73a96:core.Destroy.Core"(ptr %.loc11_21.2.temp), !dbg !34 -// CHECK:STDOUT: ret void, !dbg !36 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.174120d4d03791b0:core.Destroy.Core"(ptr %self), !dbg !38 +// CHECK:STDOUT: ret void, !dbg !38 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassIntPtrToConstVoidPtr.Main(ptr %a) #0 !dbg !38 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.14b4a412ddf73a96:core.Destroy.Core"(ptr %self) #0 !dbg !40 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc15_27.2.temp = alloca ptr, align 8, !dbg !41 -// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.aed6f04ab83d7fc5"(ptr %a), !dbg !41 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc15_27.2.temp), !dbg !41 -// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc15_27.2.temp, align 8, !dbg !41 -// CHECK:STDOUT: %.loc15_27.4 = load ptr, ptr %.loc15_27.2.temp, align 8, !dbg !41 -// CHECK:STDOUT: call void @_Z19take_const_void_ptrPKv(ptr %.loc15_27.4), !dbg !42 -// CHECK:STDOUT: call void @"_COp.dfb26e502f641cc5:core.Destroy.Core"(ptr %.loc15_27.2.temp), !dbg !41 -// CHECK:STDOUT: ret void, !dbg !43 +// CHECK:STDOUT: ret void, !dbg !42 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.14b4a412ddf73a96:core.Destroy.Core"(ptr %self) #0 !dbg !44 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.14b4a412ddf73a96:core.Destroy.Core"(ptr %self), !dbg !46 +// CHECK:STDOUT: ret void, !dbg !46 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CPassIntPtr.Main(ptr %a) #0 !dbg !48 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %.loc11_21.2.temp = alloca ptr, align 8, !dbg !51 +// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.6031252d10ea5365"(ptr %a), !dbg !51 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc11_21.2.temp), !dbg !51 +// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc11_21.2.temp, align 8, !dbg !51 +// CHECK:STDOUT: %.loc11_21.4 = load ptr, ptr %.loc11_21.2.temp, align 8, !dbg !51 +// CHECK:STDOUT: call void @_Z13take_void_ptrPv(ptr %.loc11_21.4), !dbg !52 +// CHECK:STDOUT: call void @"_CSelfDestruct.14b4a412ddf73a96:core.Destroy.Core"(ptr %.loc11_21.2.temp), !dbg !51 +// CHECK:STDOUT: ret void, !dbg !53 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.d088c7eb746488be:core.Destroy.Core"(ptr %self) #0 !dbg !55 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !57 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CPassIntPtrToConstVoidPtr.Main(ptr %a) #0 !dbg !59 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %.loc15_27.2.temp = alloca ptr, align 8, !dbg !62 +// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.d72303bab6c7803c"(ptr %a), !dbg !62 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc15_27.2.temp), !dbg !62 +// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc15_27.2.temp, align 8, !dbg !62 +// CHECK:STDOUT: %.loc15_27.4 = load ptr, ptr %.loc15_27.2.temp, align 8, !dbg !62 +// CHECK:STDOUT: call void @_Z19take_const_void_ptrPKv(ptr %.loc15_27.4), !dbg !63 +// CHECK:STDOUT: call void @"_CSelfDestruct.dfb26e502f641cc5:core.Destroy.Core"(ptr %.loc15_27.2.temp), !dbg !62 +// CHECK:STDOUT: ret void, !dbg !64 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.e9afb99fe676df82:core.Destroy.Core"(ptr %self) #0 !dbg !66 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !68 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z19take_const_void_ptrPKv(ptr noundef) #1 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.8d3ff16138365f48:core.Destroy.Core"(ptr %self) #0 !dbg !45 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.8d3ff16138365f48:core.Destroy.Core"(ptr %self) #0 !dbg !70 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !47 +// CHECK:STDOUT: ret void, !dbg !72 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.d7d7d0af84cf13b8:core.Destroy.Core"(ptr %self) #0 !dbg !49 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.8d3ff16138365f48:core.Destroy.Core"(ptr %self) #0 !dbg !74 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !51 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.8d3ff16138365f48:core.Destroy.Core"(ptr %self), !dbg !76 +// CHECK:STDOUT: ret void, !dbg !76 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.dfb26e502f641cc5:core.Destroy.Core"(ptr %self) #0 !dbg !53 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.4e1f0f3b7725eea2:core.Destroy.Core"(ptr %self) #0 !dbg !78 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !55 +// CHECK:STDOUT: ret void, !dbg !80 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassConstIntPtrToConstVoidPtr.Main(ptr %a) #0 !dbg !57 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.4e1f0f3b7725eea2:core.Destroy.Core"(ptr %self) #0 !dbg !82 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc19_27.2.temp = alloca ptr, align 8, !dbg !60 -// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.aed6f04ab83d7fc5"(ptr %a), !dbg !60 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc19_27.2.temp), !dbg !60 -// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc19_27.2.temp, align 8, !dbg !60 -// CHECK:STDOUT: %.loc19_27.4 = load ptr, ptr %.loc19_27.2.temp, align 8, !dbg !60 -// CHECK:STDOUT: call void @_Z19take_const_void_ptrPKv(ptr %.loc19_27.4), !dbg !61 -// CHECK:STDOUT: call void @"_COp.dfb26e502f641cc5:core.Destroy.Core"(ptr %.loc19_27.2.temp), !dbg !60 -// CHECK:STDOUT: ret void, !dbg !62 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.4e1f0f3b7725eea2:core.Destroy.Core"(ptr %self), !dbg !84 +// CHECK:STDOUT: ret void, !dbg !84 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.0532bac23645330a"(ptr %self) #0 !dbg !65 { -// CHECK:STDOUT: %1 = call ptr @"_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.4201ec9a263c5642"(ptr %self), !dbg !70 -// CHECK:STDOUT: ret ptr %1, !dbg !71 +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.dfb26e502f641cc5:core.Destroy.Core"(ptr %self) #0 !dbg !86 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !88 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.dfb26e502f641cc5:core.Destroy.Core"(ptr %self) #0 !dbg !90 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.dfb26e502f641cc5:core.Destroy.Core"(ptr %self), !dbg !92 +// CHECK:STDOUT: ret void, !dbg !92 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CPassConstIntPtrToConstVoidPtr.Main(ptr %a) #0 !dbg !94 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %.loc19_27.2.temp = alloca ptr, align 8, !dbg !97 +// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.d72303bab6c7803c"(ptr %a), !dbg !97 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc19_27.2.temp), !dbg !97 +// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc19_27.2.temp, align 8, !dbg !97 +// CHECK:STDOUT: %.loc19_27.4 = load ptr, ptr %.loc19_27.2.temp, align 8, !dbg !97 +// CHECK:STDOUT: call void @_Z19take_const_void_ptrPKv(ptr %.loc19_27.4), !dbg !98 +// CHECK:STDOUT: call void @"_CSelfDestruct.dfb26e502f641cc5:core.Destroy.Core"(ptr %.loc19_27.2.temp), !dbg !97 +// CHECK:STDOUT: ret void, !dbg !99 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.7742c7b82efb7924:core.Destroy.Core"(ptr %self) #0 !dbg !101 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !103 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.0532bac23645330a"(ptr %self) #0 !dbg !105 { +// CHECK:STDOUT: %1 = call ptr @"_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.4201ec9a263c5642"(ptr %self), !dbg !110 +// CHECK:STDOUT: ret ptr %1, !dbg !111 // 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)) #2 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.743bdca835b10868"(ptr %self) #0 !dbg !73 { -// CHECK:STDOUT: %1 = call ptr @"_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.fbfbaeeadd5088b8"(ptr %self), !dbg !78 -// CHECK:STDOUT: ret ptr %1, !dbg !79 +// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.6031252d10ea5365"(ptr %self) #0 !dbg !113 { +// CHECK:STDOUT: %1 = call ptr @"_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.1e16d6a5a3286ade"(ptr %self), !dbg !118 +// CHECK:STDOUT: ret ptr %1, !dbg !119 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.aed6f04ab83d7fc5"(ptr %self) #0 !dbg !81 { -// CHECK:STDOUT: %1 = call ptr @"_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.0d728554b50ee51c"(ptr %self), !dbg !86 -// CHECK:STDOUT: ret ptr %1, !dbg !87 +// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.d72303bab6c7803c"(ptr %self) #0 !dbg !121 { +// CHECK:STDOUT: %1 = call ptr @"_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.ea6f599e1a77a7ea"(ptr %self), !dbg !126 +// CHECK:STDOUT: ret ptr %1, !dbg !127 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.4201ec9a263c5642"(ptr %self) #0 !dbg !97 { -// CHECK:STDOUT: %1 = call ptr @_CSome.Optional.Core.4201ec9a263c5642(ptr %self), !dbg !103 -// CHECK:STDOUT: ret ptr %1, !dbg !104 +// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.4201ec9a263c5642"(ptr %self) #0 !dbg !137 { +// CHECK:STDOUT: %1 = call ptr @_CSome.Optional.Core.4201ec9a263c5642(ptr %self), !dbg !143 +// CHECK:STDOUT: ret ptr %1, !dbg !144 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.fbfbaeeadd5088b8"(ptr %self) #0 !dbg !106 { -// CHECK:STDOUT: %temp = alloca ptr, align 8, !dbg !111 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp), !dbg !111 -// CHECK:STDOUT: store ptr %self, ptr %temp, align 8, !dbg !111 -// CHECK:STDOUT: %1 = load ptr, ptr %temp, align 8, !dbg !111 -// CHECK:STDOUT: %2 = call ptr @_CSome.Optional.Core.4201ec9a263c5642(ptr %1), !dbg !112 -// CHECK:STDOUT: ret ptr %2, !dbg !113 +// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.1e16d6a5a3286ade"(ptr %self) #0 !dbg !146 { +// CHECK:STDOUT: %temp = alloca ptr, align 8, !dbg !151 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp), !dbg !151 +// CHECK:STDOUT: store ptr %self, ptr %temp, align 8, !dbg !151 +// CHECK:STDOUT: %1 = load ptr, ptr %temp, align 8, !dbg !151 +// CHECK:STDOUT: %2 = call ptr @_CSome.Optional.Core.4201ec9a263c5642(ptr %1), !dbg !152 +// CHECK:STDOUT: call void @"_CSelfDestruct.00ac8ef5084ea134:core.Destroy.Core"(ptr %temp), !dbg !151 +// CHECK:STDOUT: ret ptr %2, !dbg !153 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.0d728554b50ee51c"(ptr %self) #0 !dbg !115 { -// CHECK:STDOUT: %temp = alloca ptr, align 8, !dbg !120 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp), !dbg !120 -// CHECK:STDOUT: %1 = call ptr @"_CConvert:thunk:ImplicitAs.a569d188b7ffe592.Core:e8f8f92d3d08d149:ImplicitAs.01c4a560c986e7d1.Core.84588f41d61dafba"(ptr %self), !dbg !120 -// CHECK:STDOUT: store ptr %1, ptr %temp, align 8, !dbg !120 -// CHECK:STDOUT: %2 = load ptr, ptr %temp, align 8, !dbg !120 -// CHECK:STDOUT: %3 = call ptr @_CSome.Optional.Core.e4523e01ac2590ba(ptr %2), !dbg !121 -// CHECK:STDOUT: ret ptr %3, !dbg !122 +// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.ea6f599e1a77a7ea"(ptr %self) #0 !dbg !155 { +// CHECK:STDOUT: %temp = alloca ptr, align 8, !dbg !160 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp), !dbg !160 +// CHECK:STDOUT: %1 = call ptr @"_CConvert:thunk:ImplicitAs.a569d188b7ffe592.Core:e8f8f92d3d08d149:ImplicitAs.01c4a560c986e7d1.Core.84588f41d61dafba"(ptr %self), !dbg !160 +// CHECK:STDOUT: store ptr %1, ptr %temp, align 8, !dbg !160 +// CHECK:STDOUT: %2 = load ptr, ptr %temp, align 8, !dbg !160 +// CHECK:STDOUT: %3 = call ptr @_CSome.Optional.Core.e4523e01ac2590ba(ptr %2), !dbg !161 +// CHECK:STDOUT: call void @"_CSelfDestruct.e9afb99fe676df82:core.Destroy.Core"(ptr %temp), !dbg !160 +// CHECK:STDOUT: ret ptr %3, !dbg !162 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CSome.Optional.Core.4201ec9a263c5642(ptr %value) #0 !dbg !133 { -// CHECK:STDOUT: %1 = call ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.7a595a06c724a271"(ptr %value), !dbg !138 -// CHECK:STDOUT: ret ptr %1, !dbg !139 +// CHECK:STDOUT: define linkonce_odr ptr @_CSome.Optional.Core.4201ec9a263c5642(ptr %value) #0 !dbg !173 { +// CHECK:STDOUT: %1 = call ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.7a595a06c724a271"(ptr %value), !dbg !178 +// CHECK:STDOUT: ret ptr %1, !dbg !179 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert:thunk:ImplicitAs.a569d188b7ffe592.Core:e8f8f92d3d08d149:ImplicitAs.01c4a560c986e7d1.Core.84588f41d61dafba"(ptr %self) #3 !dbg !142 { -// CHECK:STDOUT: ret ptr %self, !dbg !145 +// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert:thunk:ImplicitAs.a569d188b7ffe592.Core:e8f8f92d3d08d149:ImplicitAs.01c4a560c986e7d1.Core.84588f41d61dafba"(ptr %self) #3 !dbg !182 { +// CHECK:STDOUT: ret ptr %self, !dbg !185 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CSome.Optional.Core.e4523e01ac2590ba(ptr %value) #0 !dbg !147 { -// CHECK:STDOUT: %1 = call ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.8f1054b47505c137"(ptr %value), !dbg !152 -// CHECK:STDOUT: ret ptr %1, !dbg !153 +// CHECK:STDOUT: define linkonce_odr ptr @_CSome.Optional.Core.e4523e01ac2590ba(ptr %value) #0 !dbg !187 { +// CHECK:STDOUT: %1 = call ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.8f1054b47505c137"(ptr %value), !dbg !192 +// CHECK:STDOUT: ret ptr %1, !dbg !193 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.7a595a06c724a271"(ptr %self) #0 !dbg !160 { -// CHECK:STDOUT: %1 = alloca ptr, align 8, !dbg !165 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !165 -// CHECK:STDOUT: store ptr poison, ptr %1, align 8, !dbg !165 -// CHECK:STDOUT: store ptr %self, ptr %1, align 8, !dbg !169 -// CHECK:STDOUT: %2 = load ptr, ptr %1, align 8, !dbg !167 -// CHECK:STDOUT: call void @"_COp.ddbd3dbdb388ab25:core.Destroy.Core"(ptr %1), !dbg !165 -// CHECK:STDOUT: ret ptr %2, !dbg !171 +// CHECK:STDOUT: define linkonce_odr ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.7a595a06c724a271"(ptr %self) #0 !dbg !200 { +// CHECK:STDOUT: %1 = alloca ptr, align 8, !dbg !205 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !205 +// CHECK:STDOUT: store ptr poison, ptr %1, align 8, !dbg !205 +// CHECK:STDOUT: store ptr %self, ptr %1, align 8, !dbg !209 +// CHECK:STDOUT: %2 = load ptr, ptr %1, align 8, !dbg !207 +// CHECK:STDOUT: call void @"_CSelfDestruct.174120d4d03791b0:core.Destroy.Core"(ptr %1), !dbg !205 +// CHECK:STDOUT: ret ptr %2, !dbg !211 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.8f1054b47505c137"(ptr %self) #0 !dbg !173 { -// CHECK:STDOUT: %1 = alloca ptr, align 8, !dbg !178 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !178 -// CHECK:STDOUT: store ptr poison, ptr %1, align 8, !dbg !178 -// CHECK:STDOUT: store ptr %self, ptr %1, align 8, !dbg !182 -// CHECK:STDOUT: %2 = load ptr, ptr %1, align 8, !dbg !180 -// CHECK:STDOUT: call void @"_COp.d7d7d0af84cf13b8:core.Destroy.Core"(ptr %1), !dbg !178 -// CHECK:STDOUT: ret ptr %2, !dbg !184 +// CHECK:STDOUT: define linkonce_odr ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.8f1054b47505c137"(ptr %self) #0 !dbg !213 { +// CHECK:STDOUT: %1 = alloca ptr, align 8, !dbg !218 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !218 +// CHECK:STDOUT: store ptr poison, ptr %1, align 8, !dbg !218 +// CHECK:STDOUT: store ptr %self, ptr %1, align 8, !dbg !222 +// CHECK:STDOUT: %2 = load ptr, ptr %1, align 8, !dbg !220 +// CHECK:STDOUT: call void @"_CSelfDestruct.4e1f0f3b7725eea2:core.Destroy.Core"(ptr %1), !dbg !218 +// CHECK:STDOUT: ret ptr %2, !dbg !224 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 0, 1, 2, 3, 7, 6, 5, 4 } -// CHECK:STDOUT: uselistorder ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.aed6f04ab83d7fc5", { 1, 0 } +// CHECK:STDOUT: uselistorder ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.d72303bab6c7803c", { 1, 0 } // CHECK:STDOUT: uselistorder ptr @_CSome.Optional.Core.4201ec9a263c5642, { 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -252,8 +320,8 @@ fn ConvertFromConstVoidPtr(p: const Cpp.void*) -> const i32* { // CHECK:STDOUT: attributes #3 = { alwaysinline nounwind } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!5} -// CHECK:STDOUT: !llvm.module.flags = !{!186, !187, !188, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!193} +// CHECK:STDOUT: !llvm.module.flags = !{!226, !227, !228, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!233} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -270,118 +338,158 @@ fn ConvertFromConstVoidPtr(p: const Cpp.void*) -> const i32* { // CHECK:STDOUT: !16 = !DILocation(line: 7, column: 3, scope: !10) // CHECK:STDOUT: !17 = !DILocation(line: 6, column: 1, scope: !10) // CHECK:STDOUT: !18 = !{!11} -// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "Op", linkageName: "_COp.a7d1b77eb1279818:core.Destroy.Core", scope: null, file: !4, line: 7, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !22) -// CHECK:STDOUT: !20 = !DILocalVariable(arg: 1, scope: !19, type: !7) -// CHECK:STDOUT: !21 = !DILocation(line: 7, column: 21, scope: !19) -// CHECK:STDOUT: !22 = !{!20} -// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "Op", linkageName: "_COp.ddbd3dbdb388ab25:core.Destroy.Core", scope: null, file: !4, line: 7, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !26) -// CHECK:STDOUT: !24 = !DILocalVariable(arg: 1, scope: !23, type: !7) -// CHECK:STDOUT: !25 = !DILocation(line: 7, column: 21, scope: !23) -// CHECK:STDOUT: !26 = !{!24} -// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "Op", linkageName: "_COp.14b4a412ddf73a96:core.Destroy.Core", scope: null, file: !4, line: 7, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !30) -// CHECK:STDOUT: !28 = !DILocalVariable(arg: 1, scope: !27, type: !7) -// CHECK:STDOUT: !29 = !DILocation(line: 7, column: 21, scope: !27) -// CHECK:STDOUT: !30 = !{!28} -// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "PassIntPtr", linkageName: "_CPassIntPtr.Main", scope: null, file: !4, line: 10, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !37) -// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !31, type: !7) -// CHECK:STDOUT: !34 = !DILocation(line: 11, column: 21, scope: !31) -// CHECK:STDOUT: !35 = !DILocation(line: 11, column: 3, scope: !31) -// CHECK:STDOUT: !36 = !DILocation(line: 10, column: 1, scope: !31) -// CHECK:STDOUT: !37 = !{!32} -// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "PassIntPtrToConstVoidPtr", linkageName: "_CPassIntPtrToConstVoidPtr.Main", scope: null, file: !4, line: 14, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !44) -// CHECK:STDOUT: !39 = !DILocalVariable(arg: 1, scope: !38, type: !7) -// CHECK:STDOUT: !41 = !DILocation(line: 15, column: 27, scope: !38) -// CHECK:STDOUT: !42 = !DILocation(line: 15, column: 3, scope: !38) -// CHECK:STDOUT: !43 = !DILocation(line: 14, column: 1, scope: !38) -// CHECK:STDOUT: !44 = !{!39} -// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "Op", linkageName: "_COp.8d3ff16138365f48:core.Destroy.Core", scope: null, file: !4, line: 15, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !48) -// CHECK:STDOUT: !46 = !DILocalVariable(arg: 1, scope: !45, type: !7) -// CHECK:STDOUT: !47 = !DILocation(line: 15, column: 27, scope: !45) -// CHECK:STDOUT: !48 = !{!46} -// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "Op", linkageName: "_COp.d7d7d0af84cf13b8:core.Destroy.Core", scope: null, file: !4, line: 15, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !52) -// CHECK:STDOUT: !50 = !DILocalVariable(arg: 1, scope: !49, type: !7) -// CHECK:STDOUT: !51 = !DILocation(line: 15, column: 27, scope: !49) -// CHECK:STDOUT: !52 = !{!50} -// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "Op", linkageName: "_COp.dfb26e502f641cc5:core.Destroy.Core", scope: null, file: !4, line: 15, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !56) -// CHECK:STDOUT: !54 = !DILocalVariable(arg: 1, scope: !53, type: !7) -// CHECK:STDOUT: !55 = !DILocation(line: 15, column: 27, scope: !53) -// CHECK:STDOUT: !56 = !{!54} -// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "PassConstIntPtrToConstVoidPtr", linkageName: "_CPassConstIntPtrToConstVoidPtr.Main", scope: null, file: !4, line: 18, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !63) -// CHECK:STDOUT: !58 = !DILocalVariable(arg: 1, scope: !57, type: !7) -// CHECK:STDOUT: !60 = !DILocation(line: 19, column: 27, scope: !57) -// CHECK:STDOUT: !61 = !DILocation(line: 19, column: 3, scope: !57) -// CHECK:STDOUT: !62 = !DILocation(line: 18, column: 1, scope: !57) -// CHECK:STDOUT: !63 = !{!58} -// CHECK:STDOUT: !64 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") -// CHECK:STDOUT: !65 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.0532bac23645330a", scope: null, file: !64, line: 105, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !72) -// CHECK:STDOUT: !66 = !DILocalVariable(arg: 1, scope: !65, type: !7) -// CHECK:STDOUT: !70 = !DILocation(line: 106, column: 12, scope: !65) -// CHECK:STDOUT: !71 = !DILocation(line: 106, column: 5, scope: !65) -// CHECK:STDOUT: !72 = !{!66} -// CHECK:STDOUT: !73 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.743bdca835b10868", scope: null, file: !64, line: 105, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !80) -// CHECK:STDOUT: !74 = !DILocalVariable(arg: 1, scope: !73, type: !7) -// CHECK:STDOUT: !78 = !DILocation(line: 106, column: 12, scope: !73) -// CHECK:STDOUT: !79 = !DILocation(line: 106, column: 5, scope: !73) -// CHECK:STDOUT: !80 = !{!74} -// CHECK:STDOUT: !81 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.aed6f04ab83d7fc5", scope: null, file: !64, line: 105, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !88) -// CHECK:STDOUT: !82 = !DILocalVariable(arg: 1, scope: !81, type: !7) -// CHECK:STDOUT: !86 = !DILocation(line: 106, column: 12, scope: !81) -// CHECK:STDOUT: !87 = !DILocation(line: 106, column: 5, scope: !81) -// CHECK:STDOUT: !88 = !{!82} -// CHECK:STDOUT: !97 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.4201ec9a263c5642", scope: null, file: !64, line: 80, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !105) -// CHECK:STDOUT: !98 = !DILocalVariable(arg: 1, scope: !97, type: !7) -// CHECK:STDOUT: !103 = !DILocation(line: 81, column: 12, scope: !97) -// CHECK:STDOUT: !104 = !DILocation(line: 81, column: 5, scope: !97) -// CHECK:STDOUT: !105 = !{!98} -// CHECK:STDOUT: !106 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.fbfbaeeadd5088b8", scope: null, file: !64, line: 87, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !114) -// CHECK:STDOUT: !107 = !DILocalVariable(arg: 1, scope: !106, type: !7) -// CHECK:STDOUT: !111 = !DILocation(line: 88, column: 29, scope: !106) -// CHECK:STDOUT: !112 = !DILocation(line: 88, column: 12, scope: !106) -// CHECK:STDOUT: !113 = !DILocation(line: 88, column: 5, scope: !106) -// CHECK:STDOUT: !114 = !{!107} -// CHECK:STDOUT: !115 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.0d728554b50ee51c", scope: null, file: !64, line: 87, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !123) -// CHECK:STDOUT: !116 = !DILocalVariable(arg: 1, scope: !115, type: !7) -// CHECK:STDOUT: !120 = !DILocation(line: 88, column: 29, scope: !115) -// CHECK:STDOUT: !121 = !DILocation(line: 88, column: 12, scope: !115) -// CHECK:STDOUT: !122 = !DILocation(line: 88, column: 5, scope: !115) -// CHECK:STDOUT: !123 = !{!116} -// CHECK:STDOUT: !133 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.4201ec9a263c5642", scope: null, file: !64, line: 33, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !140) -// CHECK:STDOUT: !134 = !DILocalVariable(arg: 1, scope: !133, type: !7) -// CHECK:STDOUT: !138 = !DILocation(line: 34, column: 12, scope: !133) -// CHECK:STDOUT: !139 = !DILocation(line: 34, column: 5, scope: !133) -// CHECK:STDOUT: !140 = !{!134} -// CHECK:STDOUT: !141 = !DIFile(filename: "{{.*}}/prelude/types/cpp/void.carbon", directory: "") -// CHECK:STDOUT: !142 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert:thunk:ImplicitAs.a569d188b7ffe592.Core:e8f8f92d3d08d149:ImplicitAs.01c4a560c986e7d1.Core.84588f41d61dafba", scope: null, file: !141, line: 40, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !146) -// CHECK:STDOUT: !143 = !DILocalVariable(arg: 1, scope: !142, type: !7) -// CHECK:STDOUT: !145 = !DILocation(line: 40, column: 3, scope: !142) -// CHECK:STDOUT: !146 = !{!143} -// CHECK:STDOUT: !147 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.e4523e01ac2590ba", scope: null, file: !64, line: 33, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !154) -// CHECK:STDOUT: !148 = !DILocalVariable(arg: 1, scope: !147, type: !7) -// CHECK:STDOUT: !152 = !DILocation(line: 34, column: 12, scope: !147) -// CHECK:STDOUT: !153 = !DILocation(line: 34, column: 5, scope: !147) -// CHECK:STDOUT: !154 = !{!148} -// CHECK:STDOUT: !160 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.e8f8f92d3d08d149:OptionalStorage.Core.7a595a06c724a271", scope: null, file: !64, line: 166, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !172) -// CHECK:STDOUT: !161 = !DILocalVariable(arg: 1, scope: !160, type: !7) -// CHECK:STDOUT: !165 = !DILocation(line: 167, column: 14, scope: !160) -// CHECK:STDOUT: !167 = !DILocation(line: 167, column: 18, scope: !160) -// CHECK:STDOUT: !169 = !DILocation(line: 169, column: 5, scope: !160) -// CHECK:STDOUT: !171 = !DILocation(line: 170, column: 5, scope: !160) -// CHECK:STDOUT: !172 = !{!161} -// CHECK:STDOUT: !173 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.e8f8f92d3d08d149:OptionalStorage.Core.8f1054b47505c137", scope: null, file: !64, line: 166, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !185) +// CHECK:STDOUT: !19 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") +// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.00ac8ef5084ea134:core.Destroy.Core", scope: null, file: !19, line: 164, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !23) +// CHECK:STDOUT: !21 = !DILocalVariable(arg: 1, scope: !20, type: !7) +// CHECK:STDOUT: !22 = !DILocation(line: 164, column: 19, scope: !20) +// CHECK:STDOUT: !23 = !{!21} +// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.a7d1b77eb1279818:core.Destroy.Core", scope: null, file: !4, line: 7, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !27) +// CHECK:STDOUT: !25 = !DILocalVariable(arg: 1, scope: !24, type: !7) +// CHECK:STDOUT: !26 = !DILocation(line: 7, column: 21, scope: !24) +// CHECK:STDOUT: !27 = !{!25} +// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.a7d1b77eb1279818:core.Destroy.Core", scope: null, file: !4, line: 7, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !31) +// CHECK:STDOUT: !29 = !DILocalVariable(arg: 1, scope: !28, type: !7) +// CHECK:STDOUT: !30 = !DILocation(line: 7, column: 21, scope: !28) +// CHECK:STDOUT: !31 = !{!29} +// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.174120d4d03791b0:core.Destroy.Core", scope: null, file: !4, line: 7, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !35) +// CHECK:STDOUT: !33 = !DILocalVariable(arg: 1, scope: !32, type: !7) +// CHECK:STDOUT: !34 = !DILocation(line: 7, column: 21, scope: !32) +// CHECK:STDOUT: !35 = !{!33} +// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.174120d4d03791b0:core.Destroy.Core", scope: null, file: !4, line: 7, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !39) +// CHECK:STDOUT: !37 = !DILocalVariable(arg: 1, scope: !36, type: !7) +// CHECK:STDOUT: !38 = !DILocation(line: 7, column: 21, scope: !36) +// CHECK:STDOUT: !39 = !{!37} +// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.14b4a412ddf73a96:core.Destroy.Core", scope: null, file: !4, line: 7, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !43) +// CHECK:STDOUT: !41 = !DILocalVariable(arg: 1, scope: !40, type: !7) +// CHECK:STDOUT: !42 = !DILocation(line: 7, column: 21, scope: !40) +// CHECK:STDOUT: !43 = !{!41} +// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.14b4a412ddf73a96:core.Destroy.Core", scope: null, file: !4, line: 7, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !47) +// CHECK:STDOUT: !45 = !DILocalVariable(arg: 1, scope: !44, type: !7) +// CHECK:STDOUT: !46 = !DILocation(line: 7, column: 21, scope: !44) +// CHECK:STDOUT: !47 = !{!45} +// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "PassIntPtr", linkageName: "_CPassIntPtr.Main", scope: null, file: !4, line: 10, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !54) +// CHECK:STDOUT: !49 = !DILocalVariable(arg: 1, scope: !48, type: !7) +// CHECK:STDOUT: !51 = !DILocation(line: 11, column: 21, scope: !48) +// CHECK:STDOUT: !52 = !DILocation(line: 11, column: 3, scope: !48) +// CHECK:STDOUT: !53 = !DILocation(line: 10, column: 1, scope: !48) +// CHECK:STDOUT: !54 = !{!49} +// CHECK:STDOUT: !55 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.d088c7eb746488be:core.Destroy.Core", scope: null, file: !19, line: 164, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !58) +// CHECK:STDOUT: !56 = !DILocalVariable(arg: 1, scope: !55, type: !7) +// CHECK:STDOUT: !57 = !DILocation(line: 164, column: 19, scope: !55) +// CHECK:STDOUT: !58 = !{!56} +// CHECK:STDOUT: !59 = distinct !DISubprogram(name: "PassIntPtrToConstVoidPtr", linkageName: "_CPassIntPtrToConstVoidPtr.Main", scope: null, file: !4, line: 14, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !65) +// CHECK:STDOUT: !60 = !DILocalVariable(arg: 1, scope: !59, type: !7) +// CHECK:STDOUT: !62 = !DILocation(line: 15, column: 27, scope: !59) +// CHECK:STDOUT: !63 = !DILocation(line: 15, column: 3, scope: !59) +// CHECK:STDOUT: !64 = !DILocation(line: 14, column: 1, scope: !59) +// CHECK:STDOUT: !65 = !{!60} +// CHECK:STDOUT: !66 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.e9afb99fe676df82:core.Destroy.Core", scope: null, file: !19, line: 164, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !69) +// CHECK:STDOUT: !67 = !DILocalVariable(arg: 1, scope: !66, type: !7) +// CHECK:STDOUT: !68 = !DILocation(line: 164, column: 19, scope: !66) +// CHECK:STDOUT: !69 = !{!67} +// CHECK:STDOUT: !70 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.8d3ff16138365f48:core.Destroy.Core", scope: null, file: !4, line: 15, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !73) +// CHECK:STDOUT: !71 = !DILocalVariable(arg: 1, scope: !70, type: !7) +// CHECK:STDOUT: !72 = !DILocation(line: 15, column: 27, scope: !70) +// CHECK:STDOUT: !73 = !{!71} +// CHECK:STDOUT: !74 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.8d3ff16138365f48:core.Destroy.Core", scope: null, file: !4, line: 15, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !77) +// CHECK:STDOUT: !75 = !DILocalVariable(arg: 1, scope: !74, type: !7) +// CHECK:STDOUT: !76 = !DILocation(line: 15, column: 27, scope: !74) +// CHECK:STDOUT: !77 = !{!75} +// CHECK:STDOUT: !78 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.4e1f0f3b7725eea2:core.Destroy.Core", scope: null, file: !4, line: 15, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !81) +// CHECK:STDOUT: !79 = !DILocalVariable(arg: 1, scope: !78, type: !7) +// CHECK:STDOUT: !80 = !DILocation(line: 15, column: 27, scope: !78) +// CHECK:STDOUT: !81 = !{!79} +// CHECK:STDOUT: !82 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.4e1f0f3b7725eea2:core.Destroy.Core", scope: null, file: !4, line: 15, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !85) +// CHECK:STDOUT: !83 = !DILocalVariable(arg: 1, scope: !82, type: !7) +// CHECK:STDOUT: !84 = !DILocation(line: 15, column: 27, scope: !82) +// CHECK:STDOUT: !85 = !{!83} +// CHECK:STDOUT: !86 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.dfb26e502f641cc5:core.Destroy.Core", scope: null, file: !4, line: 15, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !89) +// CHECK:STDOUT: !87 = !DILocalVariable(arg: 1, scope: !86, type: !7) +// CHECK:STDOUT: !88 = !DILocation(line: 15, column: 27, scope: !86) +// CHECK:STDOUT: !89 = !{!87} +// CHECK:STDOUT: !90 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.dfb26e502f641cc5:core.Destroy.Core", scope: null, file: !4, line: 15, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !93) +// CHECK:STDOUT: !91 = !DILocalVariable(arg: 1, scope: !90, type: !7) +// CHECK:STDOUT: !92 = !DILocation(line: 15, column: 27, scope: !90) +// CHECK:STDOUT: !93 = !{!91} +// CHECK:STDOUT: !94 = distinct !DISubprogram(name: "PassConstIntPtrToConstVoidPtr", linkageName: "_CPassConstIntPtrToConstVoidPtr.Main", scope: null, file: !4, line: 18, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !100) +// CHECK:STDOUT: !95 = !DILocalVariable(arg: 1, scope: !94, type: !7) +// CHECK:STDOUT: !97 = !DILocation(line: 19, column: 27, scope: !94) +// CHECK:STDOUT: !98 = !DILocation(line: 19, column: 3, scope: !94) +// CHECK:STDOUT: !99 = !DILocation(line: 18, column: 1, scope: !94) +// CHECK:STDOUT: !100 = !{!95} +// CHECK:STDOUT: !101 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.7742c7b82efb7924:core.Destroy.Core", scope: null, file: !19, line: 164, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !104) +// CHECK:STDOUT: !102 = !DILocalVariable(arg: 1, scope: !101, type: !7) +// CHECK:STDOUT: !103 = !DILocation(line: 164, column: 19, scope: !101) +// CHECK:STDOUT: !104 = !{!102} +// CHECK:STDOUT: !105 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.0532bac23645330a", scope: null, file: !19, line: 105, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !112) +// CHECK:STDOUT: !106 = !DILocalVariable(arg: 1, scope: !105, type: !7) +// CHECK:STDOUT: !110 = !DILocation(line: 106, column: 12, scope: !105) +// CHECK:STDOUT: !111 = !DILocation(line: 106, column: 5, scope: !105) +// CHECK:STDOUT: !112 = !{!106} +// CHECK:STDOUT: !113 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.6031252d10ea5365", scope: null, file: !19, line: 105, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !120) +// CHECK:STDOUT: !114 = !DILocalVariable(arg: 1, scope: !113, type: !7) +// CHECK:STDOUT: !118 = !DILocation(line: 106, column: 12, scope: !113) +// CHECK:STDOUT: !119 = !DILocation(line: 106, column: 5, scope: !113) +// CHECK:STDOUT: !120 = !{!114} +// CHECK:STDOUT: !121 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.d72303bab6c7803c", scope: null, file: !19, line: 105, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !128) +// CHECK:STDOUT: !122 = !DILocalVariable(arg: 1, scope: !121, type: !7) +// CHECK:STDOUT: !126 = !DILocation(line: 106, column: 12, scope: !121) +// CHECK:STDOUT: !127 = !DILocation(line: 106, column: 5, scope: !121) +// CHECK:STDOUT: !128 = !{!122} +// CHECK:STDOUT: !137 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.4201ec9a263c5642", scope: null, file: !19, line: 80, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !145) +// CHECK:STDOUT: !138 = !DILocalVariable(arg: 1, scope: !137, type: !7) +// CHECK:STDOUT: !143 = !DILocation(line: 81, column: 12, scope: !137) +// CHECK:STDOUT: !144 = !DILocation(line: 81, column: 5, scope: !137) +// CHECK:STDOUT: !145 = !{!138} +// CHECK:STDOUT: !146 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.1e16d6a5a3286ade", scope: null, file: !19, line: 87, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !154) +// CHECK:STDOUT: !147 = !DILocalVariable(arg: 1, scope: !146, type: !7) +// CHECK:STDOUT: !151 = !DILocation(line: 88, column: 29, scope: !146) +// CHECK:STDOUT: !152 = !DILocation(line: 88, column: 12, scope: !146) +// CHECK:STDOUT: !153 = !DILocation(line: 88, column: 5, scope: !146) +// CHECK:STDOUT: !154 = !{!147} +// CHECK:STDOUT: !155 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.ea6f599e1a77a7ea", scope: null, file: !19, line: 87, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !163) +// CHECK:STDOUT: !156 = !DILocalVariable(arg: 1, scope: !155, type: !7) +// CHECK:STDOUT: !160 = !DILocation(line: 88, column: 29, scope: !155) +// CHECK:STDOUT: !161 = !DILocation(line: 88, column: 12, scope: !155) +// CHECK:STDOUT: !162 = !DILocation(line: 88, column: 5, scope: !155) +// CHECK:STDOUT: !163 = !{!156} +// CHECK:STDOUT: !173 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.4201ec9a263c5642", scope: null, file: !19, line: 33, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !180) // CHECK:STDOUT: !174 = !DILocalVariable(arg: 1, scope: !173, type: !7) -// CHECK:STDOUT: !178 = !DILocation(line: 167, column: 14, scope: !173) -// CHECK:STDOUT: !180 = !DILocation(line: 167, column: 18, scope: !173) -// CHECK:STDOUT: !182 = !DILocation(line: 169, column: 5, scope: !173) -// CHECK:STDOUT: !184 = !DILocation(line: 170, column: 5, scope: !173) -// CHECK:STDOUT: !185 = !{!174} -// CHECK:STDOUT: !186 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !187 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !188 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !189 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !190 = !{!"omnipotent char", !189, i64 0} -// CHECK:STDOUT: !191 = !{!"int", !190, i64 0} -// CHECK:STDOUT: !192 = !{!"__libc_errno", !191, i64 0} -// CHECK:STDOUT: !193 = !{!192, !191, i64 0} +// CHECK:STDOUT: !178 = !DILocation(line: 34, column: 12, scope: !173) +// CHECK:STDOUT: !179 = !DILocation(line: 34, column: 5, scope: !173) +// CHECK:STDOUT: !180 = !{!174} +// CHECK:STDOUT: !181 = !DIFile(filename: "{{.*}}/prelude/types/cpp/void.carbon", directory: "") +// CHECK:STDOUT: !182 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert:thunk:ImplicitAs.a569d188b7ffe592.Core:e8f8f92d3d08d149:ImplicitAs.01c4a560c986e7d1.Core.84588f41d61dafba", scope: null, file: !181, line: 40, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !186) +// CHECK:STDOUT: !183 = !DILocalVariable(arg: 1, scope: !182, type: !7) +// CHECK:STDOUT: !185 = !DILocation(line: 40, column: 3, scope: !182) +// CHECK:STDOUT: !186 = !{!183} +// CHECK:STDOUT: !187 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.e4523e01ac2590ba", scope: null, file: !19, line: 33, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !194) +// CHECK:STDOUT: !188 = !DILocalVariable(arg: 1, scope: !187, type: !7) +// CHECK:STDOUT: !192 = !DILocation(line: 34, column: 12, scope: !187) +// CHECK:STDOUT: !193 = !DILocation(line: 34, column: 5, scope: !187) +// CHECK:STDOUT: !194 = !{!188} +// CHECK:STDOUT: !200 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.e8f8f92d3d08d149:OptionalStorage.Core.7a595a06c724a271", scope: null, file: !19, line: 166, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !212) +// CHECK:STDOUT: !201 = !DILocalVariable(arg: 1, scope: !200, type: !7) +// CHECK:STDOUT: !205 = !DILocation(line: 167, column: 14, scope: !200) +// CHECK:STDOUT: !207 = !DILocation(line: 167, column: 18, scope: !200) +// CHECK:STDOUT: !209 = !DILocation(line: 169, column: 5, scope: !200) +// CHECK:STDOUT: !211 = !DILocation(line: 170, column: 5, scope: !200) +// CHECK:STDOUT: !212 = !{!201} +// CHECK:STDOUT: !213 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.e8f8f92d3d08d149:OptionalStorage.Core.8f1054b47505c137", scope: null, file: !19, line: 166, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !225) +// CHECK:STDOUT: !214 = !DILocalVariable(arg: 1, scope: !213, type: !7) +// CHECK:STDOUT: !218 = !DILocation(line: 167, column: 14, scope: !213) +// CHECK:STDOUT: !220 = !DILocation(line: 167, column: 18, scope: !213) +// CHECK:STDOUT: !222 = !DILocation(line: 169, column: 5, scope: !213) +// CHECK:STDOUT: !224 = !DILocation(line: 170, column: 5, scope: !213) +// CHECK:STDOUT: !225 = !{!214} +// CHECK:STDOUT: !226 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !227 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !228 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !229 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !230 = !{!"omnipotent char", !229, i64 0} +// CHECK:STDOUT: !231 = !{!"int", !230, i64 0} +// CHECK:STDOUT: !232 = !{!"__libc_errno", !231, i64 0} +// CHECK:STDOUT: !233 = !{!232, !231, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'receive.carbon' @@ -390,59 +498,72 @@ fn ConvertFromConstVoidPtr(p: const Cpp.void*) -> const i32* { // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define ptr @_CReceiveVoidPtr.Main() #0 !dbg !198 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.00ac8ef5084ea134:core.Destroy.Core"(ptr %self) #0 !dbg !238 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %return_void_ptr.call = call ptr @_Z15return_void_ptrv(), !dbg !201 -// CHECK:STDOUT: ret ptr %return_void_ptr.call, !dbg !202 +// CHECK:STDOUT: ret void, !dbg !240 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define ptr @_CReceiveVoidPtr.Main() #0 !dbg !242 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %return_void_ptr.call = call ptr @_Z15return_void_ptrv(), !dbg !245 +// CHECK:STDOUT: ret ptr %return_void_ptr.call, !dbg !246 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare noundef ptr @_Z15return_void_ptrv() #1 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define ptr @_CConvertFromVoidPtr.Main(ptr %p) #0 !dbg !203 { +// CHECK:STDOUT: define ptr @_CConvertFromVoidPtr.Main(ptr %p) #0 !dbg !247 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret ptr %p, !dbg !209 +// CHECK:STDOUT: ret ptr %p, !dbg !253 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define ptr @_CConvertFromConstVoidPtr.Main(ptr %p) #0 !dbg !211 { +// CHECK:STDOUT: define ptr @_CConvertFromConstVoidPtr.Main(ptr %p) #0 !dbg !255 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret ptr %p, !dbg !217 +// CHECK:STDOUT: ret ptr %p, !dbg !261 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!195} -// CHECK:STDOUT: !llvm.module.flags = !{!186, !187, !188, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!193} +// CHECK:STDOUT: !llvm.dbg.cu = !{!235} +// CHECK:STDOUT: !llvm.module.flags = !{!226, !227, !228, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!233} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !7 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !8 = !{null, !7} +// CHECK:STDOUT: !9 = !DISubroutineType(types: !8) // CHECK:STDOUT: !14 = !{!7, !7} // CHECK:STDOUT: !15 = !DISubroutineType(types: !14) -// CHECK:STDOUT: !186 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !187 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !188 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !189 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !190 = !{!"omnipotent char", !189, i64 0} -// CHECK:STDOUT: !191 = !{!"int", !190, i64 0} -// CHECK:STDOUT: !192 = !{!"__libc_errno", !191, i64 0} -// CHECK:STDOUT: !193 = !{!192, !191, i64 0} -// CHECK:STDOUT: !194 = !DIFile(filename: "receive.carbon", directory: "") -// CHECK:STDOUT: !195 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !194, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !196 = !{!7} -// CHECK:STDOUT: !197 = !DISubroutineType(types: !196) -// CHECK:STDOUT: !198 = distinct !DISubprogram(name: "ReceiveVoidPtr", linkageName: "_CReceiveVoidPtr.Main", scope: null, file: !194, line: 6, type: !197, spFlags: DISPFlagDefinition, unit: !195) -// CHECK:STDOUT: !201 = !DILocation(line: 7, column: 10, scope: !198) -// CHECK:STDOUT: !202 = !DILocation(line: 7, column: 3, scope: !198) -// CHECK:STDOUT: !203 = distinct !DISubprogram(name: "ConvertFromVoidPtr", linkageName: "_CConvertFromVoidPtr.Main", scope: null, file: !194, line: 10, type: !15, spFlags: DISPFlagDefinition, unit: !195, retainedNodes: !210) -// CHECK:STDOUT: !204 = !DILocalVariable(arg: 1, scope: !203, type: !7) -// CHECK:STDOUT: !209 = !DILocation(line: 11, column: 3, scope: !203) -// CHECK:STDOUT: !210 = !{!204} -// CHECK:STDOUT: !211 = distinct !DISubprogram(name: "ConvertFromConstVoidPtr", linkageName: "_CConvertFromConstVoidPtr.Main", scope: null, file: !194, line: 14, type: !15, spFlags: DISPFlagDefinition, unit: !195, retainedNodes: !218) -// CHECK:STDOUT: !212 = !DILocalVariable(arg: 1, scope: !211, type: !7) -// CHECK:STDOUT: !217 = !DILocation(line: 15, column: 3, scope: !211) -// CHECK:STDOUT: !218 = !{!212} +// CHECK:STDOUT: !19 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") +// CHECK:STDOUT: !226 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !227 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !228 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !229 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !230 = !{!"omnipotent char", !229, i64 0} +// CHECK:STDOUT: !231 = !{!"int", !230, i64 0} +// CHECK:STDOUT: !232 = !{!"__libc_errno", !231, i64 0} +// CHECK:STDOUT: !233 = !{!232, !231, i64 0} +// CHECK:STDOUT: !234 = !DIFile(filename: "receive.carbon", directory: "") +// CHECK:STDOUT: !235 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !234, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !236 = !{!7} +// CHECK:STDOUT: !237 = !DISubroutineType(types: !236) +// CHECK:STDOUT: !238 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.00ac8ef5084ea134:core.Destroy.Core", scope: null, file: !19, line: 164, type: !9, spFlags: DISPFlagDefinition, unit: !235, retainedNodes: !241) +// CHECK:STDOUT: !239 = !DILocalVariable(arg: 1, scope: !238, type: !7) +// CHECK:STDOUT: !240 = !DILocation(line: 164, column: 19, scope: !238) +// CHECK:STDOUT: !241 = !{!239} +// CHECK:STDOUT: !242 = distinct !DISubprogram(name: "ReceiveVoidPtr", linkageName: "_CReceiveVoidPtr.Main", scope: null, file: !234, line: 6, type: !237, spFlags: DISPFlagDefinition, unit: !235) +// CHECK:STDOUT: !245 = !DILocation(line: 7, column: 10, scope: !242) +// CHECK:STDOUT: !246 = !DILocation(line: 7, column: 3, scope: !242) +// CHECK:STDOUT: !247 = distinct !DISubprogram(name: "ConvertFromVoidPtr", linkageName: "_CConvertFromVoidPtr.Main", scope: null, file: !234, line: 10, type: !15, spFlags: DISPFlagDefinition, unit: !235, retainedNodes: !254) +// CHECK:STDOUT: !248 = !DILocalVariable(arg: 1, scope: !247, type: !7) +// CHECK:STDOUT: !253 = !DILocation(line: 11, column: 3, scope: !247) +// CHECK:STDOUT: !254 = !{!248} +// CHECK:STDOUT: !255 = distinct !DISubprogram(name: "ConvertFromConstVoidPtr", linkageName: "_CConvertFromConstVoidPtr.Main", scope: null, file: !234, line: 14, type: !15, spFlags: DISPFlagDefinition, unit: !235, retainedNodes: !262) +// CHECK:STDOUT: !256 = !DILocalVariable(arg: 1, scope: !255, type: !7) +// CHECK:STDOUT: !261 = !DILocation(line: 15, column: 3, scope: !255) +// CHECK:STDOUT: !262 = !{!256} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/let/copy_value_rep.carbon b/toolchain/lower/testdata/let/copy_value_rep.carbon index af1958343607..c9f5d47f2c88 100644 --- a/toolchain/lower/testdata/let/copy_value_rep.carbon +++ b/toolchain/lower/testdata/let/copy_value_rep.carbon @@ -39,28 +39,55 @@ fn Run() -> i32 { // CHECK:STDOUT: %.loc19_17.2 = load i32, ptr %.loc19_17.1.a, align 4, !dbg !34 // CHECK:STDOUT: %.loc20_4.a = getelementptr inbounds nuw { i32 }, ptr %x.var, i32 0, i32 0, !dbg !37 // CHECK:STDOUT: store i32 2, ptr %.loc20_4.a, align 4, !dbg !37 -// CHECK:STDOUT: call void @"_COp.8b0bf151036f045a:core.Destroy.Core"(ptr %x.var), !dbg !31 +// CHECK:STDOUT: call void @"_CSelfDestruct.8b0bf151036f045a:core.Destroy.Core"(ptr %x.var), !dbg !31 // CHECK:STDOUT: ret i32 %.loc19_17.2, !dbg !39 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !40 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !40 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !42 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.a9280e8bea6fc5f9:core.Destroy.Core"(ptr %self) #0 !dbg !44 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !44 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !46 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.8b0bf151036f045a:core.Destroy.Core"(ptr %self) #0 !dbg !48 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !48 { // CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !50 // CHECK:STDOUT: ret void, !dbg !50 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.a9280e8bea6fc5f9:core.Destroy.Core"(ptr %self) #0 !dbg !52 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !54 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.a9280e8bea6fc5f9:core.Destroy.Core"(ptr %self) #0 !dbg !56 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.a9280e8bea6fc5f9:core.Destroy.Core"(ptr %self), !dbg !58 +// CHECK:STDOUT: ret void, !dbg !58 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.8b0bf151036f045a:core.Destroy.Core"(ptr %self) #0 !dbg !60 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !62 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.8b0bf151036f045a:core.Destroy.Core"(ptr %self) #0 !dbg !64 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.8b0bf151036f045a:core.Destroy.Core"(ptr %self), !dbg !66 +// CHECK:STDOUT: ret void, !dbg !66 +// 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: @@ -91,16 +118,32 @@ fn Run() -> i32 { // CHECK:STDOUT: !34 = !DILocation(line: 19, column: 16, scope: !28) // CHECK:STDOUT: !37 = !DILocation(line: 20, column: 3, scope: !28) // CHECK:STDOUT: !39 = !DILocation(line: 22, column: 3, scope: !28) -// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 18, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !43) +// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !18, line: 18, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !43) // CHECK:STDOUT: !41 = !DILocalVariable(arg: 1, scope: !40, type: !20) // CHECK:STDOUT: !42 = !DILocation(line: 18, column: 3, scope: !40) // CHECK:STDOUT: !43 = !{!41} -// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "Op", linkageName: "_COp.a9280e8bea6fc5f9:core.Destroy.Core", scope: null, file: !18, line: 18, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !47) -// CHECK:STDOUT: !45 = !DILocalVariable(arg: 1, scope: !44, type: !25) +// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 18, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !47) +// CHECK:STDOUT: !45 = !DILocalVariable(arg: 1, scope: !44, type: !20) // CHECK:STDOUT: !46 = !DILocation(line: 18, column: 3, scope: !44) // CHECK:STDOUT: !47 = !{!45} -// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "Op", linkageName: "_COp.8b0bf151036f045a:core.Destroy.Core", scope: null, file: !18, line: 18, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !51) -// CHECK:STDOUT: !49 = !DILocalVariable(arg: 1, scope: !48, type: !25) +// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 18, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !51) +// CHECK:STDOUT: !49 = !DILocalVariable(arg: 1, scope: !48, type: !20) // CHECK:STDOUT: !50 = !DILocation(line: 18, column: 3, scope: !48) // CHECK:STDOUT: !51 = !{!49} +// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.a9280e8bea6fc5f9:core.Destroy.Core", scope: null, file: !18, line: 18, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !55) +// CHECK:STDOUT: !53 = !DILocalVariable(arg: 1, scope: !52, type: !25) +// CHECK:STDOUT: !54 = !DILocation(line: 18, column: 3, scope: !52) +// CHECK:STDOUT: !55 = !{!53} +// CHECK:STDOUT: !56 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.a9280e8bea6fc5f9:core.Destroy.Core", scope: null, file: !18, line: 18, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !59) +// CHECK:STDOUT: !57 = !DILocalVariable(arg: 1, scope: !56, type: !25) +// CHECK:STDOUT: !58 = !DILocation(line: 18, column: 3, scope: !56) +// CHECK:STDOUT: !59 = !{!57} +// CHECK:STDOUT: !60 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.8b0bf151036f045a:core.Destroy.Core", scope: null, file: !18, line: 18, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !63) +// CHECK:STDOUT: !61 = !DILocalVariable(arg: 1, scope: !60, type: !25) +// CHECK:STDOUT: !62 = !DILocation(line: 18, column: 3, scope: !60) +// CHECK:STDOUT: !63 = !{!61} +// CHECK:STDOUT: !64 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.8b0bf151036f045a:core.Destroy.Core", scope: null, file: !18, line: 18, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !67) +// CHECK:STDOUT: !65 = !DILocalVariable(arg: 1, scope: !64, type: !25) +// CHECK:STDOUT: !66 = !DILocation(line: 18, column: 3, scope: !64) +// CHECK:STDOUT: !67 = !{!65} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/let/tuple.carbon b/toolchain/lower/testdata/let/tuple.carbon index ae1ed98af3c8..1ed5706c9fa1 100644 --- a/toolchain/lower/testdata/let/tuple.carbon +++ b/toolchain/lower/testdata/let/tuple.carbon @@ -72,29 +72,56 @@ fn F() -> i32 { // CHECK:STDOUT: %tuple.elem1.loc17_11.tuple.elem.load = load ptr, ptr %tuple.elem1.loc17_11.tuple.elem, align 8, !dbg !42 // CHECK:STDOUT: %tuple.elem1.loc17_13.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %tuple.elem1.loc17_11.tuple.elem.load, i32 0, i32 1, !dbg !42 // CHECK:STDOUT: %tuple.elem1.loc17_13.tuple.elem.load = load i32, ptr %tuple.elem1.loc17_13.tuple.elem, align 4, !dbg !42 -// CHECK:STDOUT: call void @"_COp.e554695bf635d9c1:core.Destroy.Core"(ptr %b.var), !dbg !34 -// CHECK:STDOUT: call void @"_COp.555b1314256372b8:core.Destroy.Core"(ptr %a.var), !dbg !31 +// CHECK:STDOUT: call void @"_CSelfDestruct.e554695bf635d9c1:core.Destroy.Core"(ptr %b.var), !dbg !34 +// CHECK:STDOUT: call void @"_CSelfDestruct.555b1314256372b8:core.Destroy.Core"(ptr %a.var), !dbg !31 // CHECK:STDOUT: ret i32 %tuple.elem1.loc17_13.tuple.elem.load, !dbg !43 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !44 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !44 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !46 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.e554695bf635d9c1:core.Destroy.Core"(ptr %self) #0 !dbg !48 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !48 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !50 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.555b1314256372b8:core.Destroy.Core"(ptr %self) #0 !dbg !52 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !52 { // CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !54 // CHECK:STDOUT: ret void, !dbg !54 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.e554695bf635d9c1:core.Destroy.Core"(ptr %self) #0 !dbg !56 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !58 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.e554695bf635d9c1:core.Destroy.Core"(ptr %self) #0 !dbg !60 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.e554695bf635d9c1:core.Destroy.Core"(ptr %self), !dbg !62 +// CHECK:STDOUT: ret void, !dbg !62 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.555b1314256372b8:core.Destroy.Core"(ptr %self) #0 !dbg !64 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !66 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.555b1314256372b8:core.Destroy.Core"(ptr %self) #0 !dbg !68 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.555b1314256372b8:core.Destroy.Core"(ptr %self), !dbg !70 +// CHECK:STDOUT: ret void, !dbg !70 +// 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: @@ -133,16 +160,32 @@ fn F() -> i32 { // CHECK:STDOUT: !39 = !DILocation(line: 16, column: 42, scope: !28) // CHECK:STDOUT: !42 = !DILocation(line: 17, column: 10, scope: !28) // CHECK:STDOUT: !43 = !DILocation(line: 17, column: 3, scope: !28) -// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 15, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !47) +// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !18, line: 15, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !47) // CHECK:STDOUT: !45 = !DILocalVariable(arg: 1, scope: !44, type: !20) // CHECK:STDOUT: !46 = !DILocation(line: 15, column: 3, scope: !44) // CHECK:STDOUT: !47 = !{!45} -// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "Op", linkageName: "_COp.e554695bf635d9c1:core.Destroy.Core", scope: null, file: !18, line: 15, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !51) -// CHECK:STDOUT: !49 = !DILocalVariable(arg: 1, scope: !48, type: !25) +// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 15, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !51) +// CHECK:STDOUT: !49 = !DILocalVariable(arg: 1, scope: !48, type: !20) // CHECK:STDOUT: !50 = !DILocation(line: 15, column: 3, scope: !48) // CHECK:STDOUT: !51 = !{!49} -// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "Op", linkageName: "_COp.555b1314256372b8:core.Destroy.Core", scope: null, file: !18, line: 14, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !55) -// CHECK:STDOUT: !53 = !DILocalVariable(arg: 1, scope: !52, type: !25) -// CHECK:STDOUT: !54 = !DILocation(line: 14, column: 3, scope: !52) +// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 15, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !55) +// CHECK:STDOUT: !53 = !DILocalVariable(arg: 1, scope: !52, type: !20) +// CHECK:STDOUT: !54 = !DILocation(line: 15, column: 3, scope: !52) // CHECK:STDOUT: !55 = !{!53} +// CHECK:STDOUT: !56 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.e554695bf635d9c1:core.Destroy.Core", scope: null, file: !18, line: 15, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !59) +// CHECK:STDOUT: !57 = !DILocalVariable(arg: 1, scope: !56, type: !25) +// CHECK:STDOUT: !58 = !DILocation(line: 15, column: 3, scope: !56) +// CHECK:STDOUT: !59 = !{!57} +// CHECK:STDOUT: !60 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.e554695bf635d9c1:core.Destroy.Core", scope: null, file: !18, line: 15, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !63) +// CHECK:STDOUT: !61 = !DILocalVariable(arg: 1, scope: !60, type: !25) +// CHECK:STDOUT: !62 = !DILocation(line: 15, column: 3, scope: !60) +// CHECK:STDOUT: !63 = !{!61} +// CHECK:STDOUT: !64 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.555b1314256372b8:core.Destroy.Core", scope: null, file: !18, line: 14, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !67) +// CHECK:STDOUT: !65 = !DILocalVariable(arg: 1, scope: !64, type: !25) +// CHECK:STDOUT: !66 = !DILocation(line: 14, column: 3, scope: !64) +// CHECK:STDOUT: !67 = !{!65} +// CHECK:STDOUT: !68 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.555b1314256372b8:core.Destroy.Core", scope: null, file: !18, line: 14, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !71) +// CHECK:STDOUT: !69 = !DILocalVariable(arg: 1, scope: !68, type: !25) +// CHECK:STDOUT: !70 = !DILocation(line: 14, column: 3, scope: !68) +// CHECK:STDOUT: !71 = !{!69} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/operators/assignment.carbon b/toolchain/lower/testdata/operators/assignment.carbon index b1e4af90f684..a3bdc58304b5 100644 --- a/toolchain/lower/testdata/operators/assignment.carbon +++ b/toolchain/lower/testdata/operators/assignment.carbon @@ -36,40 +36,60 @@ fn G() -> (i32, i32) { // CHECK:STDOUT: store i32 12, ptr %a.var, align 4, !dbg !33 // CHECK:STDOUT: store i32 9, ptr %a.var, align 4, !dbg !35 // CHECK:STDOUT: %.loc16 = load i32, ptr %a.var, align 4, !dbg !36 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %a.var), !dbg !33 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %a.var), !dbg !33 // CHECK:STDOUT: ret i32 %.loc16, !dbg !37 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !38 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !38 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !40 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CG.Main(ptr sret({ i32, i32 }) %return) #0 !dbg !42 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !42 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %b.var = alloca { i32, i32 }, align 4, !dbg !45 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %b.var), !dbg !45 -// CHECK:STDOUT: %tuple.elem0.loc21.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %b.var, i32 0, i32 0, !dbg !48 -// CHECK:STDOUT: %tuple.elem1.loc21.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %b.var, i32 0, i32 1, !dbg !48 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %b.var, ptr align 4 @tuple.102.loc21_5, i64 8, i1 false), !dbg !47 -// CHECK:STDOUT: %tuple.elem0.loc22_10.1.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %b.var, i32 0, i32 0, !dbg !49 -// CHECK:STDOUT: %.loc22_10.1 = load i32, ptr %tuple.elem0.loc22_10.1.tuple.elem, align 4, !dbg !49 -// CHECK:STDOUT: %tuple.elem0.loc22_10.2.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 0, !dbg !49 -// CHECK:STDOUT: store i32 %.loc22_10.1, ptr %tuple.elem0.loc22_10.2.tuple.elem, align 4, !dbg !49 -// CHECK:STDOUT: %tuple.elem1.loc22_10.1.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %b.var, i32 0, i32 1, !dbg !49 -// CHECK:STDOUT: %.loc22_10.3 = load i32, ptr %tuple.elem1.loc22_10.1.tuple.elem, align 4, !dbg !49 -// CHECK:STDOUT: %tuple.elem1.loc22_10.2.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 1, !dbg !49 -// CHECK:STDOUT: store i32 %.loc22_10.3, ptr %tuple.elem1.loc22_10.2.tuple.elem, align 4, !dbg !49 -// CHECK:STDOUT: call void @"_COp.e554695bf635d9c1:core.Destroy.Core"(ptr %b.var), !dbg !45 -// CHECK:STDOUT: ret void, !dbg !50 +// CHECK:STDOUT: ret void, !dbg !44 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.e554695bf635d9c1:core.Destroy.Core"(ptr %self) #0 !dbg !51 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !46 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !53 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !48 +// CHECK:STDOUT: ret void, !dbg !48 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CG.Main(ptr sret({ i32, i32 }) %return) #0 !dbg !50 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %b.var = alloca { i32, i32 }, align 4, !dbg !53 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %b.var), !dbg !53 +// CHECK:STDOUT: %tuple.elem0.loc21.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %b.var, i32 0, i32 0, !dbg !56 +// CHECK:STDOUT: %tuple.elem1.loc21.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %b.var, i32 0, i32 1, !dbg !56 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %b.var, ptr align 4 @tuple.102.loc21_5, i64 8, i1 false), !dbg !55 +// CHECK:STDOUT: %tuple.elem0.loc22_10.1.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %b.var, i32 0, i32 0, !dbg !57 +// CHECK:STDOUT: %.loc22_10.1 = load i32, ptr %tuple.elem0.loc22_10.1.tuple.elem, align 4, !dbg !57 +// CHECK:STDOUT: %tuple.elem0.loc22_10.2.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 0, !dbg !57 +// CHECK:STDOUT: store i32 %.loc22_10.1, ptr %tuple.elem0.loc22_10.2.tuple.elem, align 4, !dbg !57 +// CHECK:STDOUT: %tuple.elem1.loc22_10.1.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %b.var, i32 0, i32 1, !dbg !57 +// CHECK:STDOUT: %.loc22_10.3 = load i32, ptr %tuple.elem1.loc22_10.1.tuple.elem, align 4, !dbg !57 +// CHECK:STDOUT: %tuple.elem1.loc22_10.2.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 1, !dbg !57 +// CHECK:STDOUT: store i32 %.loc22_10.3, ptr %tuple.elem1.loc22_10.2.tuple.elem, align 4, !dbg !57 +// CHECK:STDOUT: call void @"_CSelfDestruct.e554695bf635d9c1:core.Destroy.Core"(ptr %b.var), !dbg !53 +// CHECK:STDOUT: ret void, !dbg !58 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.e554695bf635d9c1:core.Destroy.Core"(ptr %self) #0 !dbg !59 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !61 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.e554695bf635d9c1:core.Destroy.Core"(ptr %self) #0 !dbg !63 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.e554695bf635d9c1:core.Destroy.Core"(ptr %self), !dbg !65 +// CHECK:STDOUT: ret void, !dbg !65 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -106,18 +126,30 @@ fn G() -> (i32, i32) { // CHECK:STDOUT: !35 = !DILocation(line: 15, column: 3, scope: !30) // CHECK:STDOUT: !36 = !DILocation(line: 16, column: 10, scope: !30) // CHECK:STDOUT: !37 = !DILocation(line: 16, column: 3, scope: !30) -// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 14, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !41) +// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !18, line: 14, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !41) // CHECK:STDOUT: !39 = !DILocalVariable(arg: 1, scope: !38, type: !20) // CHECK:STDOUT: !40 = !DILocation(line: 14, column: 3, scope: !38) // CHECK:STDOUT: !41 = !{!39} -// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !18, line: 19, type: !27, spFlags: DISPFlagDefinition, unit: !19) -// CHECK:STDOUT: !45 = !DILocation(line: 20, column: 3, scope: !42) -// CHECK:STDOUT: !47 = !DILocation(line: 21, column: 3, scope: !42) -// CHECK:STDOUT: !48 = !DILocation(line: 21, column: 7, scope: !42) -// CHECK:STDOUT: !49 = !DILocation(line: 22, column: 10, scope: !42) -// CHECK:STDOUT: !50 = !DILocation(line: 22, column: 3, scope: !42) -// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "Op", linkageName: "_COp.e554695bf635d9c1:core.Destroy.Core", scope: null, file: !18, line: 20, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !54) -// CHECK:STDOUT: !52 = !DILocalVariable(arg: 1, scope: !51, type: !25) -// CHECK:STDOUT: !53 = !DILocation(line: 20, column: 3, scope: !51) -// CHECK:STDOUT: !54 = !{!52} +// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 14, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !45) +// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !42, type: !20) +// CHECK:STDOUT: !44 = !DILocation(line: 14, column: 3, scope: !42) +// CHECK:STDOUT: !45 = !{!43} +// CHECK:STDOUT: !46 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 14, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !49) +// CHECK:STDOUT: !47 = !DILocalVariable(arg: 1, scope: !46, type: !20) +// CHECK:STDOUT: !48 = !DILocation(line: 14, column: 3, scope: !46) +// CHECK:STDOUT: !49 = !{!47} +// CHECK:STDOUT: !50 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !18, line: 19, type: !27, spFlags: DISPFlagDefinition, unit: !19) +// CHECK:STDOUT: !53 = !DILocation(line: 20, column: 3, scope: !50) +// CHECK:STDOUT: !55 = !DILocation(line: 21, column: 3, scope: !50) +// CHECK:STDOUT: !56 = !DILocation(line: 21, column: 7, scope: !50) +// CHECK:STDOUT: !57 = !DILocation(line: 22, column: 10, scope: !50) +// CHECK:STDOUT: !58 = !DILocation(line: 22, column: 3, scope: !50) +// CHECK:STDOUT: !59 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.e554695bf635d9c1:core.Destroy.Core", scope: null, file: !18, line: 20, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !62) +// CHECK:STDOUT: !60 = !DILocalVariable(arg: 1, scope: !59, type: !25) +// CHECK:STDOUT: !61 = !DILocation(line: 20, column: 3, scope: !59) +// CHECK:STDOUT: !62 = !{!60} +// CHECK:STDOUT: !63 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.e554695bf635d9c1:core.Destroy.Core", scope: null, file: !18, line: 20, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !66) +// CHECK:STDOUT: !64 = !DILocalVariable(arg: 1, scope: !63, type: !25) +// CHECK:STDOUT: !65 = !DILocation(line: 20, column: 3, scope: !63) +// CHECK:STDOUT: !66 = !{!64} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/operators/increment.carbon b/toolchain/lower/testdata/operators/increment.carbon index 74fb5c0c05dd..fe05a34f759d 100644 --- a/toolchain/lower/testdata/operators/increment.carbon +++ b/toolchain/lower/testdata/operators/increment.carbon @@ -30,43 +30,56 @@ fn IncrSigned() { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %from.var), !dbg !12 // CHECK:STDOUT: store i32 0, ptr %from.var, align 4, !dbg !12 // CHECK:STDOUT: call void @"_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8"(ptr %from.var), !dbg !15 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %from.var), !dbg !12 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %from.var), !dbg !12 // CHECK:STDOUT: ret void, !dbg !16 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !17 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !17 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !19 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !21 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !23 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !25 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !27 +// CHECK:STDOUT: ret void, !dbg !27 +// 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 @"_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8"(ptr %self) #0 !dbg !22 { -// CHECK:STDOUT: call void @"_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895"(ptr %self, i32 1), !dbg !25 -// CHECK:STDOUT: ret void, !dbg !28 +// CHECK:STDOUT: define linkonce_odr void @"_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8"(ptr %self) #0 !dbg !30 { +// CHECK:STDOUT: call void @"_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895"(ptr %self, i32 1), !dbg !33 +// CHECK:STDOUT: ret void, !dbg !36 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define linkonce_odr void @"_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895"(ptr %self, i32 %other) #2 !dbg !30 { -// CHECK:STDOUT: %1 = call i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044"(i32 %other), !dbg !33 -// 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 -// CHECK:STDOUT: ret void, !dbg !34 +// CHECK:STDOUT: define linkonce_odr void @"_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895"(ptr %self, i32 %other) #2 !dbg !38 { +// CHECK:STDOUT: %1 = call i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044"(i32 %other), !dbg !41 +// CHECK:STDOUT: %2 = load i32, ptr %self, align 4, !dbg !42 +// CHECK:STDOUT: %3 = add i32 %2, %1, !dbg !42 +// CHECK:STDOUT: store i32 %3, ptr %self, align 4, !dbg !42 +// CHECK:STDOUT: ret void, !dbg !42 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044"(i32 %self) #0 !dbg !38 { -// CHECK:STDOUT: %1 = call i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self), !dbg !43 -// CHECK:STDOUT: ret i32 %1, !dbg !45 +// CHECK:STDOUT: define linkonce_odr i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044"(i32 %self) #0 !dbg !46 { +// CHECK:STDOUT: %1 = call i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self), !dbg !51 +// CHECK:STDOUT: ret i32 %1, !dbg !53 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self) #0 !dbg !47 { -// CHECK:STDOUT: ret i32 %self, !dbg !53 +// CHECK:STDOUT: define linkonce_odr i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self) #0 !dbg !55 { +// CHECK:STDOUT: ret i32 %self, !dbg !61 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -89,33 +102,41 @@ fn IncrSigned() { // CHECK:STDOUT: !12 = !DILocation(line: 5, column: 3, scope: !11) // CHECK:STDOUT: !15 = !DILocation(line: 6, column: 3, scope: !11) // CHECK:STDOUT: !16 = !DILocation(line: 4, column: 1, scope: !11) -// CHECK:STDOUT: !17 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 5, type: !10, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !20) +// CHECK:STDOUT: !17 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !4, line: 5, type: !10, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !20) // CHECK:STDOUT: !18 = !DILocalVariable(arg: 1, scope: !17, type: !6) // CHECK:STDOUT: !19 = !DILocation(line: 5, column: 3, scope: !17) // CHECK:STDOUT: !20 = !{!18} -// CHECK:STDOUT: !21 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "") -// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !21, line: 396, type: !10, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !29) -// CHECK:STDOUT: !23 = !DILocalVariable(arg: 1, scope: !22, type: !6) -// CHECK:STDOUT: !25 = !DILocation(line: 398, column: 5, scope: !22) -// CHECK:STDOUT: !26 = !{null, !6, !6} -// CHECK:STDOUT: !27 = !DISubroutineType(types: !26) -// CHECK:STDOUT: !28 = !DILocation(line: 396, column: 3, scope: !22) -// CHECK:STDOUT: !29 = !{!23} -// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895", scope: null, file: !21, line: 331, type: !27, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !37) +// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 5, type: !10, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !24) +// CHECK:STDOUT: !22 = !DILocalVariable(arg: 1, scope: !21, type: !6) +// CHECK:STDOUT: !23 = !DILocation(line: 5, column: 3, scope: !21) +// CHECK:STDOUT: !24 = !{!22} +// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 5, type: !10, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !28) +// CHECK:STDOUT: !26 = !DILocalVariable(arg: 1, scope: !25, type: !6) +// CHECK:STDOUT: !27 = !DILocation(line: 5, column: 3, scope: !25) +// CHECK:STDOUT: !28 = !{!26} +// CHECK:STDOUT: !29 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "") +// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.9452f4c51951679b.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !29, line: 396, type: !10, 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) -// CHECK:STDOUT: !37 = !{!31, !32} -// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044", scope: null, file: !21, line: 64, type: !36, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !46) +// CHECK:STDOUT: !33 = !DILocation(line: 398, column: 5, scope: !30) +// CHECK:STDOUT: !34 = !{null, !6, !6} +// CHECK:STDOUT: !35 = !DISubroutineType(types: !34) +// CHECK:STDOUT: !36 = !DILocation(line: 396, column: 3, scope: !30) +// CHECK:STDOUT: !37 = !{!31} +// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:AddAssignWith.39e2e78a3c2e036d.Core:Int.9452f4c51951679b.Core:AddAssignWith.bcc2a64c00f3554f.Core.83481f1872d67895", scope: null, file: !29, line: 331, type: !35, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !45) // CHECK:STDOUT: !39 = !DILocalVariable(arg: 1, scope: !38, type: !6) -// CHECK:STDOUT: !43 = !DILocation(line: 66, column: 17, scope: !38) -// CHECK:STDOUT: !45 = !DILocation(line: 66, column: 5, scope: !38) -// CHECK:STDOUT: !46 = !{!39} -// CHECK:STDOUT: !47 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !21, line: 59, type: !36, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !54) -// CHECK:STDOUT: !48 = !DILocalVariable(arg: 1, scope: !47, type: !6) -// CHECK:STDOUT: !53 = !DILocation(line: 59, column: 28, scope: !47) -// CHECK:STDOUT: !54 = !{!48} +// CHECK:STDOUT: !40 = !DILocalVariable(arg: 2, scope: !38, type: !6) +// CHECK:STDOUT: !41 = !DILocation(line: 0, scope: !38) +// CHECK:STDOUT: !42 = !DILocation(line: 331, column: 3, scope: !38) +// CHECK:STDOUT: !43 = !{!6, !6} +// CHECK:STDOUT: !44 = !DISubroutineType(types: !43) +// CHECK:STDOUT: !45 = !{!39, !40} +// CHECK:STDOUT: !46 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044", scope: null, file: !29, line: 64, type: !44, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !54) +// CHECK:STDOUT: !47 = !DILocalVariable(arg: 1, scope: !46, type: !6) +// CHECK:STDOUT: !51 = !DILocation(line: 66, column: 17, scope: !46) +// CHECK:STDOUT: !53 = !DILocation(line: 66, column: 5, scope: !46) +// CHECK:STDOUT: !54 = !{!47} +// CHECK:STDOUT: !55 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !29, line: 59, type: !44, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !62) +// CHECK:STDOUT: !56 = !DILocalVariable(arg: 1, scope: !55, type: !6) +// CHECK:STDOUT: !61 = !DILocation(line: 59, column: 28, scope: !55) +// CHECK:STDOUT: !62 = !{!56} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/operators/overloaded.carbon b/toolchain/lower/testdata/operators/overloaded.carbon index db860a1dbfa2..0d0ce80134ee 100644 --- a/toolchain/lower/testdata/operators/overloaded.carbon +++ b/toolchain/lower/testdata/operators/overloaded.carbon @@ -99,22 +99,42 @@ fn Calculate(a: Number, b: Number) -> Number { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc30_10.1.temp), !dbg !48 // CHECK:STDOUT: call void @"_COp.Number.Main:Negate.Core"(ptr %.loc30_10.1.temp, ptr %a), !dbg !48 // CHECK:STDOUT: call void @"_COp.Number.Main:MulWith.124acaad20680602.Core"(ptr %return, ptr %.loc30_10.1.temp, ptr %b), !dbg !48 -// CHECK:STDOUT: call void @"_COp.3e6115156c640ef2:core.Destroy.Core"(ptr %.loc30_10.1.temp), !dbg !48 +// CHECK:STDOUT: call void @"_CSelfDestruct.3e6115156c640ef2:core.Destroy.Core"(ptr %.loc30_10.1.temp), !dbg !48 // CHECK:STDOUT: ret void, !dbg !50 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.4fdb30b3bf76b447:core.Destroy.Core"(ptr %self) #0 !dbg !52 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.48e0adf639fe7af4:core.Destroy.Core"(ptr %self) #0 !dbg !52 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !54 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.3e6115156c640ef2:core.Destroy.Core"(ptr %self) #0 !dbg !56 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.4fdb30b3bf76b447:core.Destroy.Core"(ptr %self) #0 !dbg !56 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !58 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.4fdb30b3bf76b447:core.Destroy.Core"(ptr %self) #0 !dbg !60 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.4fdb30b3bf76b447:core.Destroy.Core"(ptr %self), !dbg !62 +// CHECK:STDOUT: ret void, !dbg !62 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.3e6115156c640ef2:core.Destroy.Core"(ptr %self) #0 !dbg !64 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !66 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.3e6115156c640ef2:core.Destroy.Core"(ptr %self) #0 !dbg !68 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.3e6115156c640ef2:core.Destroy.Core"(ptr %self), !dbg !70 +// CHECK:STDOUT: ret void, !dbg !70 +// 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: @@ -161,12 +181,24 @@ fn Calculate(a: Number, b: Number) -> Number { // CHECK:STDOUT: !48 = !DILocation(line: 30, column: 10, scope: !40) // CHECK:STDOUT: !50 = !DILocation(line: 30, column: 3, scope: !40) // CHECK:STDOUT: !51 = !{!41, !42} -// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "Op", linkageName: "_COp.4fdb30b3bf76b447:core.Destroy.Core", scope: null, file: !4, line: 30, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !55) +// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.48e0adf639fe7af4:core.Destroy.Core", scope: null, file: !4, line: 30, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !55) // CHECK:STDOUT: !53 = !DILocalVariable(arg: 1, scope: !52, type: !6) // CHECK:STDOUT: !54 = !DILocation(line: 30, column: 10, scope: !52) // CHECK:STDOUT: !55 = !{!53} -// CHECK:STDOUT: !56 = distinct !DISubprogram(name: "Op", linkageName: "_COp.3e6115156c640ef2:core.Destroy.Core", scope: null, file: !4, line: 30, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !59) +// CHECK:STDOUT: !56 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.4fdb30b3bf76b447:core.Destroy.Core", scope: null, file: !4, line: 30, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !59) // CHECK:STDOUT: !57 = !DILocalVariable(arg: 1, scope: !56, type: !6) // CHECK:STDOUT: !58 = !DILocation(line: 30, column: 10, scope: !56) // CHECK:STDOUT: !59 = !{!57} +// CHECK:STDOUT: !60 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.4fdb30b3bf76b447:core.Destroy.Core", scope: null, file: !4, line: 30, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !63) +// CHECK:STDOUT: !61 = !DILocalVariable(arg: 1, scope: !60, type: !6) +// CHECK:STDOUT: !62 = !DILocation(line: 30, column: 10, scope: !60) +// CHECK:STDOUT: !63 = !{!61} +// CHECK:STDOUT: !64 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.3e6115156c640ef2:core.Destroy.Core", scope: null, file: !4, line: 30, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !67) +// CHECK:STDOUT: !65 = !DILocalVariable(arg: 1, scope: !64, type: !6) +// CHECK:STDOUT: !66 = !DILocation(line: 30, column: 10, scope: !64) +// CHECK:STDOUT: !67 = !{!65} +// CHECK:STDOUT: !68 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.3e6115156c640ef2:core.Destroy.Core", scope: null, file: !4, line: 30, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !71) +// CHECK:STDOUT: !69 = !DILocalVariable(arg: 1, scope: !68, type: !6) +// CHECK:STDOUT: !70 = !DILocation(line: 30, column: 10, scope: !68) +// CHECK:STDOUT: !71 = !{!69} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/packages/imported_type_completeness.carbon b/toolchain/lower/testdata/packages/imported_type_completeness.carbon index 77fec0ec6aa5..b69183d65c75 100644 --- a/toolchain/lower/testdata/packages/imported_type_completeness.carbon +++ b/toolchain/lower/testdata/packages/imported_type_completeness.carbon @@ -96,6 +96,14 @@ fn CallF() { // CHECK:STDOUT: ; ModuleID = 'require_completion_in_call.carbon' // CHECK:STDOUT: source_filename = "require_completion_in_call.carbon" // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %self) #0 !dbg !25 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !27 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: attributes #0 = { nounwind } +// CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!19} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: @@ -103,6 +111,13 @@ fn CallF() { // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !18 = !DIFile(filename: "require_completion_in_call.carbon", directory: "") // CHECK:STDOUT: !19 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !18, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !22 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !23 = !{null, !22} +// CHECK:STDOUT: !24 = !DISubroutineType(types: !23) +// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !18, line: 19, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !28) +// CHECK:STDOUT: !26 = !DILocalVariable(arg: 1, scope: !25, type: !22) +// CHECK:STDOUT: !27 = !DILocation(line: 19, column: 4, scope: !25) +// CHECK:STDOUT: !28 = !{!26} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'use_without_completion_in_call.carbon' @@ -111,42 +126,55 @@ fn CallF() { // CHECK:STDOUT: @C.val.eeb = internal constant {} zeroinitializer // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CI.Main() #0 !dbg !29 { +// CHECK:STDOUT: define void @_CI.Main() #0 !dbg !33 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CG.Main.e43630e9a6c38c3f(), !dbg !30 -// CHECK:STDOUT: ret void, !dbg !31 +// CHECK:STDOUT: call void @_CG.Main.e43630e9a6c38c3f(), !dbg !34 +// CHECK:STDOUT: ret void, !dbg !35 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.b7a0a8bb33ac84ff:core.Destroy.Core"(ptr %self) #0 !dbg !32 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %self) #0 !dbg !36 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !34 +// CHECK:STDOUT: ret void, !dbg !38 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CG.Main.e43630e9a6c38c3f() #0 !dbg !36 { -// CHECK:STDOUT: %temp = alloca {}, align 1, !dbg !38 -// CHECK:STDOUT: %temp1 = alloca {}, align 1, !dbg !42 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp), !dbg !38 -// CHECK:STDOUT: %1 = call i123 @_CF.C.Main.e43630e9a6c38c3f(), !dbg !39 -// CHECK:STDOUT: call void @"_COp.b7a0a8bb33ac84ff:core.Destroy.Core"(ptr @C.val.eeb), !dbg !38 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp1), !dbg !42 -// CHECK:STDOUT: %2 = call i456 @_CG.C.Main.e43630e9a6c38c3f(), !dbg !44 -// CHECK:STDOUT: call void @"_COp.b7a0a8bb33ac84ff:core.Destroy.Core"(ptr @C.val.eeb), !dbg !42 -// CHECK:STDOUT: ret void, !dbg !47 +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.b7a0a8bb33ac84ff:core.Destroy.Core"(ptr %self) #0 !dbg !40 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !42 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.b7a0a8bb33ac84ff:core.Destroy.Core"(ptr %self) #0 !dbg !44 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.b7a0a8bb33ac84ff:core.Destroy.Core"(ptr %self), !dbg !46 +// CHECK:STDOUT: ret void, !dbg !46 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @_CG.Main.e43630e9a6c38c3f() #0 !dbg !48 { +// CHECK:STDOUT: %temp = alloca {}, align 1, !dbg !50 +// CHECK:STDOUT: %temp1 = alloca {}, align 1, !dbg !54 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp), !dbg !50 +// CHECK:STDOUT: %1 = call i123 @_CF.C.Main.e43630e9a6c38c3f(), !dbg !51 +// CHECK:STDOUT: call void @"_CSelfDestruct.b7a0a8bb33ac84ff:core.Destroy.Core"(ptr @C.val.eeb), !dbg !50 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp1), !dbg !54 +// CHECK:STDOUT: %2 = call i456 @_CG.C.Main.e43630e9a6c38c3f(), !dbg !56 +// CHECK:STDOUT: call void @"_CSelfDestruct.b7a0a8bb33ac84ff:core.Destroy.Core"(ptr @C.val.eeb), !dbg !54 +// CHECK:STDOUT: ret void, !dbg !59 // 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 i123 @_CF.C.Main.e43630e9a6c38c3f() #0 !dbg !48 { -// CHECK:STDOUT: ret i123 123, !dbg !51 +// CHECK:STDOUT: define linkonce_odr i123 @_CF.C.Main.e43630e9a6c38c3f() #0 !dbg !60 { +// CHECK:STDOUT: ret i123 123, !dbg !63 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i456 @_CG.C.Main.e43630e9a6c38c3f() #0 !dbg !52 { -// CHECK:STDOUT: ret i456 456, !dbg !56 +// CHECK:STDOUT: define linkonce_odr i456 @_CG.C.Main.e43630e9a6c38c3f() #0 !dbg !64 { +// CHECK:STDOUT: ret i456 456, !dbg !68 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -155,7 +183,7 @@ fn CallF() { // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!23} +// CHECK:STDOUT: !llvm.dbg.cu = !{!30} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} @@ -163,46 +191,54 @@ fn CallF() { // CHECK:STDOUT: !18 = !DIFile(filename: "require_completion_in_call.carbon", directory: "") // CHECK:STDOUT: !20 = !DIBasicType(name: "int", size: 123, encoding: DW_ATE_signed) // CHECK:STDOUT: !21 = !DIBasicType(name: "int", size: 456, encoding: DW_ATE_signed) -// CHECK:STDOUT: !22 = !DIFile(filename: "use_without_completion_in_call.carbon", directory: "") -// CHECK:STDOUT: !23 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !22, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !24 = !{null} -// CHECK:STDOUT: !25 = !DISubroutineType(types: !24) -// CHECK:STDOUT: !26 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !27 = !{null, !26} -// CHECK:STDOUT: !28 = !DISubroutineType(types: !27) -// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "I", linkageName: "_CI.Main", scope: null, file: !22, line: 6, type: !25, spFlags: DISPFlagDefinition, unit: !23) -// CHECK:STDOUT: !30 = !DILocation(line: 9, column: 3, scope: !29) -// CHECK:STDOUT: !31 = !DILocation(line: 6, column: 1, scope: !29) -// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "Op", linkageName: "_COp.b7a0a8bb33ac84ff:core.Destroy.Core", scope: null, file: !18, line: 19, type: !28, spFlags: DISPFlagDefinition, unit: !23, retainedNodes: !35) -// CHECK:STDOUT: !33 = !DILocalVariable(arg: 1, scope: !32, type: !26) -// CHECK:STDOUT: !34 = !DILocation(line: 19, column: 4, scope: !32) -// CHECK:STDOUT: !35 = !{!33} -// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.e43630e9a6c38c3f", scope: null, file: !18, line: 16, type: !25, spFlags: DISPFlagDefinition, unit: !23) +// CHECK:STDOUT: !22 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !23 = !{null, !22} +// CHECK:STDOUT: !24 = !DISubroutineType(types: !23) +// CHECK:STDOUT: !29 = !DIFile(filename: "use_without_completion_in_call.carbon", directory: "") +// CHECK:STDOUT: !30 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !29, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !31 = !{null} +// CHECK:STDOUT: !32 = !DISubroutineType(types: !31) +// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "I", linkageName: "_CI.Main", scope: null, file: !29, line: 6, type: !32, spFlags: DISPFlagDefinition, unit: !30) +// CHECK:STDOUT: !34 = !DILocation(line: 9, column: 3, scope: !33) +// CHECK:STDOUT: !35 = !DILocation(line: 6, column: 1, scope: !33) +// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !18, line: 19, type: !24, spFlags: DISPFlagDefinition, unit: !30, retainedNodes: !39) +// CHECK:STDOUT: !37 = !DILocalVariable(arg: 1, scope: !36, type: !22) // CHECK:STDOUT: !38 = !DILocation(line: 19, column: 4, scope: !36) -// CHECK:STDOUT: !39 = !DILocation(line: 19, column: 3, scope: !36) -// CHECK:STDOUT: !40 = !{!20} -// CHECK:STDOUT: !41 = !DISubroutineType(types: !40) -// CHECK:STDOUT: !42 = !DILocation(line: 22, column: 4, scope: !36) -// CHECK:STDOUT: !44 = !DILocation(line: 22, column: 3, scope: !36) -// CHECK:STDOUT: !45 = !{!21} -// CHECK:STDOUT: !46 = !DISubroutineType(types: !45) -// CHECK:STDOUT: !47 = !DILocation(line: 16, column: 1, scope: !36) -// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "F", linkageName: "_CF.C.Main.e43630e9a6c38c3f", scope: null, file: !18, line: 6, type: !41, spFlags: DISPFlagDefinition, unit: !23) -// CHECK:STDOUT: !51 = !DILocation(line: 7, column: 5, scope: !48) -// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "G", linkageName: "_CG.C.Main.e43630e9a6c38c3f", scope: null, file: !18, line: 11, type: !46, spFlags: DISPFlagDefinition, unit: !23) -// CHECK:STDOUT: !56 = !DILocation(line: 12, column: 5, scope: !52) +// CHECK:STDOUT: !39 = !{!37} +// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.b7a0a8bb33ac84ff:core.Destroy.Core", scope: null, file: !18, line: 19, type: !24, spFlags: DISPFlagDefinition, unit: !30, retainedNodes: !43) +// CHECK:STDOUT: !41 = !DILocalVariable(arg: 1, scope: !40, type: !22) +// CHECK:STDOUT: !42 = !DILocation(line: 19, column: 4, scope: !40) +// CHECK:STDOUT: !43 = !{!41} +// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.b7a0a8bb33ac84ff:core.Destroy.Core", scope: null, file: !18, line: 19, type: !24, spFlags: DISPFlagDefinition, unit: !30, retainedNodes: !47) +// CHECK:STDOUT: !45 = !DILocalVariable(arg: 1, scope: !44, type: !22) +// CHECK:STDOUT: !46 = !DILocation(line: 19, column: 4, scope: !44) +// CHECK:STDOUT: !47 = !{!45} +// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main.e43630e9a6c38c3f", scope: null, file: !18, line: 16, type: !32, spFlags: DISPFlagDefinition, unit: !30) +// CHECK:STDOUT: !50 = !DILocation(line: 19, column: 4, scope: !48) +// CHECK:STDOUT: !51 = !DILocation(line: 19, column: 3, scope: !48) +// CHECK:STDOUT: !52 = !{!20} +// CHECK:STDOUT: !53 = !DISubroutineType(types: !52) +// CHECK:STDOUT: !54 = !DILocation(line: 22, column: 4, scope: !48) +// CHECK:STDOUT: !56 = !DILocation(line: 22, column: 3, scope: !48) +// CHECK:STDOUT: !57 = !{!21} +// CHECK:STDOUT: !58 = !DISubroutineType(types: !57) +// CHECK:STDOUT: !59 = !DILocation(line: 16, column: 1, scope: !48) +// CHECK:STDOUT: !60 = distinct !DISubprogram(name: "F", linkageName: "_CF.C.Main.e43630e9a6c38c3f", scope: null, file: !18, line: 6, type: !53, spFlags: DISPFlagDefinition, unit: !30) +// CHECK:STDOUT: !63 = !DILocation(line: 7, column: 5, scope: !60) +// CHECK:STDOUT: !64 = distinct !DISubprogram(name: "G", linkageName: "_CG.C.Main.e43630e9a6c38c3f", scope: null, file: !18, line: 11, type: !58, spFlags: DISPFlagDefinition, unit: !30) +// CHECK:STDOUT: !68 = !DILocation(line: 12, column: 5, scope: !64) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'require_completion_in_vtable.carbon' // CHECK:STDOUT: source_filename = "require_completion_in_vtable.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!58} +// CHECK:STDOUT: !llvm.dbg.cu = !{!70} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !57 = !DIFile(filename: "require_completion_in_vtable.carbon", directory: "") -// CHECK:STDOUT: !58 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !57, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !69 = !DIFile(filename: "require_completion_in_vtable.carbon", directory: "") +// CHECK:STDOUT: !70 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !69, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'use_without_completion_in_vtable.carbon' @@ -214,10 +250,10 @@ fn CallF() { // CHECK:STDOUT: @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @_C__global_init.Main, ptr null }] // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define internal void @_C__global_init.Main() #0 !dbg !63 { +// CHECK:STDOUT: define internal void @_C__global_init.Main() #0 !dbg !75 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 @_Cv.Main, ptr align 8 @C.val.loc9_1, i64 8, i1 false), !dbg !64 -// CHECK:STDOUT: ret void, !dbg !65 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 @_Cv.Main, ptr align 8 @C.val.loc9_1, i64 8, i1 false), !dbg !76 +// CHECK:STDOUT: ret void, !dbg !77 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -226,45 +262,66 @@ fn CallF() { // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!62} +// CHECK:STDOUT: !llvm.dbg.cu = !{!74} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !24 = !{null} -// CHECK:STDOUT: !25 = !DISubroutineType(types: !24) -// CHECK:STDOUT: !61 = !DIFile(filename: "use_without_completion_in_vtable.carbon", directory: "") -// CHECK:STDOUT: !62 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !61, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !63 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !61, type: !25, spFlags: DISPFlagDefinition, unit: !62) -// CHECK:STDOUT: !64 = !DILocation(line: 9, column: 1, scope: !63) -// CHECK:STDOUT: !65 = !DILocation(line: 0, scope: !63) +// CHECK:STDOUT: !31 = !{null} +// CHECK:STDOUT: !32 = !DISubroutineType(types: !31) +// CHECK:STDOUT: !73 = !DIFile(filename: "use_without_completion_in_vtable.carbon", directory: "") +// CHECK:STDOUT: !74 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !73, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !75 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !73, type: !32, spFlags: DISPFlagDefinition, unit: !74) +// CHECK:STDOUT: !76 = !DILocation(line: 9, column: 1, scope: !75) +// CHECK:STDOUT: !77 = !DILocation(line: 0, scope: !75) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'require_completion_in_virtual_call.carbon' // CHECK:STDOUT: source_filename = "require_completion_in_virtual_call.carbon" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.95528a86e1127e2d:core.Destroy.Core"(ptr %self) #0 !dbg !68 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.454fecbcedcd86e1:core.Destroy.Core"(ptr %self) #0 !dbg !80 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !70 +// CHECK:STDOUT: ret void, !dbg !82 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.95528a86e1127e2d:core.Destroy.Core"(ptr %self) #0 !dbg !84 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !86 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.95528a86e1127e2d:core.Destroy.Core"(ptr %self) #0 !dbg !88 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.95528a86e1127e2d:core.Destroy.Core"(ptr %self), !dbg !90 +// CHECK:STDOUT: ret void, !dbg !90 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!67} +// CHECK:STDOUT: !llvm.dbg.cu = !{!79} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !26 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !27 = !{null, !26} -// CHECK:STDOUT: !28 = !DISubroutineType(types: !27) -// CHECK:STDOUT: !66 = !DIFile(filename: "require_completion_in_virtual_call.carbon", directory: "") -// CHECK:STDOUT: !67 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !66, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !68 = distinct !DISubprogram(name: "Op", linkageName: "_COp.95528a86e1127e2d:core.Destroy.Core", scope: null, file: !66, line: 7, type: !28, spFlags: DISPFlagDefinition, unit: !67, retainedNodes: !71) -// CHECK:STDOUT: !69 = !DILocalVariable(arg: 1, scope: !68, type: !26) -// CHECK:STDOUT: !70 = !DILocation(line: 7, column: 3, scope: !68) -// CHECK:STDOUT: !71 = !{!69} +// CHECK:STDOUT: !22 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !23 = !{null, !22} +// CHECK:STDOUT: !24 = !DISubroutineType(types: !23) +// CHECK:STDOUT: !78 = !DIFile(filename: "require_completion_in_virtual_call.carbon", directory: "") +// CHECK:STDOUT: !79 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !78, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !80 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.454fecbcedcd86e1:core.Destroy.Core", scope: null, file: !78, line: 7, type: !24, spFlags: DISPFlagDefinition, unit: !79, retainedNodes: !83) +// CHECK:STDOUT: !81 = !DILocalVariable(arg: 1, scope: !80, type: !22) +// CHECK:STDOUT: !82 = !DILocation(line: 7, column: 3, scope: !80) +// CHECK:STDOUT: !83 = !{!81} +// CHECK:STDOUT: !84 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.95528a86e1127e2d:core.Destroy.Core", scope: null, file: !78, line: 7, type: !24, spFlags: DISPFlagDefinition, unit: !79, retainedNodes: !87) +// CHECK:STDOUT: !85 = !DILocalVariable(arg: 1, scope: !84, type: !22) +// CHECK:STDOUT: !86 = !DILocation(line: 7, column: 3, scope: !84) +// CHECK:STDOUT: !87 = !{!85} +// CHECK:STDOUT: !88 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.95528a86e1127e2d:core.Destroy.Core", scope: null, file: !78, line: 7, type: !24, spFlags: DISPFlagDefinition, unit: !79, retainedNodes: !91) +// CHECK:STDOUT: !89 = !DILocalVariable(arg: 1, scope: !88, type: !22) +// CHECK:STDOUT: !90 = !DILocation(line: 7, column: 3, scope: !88) +// CHECK:STDOUT: !91 = !{!89} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'use_without_completion_in_virtual_call.carbon' @@ -276,66 +333,99 @@ fn CallF() { // CHECK:STDOUT: @C.val.9ff.anon = internal constant { ptr } { ptr @"_CC.Main.$vtable.9522ff908e97e267" } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CCallF.Main() #0 !dbg !74 { +// CHECK:STDOUT: define void @_CCallF.Main() #0 !dbg !94 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc9_9.2.temp = alloca {}, align 1, !dbg !75 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_9.2.temp), !dbg !75 -// CHECK:STDOUT: call void @_CF.Main.9522ff908e97e267(ptr @C.val.d1d.loc9_11.3), !dbg !76 -// CHECK:STDOUT: call void @"_COp.08d9e38b928ba575:core.Destroy.Core"(ptr @C.val.d1d), !dbg !75 -// CHECK:STDOUT: ret void, !dbg !77 +// CHECK:STDOUT: %.loc9_9.2.temp = alloca {}, align 1, !dbg !95 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_9.2.temp), !dbg !95 +// CHECK:STDOUT: call void @_CF.Main.9522ff908e97e267(ptr @C.val.d1d.loc9_11.3), !dbg !96 +// CHECK:STDOUT: call void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr @C.val.d1d), !dbg !95 +// CHECK:STDOUT: ret void, !dbg !97 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !78 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %self) #0 !dbg !98 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !80 +// CHECK:STDOUT: ret void, !dbg !100 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.95528a86e1127e2d:core.Destroy.Core"(ptr %self) #0 !dbg !82 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !102 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !84 +// CHECK:STDOUT: ret void, !dbg !104 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.119330419006a03e:core.Destroy.Core"(ptr %self) #0 !dbg !86 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !106 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !88 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core"(ptr %self), !dbg !108 +// CHECK:STDOUT: ret void, !dbg !108 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.454fecbcedcd86e1:core.Destroy.Core"(ptr %self) #0 !dbg !110 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !112 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.95528a86e1127e2d:core.Destroy.Core"(ptr %self) #0 !dbg !114 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !116 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.95528a86e1127e2d:core.Destroy.Core"(ptr %self) #0 !dbg !118 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.95528a86e1127e2d:core.Destroy.Core"(ptr %self), !dbg !120 +// CHECK:STDOUT: ret void, !dbg !120 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.119330419006a03e:core.Destroy.Core"(ptr %self) #0 !dbg !122 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !124 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.119330419006a03e:core.Destroy.Core"(ptr %self) #0 !dbg !126 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.119330419006a03e:core.Destroy.Core"(ptr %self), !dbg !128 +// CHECK:STDOUT: ret void, !dbg !128 // 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 @_CF.Main.9522ff908e97e267(ptr %t) #0 !dbg !90 { -// CHECK:STDOUT: %1 = alloca { ptr }, align 8, !dbg !93 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !93 -// CHECK:STDOUT: %vptr = getelementptr inbounds nuw { ptr }, ptr %1, i32 0, i32 0, !dbg !94 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %1, ptr align 8 @C.val.9ff.anon, i64 8, i1 false), !dbg !93 -// CHECK:STDOUT: %vtable = load ptr, ptr %1, align 8, !dbg !96 -// CHECK:STDOUT: %2 = call ptr @llvm.load.relative.i32(ptr %vtable, i32 0), !dbg !96 -// CHECK:STDOUT: %3 = call i11 %2(ptr %1), !dbg !96 -// CHECK:STDOUT: %vtable1 = load ptr, ptr %1, align 8, !dbg !99 -// CHECK:STDOUT: %4 = call ptr @llvm.load.relative.i32(ptr %vtable1, i32 4), !dbg !99 -// CHECK:STDOUT: %5 = call i12 %4(ptr %1, ptr %t), !dbg !99 -// CHECK:STDOUT: call void @"_COp.119330419006a03e:core.Destroy.Core"(ptr %1), !dbg !93 -// CHECK:STDOUT: ret void, !dbg !103 +// CHECK:STDOUT: define linkonce_odr void @_CF.Main.9522ff908e97e267(ptr %t) #0 !dbg !130 { +// CHECK:STDOUT: %1 = alloca { ptr }, align 8, !dbg !133 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !133 +// CHECK:STDOUT: %vptr = getelementptr inbounds nuw { ptr }, ptr %1, i32 0, i32 0, !dbg !134 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %1, ptr align 8 @C.val.9ff.anon, i64 8, i1 false), !dbg !133 +// CHECK:STDOUT: %vtable = load ptr, ptr %1, align 8, !dbg !136 +// CHECK:STDOUT: %2 = call ptr @llvm.load.relative.i32(ptr %vtable, i32 0), !dbg !136 +// CHECK:STDOUT: %3 = call i11 %2(ptr %1), !dbg !136 +// CHECK:STDOUT: %vtable1 = load ptr, ptr %1, align 8, !dbg !139 +// CHECK:STDOUT: %4 = call ptr @llvm.load.relative.i32(ptr %vtable1, i32 4), !dbg !139 +// CHECK:STDOUT: %5 = call i12 %4(ptr %1, ptr %t), !dbg !139 +// CHECK:STDOUT: call void @"_CSelfDestruct.119330419006a03e:core.Destroy.Core"(ptr %1), !dbg !133 +// CHECK:STDOUT: ret void, !dbg !143 // 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 i11 @_CF.C.Main.9522ff908e97e267(ptr %self) #0 !dbg !105 { -// CHECK:STDOUT: ret i11 11, !dbg !110 +// CHECK:STDOUT: define linkonce_odr i11 @_CF.C.Main.9522ff908e97e267(ptr %self) #0 !dbg !145 { +// CHECK:STDOUT: ret i11 11, !dbg !150 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: read) // CHECK:STDOUT: declare ptr @llvm.load.relative.i32(ptr, i32) #2 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i12 @_CG.C.Main.9522ff908e97e267(ptr %self, ptr %t) #0 !dbg !112 { -// CHECK:STDOUT: ret i12 12, !dbg !119 +// CHECK:STDOUT: define linkonce_odr i12 @_CG.C.Main.9522ff908e97e267(ptr %self, ptr %t) #0 !dbg !152 { +// CHECK:STDOUT: ret i12 12, !dbg !159 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -345,57 +435,77 @@ fn CallF() { // CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: read) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!73} +// CHECK:STDOUT: !llvm.dbg.cu = !{!93} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !24 = !{null} -// CHECK:STDOUT: !25 = !DISubroutineType(types: !24) -// CHECK:STDOUT: !26 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !27 = !{null, !26} -// CHECK:STDOUT: !28 = !DISubroutineType(types: !27) -// CHECK:STDOUT: !57 = !DIFile(filename: "require_completion_in_vtable.carbon", directory: "") -// CHECK:STDOUT: !59 = !DIBasicType(name: "int", size: 11, encoding: DW_ATE_signed) -// CHECK:STDOUT: !60 = !DIBasicType(name: "int", size: 12, encoding: DW_ATE_signed) -// CHECK:STDOUT: !66 = !DIFile(filename: "require_completion_in_virtual_call.carbon", directory: "") -// CHECK:STDOUT: !72 = !DIFile(filename: "use_without_completion_in_virtual_call.carbon", directory: "") -// CHECK:STDOUT: !73 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !72, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !74 = distinct !DISubprogram(name: "CallF", linkageName: "_CCallF.Main", scope: null, file: !72, line: 8, type: !25, spFlags: DISPFlagDefinition, unit: !73) -// CHECK:STDOUT: !75 = !DILocation(line: 9, column: 8, scope: !74) -// CHECK:STDOUT: !76 = !DILocation(line: 9, column: 3, scope: !74) -// CHECK:STDOUT: !77 = !DILocation(line: 8, column: 1, scope: !74) -// CHECK:STDOUT: !78 = distinct !DISubprogram(name: "Op", linkageName: "_COp.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !72, line: 9, type: !28, spFlags: DISPFlagDefinition, unit: !73, retainedNodes: !81) -// CHECK:STDOUT: !79 = !DILocalVariable(arg: 1, scope: !78, type: !26) -// CHECK:STDOUT: !80 = !DILocation(line: 9, column: 8, scope: !78) -// CHECK:STDOUT: !81 = !{!79} -// CHECK:STDOUT: !82 = distinct !DISubprogram(name: "Op", linkageName: "_COp.95528a86e1127e2d:core.Destroy.Core", scope: null, file: !66, line: 7, type: !28, spFlags: DISPFlagDefinition, unit: !73, retainedNodes: !85) -// CHECK:STDOUT: !83 = !DILocalVariable(arg: 1, scope: !82, type: !26) -// CHECK:STDOUT: !84 = !DILocation(line: 7, column: 3, scope: !82) -// CHECK:STDOUT: !85 = !{!83} -// CHECK:STDOUT: !86 = distinct !DISubprogram(name: "Op", linkageName: "_COp.119330419006a03e:core.Destroy.Core", scope: null, file: !66, line: 7, type: !28, spFlags: DISPFlagDefinition, unit: !73, retainedNodes: !89) -// CHECK:STDOUT: !87 = !DILocalVariable(arg: 1, scope: !86, type: !26) -// CHECK:STDOUT: !88 = !DILocation(line: 7, column: 3, scope: !86) -// CHECK:STDOUT: !89 = !{!87} -// CHECK:STDOUT: !90 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.9522ff908e97e267", scope: null, file: !66, line: 6, type: !28, spFlags: DISPFlagDefinition, unit: !73, retainedNodes: !104) -// CHECK:STDOUT: !91 = !DILocalVariable(arg: 1, scope: !90, type: !26) -// CHECK:STDOUT: !93 = !DILocation(line: 7, column: 3, scope: !90) -// CHECK:STDOUT: !94 = !DILocation(line: 7, column: 17, scope: !90) -// CHECK:STDOUT: !96 = !DILocation(line: 8, column: 3, scope: !90) -// CHECK:STDOUT: !97 = !{!59, !26} -// CHECK:STDOUT: !98 = !DISubroutineType(types: !97) -// CHECK:STDOUT: !99 = !DILocation(line: 9, column: 3, scope: !90) -// CHECK:STDOUT: !101 = !{!60, !26, !26} -// CHECK:STDOUT: !102 = !DISubroutineType(types: !101) -// CHECK:STDOUT: !103 = !DILocation(line: 6, column: 1, scope: !90) -// CHECK:STDOUT: !104 = !{!91} -// CHECK:STDOUT: !105 = distinct !DISubprogram(name: "F", linkageName: "_CF.C.Main.9522ff908e97e267", scope: null, file: !57, line: 6, type: !98, spFlags: DISPFlagDefinition, unit: !73, retainedNodes: !111) -// CHECK:STDOUT: !106 = !DILocalVariable(arg: 1, scope: !105, type: !26) -// CHECK:STDOUT: !110 = !DILocation(line: 6, column: 47, scope: !105) -// CHECK:STDOUT: !111 = !{!106} -// CHECK:STDOUT: !112 = distinct !DISubprogram(name: "G", linkageName: "_CG.C.Main.9522ff908e97e267", scope: null, file: !57, line: 7, type: !102, spFlags: DISPFlagDefinition, unit: !73, retainedNodes: !120) -// CHECK:STDOUT: !113 = !DILocalVariable(arg: 1, scope: !112, type: !26) -// CHECK:STDOUT: !114 = !DILocalVariable(arg: 2, scope: !112, type: !26) -// CHECK:STDOUT: !119 = !DILocation(line: 7, column: 60, scope: !112) -// CHECK:STDOUT: !120 = !{!113, !114} +// CHECK:STDOUT: !22 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !23 = !{null, !22} +// CHECK:STDOUT: !24 = !DISubroutineType(types: !23) +// CHECK:STDOUT: !31 = !{null} +// CHECK:STDOUT: !32 = !DISubroutineType(types: !31) +// CHECK:STDOUT: !69 = !DIFile(filename: "require_completion_in_vtable.carbon", directory: "") +// CHECK:STDOUT: !71 = !DIBasicType(name: "int", size: 11, encoding: DW_ATE_signed) +// CHECK:STDOUT: !72 = !DIBasicType(name: "int", size: 12, encoding: DW_ATE_signed) +// CHECK:STDOUT: !78 = !DIFile(filename: "require_completion_in_virtual_call.carbon", directory: "") +// CHECK:STDOUT: !92 = !DIFile(filename: "use_without_completion_in_virtual_call.carbon", directory: "") +// CHECK:STDOUT: !93 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !92, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !94 = distinct !DISubprogram(name: "CallF", linkageName: "_CCallF.Main", scope: null, file: !92, line: 8, type: !32, spFlags: DISPFlagDefinition, unit: !93) +// CHECK:STDOUT: !95 = !DILocation(line: 9, column: 8, scope: !94) +// CHECK:STDOUT: !96 = !DILocation(line: 9, column: 3, scope: !94) +// CHECK:STDOUT: !97 = !DILocation(line: 8, column: 1, scope: !94) +// CHECK:STDOUT: !98 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !92, line: 9, type: !24, spFlags: DISPFlagDefinition, unit: !93, retainedNodes: !101) +// CHECK:STDOUT: !99 = !DILocalVariable(arg: 1, scope: !98, type: !22) +// CHECK:STDOUT: !100 = !DILocation(line: 9, column: 8, scope: !98) +// CHECK:STDOUT: !101 = !{!99} +// CHECK:STDOUT: !102 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !92, line: 9, type: !24, spFlags: DISPFlagDefinition, unit: !93, retainedNodes: !105) +// CHECK:STDOUT: !103 = !DILocalVariable(arg: 1, scope: !102, type: !22) +// CHECK:STDOUT: !104 = !DILocation(line: 9, column: 8, scope: !102) +// CHECK:STDOUT: !105 = !{!103} +// CHECK:STDOUT: !106 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !92, line: 9, type: !24, spFlags: DISPFlagDefinition, unit: !93, retainedNodes: !109) +// CHECK:STDOUT: !107 = !DILocalVariable(arg: 1, scope: !106, type: !22) +// CHECK:STDOUT: !108 = !DILocation(line: 9, column: 8, scope: !106) +// CHECK:STDOUT: !109 = !{!107} +// CHECK:STDOUT: !110 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.454fecbcedcd86e1:core.Destroy.Core", scope: null, file: !78, line: 7, type: !24, spFlags: DISPFlagDefinition, unit: !93, retainedNodes: !113) +// CHECK:STDOUT: !111 = !DILocalVariable(arg: 1, scope: !110, type: !22) +// CHECK:STDOUT: !112 = !DILocation(line: 7, column: 3, scope: !110) +// CHECK:STDOUT: !113 = !{!111} +// CHECK:STDOUT: !114 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.95528a86e1127e2d:core.Destroy.Core", scope: null, file: !78, line: 7, type: !24, spFlags: DISPFlagDefinition, unit: !93, retainedNodes: !117) +// CHECK:STDOUT: !115 = !DILocalVariable(arg: 1, scope: !114, type: !22) +// CHECK:STDOUT: !116 = !DILocation(line: 7, column: 3, scope: !114) +// CHECK:STDOUT: !117 = !{!115} +// CHECK:STDOUT: !118 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.95528a86e1127e2d:core.Destroy.Core", scope: null, file: !78, line: 7, type: !24, spFlags: DISPFlagDefinition, unit: !93, retainedNodes: !121) +// CHECK:STDOUT: !119 = !DILocalVariable(arg: 1, scope: !118, type: !22) +// CHECK:STDOUT: !120 = !DILocation(line: 7, column: 3, scope: !118) +// CHECK:STDOUT: !121 = !{!119} +// CHECK:STDOUT: !122 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.119330419006a03e:core.Destroy.Core", scope: null, file: !78, line: 7, type: !24, spFlags: DISPFlagDefinition, unit: !93, retainedNodes: !125) +// CHECK:STDOUT: !123 = !DILocalVariable(arg: 1, scope: !122, type: !22) +// CHECK:STDOUT: !124 = !DILocation(line: 7, column: 3, scope: !122) +// CHECK:STDOUT: !125 = !{!123} +// CHECK:STDOUT: !126 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.119330419006a03e:core.Destroy.Core", scope: null, file: !78, line: 7, type: !24, spFlags: DISPFlagDefinition, unit: !93, retainedNodes: !129) +// CHECK:STDOUT: !127 = !DILocalVariable(arg: 1, scope: !126, type: !22) +// CHECK:STDOUT: !128 = !DILocation(line: 7, column: 3, scope: !126) +// CHECK:STDOUT: !129 = !{!127} +// CHECK:STDOUT: !130 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.9522ff908e97e267", scope: null, file: !78, line: 6, type: !24, spFlags: DISPFlagDefinition, unit: !93, retainedNodes: !144) +// CHECK:STDOUT: !131 = !DILocalVariable(arg: 1, scope: !130, type: !22) +// CHECK:STDOUT: !133 = !DILocation(line: 7, column: 3, scope: !130) +// CHECK:STDOUT: !134 = !DILocation(line: 7, column: 17, scope: !130) +// CHECK:STDOUT: !136 = !DILocation(line: 8, column: 3, scope: !130) +// CHECK:STDOUT: !137 = !{!71, !22} +// CHECK:STDOUT: !138 = !DISubroutineType(types: !137) +// CHECK:STDOUT: !139 = !DILocation(line: 9, column: 3, scope: !130) +// CHECK:STDOUT: !141 = !{!72, !22, !22} +// CHECK:STDOUT: !142 = !DISubroutineType(types: !141) +// CHECK:STDOUT: !143 = !DILocation(line: 6, column: 1, scope: !130) +// CHECK:STDOUT: !144 = !{!131} +// CHECK:STDOUT: !145 = distinct !DISubprogram(name: "F", linkageName: "_CF.C.Main.9522ff908e97e267", scope: null, file: !69, line: 6, type: !138, spFlags: DISPFlagDefinition, unit: !93, retainedNodes: !151) +// CHECK:STDOUT: !146 = !DILocalVariable(arg: 1, scope: !145, type: !22) +// CHECK:STDOUT: !150 = !DILocation(line: 6, column: 47, scope: !145) +// CHECK:STDOUT: !151 = !{!146} +// CHECK:STDOUT: !152 = distinct !DISubprogram(name: "G", linkageName: "_CG.C.Main.9522ff908e97e267", scope: null, file: !69, line: 7, type: !142, spFlags: DISPFlagDefinition, unit: !93, retainedNodes: !160) +// CHECK:STDOUT: !153 = !DILocalVariable(arg: 1, scope: !152, type: !22) +// CHECK:STDOUT: !154 = !DILocalVariable(arg: 2, scope: !152, type: !22) +// CHECK:STDOUT: !159 = !DILocation(line: 7, column: 60, scope: !152) +// CHECK:STDOUT: !160 = !{!153, !154} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/packages/separate_compilation_witness.carbon b/toolchain/lower/testdata/packages/separate_compilation_witness.carbon index c9df68c7f280..74b65259356c 100644 --- a/toolchain/lower/testdata/packages/separate_compilation_witness.carbon +++ b/toolchain/lower/testdata/packages/separate_compilation_witness.carbon @@ -183,7 +183,7 @@ fn CallGeneric() { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc5_18.1.temp), !dbg !50 // CHECK:STDOUT: call void @"_COp.Vector.OwningPackage:MulWith.84588f41d61dafba.Core"(ptr %.loc5_18.1.temp, ptr %v2, i32 2), !dbg !50 // CHECK:STDOUT: call void @"_COp.Vector.OwningPackage:AddWith.f941828044620367.Core"(ptr %return, ptr %v1, ptr %.loc5_18.1.temp), !dbg !49 -// CHECK:STDOUT: call void @"_COp.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %.loc5_18.1.temp), !dbg !50 +// CHECK:STDOUT: call void @"_CSelfDestruct.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %.loc5_18.1.temp), !dbg !50 // CHECK:STDOUT: ret void, !dbg !51 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -192,23 +192,50 @@ fn CallGeneric() { // CHECK:STDOUT: declare void @"_COp.Vector.OwningPackage:AddWith.f941828044620367.Core"(ptr sret({ i32 }), ptr, ptr) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !53 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !53 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !55 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.a15077f50f3020c3:core.Destroy.Core"(ptr %self) #0 !dbg !57 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !57 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !59 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %self) #0 !dbg !61 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !61 { // CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !63 // CHECK:STDOUT: ret void, !dbg !63 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.a15077f50f3020c3:core.Destroy.Core"(ptr %self) #0 !dbg !65 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !67 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.a15077f50f3020c3:core.Destroy.Core"(ptr %self) #0 !dbg !69 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.a15077f50f3020c3:core.Destroy.Core"(ptr %self), !dbg !71 +// CHECK:STDOUT: ret void, !dbg !71 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %self) #0 !dbg !73 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !75 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %self) #0 !dbg !77 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %self), !dbg !79 +// CHECK:STDOUT: ret void, !dbg !79 +// 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: @@ -237,32 +264,48 @@ fn CallGeneric() { // CHECK:STDOUT: !50 = !DILocation(line: 5, column: 15, scope: !42) // CHECK:STDOUT: !51 = !DILocation(line: 5, column: 3, scope: !42) // CHECK:STDOUT: !52 = !{!43, !44} -// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !36, line: 5, type: !39, spFlags: DISPFlagDefinition, unit: !37, retainedNodes: !56) +// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !36, line: 5, type: !39, spFlags: DISPFlagDefinition, unit: !37, retainedNodes: !56) // CHECK:STDOUT: !54 = !DILocalVariable(arg: 1, scope: !53, type: !6) // CHECK:STDOUT: !55 = !DILocation(line: 5, column: 15, scope: !53) // CHECK:STDOUT: !56 = !{!54} -// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "Op", linkageName: "_COp.a15077f50f3020c3:core.Destroy.Core", scope: null, file: !36, line: 5, type: !41, spFlags: DISPFlagDefinition, unit: !37, retainedNodes: !60) -// CHECK:STDOUT: !58 = !DILocalVariable(arg: 1, scope: !57, type: !7) +// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !36, line: 5, type: !39, spFlags: DISPFlagDefinition, unit: !37, retainedNodes: !60) +// CHECK:STDOUT: !58 = !DILocalVariable(arg: 1, scope: !57, type: !6) // CHECK:STDOUT: !59 = !DILocation(line: 5, column: 15, scope: !57) // CHECK:STDOUT: !60 = !{!58} -// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "Op", linkageName: "_COp.d9636b4f2fbd64a7:core.Destroy.Core", scope: null, file: !36, line: 5, type: !41, spFlags: DISPFlagDefinition, unit: !37, retainedNodes: !64) -// CHECK:STDOUT: !62 = !DILocalVariable(arg: 1, scope: !61, type: !7) +// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !36, line: 5, type: !39, spFlags: DISPFlagDefinition, unit: !37, retainedNodes: !64) +// CHECK:STDOUT: !62 = !DILocalVariable(arg: 1, scope: !61, type: !6) // CHECK:STDOUT: !63 = !DILocation(line: 5, column: 15, scope: !61) // CHECK:STDOUT: !64 = !{!62} +// CHECK:STDOUT: !65 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.a15077f50f3020c3:core.Destroy.Core", scope: null, file: !36, line: 5, type: !41, spFlags: DISPFlagDefinition, unit: !37, retainedNodes: !68) +// CHECK:STDOUT: !66 = !DILocalVariable(arg: 1, scope: !65, type: !7) +// CHECK:STDOUT: !67 = !DILocation(line: 5, column: 15, scope: !65) +// CHECK:STDOUT: !68 = !{!66} +// CHECK:STDOUT: !69 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.a15077f50f3020c3:core.Destroy.Core", scope: null, file: !36, line: 5, type: !41, spFlags: DISPFlagDefinition, unit: !37, retainedNodes: !72) +// CHECK:STDOUT: !70 = !DILocalVariable(arg: 1, scope: !69, type: !7) +// CHECK:STDOUT: !71 = !DILocation(line: 5, column: 15, scope: !69) +// CHECK:STDOUT: !72 = !{!70} +// CHECK:STDOUT: !73 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.d9636b4f2fbd64a7:core.Destroy.Core", scope: null, file: !36, line: 5, type: !41, spFlags: DISPFlagDefinition, unit: !37, retainedNodes: !76) +// CHECK:STDOUT: !74 = !DILocalVariable(arg: 1, scope: !73, type: !7) +// CHECK:STDOUT: !75 = !DILocation(line: 5, column: 15, scope: !73) +// CHECK:STDOUT: !76 = !{!74} +// CHECK:STDOUT: !77 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.d9636b4f2fbd64a7:core.Destroy.Core", scope: null, file: !36, line: 5, type: !41, spFlags: DISPFlagDefinition, unit: !37, retainedNodes: !80) +// CHECK:STDOUT: !78 = !DILocalVariable(arg: 1, scope: !77, type: !7) +// CHECK:STDOUT: !79 = !DILocation(line: 5, column: 15, scope: !77) +// CHECK:STDOUT: !80 = !{!78} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'direct_same_package.carbon' // CHECK:STDOUT: source_filename = "direct_same_package.carbon" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CDirect.OwningPackage(ptr sret({ i32 }) %return, ptr %v1, ptr %v2) #0 !dbg !67 { +// CHECK:STDOUT: define void @_CDirect.OwningPackage(ptr sret({ i32 }) %return, ptr %v1, ptr %v2) #0 !dbg !83 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc7_18.1.temp = alloca { i32 }, align 4, !dbg !75 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_18.1.temp), !dbg !75 -// CHECK:STDOUT: call void @"_COp.Vector.OwningPackage:MulWith.84588f41d61dafba.Core"(ptr %.loc7_18.1.temp, ptr %v2, i32 2), !dbg !75 -// CHECK:STDOUT: call void @"_COp.Vector.OwningPackage:AddWith.f941828044620367.Core"(ptr %return, ptr %v1, ptr %.loc7_18.1.temp), !dbg !74 -// CHECK:STDOUT: call void @"_COp.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %.loc7_18.1.temp), !dbg !75 -// CHECK:STDOUT: ret void, !dbg !76 +// CHECK:STDOUT: %.loc7_18.1.temp = alloca { i32 }, align 4, !dbg !91 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_18.1.temp), !dbg !91 +// CHECK:STDOUT: call void @"_COp.Vector.OwningPackage:MulWith.84588f41d61dafba.Core"(ptr %.loc7_18.1.temp, ptr %v2, i32 2), !dbg !91 +// CHECK:STDOUT: call void @"_COp.Vector.OwningPackage:AddWith.f941828044620367.Core"(ptr %return, ptr %v1, ptr %.loc7_18.1.temp), !dbg !90 +// CHECK:STDOUT: call void @"_CSelfDestruct.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %.loc7_18.1.temp), !dbg !91 +// CHECK:STDOUT: ret void, !dbg !92 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @"_COp.Vector.OwningPackage:MulWith.84588f41d61dafba.Core"(ptr sret({ i32 }), ptr, i32) @@ -270,21 +313,48 @@ fn CallGeneric() { // CHECK:STDOUT: declare void @"_COp.Vector.OwningPackage:AddWith.f941828044620367.Core"(ptr sret({ i32 }), ptr, ptr) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !78 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !94 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !80 +// CHECK:STDOUT: ret void, !dbg !96 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.a15077f50f3020c3:core.Destroy.Core"(ptr %self) #0 !dbg !82 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !98 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !84 +// CHECK:STDOUT: ret void, !dbg !100 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %self) #0 !dbg !86 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !102 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !88 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !104 +// CHECK:STDOUT: ret void, !dbg !104 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.a15077f50f3020c3:core.Destroy.Core"(ptr %self) #0 !dbg !106 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !108 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.a15077f50f3020c3:core.Destroy.Core"(ptr %self) #0 !dbg !110 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.a15077f50f3020c3:core.Destroy.Core"(ptr %self), !dbg !112 +// CHECK:STDOUT: ret void, !dbg !112 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %self) #0 !dbg !114 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !116 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %self) #0 !dbg !118 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %self), !dbg !120 +// CHECK:STDOUT: ret void, !dbg !120 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -293,7 +363,7 @@ fn CallGeneric() { // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!66} +// CHECK:STDOUT: !llvm.dbg.cu = !{!82} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} @@ -306,27 +376,43 @@ fn CallGeneric() { // CHECK:STDOUT: !39 = !DISubroutineType(types: !38) // CHECK:STDOUT: !40 = !{null, !7} // CHECK:STDOUT: !41 = !DISubroutineType(types: !40) -// CHECK:STDOUT: !65 = !DIFile(filename: "direct_same_package.carbon", directory: "") -// CHECK:STDOUT: !66 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !65, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "Direct", linkageName: "_CDirect.OwningPackage", scope: null, file: !65, line: 5, type: !9, spFlags: DISPFlagDefinition, unit: !66, retainedNodes: !77) -// CHECK:STDOUT: !68 = !DILocalVariable(arg: 1, scope: !67, type: !7) -// CHECK:STDOUT: !69 = !DILocalVariable(arg: 2, scope: !67, type: !7) -// CHECK:STDOUT: !74 = !DILocation(line: 7, column: 10, scope: !67) -// CHECK:STDOUT: !75 = !DILocation(line: 7, column: 15, scope: !67) -// CHECK:STDOUT: !76 = !DILocation(line: 7, column: 3, scope: !67) -// CHECK:STDOUT: !77 = !{!68, !69} -// CHECK:STDOUT: !78 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !65, line: 7, type: !39, spFlags: DISPFlagDefinition, unit: !66, retainedNodes: !81) -// CHECK:STDOUT: !79 = !DILocalVariable(arg: 1, scope: !78, type: !6) -// CHECK:STDOUT: !80 = !DILocation(line: 7, column: 15, scope: !78) -// CHECK:STDOUT: !81 = !{!79} -// CHECK:STDOUT: !82 = distinct !DISubprogram(name: "Op", linkageName: "_COp.a15077f50f3020c3:core.Destroy.Core", scope: null, file: !65, line: 7, type: !41, spFlags: DISPFlagDefinition, unit: !66, retainedNodes: !85) -// CHECK:STDOUT: !83 = !DILocalVariable(arg: 1, scope: !82, type: !7) -// CHECK:STDOUT: !84 = !DILocation(line: 7, column: 15, scope: !82) -// CHECK:STDOUT: !85 = !{!83} -// CHECK:STDOUT: !86 = distinct !DISubprogram(name: "Op", linkageName: "_COp.d9636b4f2fbd64a7:core.Destroy.Core", scope: null, file: !65, line: 7, type: !41, spFlags: DISPFlagDefinition, unit: !66, retainedNodes: !89) -// CHECK:STDOUT: !87 = !DILocalVariable(arg: 1, scope: !86, type: !7) -// CHECK:STDOUT: !88 = !DILocation(line: 7, column: 15, scope: !86) -// CHECK:STDOUT: !89 = !{!87} +// CHECK:STDOUT: !81 = !DIFile(filename: "direct_same_package.carbon", directory: "") +// CHECK:STDOUT: !82 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !81, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !83 = distinct !DISubprogram(name: "Direct", linkageName: "_CDirect.OwningPackage", scope: null, file: !81, line: 5, type: !9, spFlags: DISPFlagDefinition, unit: !82, retainedNodes: !93) +// CHECK:STDOUT: !84 = !DILocalVariable(arg: 1, scope: !83, type: !7) +// CHECK:STDOUT: !85 = !DILocalVariable(arg: 2, scope: !83, type: !7) +// CHECK:STDOUT: !90 = !DILocation(line: 7, column: 10, scope: !83) +// CHECK:STDOUT: !91 = !DILocation(line: 7, column: 15, scope: !83) +// CHECK:STDOUT: !92 = !DILocation(line: 7, column: 3, scope: !83) +// CHECK:STDOUT: !93 = !{!84, !85} +// CHECK:STDOUT: !94 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !81, line: 7, type: !39, spFlags: DISPFlagDefinition, unit: !82, retainedNodes: !97) +// CHECK:STDOUT: !95 = !DILocalVariable(arg: 1, scope: !94, type: !6) +// CHECK:STDOUT: !96 = !DILocation(line: 7, column: 15, scope: !94) +// CHECK:STDOUT: !97 = !{!95} +// CHECK:STDOUT: !98 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !81, line: 7, type: !39, spFlags: DISPFlagDefinition, unit: !82, retainedNodes: !101) +// CHECK:STDOUT: !99 = !DILocalVariable(arg: 1, scope: !98, type: !6) +// CHECK:STDOUT: !100 = !DILocation(line: 7, column: 15, scope: !98) +// CHECK:STDOUT: !101 = !{!99} +// CHECK:STDOUT: !102 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !81, line: 7, type: !39, spFlags: DISPFlagDefinition, unit: !82, retainedNodes: !105) +// CHECK:STDOUT: !103 = !DILocalVariable(arg: 1, scope: !102, type: !6) +// CHECK:STDOUT: !104 = !DILocation(line: 7, column: 15, scope: !102) +// CHECK:STDOUT: !105 = !{!103} +// CHECK:STDOUT: !106 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.a15077f50f3020c3:core.Destroy.Core", scope: null, file: !81, line: 7, type: !41, spFlags: DISPFlagDefinition, unit: !82, retainedNodes: !109) +// CHECK:STDOUT: !107 = !DILocalVariable(arg: 1, scope: !106, type: !7) +// CHECK:STDOUT: !108 = !DILocation(line: 7, column: 15, scope: !106) +// CHECK:STDOUT: !109 = !{!107} +// CHECK:STDOUT: !110 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.a15077f50f3020c3:core.Destroy.Core", scope: null, file: !81, line: 7, type: !41, spFlags: DISPFlagDefinition, unit: !82, retainedNodes: !113) +// CHECK:STDOUT: !111 = !DILocalVariable(arg: 1, scope: !110, type: !7) +// CHECK:STDOUT: !112 = !DILocation(line: 7, column: 15, scope: !110) +// CHECK:STDOUT: !113 = !{!111} +// CHECK:STDOUT: !114 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.d9636b4f2fbd64a7:core.Destroy.Core", scope: null, file: !81, line: 7, type: !41, spFlags: DISPFlagDefinition, unit: !82, retainedNodes: !117) +// CHECK:STDOUT: !115 = !DILocalVariable(arg: 1, scope: !114, type: !7) +// CHECK:STDOUT: !116 = !DILocation(line: 7, column: 15, scope: !114) +// CHECK:STDOUT: !117 = !{!115} +// CHECK:STDOUT: !118 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.d9636b4f2fbd64a7:core.Destroy.Core", scope: null, file: !81, line: 7, type: !41, spFlags: DISPFlagDefinition, unit: !82, retainedNodes: !121) +// CHECK:STDOUT: !119 = !DILocalVariable(arg: 1, scope: !118, type: !7) +// CHECK:STDOUT: !120 = !DILocation(line: 7, column: 15, scope: !118) +// CHECK:STDOUT: !121 = !{!119} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'generic_same_package.carbon' @@ -337,28 +423,55 @@ fn CallGeneric() { // CHECK:STDOUT: declare void @"_COp.Vector.OwningPackage:AddWith.f941828044620367.Core"(ptr sret({ i32 }), ptr, ptr) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !94 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !126 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !96 +// CHECK:STDOUT: ret void, !dbg !128 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.a15077f50f3020c3:core.Destroy.Core"(ptr %self) #0 !dbg !98 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !130 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !100 +// CHECK:STDOUT: ret void, !dbg !132 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %self) #0 !dbg !102 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !134 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !104 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !136 +// CHECK:STDOUT: ret void, !dbg !136 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.a15077f50f3020c3:core.Destroy.Core"(ptr %self) #0 !dbg !138 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !140 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.a15077f50f3020c3:core.Destroy.Core"(ptr %self) #0 !dbg !142 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.a15077f50f3020c3:core.Destroy.Core"(ptr %self), !dbg !144 +// CHECK:STDOUT: ret void, !dbg !144 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %self) #0 !dbg !146 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !148 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %self) #0 !dbg !150 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %self), !dbg !152 +// CHECK:STDOUT: ret void, !dbg !152 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_CMake.OwningPackage(ptr sret({ i32 })) // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!91} +// CHECK:STDOUT: !llvm.dbg.cu = !{!123} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} @@ -369,74 +482,117 @@ fn CallGeneric() { // CHECK:STDOUT: !39 = !DISubroutineType(types: !38) // CHECK:STDOUT: !40 = !{null, !7} // CHECK:STDOUT: !41 = !DISubroutineType(types: !40) -// CHECK:STDOUT: !90 = !DIFile(filename: "generic_same_package.carbon", directory: "") -// CHECK:STDOUT: !91 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !90, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !94 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !90, line: 6, type: !39, spFlags: DISPFlagDefinition, unit: !91, retainedNodes: !97) -// CHECK:STDOUT: !95 = !DILocalVariable(arg: 1, scope: !94, type: !6) -// CHECK:STDOUT: !96 = !DILocation(line: 6, column: 15, scope: !94) -// CHECK:STDOUT: !97 = !{!95} -// CHECK:STDOUT: !98 = distinct !DISubprogram(name: "Op", linkageName: "_COp.a15077f50f3020c3:core.Destroy.Core", scope: null, file: !90, line: 6, type: !41, spFlags: DISPFlagDefinition, unit: !91, retainedNodes: !101) -// CHECK:STDOUT: !99 = !DILocalVariable(arg: 1, scope: !98, type: !7) -// CHECK:STDOUT: !100 = !DILocation(line: 6, column: 15, scope: !98) -// CHECK:STDOUT: !101 = !{!99} -// CHECK:STDOUT: !102 = distinct !DISubprogram(name: "Op", linkageName: "_COp.d9636b4f2fbd64a7:core.Destroy.Core", scope: null, file: !90, line: 6, type: !41, spFlags: DISPFlagDefinition, unit: !91, retainedNodes: !105) -// CHECK:STDOUT: !103 = !DILocalVariable(arg: 1, scope: !102, type: !7) -// CHECK:STDOUT: !104 = !DILocation(line: 6, column: 15, scope: !102) -// CHECK:STDOUT: !105 = !{!103} +// CHECK:STDOUT: !122 = !DIFile(filename: "generic_same_package.carbon", directory: "") +// CHECK:STDOUT: !123 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !122, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !126 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !122, line: 6, type: !39, spFlags: DISPFlagDefinition, unit: !123, retainedNodes: !129) +// CHECK:STDOUT: !127 = !DILocalVariable(arg: 1, scope: !126, type: !6) +// CHECK:STDOUT: !128 = !DILocation(line: 6, column: 15, scope: !126) +// CHECK:STDOUT: !129 = !{!127} +// CHECK:STDOUT: !130 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !122, line: 6, type: !39, spFlags: DISPFlagDefinition, unit: !123, retainedNodes: !133) +// CHECK:STDOUT: !131 = !DILocalVariable(arg: 1, scope: !130, type: !6) +// CHECK:STDOUT: !132 = !DILocation(line: 6, column: 15, scope: !130) +// CHECK:STDOUT: !133 = !{!131} +// CHECK:STDOUT: !134 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !122, line: 6, type: !39, spFlags: DISPFlagDefinition, unit: !123, retainedNodes: !137) +// CHECK:STDOUT: !135 = !DILocalVariable(arg: 1, scope: !134, type: !6) +// CHECK:STDOUT: !136 = !DILocation(line: 6, column: 15, scope: !134) +// CHECK:STDOUT: !137 = !{!135} +// CHECK:STDOUT: !138 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.a15077f50f3020c3:core.Destroy.Core", scope: null, file: !122, line: 6, type: !41, spFlags: DISPFlagDefinition, unit: !123, retainedNodes: !141) +// CHECK:STDOUT: !139 = !DILocalVariable(arg: 1, scope: !138, type: !7) +// CHECK:STDOUT: !140 = !DILocation(line: 6, column: 15, scope: !138) +// CHECK:STDOUT: !141 = !{!139} +// CHECK:STDOUT: !142 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.a15077f50f3020c3:core.Destroy.Core", scope: null, file: !122, line: 6, type: !41, spFlags: DISPFlagDefinition, unit: !123, retainedNodes: !145) +// CHECK:STDOUT: !143 = !DILocalVariable(arg: 1, scope: !142, type: !7) +// CHECK:STDOUT: !144 = !DILocation(line: 6, column: 15, scope: !142) +// CHECK:STDOUT: !145 = !{!143} +// CHECK:STDOUT: !146 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.d9636b4f2fbd64a7:core.Destroy.Core", scope: null, file: !122, line: 6, type: !41, spFlags: DISPFlagDefinition, unit: !123, retainedNodes: !149) +// CHECK:STDOUT: !147 = !DILocalVariable(arg: 1, scope: !146, type: !7) +// CHECK:STDOUT: !148 = !DILocation(line: 6, column: 15, scope: !146) +// CHECK:STDOUT: !149 = !{!147} +// CHECK:STDOUT: !150 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.d9636b4f2fbd64a7:core.Destroy.Core", scope: null, file: !122, line: 6, type: !41, spFlags: DISPFlagDefinition, unit: !123, retainedNodes: !153) +// CHECK:STDOUT: !151 = !DILocalVariable(arg: 1, scope: !150, type: !7) +// CHECK:STDOUT: !152 = !DILocation(line: 6, column: 15, scope: !150) +// CHECK:STDOUT: !153 = !{!151} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'indirect_same_package.carbon' // CHECK:STDOUT: source_filename = "indirect_same_package.carbon" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CCallGeneric.OwningPackage() #0 !dbg !110 { +// CHECK:STDOUT: define void @_CCallGeneric.OwningPackage() #0 !dbg !158 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc7_20.1.temp = alloca { i32 }, align 4, !dbg !111 -// CHECK:STDOUT: %.loc7_28.1.temp = alloca { i32 }, align 4, !dbg !112 -// CHECK:STDOUT: %.loc7_29.2.temp = alloca { i32 }, align 4, !dbg !113 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_20.1.temp), !dbg !111 -// CHECK:STDOUT: call void @_CMake.OwningPackage(ptr %.loc7_20.1.temp), !dbg !111 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_28.1.temp), !dbg !112 -// CHECK:STDOUT: call void @_CMake.OwningPackage(ptr %.loc7_28.1.temp), !dbg !112 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_29.2.temp), !dbg !113 -// CHECK:STDOUT: call void @_CGeneric.OwningPackage.e43630e9a6c38c3f(ptr %.loc7_29.2.temp, ptr %.loc7_20.1.temp, ptr %.loc7_28.1.temp), !dbg !113 -// CHECK:STDOUT: call void @"_COp.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %.loc7_29.2.temp), !dbg !113 -// CHECK:STDOUT: call void @"_COp.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %.loc7_28.1.temp), !dbg !112 -// CHECK:STDOUT: call void @"_COp.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %.loc7_20.1.temp), !dbg !111 -// CHECK:STDOUT: ret void, !dbg !114 +// CHECK:STDOUT: %.loc7_20.1.temp = alloca { i32 }, align 4, !dbg !159 +// CHECK:STDOUT: %.loc7_28.1.temp = alloca { i32 }, align 4, !dbg !160 +// CHECK:STDOUT: %.loc7_29.2.temp = alloca { i32 }, align 4, !dbg !161 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_20.1.temp), !dbg !159 +// CHECK:STDOUT: call void @_CMake.OwningPackage(ptr %.loc7_20.1.temp), !dbg !159 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_28.1.temp), !dbg !160 +// CHECK:STDOUT: call void @_CMake.OwningPackage(ptr %.loc7_28.1.temp), !dbg !160 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_29.2.temp), !dbg !161 +// CHECK:STDOUT: call void @_CGeneric.OwningPackage.e43630e9a6c38c3f(ptr %.loc7_29.2.temp, ptr %.loc7_20.1.temp, ptr %.loc7_28.1.temp), !dbg !161 +// CHECK:STDOUT: call void @"_CSelfDestruct.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %.loc7_29.2.temp), !dbg !161 +// CHECK:STDOUT: call void @"_CSelfDestruct.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %.loc7_28.1.temp), !dbg !160 +// CHECK:STDOUT: call void @"_CSelfDestruct.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %.loc7_20.1.temp), !dbg !159 +// CHECK:STDOUT: ret void, !dbg !162 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_CMake.OwningPackage(ptr sret({ i32 })) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !115 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !163 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !117 +// CHECK:STDOUT: ret void, !dbg !165 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.a15077f50f3020c3:core.Destroy.Core"(ptr %self) #0 !dbg !119 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !167 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !121 +// CHECK:STDOUT: ret void, !dbg !169 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %self) #0 !dbg !123 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !171 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !125 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !173 +// CHECK:STDOUT: ret void, !dbg !173 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.a15077f50f3020c3:core.Destroy.Core"(ptr %self) #0 !dbg !175 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !177 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.a15077f50f3020c3:core.Destroy.Core"(ptr %self) #0 !dbg !179 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.a15077f50f3020c3:core.Destroy.Core"(ptr %self), !dbg !181 +// CHECK:STDOUT: ret void, !dbg !181 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %self) #0 !dbg !183 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !185 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %self) #0 !dbg !187 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %self), !dbg !189 +// CHECK:STDOUT: ret void, !dbg !189 // 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 @_CGeneric.OwningPackage.e43630e9a6c38c3f(ptr sret({ i32 }) %return, ptr %v1, ptr %v2) #0 !dbg !127 { -// CHECK:STDOUT: %temp = alloca { i32 }, align 4, !dbg !135 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp), !dbg !135 -// CHECK:STDOUT: call void @"_COp.Vector.OwningPackage:MulWith.84588f41d61dafba.Core"(ptr %temp, ptr %v2, i32 2), !dbg !135 -// CHECK:STDOUT: call void @"_COp.Vector.OwningPackage:AddWith.f941828044620367.Core"(ptr %return, ptr %v1, ptr %temp), !dbg !134 -// CHECK:STDOUT: call void @"_COp.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %temp), !dbg !135 -// CHECK:STDOUT: ret void, !dbg !136 +// CHECK:STDOUT: define linkonce_odr void @_CGeneric.OwningPackage.e43630e9a6c38c3f(ptr sret({ i32 }) %return, ptr %v1, ptr %v2) #0 !dbg !191 { +// CHECK:STDOUT: %temp = alloca { i32 }, align 4, !dbg !199 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp), !dbg !199 +// CHECK:STDOUT: call void @"_COp.Vector.OwningPackage:MulWith.84588f41d61dafba.Core"(ptr %temp, ptr %v2, i32 2), !dbg !199 +// CHECK:STDOUT: call void @"_COp.Vector.OwningPackage:AddWith.f941828044620367.Core"(ptr %return, ptr %v1, ptr %temp), !dbg !198 +// CHECK:STDOUT: call void @"_CSelfDestruct.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %temp), !dbg !199 +// CHECK:STDOUT: ret void, !dbg !200 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @"_COp.Vector.OwningPackage:MulWith.84588f41d61dafba.Core"(ptr sret({ i32 }), ptr, i32) @@ -445,13 +601,13 @@ fn CallGeneric() { // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives // CHECK:STDOUT: uselistorder ptr @_CMake.OwningPackage, { 1, 0 } -// CHECK:STDOUT: uselistorder ptr @"_COp.d9636b4f2fbd64a7:core.Destroy.Core", { 0, 3, 2, 1 } +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.d9636b4f2fbd64a7:core.Destroy.Core", { 0, 3, 2, 1 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 0, 3, 2, 1 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!107} +// CHECK:STDOUT: !llvm.dbg.cu = !{!155} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} @@ -464,49 +620,65 @@ fn CallGeneric() { // CHECK:STDOUT: !39 = !DISubroutineType(types: !38) // CHECK:STDOUT: !40 = !{null, !7} // CHECK:STDOUT: !41 = !DISubroutineType(types: !40) -// CHECK:STDOUT: !90 = !DIFile(filename: "generic_same_package.carbon", directory: "") -// CHECK:STDOUT: !106 = !DIFile(filename: "indirect_same_package.carbon", directory: "") -// CHECK:STDOUT: !107 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !106, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !108 = !{null} -// CHECK:STDOUT: !109 = !DISubroutineType(types: !108) -// CHECK:STDOUT: !110 = distinct !DISubprogram(name: "CallGeneric", linkageName: "_CCallGeneric.OwningPackage", scope: null, file: !106, line: 5, type: !109, spFlags: DISPFlagDefinition, unit: !107) -// CHECK:STDOUT: !111 = !DILocation(line: 7, column: 15, scope: !110) -// CHECK:STDOUT: !112 = !DILocation(line: 7, column: 23, scope: !110) -// CHECK:STDOUT: !113 = !DILocation(line: 7, column: 3, scope: !110) -// CHECK:STDOUT: !114 = !DILocation(line: 5, column: 1, scope: !110) -// CHECK:STDOUT: !115 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !106, line: 7, type: !39, spFlags: DISPFlagDefinition, unit: !107, retainedNodes: !118) -// CHECK:STDOUT: !116 = !DILocalVariable(arg: 1, scope: !115, type: !6) -// CHECK:STDOUT: !117 = !DILocation(line: 7, column: 3, scope: !115) -// CHECK:STDOUT: !118 = !{!116} -// CHECK:STDOUT: !119 = distinct !DISubprogram(name: "Op", linkageName: "_COp.a15077f50f3020c3:core.Destroy.Core", scope: null, file: !106, line: 7, type: !41, spFlags: DISPFlagDefinition, unit: !107, retainedNodes: !122) -// CHECK:STDOUT: !120 = !DILocalVariable(arg: 1, scope: !119, type: !7) -// CHECK:STDOUT: !121 = !DILocation(line: 7, column: 3, scope: !119) -// CHECK:STDOUT: !122 = !{!120} -// CHECK:STDOUT: !123 = distinct !DISubprogram(name: "Op", linkageName: "_COp.d9636b4f2fbd64a7:core.Destroy.Core", scope: null, file: !106, line: 7, type: !41, spFlags: DISPFlagDefinition, unit: !107, retainedNodes: !126) -// CHECK:STDOUT: !124 = !DILocalVariable(arg: 1, scope: !123, type: !7) -// CHECK:STDOUT: !125 = !DILocation(line: 7, column: 3, scope: !123) -// CHECK:STDOUT: !126 = !{!124} -// CHECK:STDOUT: !127 = distinct !DISubprogram(name: "Generic", linkageName: "_CGeneric.OwningPackage.e43630e9a6c38c3f", scope: null, file: !90, line: 5, type: !9, spFlags: DISPFlagDefinition, unit: !107, retainedNodes: !137) -// CHECK:STDOUT: !128 = !DILocalVariable(arg: 1, scope: !127, type: !7) -// CHECK:STDOUT: !129 = !DILocalVariable(arg: 2, scope: !127, type: !7) -// CHECK:STDOUT: !134 = !DILocation(line: 6, column: 10, scope: !127) -// CHECK:STDOUT: !135 = !DILocation(line: 6, column: 15, scope: !127) -// CHECK:STDOUT: !136 = !DILocation(line: 6, column: 3, scope: !127) -// CHECK:STDOUT: !137 = !{!128, !129} +// CHECK:STDOUT: !122 = !DIFile(filename: "generic_same_package.carbon", directory: "") +// CHECK:STDOUT: !154 = !DIFile(filename: "indirect_same_package.carbon", directory: "") +// CHECK:STDOUT: !155 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !154, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !156 = !{null} +// CHECK:STDOUT: !157 = !DISubroutineType(types: !156) +// CHECK:STDOUT: !158 = distinct !DISubprogram(name: "CallGeneric", linkageName: "_CCallGeneric.OwningPackage", scope: null, file: !154, line: 5, type: !157, spFlags: DISPFlagDefinition, unit: !155) +// CHECK:STDOUT: !159 = !DILocation(line: 7, column: 15, scope: !158) +// CHECK:STDOUT: !160 = !DILocation(line: 7, column: 23, scope: !158) +// CHECK:STDOUT: !161 = !DILocation(line: 7, column: 3, scope: !158) +// CHECK:STDOUT: !162 = !DILocation(line: 5, column: 1, scope: !158) +// CHECK:STDOUT: !163 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !154, line: 7, type: !39, spFlags: DISPFlagDefinition, unit: !155, retainedNodes: !166) +// CHECK:STDOUT: !164 = !DILocalVariable(arg: 1, scope: !163, type: !6) +// CHECK:STDOUT: !165 = !DILocation(line: 7, column: 3, scope: !163) +// CHECK:STDOUT: !166 = !{!164} +// CHECK:STDOUT: !167 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !154, line: 7, type: !39, spFlags: DISPFlagDefinition, unit: !155, retainedNodes: !170) +// CHECK:STDOUT: !168 = !DILocalVariable(arg: 1, scope: !167, type: !6) +// CHECK:STDOUT: !169 = !DILocation(line: 7, column: 3, scope: !167) +// CHECK:STDOUT: !170 = !{!168} +// CHECK:STDOUT: !171 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !154, line: 7, type: !39, spFlags: DISPFlagDefinition, unit: !155, retainedNodes: !174) +// CHECK:STDOUT: !172 = !DILocalVariable(arg: 1, scope: !171, type: !6) +// CHECK:STDOUT: !173 = !DILocation(line: 7, column: 3, scope: !171) +// CHECK:STDOUT: !174 = !{!172} +// CHECK:STDOUT: !175 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.a15077f50f3020c3:core.Destroy.Core", scope: null, file: !154, line: 7, type: !41, spFlags: DISPFlagDefinition, unit: !155, retainedNodes: !178) +// CHECK:STDOUT: !176 = !DILocalVariable(arg: 1, scope: !175, type: !7) +// CHECK:STDOUT: !177 = !DILocation(line: 7, column: 3, scope: !175) +// CHECK:STDOUT: !178 = !{!176} +// CHECK:STDOUT: !179 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.a15077f50f3020c3:core.Destroy.Core", scope: null, file: !154, line: 7, type: !41, spFlags: DISPFlagDefinition, unit: !155, retainedNodes: !182) +// CHECK:STDOUT: !180 = !DILocalVariable(arg: 1, scope: !179, type: !7) +// CHECK:STDOUT: !181 = !DILocation(line: 7, column: 3, scope: !179) +// CHECK:STDOUT: !182 = !{!180} +// CHECK:STDOUT: !183 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.d9636b4f2fbd64a7:core.Destroy.Core", scope: null, file: !154, line: 7, type: !41, spFlags: DISPFlagDefinition, unit: !155, retainedNodes: !186) +// CHECK:STDOUT: !184 = !DILocalVariable(arg: 1, scope: !183, type: !7) +// CHECK:STDOUT: !185 = !DILocation(line: 7, column: 3, scope: !183) +// CHECK:STDOUT: !186 = !{!184} +// CHECK:STDOUT: !187 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.d9636b4f2fbd64a7:core.Destroy.Core", scope: null, file: !154, line: 7, type: !41, spFlags: DISPFlagDefinition, unit: !155, retainedNodes: !190) +// CHECK:STDOUT: !188 = !DILocalVariable(arg: 1, scope: !187, type: !7) +// CHECK:STDOUT: !189 = !DILocation(line: 7, column: 3, scope: !187) +// CHECK:STDOUT: !190 = !{!188} +// CHECK:STDOUT: !191 = distinct !DISubprogram(name: "Generic", linkageName: "_CGeneric.OwningPackage.e43630e9a6c38c3f", scope: null, file: !122, line: 5, type: !9, spFlags: DISPFlagDefinition, unit: !155, retainedNodes: !201) +// CHECK:STDOUT: !192 = !DILocalVariable(arg: 1, scope: !191, type: !7) +// CHECK:STDOUT: !193 = !DILocalVariable(arg: 2, scope: !191, type: !7) +// CHECK:STDOUT: !198 = !DILocation(line: 6, column: 10, scope: !191) +// CHECK:STDOUT: !199 = !DILocation(line: 6, column: 15, scope: !191) +// CHECK:STDOUT: !200 = !DILocation(line: 6, column: 3, scope: !191) +// CHECK:STDOUT: !201 = !{!192, !193} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'direct_different_package.carbon' // CHECK:STDOUT: source_filename = "direct_different_package.carbon" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CDirect.OtherPackage(ptr sret({ i32 }) %return, ptr %v1, ptr %v2) #0 !dbg !140 { +// CHECK:STDOUT: define void @_CDirect.OtherPackage(ptr sret({ i32 }) %return, ptr %v1, ptr %v2) #0 !dbg !204 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc7_18.1.temp = alloca { i32 }, align 4, !dbg !148 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_18.1.temp), !dbg !148 -// CHECK:STDOUT: call void @"_COp.Vector.OwningPackage:MulWith.84588f41d61dafba.Core"(ptr %.loc7_18.1.temp, ptr %v2, i32 2), !dbg !148 -// CHECK:STDOUT: call void @"_COp.Vector.OwningPackage:AddWith.f941828044620367.Core"(ptr %return, ptr %v1, ptr %.loc7_18.1.temp), !dbg !147 -// CHECK:STDOUT: call void @"_COp.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %.loc7_18.1.temp), !dbg !148 -// CHECK:STDOUT: ret void, !dbg !149 +// CHECK:STDOUT: %.loc7_18.1.temp = alloca { i32 }, align 4, !dbg !212 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_18.1.temp), !dbg !212 +// CHECK:STDOUT: call void @"_COp.Vector.OwningPackage:MulWith.84588f41d61dafba.Core"(ptr %.loc7_18.1.temp, ptr %v2, i32 2), !dbg !212 +// CHECK:STDOUT: call void @"_COp.Vector.OwningPackage:AddWith.f941828044620367.Core"(ptr %return, ptr %v1, ptr %.loc7_18.1.temp), !dbg !211 +// CHECK:STDOUT: call void @"_CSelfDestruct.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %.loc7_18.1.temp), !dbg !212 +// CHECK:STDOUT: ret void, !dbg !213 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @"_COp.Vector.OwningPackage:MulWith.84588f41d61dafba.Core"(ptr sret({ i32 }), ptr, i32) @@ -514,21 +686,48 @@ fn CallGeneric() { // CHECK:STDOUT: declare void @"_COp.Vector.OwningPackage:AddWith.f941828044620367.Core"(ptr sret({ i32 }), ptr, ptr) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !151 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !215 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !153 +// CHECK:STDOUT: ret void, !dbg !217 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.a15077f50f3020c3:core.Destroy.Core"(ptr %self) #0 !dbg !155 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !219 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !157 +// CHECK:STDOUT: ret void, !dbg !221 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %self) #0 !dbg !159 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !223 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !161 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !225 +// CHECK:STDOUT: ret void, !dbg !225 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.a15077f50f3020c3:core.Destroy.Core"(ptr %self) #0 !dbg !227 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !229 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.a15077f50f3020c3:core.Destroy.Core"(ptr %self) #0 !dbg !231 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.a15077f50f3020c3:core.Destroy.Core"(ptr %self), !dbg !233 +// CHECK:STDOUT: ret void, !dbg !233 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %self) #0 !dbg !235 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !237 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %self) #0 !dbg !239 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %self), !dbg !241 +// CHECK:STDOUT: ret void, !dbg !241 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -537,7 +736,7 @@ fn CallGeneric() { // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!139} +// CHECK:STDOUT: !llvm.dbg.cu = !{!203} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} @@ -550,81 +749,124 @@ fn CallGeneric() { // CHECK:STDOUT: !39 = !DISubroutineType(types: !38) // CHECK:STDOUT: !40 = !{null, !7} // CHECK:STDOUT: !41 = !DISubroutineType(types: !40) -// CHECK:STDOUT: !138 = !DIFile(filename: "direct_different_package.carbon", directory: "") -// CHECK:STDOUT: !139 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !138, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !140 = distinct !DISubprogram(name: "Direct", linkageName: "_CDirect.OtherPackage", scope: null, file: !138, line: 5, type: !9, spFlags: DISPFlagDefinition, unit: !139, retainedNodes: !150) -// CHECK:STDOUT: !141 = !DILocalVariable(arg: 1, scope: !140, type: !7) -// CHECK:STDOUT: !142 = !DILocalVariable(arg: 2, scope: !140, type: !7) -// CHECK:STDOUT: !147 = !DILocation(line: 7, column: 10, scope: !140) -// CHECK:STDOUT: !148 = !DILocation(line: 7, column: 15, scope: !140) -// CHECK:STDOUT: !149 = !DILocation(line: 7, column: 3, scope: !140) -// CHECK:STDOUT: !150 = !{!141, !142} -// CHECK:STDOUT: !151 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !138, line: 7, type: !39, spFlags: DISPFlagDefinition, unit: !139, retainedNodes: !154) -// CHECK:STDOUT: !152 = !DILocalVariable(arg: 1, scope: !151, type: !6) -// CHECK:STDOUT: !153 = !DILocation(line: 7, column: 15, scope: !151) -// CHECK:STDOUT: !154 = !{!152} -// CHECK:STDOUT: !155 = distinct !DISubprogram(name: "Op", linkageName: "_COp.a15077f50f3020c3:core.Destroy.Core", scope: null, file: !138, line: 7, type: !41, spFlags: DISPFlagDefinition, unit: !139, retainedNodes: !158) -// CHECK:STDOUT: !156 = !DILocalVariable(arg: 1, scope: !155, type: !7) -// CHECK:STDOUT: !157 = !DILocation(line: 7, column: 15, scope: !155) -// CHECK:STDOUT: !158 = !{!156} -// CHECK:STDOUT: !159 = distinct !DISubprogram(name: "Op", linkageName: "_COp.d9636b4f2fbd64a7:core.Destroy.Core", scope: null, file: !138, line: 7, type: !41, spFlags: DISPFlagDefinition, unit: !139, retainedNodes: !162) -// CHECK:STDOUT: !160 = !DILocalVariable(arg: 1, scope: !159, type: !7) -// CHECK:STDOUT: !161 = !DILocation(line: 7, column: 15, scope: !159) -// CHECK:STDOUT: !162 = !{!160} +// CHECK:STDOUT: !202 = !DIFile(filename: "direct_different_package.carbon", directory: "") +// CHECK:STDOUT: !203 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !202, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !204 = distinct !DISubprogram(name: "Direct", linkageName: "_CDirect.OtherPackage", scope: null, file: !202, line: 5, type: !9, spFlags: DISPFlagDefinition, unit: !203, retainedNodes: !214) +// CHECK:STDOUT: !205 = !DILocalVariable(arg: 1, scope: !204, type: !7) +// CHECK:STDOUT: !206 = !DILocalVariable(arg: 2, scope: !204, type: !7) +// CHECK:STDOUT: !211 = !DILocation(line: 7, column: 10, scope: !204) +// CHECK:STDOUT: !212 = !DILocation(line: 7, column: 15, scope: !204) +// CHECK:STDOUT: !213 = !DILocation(line: 7, column: 3, scope: !204) +// CHECK:STDOUT: !214 = !{!205, !206} +// CHECK:STDOUT: !215 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !202, line: 7, type: !39, spFlags: DISPFlagDefinition, unit: !203, retainedNodes: !218) +// CHECK:STDOUT: !216 = !DILocalVariable(arg: 1, scope: !215, type: !6) +// CHECK:STDOUT: !217 = !DILocation(line: 7, column: 15, scope: !215) +// CHECK:STDOUT: !218 = !{!216} +// CHECK:STDOUT: !219 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !202, line: 7, type: !39, spFlags: DISPFlagDefinition, unit: !203, retainedNodes: !222) +// CHECK:STDOUT: !220 = !DILocalVariable(arg: 1, scope: !219, type: !6) +// CHECK:STDOUT: !221 = !DILocation(line: 7, column: 15, scope: !219) +// CHECK:STDOUT: !222 = !{!220} +// CHECK:STDOUT: !223 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !202, line: 7, type: !39, spFlags: DISPFlagDefinition, unit: !203, retainedNodes: !226) +// CHECK:STDOUT: !224 = !DILocalVariable(arg: 1, scope: !223, type: !6) +// CHECK:STDOUT: !225 = !DILocation(line: 7, column: 15, scope: !223) +// CHECK:STDOUT: !226 = !{!224} +// CHECK:STDOUT: !227 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.a15077f50f3020c3:core.Destroy.Core", scope: null, file: !202, line: 7, type: !41, spFlags: DISPFlagDefinition, unit: !203, retainedNodes: !230) +// CHECK:STDOUT: !228 = !DILocalVariable(arg: 1, scope: !227, type: !7) +// CHECK:STDOUT: !229 = !DILocation(line: 7, column: 15, scope: !227) +// CHECK:STDOUT: !230 = !{!228} +// CHECK:STDOUT: !231 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.a15077f50f3020c3:core.Destroy.Core", scope: null, file: !202, line: 7, type: !41, spFlags: DISPFlagDefinition, unit: !203, retainedNodes: !234) +// CHECK:STDOUT: !232 = !DILocalVariable(arg: 1, scope: !231, type: !7) +// CHECK:STDOUT: !233 = !DILocation(line: 7, column: 15, scope: !231) +// CHECK:STDOUT: !234 = !{!232} +// CHECK:STDOUT: !235 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.d9636b4f2fbd64a7:core.Destroy.Core", scope: null, file: !202, line: 7, type: !41, spFlags: DISPFlagDefinition, unit: !203, retainedNodes: !238) +// CHECK:STDOUT: !236 = !DILocalVariable(arg: 1, scope: !235, type: !7) +// CHECK:STDOUT: !237 = !DILocation(line: 7, column: 15, scope: !235) +// CHECK:STDOUT: !238 = !{!236} +// CHECK:STDOUT: !239 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.d9636b4f2fbd64a7:core.Destroy.Core", scope: null, file: !202, line: 7, type: !41, spFlags: DISPFlagDefinition, unit: !203, retainedNodes: !242) +// CHECK:STDOUT: !240 = !DILocalVariable(arg: 1, scope: !239, type: !7) +// CHECK:STDOUT: !241 = !DILocation(line: 7, column: 15, scope: !239) +// CHECK:STDOUT: !242 = !{!240} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'indirect_different_package_via_generic_in_same_package.carbon' // CHECK:STDOUT: source_filename = "indirect_different_package_via_generic_in_same_package.carbon" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CCallGenericInOwningPackage.OtherPackage() #0 !dbg !165 { +// CHECK:STDOUT: define void @_CCallGenericInOwningPackage.OtherPackage() #0 !dbg !245 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc7_48.1.temp = alloca { i32 }, align 4, !dbg !166 -// CHECK:STDOUT: %.loc7_70.1.temp = alloca { i32 }, align 4, !dbg !167 -// CHECK:STDOUT: %.loc7_71.2.temp = alloca { i32 }, align 4, !dbg !168 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_48.1.temp), !dbg !166 -// CHECK:STDOUT: call void @_CMake.OwningPackage(ptr %.loc7_48.1.temp), !dbg !166 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_70.1.temp), !dbg !167 -// CHECK:STDOUT: call void @_CMake.OwningPackage(ptr %.loc7_70.1.temp), !dbg !167 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_71.2.temp), !dbg !168 -// CHECK:STDOUT: call void @_CGeneric.OwningPackage.e43630e9a6c38c3f(ptr %.loc7_71.2.temp, ptr %.loc7_48.1.temp, ptr %.loc7_70.1.temp), !dbg !168 -// CHECK:STDOUT: call void @"_COp.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %.loc7_71.2.temp), !dbg !168 -// CHECK:STDOUT: call void @"_COp.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %.loc7_70.1.temp), !dbg !167 -// CHECK:STDOUT: call void @"_COp.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %.loc7_48.1.temp), !dbg !166 -// CHECK:STDOUT: ret void, !dbg !169 +// CHECK:STDOUT: %.loc7_48.1.temp = alloca { i32 }, align 4, !dbg !246 +// CHECK:STDOUT: %.loc7_70.1.temp = alloca { i32 }, align 4, !dbg !247 +// CHECK:STDOUT: %.loc7_71.2.temp = alloca { i32 }, align 4, !dbg !248 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_48.1.temp), !dbg !246 +// CHECK:STDOUT: call void @_CMake.OwningPackage(ptr %.loc7_48.1.temp), !dbg !246 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_70.1.temp), !dbg !247 +// CHECK:STDOUT: call void @_CMake.OwningPackage(ptr %.loc7_70.1.temp), !dbg !247 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_71.2.temp), !dbg !248 +// CHECK:STDOUT: call void @_CGeneric.OwningPackage.e43630e9a6c38c3f(ptr %.loc7_71.2.temp, ptr %.loc7_48.1.temp, ptr %.loc7_70.1.temp), !dbg !248 +// CHECK:STDOUT: call void @"_CSelfDestruct.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %.loc7_71.2.temp), !dbg !248 +// CHECK:STDOUT: call void @"_CSelfDestruct.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %.loc7_70.1.temp), !dbg !247 +// CHECK:STDOUT: call void @"_CSelfDestruct.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %.loc7_48.1.temp), !dbg !246 +// CHECK:STDOUT: ret void, !dbg !249 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_CMake.OwningPackage(ptr sret({ i32 })) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !170 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !250 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !172 +// CHECK:STDOUT: ret void, !dbg !252 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.a15077f50f3020c3:core.Destroy.Core"(ptr %self) #0 !dbg !174 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !254 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !176 +// CHECK:STDOUT: ret void, !dbg !256 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %self) #0 !dbg !178 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !258 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !180 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !260 +// CHECK:STDOUT: ret void, !dbg !260 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.a15077f50f3020c3:core.Destroy.Core"(ptr %self) #0 !dbg !262 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !264 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.a15077f50f3020c3:core.Destroy.Core"(ptr %self) #0 !dbg !266 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.a15077f50f3020c3:core.Destroy.Core"(ptr %self), !dbg !268 +// CHECK:STDOUT: ret void, !dbg !268 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %self) #0 !dbg !270 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !272 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %self) #0 !dbg !274 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %self), !dbg !276 +// CHECK:STDOUT: ret void, !dbg !276 // 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 @_CGeneric.OwningPackage.e43630e9a6c38c3f(ptr sret({ i32 }) %return, ptr %v1, ptr %v2) #0 !dbg !182 { -// CHECK:STDOUT: %temp = alloca { i32 }, align 4, !dbg !190 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp), !dbg !190 -// CHECK:STDOUT: call void @"_COp.Vector.OwningPackage:MulWith.84588f41d61dafba.Core"(ptr %temp, ptr %v2, i32 2), !dbg !190 -// CHECK:STDOUT: call void @"_COp.Vector.OwningPackage:AddWith.f941828044620367.Core"(ptr %return, ptr %v1, ptr %temp), !dbg !189 -// CHECK:STDOUT: call void @"_COp.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %temp), !dbg !190 -// CHECK:STDOUT: ret void, !dbg !191 +// CHECK:STDOUT: define linkonce_odr void @_CGeneric.OwningPackage.e43630e9a6c38c3f(ptr sret({ i32 }) %return, ptr %v1, ptr %v2) #0 !dbg !278 { +// CHECK:STDOUT: %temp = alloca { i32 }, align 4, !dbg !286 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp), !dbg !286 +// CHECK:STDOUT: call void @"_COp.Vector.OwningPackage:MulWith.84588f41d61dafba.Core"(ptr %temp, ptr %v2, i32 2), !dbg !286 +// CHECK:STDOUT: call void @"_COp.Vector.OwningPackage:AddWith.f941828044620367.Core"(ptr %return, ptr %v1, ptr %temp), !dbg !285 +// CHECK:STDOUT: call void @"_CSelfDestruct.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %temp), !dbg !286 +// CHECK:STDOUT: ret void, !dbg !287 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @"_COp.Vector.OwningPackage:MulWith.84588f41d61dafba.Core"(ptr sret({ i32 }), ptr, i32) @@ -633,13 +875,13 @@ fn CallGeneric() { // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives // CHECK:STDOUT: uselistorder ptr @_CMake.OwningPackage, { 1, 0 } -// CHECK:STDOUT: uselistorder ptr @"_COp.d9636b4f2fbd64a7:core.Destroy.Core", { 0, 3, 2, 1 } +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.d9636b4f2fbd64a7:core.Destroy.Core", { 0, 3, 2, 1 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 0, 3, 2, 1 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!164} +// CHECK:STDOUT: !llvm.dbg.cu = !{!244} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} @@ -652,35 +894,51 @@ fn CallGeneric() { // CHECK:STDOUT: !39 = !DISubroutineType(types: !38) // CHECK:STDOUT: !40 = !{null, !7} // CHECK:STDOUT: !41 = !DISubroutineType(types: !40) -// CHECK:STDOUT: !90 = !DIFile(filename: "generic_same_package.carbon", directory: "") -// CHECK:STDOUT: !108 = !{null} -// CHECK:STDOUT: !109 = !DISubroutineType(types: !108) -// CHECK:STDOUT: !163 = !DIFile(filename: "indirect_different_package_via_generic_in_same_package.carbon", directory: "") -// CHECK:STDOUT: !164 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !163, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !165 = distinct !DISubprogram(name: "CallGenericInOwningPackage", linkageName: "_CCallGenericInOwningPackage.OtherPackage", scope: null, file: !163, line: 5, type: !109, spFlags: DISPFlagDefinition, unit: !164) -// CHECK:STDOUT: !166 = !DILocation(line: 7, column: 29, scope: !165) -// CHECK:STDOUT: !167 = !DILocation(line: 7, column: 51, scope: !165) -// CHECK:STDOUT: !168 = !DILocation(line: 7, column: 3, scope: !165) -// CHECK:STDOUT: !169 = !DILocation(line: 5, column: 1, scope: !165) -// CHECK:STDOUT: !170 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !163, line: 7, type: !39, spFlags: DISPFlagDefinition, unit: !164, retainedNodes: !173) -// CHECK:STDOUT: !171 = !DILocalVariable(arg: 1, scope: !170, type: !6) -// CHECK:STDOUT: !172 = !DILocation(line: 7, column: 3, scope: !170) -// CHECK:STDOUT: !173 = !{!171} -// CHECK:STDOUT: !174 = distinct !DISubprogram(name: "Op", linkageName: "_COp.a15077f50f3020c3:core.Destroy.Core", scope: null, file: !163, line: 7, type: !41, spFlags: DISPFlagDefinition, unit: !164, retainedNodes: !177) -// CHECK:STDOUT: !175 = !DILocalVariable(arg: 1, scope: !174, type: !7) -// CHECK:STDOUT: !176 = !DILocation(line: 7, column: 3, scope: !174) -// CHECK:STDOUT: !177 = !{!175} -// CHECK:STDOUT: !178 = distinct !DISubprogram(name: "Op", linkageName: "_COp.d9636b4f2fbd64a7:core.Destroy.Core", scope: null, file: !163, line: 7, type: !41, spFlags: DISPFlagDefinition, unit: !164, retainedNodes: !181) -// CHECK:STDOUT: !179 = !DILocalVariable(arg: 1, scope: !178, type: !7) -// CHECK:STDOUT: !180 = !DILocation(line: 7, column: 3, scope: !178) -// CHECK:STDOUT: !181 = !{!179} -// CHECK:STDOUT: !182 = distinct !DISubprogram(name: "Generic", linkageName: "_CGeneric.OwningPackage.e43630e9a6c38c3f", scope: null, file: !90, line: 5, type: !9, spFlags: DISPFlagDefinition, unit: !164, retainedNodes: !192) -// CHECK:STDOUT: !183 = !DILocalVariable(arg: 1, scope: !182, type: !7) -// CHECK:STDOUT: !184 = !DILocalVariable(arg: 2, scope: !182, type: !7) -// CHECK:STDOUT: !189 = !DILocation(line: 6, column: 10, scope: !182) -// CHECK:STDOUT: !190 = !DILocation(line: 6, column: 15, scope: !182) -// CHECK:STDOUT: !191 = !DILocation(line: 6, column: 3, scope: !182) -// CHECK:STDOUT: !192 = !{!183, !184} +// CHECK:STDOUT: !122 = !DIFile(filename: "generic_same_package.carbon", directory: "") +// CHECK:STDOUT: !156 = !{null} +// CHECK:STDOUT: !157 = !DISubroutineType(types: !156) +// CHECK:STDOUT: !243 = !DIFile(filename: "indirect_different_package_via_generic_in_same_package.carbon", directory: "") +// CHECK:STDOUT: !244 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !243, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !245 = distinct !DISubprogram(name: "CallGenericInOwningPackage", linkageName: "_CCallGenericInOwningPackage.OtherPackage", scope: null, file: !243, line: 5, type: !157, spFlags: DISPFlagDefinition, unit: !244) +// CHECK:STDOUT: !246 = !DILocation(line: 7, column: 29, scope: !245) +// CHECK:STDOUT: !247 = !DILocation(line: 7, column: 51, scope: !245) +// CHECK:STDOUT: !248 = !DILocation(line: 7, column: 3, scope: !245) +// CHECK:STDOUT: !249 = !DILocation(line: 5, column: 1, scope: !245) +// CHECK:STDOUT: !250 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !243, line: 7, type: !39, spFlags: DISPFlagDefinition, unit: !244, retainedNodes: !253) +// CHECK:STDOUT: !251 = !DILocalVariable(arg: 1, scope: !250, type: !6) +// CHECK:STDOUT: !252 = !DILocation(line: 7, column: 3, scope: !250) +// CHECK:STDOUT: !253 = !{!251} +// CHECK:STDOUT: !254 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !243, line: 7, type: !39, spFlags: DISPFlagDefinition, unit: !244, retainedNodes: !257) +// CHECK:STDOUT: !255 = !DILocalVariable(arg: 1, scope: !254, type: !6) +// CHECK:STDOUT: !256 = !DILocation(line: 7, column: 3, scope: !254) +// CHECK:STDOUT: !257 = !{!255} +// CHECK:STDOUT: !258 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !243, line: 7, type: !39, spFlags: DISPFlagDefinition, unit: !244, retainedNodes: !261) +// CHECK:STDOUT: !259 = !DILocalVariable(arg: 1, scope: !258, type: !6) +// CHECK:STDOUT: !260 = !DILocation(line: 7, column: 3, scope: !258) +// CHECK:STDOUT: !261 = !{!259} +// CHECK:STDOUT: !262 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.a15077f50f3020c3:core.Destroy.Core", scope: null, file: !243, line: 7, type: !41, spFlags: DISPFlagDefinition, unit: !244, retainedNodes: !265) +// CHECK:STDOUT: !263 = !DILocalVariable(arg: 1, scope: !262, type: !7) +// CHECK:STDOUT: !264 = !DILocation(line: 7, column: 3, scope: !262) +// CHECK:STDOUT: !265 = !{!263} +// CHECK:STDOUT: !266 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.a15077f50f3020c3:core.Destroy.Core", scope: null, file: !243, line: 7, type: !41, spFlags: DISPFlagDefinition, unit: !244, retainedNodes: !269) +// CHECK:STDOUT: !267 = !DILocalVariable(arg: 1, scope: !266, type: !7) +// CHECK:STDOUT: !268 = !DILocation(line: 7, column: 3, scope: !266) +// CHECK:STDOUT: !269 = !{!267} +// CHECK:STDOUT: !270 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.d9636b4f2fbd64a7:core.Destroy.Core", scope: null, file: !243, line: 7, type: !41, spFlags: DISPFlagDefinition, unit: !244, retainedNodes: !273) +// CHECK:STDOUT: !271 = !DILocalVariable(arg: 1, scope: !270, type: !7) +// CHECK:STDOUT: !272 = !DILocation(line: 7, column: 3, scope: !270) +// CHECK:STDOUT: !273 = !{!271} +// CHECK:STDOUT: !274 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.d9636b4f2fbd64a7:core.Destroy.Core", scope: null, file: !243, line: 7, type: !41, spFlags: DISPFlagDefinition, unit: !244, retainedNodes: !277) +// CHECK:STDOUT: !275 = !DILocalVariable(arg: 1, scope: !274, type: !7) +// CHECK:STDOUT: !276 = !DILocation(line: 7, column: 3, scope: !274) +// CHECK:STDOUT: !277 = !{!275} +// CHECK:STDOUT: !278 = distinct !DISubprogram(name: "Generic", linkageName: "_CGeneric.OwningPackage.e43630e9a6c38c3f", scope: null, file: !122, line: 5, type: !9, spFlags: DISPFlagDefinition, unit: !244, retainedNodes: !288) +// CHECK:STDOUT: !279 = !DILocalVariable(arg: 1, scope: !278, type: !7) +// CHECK:STDOUT: !280 = !DILocalVariable(arg: 2, scope: !278, type: !7) +// CHECK:STDOUT: !285 = !DILocation(line: 6, column: 10, scope: !278) +// CHECK:STDOUT: !286 = !DILocation(line: 6, column: 15, scope: !278) +// CHECK:STDOUT: !287 = !DILocation(line: 6, column: 3, scope: !278) +// CHECK:STDOUT: !288 = !{!279, !280} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'generic_different_package.carbon' @@ -691,28 +949,55 @@ fn CallGeneric() { // CHECK:STDOUT: declare void @"_COp.Vector.OwningPackage:AddWith.f941828044620367.Core"(ptr sret({ i32 }), ptr, ptr) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !195 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !291 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !197 +// CHECK:STDOUT: ret void, !dbg !293 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.a15077f50f3020c3:core.Destroy.Core"(ptr %self) #0 !dbg !199 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !295 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !201 +// CHECK:STDOUT: ret void, !dbg !297 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %self) #0 !dbg !203 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !299 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !205 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !301 +// CHECK:STDOUT: ret void, !dbg !301 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.a15077f50f3020c3:core.Destroy.Core"(ptr %self) #0 !dbg !303 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !305 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.a15077f50f3020c3:core.Destroy.Core"(ptr %self) #0 !dbg !307 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.a15077f50f3020c3:core.Destroy.Core"(ptr %self), !dbg !309 +// CHECK:STDOUT: ret void, !dbg !309 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %self) #0 !dbg !311 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !313 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %self) #0 !dbg !315 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %self), !dbg !317 +// CHECK:STDOUT: ret void, !dbg !317 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_CMake.OtherPackage(ptr sret({ i32 })) // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!194} +// CHECK:STDOUT: !llvm.dbg.cu = !{!290} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} @@ -723,74 +1008,117 @@ fn CallGeneric() { // CHECK:STDOUT: !39 = !DISubroutineType(types: !38) // CHECK:STDOUT: !40 = !{null, !7} // CHECK:STDOUT: !41 = !DISubroutineType(types: !40) -// CHECK:STDOUT: !193 = !DIFile(filename: "generic_different_package.carbon", directory: "") -// CHECK:STDOUT: !194 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !193, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !195 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !193, line: 6, type: !39, spFlags: DISPFlagDefinition, unit: !194, retainedNodes: !198) -// CHECK:STDOUT: !196 = !DILocalVariable(arg: 1, scope: !195, type: !6) -// CHECK:STDOUT: !197 = !DILocation(line: 6, column: 15, scope: !195) -// CHECK:STDOUT: !198 = !{!196} -// CHECK:STDOUT: !199 = distinct !DISubprogram(name: "Op", linkageName: "_COp.a15077f50f3020c3:core.Destroy.Core", scope: null, file: !193, line: 6, type: !41, spFlags: DISPFlagDefinition, unit: !194, retainedNodes: !202) -// CHECK:STDOUT: !200 = !DILocalVariable(arg: 1, scope: !199, type: !7) -// CHECK:STDOUT: !201 = !DILocation(line: 6, column: 15, scope: !199) -// CHECK:STDOUT: !202 = !{!200} -// CHECK:STDOUT: !203 = distinct !DISubprogram(name: "Op", linkageName: "_COp.d9636b4f2fbd64a7:core.Destroy.Core", scope: null, file: !193, line: 6, type: !41, spFlags: DISPFlagDefinition, unit: !194, retainedNodes: !206) -// CHECK:STDOUT: !204 = !DILocalVariable(arg: 1, scope: !203, type: !7) -// CHECK:STDOUT: !205 = !DILocation(line: 6, column: 15, scope: !203) -// CHECK:STDOUT: !206 = !{!204} +// CHECK:STDOUT: !289 = !DIFile(filename: "generic_different_package.carbon", directory: "") +// CHECK:STDOUT: !290 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !289, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !291 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !289, line: 6, type: !39, spFlags: DISPFlagDefinition, unit: !290, retainedNodes: !294) +// CHECK:STDOUT: !292 = !DILocalVariable(arg: 1, scope: !291, type: !6) +// CHECK:STDOUT: !293 = !DILocation(line: 6, column: 15, scope: !291) +// CHECK:STDOUT: !294 = !{!292} +// CHECK:STDOUT: !295 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !289, line: 6, type: !39, spFlags: DISPFlagDefinition, unit: !290, retainedNodes: !298) +// CHECK:STDOUT: !296 = !DILocalVariable(arg: 1, scope: !295, type: !6) +// CHECK:STDOUT: !297 = !DILocation(line: 6, column: 15, scope: !295) +// CHECK:STDOUT: !298 = !{!296} +// CHECK:STDOUT: !299 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !289, line: 6, type: !39, spFlags: DISPFlagDefinition, unit: !290, retainedNodes: !302) +// CHECK:STDOUT: !300 = !DILocalVariable(arg: 1, scope: !299, type: !6) +// CHECK:STDOUT: !301 = !DILocation(line: 6, column: 15, scope: !299) +// CHECK:STDOUT: !302 = !{!300} +// CHECK:STDOUT: !303 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.a15077f50f3020c3:core.Destroy.Core", scope: null, file: !289, line: 6, type: !41, spFlags: DISPFlagDefinition, unit: !290, retainedNodes: !306) +// CHECK:STDOUT: !304 = !DILocalVariable(arg: 1, scope: !303, type: !7) +// CHECK:STDOUT: !305 = !DILocation(line: 6, column: 15, scope: !303) +// CHECK:STDOUT: !306 = !{!304} +// CHECK:STDOUT: !307 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.a15077f50f3020c3:core.Destroy.Core", scope: null, file: !289, line: 6, type: !41, spFlags: DISPFlagDefinition, unit: !290, retainedNodes: !310) +// CHECK:STDOUT: !308 = !DILocalVariable(arg: 1, scope: !307, type: !7) +// CHECK:STDOUT: !309 = !DILocation(line: 6, column: 15, scope: !307) +// CHECK:STDOUT: !310 = !{!308} +// CHECK:STDOUT: !311 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.d9636b4f2fbd64a7:core.Destroy.Core", scope: null, file: !289, line: 6, type: !41, spFlags: DISPFlagDefinition, unit: !290, retainedNodes: !314) +// CHECK:STDOUT: !312 = !DILocalVariable(arg: 1, scope: !311, type: !7) +// CHECK:STDOUT: !313 = !DILocation(line: 6, column: 15, scope: !311) +// CHECK:STDOUT: !314 = !{!312} +// CHECK:STDOUT: !315 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.d9636b4f2fbd64a7:core.Destroy.Core", scope: null, file: !289, line: 6, type: !41, spFlags: DISPFlagDefinition, unit: !290, retainedNodes: !318) +// CHECK:STDOUT: !316 = !DILocalVariable(arg: 1, scope: !315, type: !7) +// CHECK:STDOUT: !317 = !DILocation(line: 6, column: 15, scope: !315) +// CHECK:STDOUT: !318 = !{!316} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'indirect_different_package_via_generic_in_different_package.carbon' // CHECK:STDOUT: source_filename = "indirect_different_package_via_generic_in_different_package.carbon" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CCallGeneric.OtherPackage() #0 !dbg !209 { +// CHECK:STDOUT: define void @_CCallGeneric.OtherPackage() #0 !dbg !321 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc7_20.1.temp = alloca { i32 }, align 4, !dbg !210 -// CHECK:STDOUT: %.loc7_28.1.temp = alloca { i32 }, align 4, !dbg !211 -// CHECK:STDOUT: %.loc7_29.2.temp = alloca { i32 }, align 4, !dbg !212 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_20.1.temp), !dbg !210 -// CHECK:STDOUT: call void @_CMake.OtherPackage(ptr %.loc7_20.1.temp), !dbg !210 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_28.1.temp), !dbg !211 -// CHECK:STDOUT: call void @_CMake.OtherPackage(ptr %.loc7_28.1.temp), !dbg !211 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_29.2.temp), !dbg !212 -// CHECK:STDOUT: call void @_CGeneric.OtherPackage.e43630e9a6c38c3f(ptr %.loc7_29.2.temp, ptr %.loc7_20.1.temp, ptr %.loc7_28.1.temp), !dbg !212 -// CHECK:STDOUT: call void @"_COp.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %.loc7_29.2.temp), !dbg !212 -// CHECK:STDOUT: call void @"_COp.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %.loc7_28.1.temp), !dbg !211 -// CHECK:STDOUT: call void @"_COp.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %.loc7_20.1.temp), !dbg !210 -// CHECK:STDOUT: ret void, !dbg !213 +// CHECK:STDOUT: %.loc7_20.1.temp = alloca { i32 }, align 4, !dbg !322 +// CHECK:STDOUT: %.loc7_28.1.temp = alloca { i32 }, align 4, !dbg !323 +// CHECK:STDOUT: %.loc7_29.2.temp = alloca { i32 }, align 4, !dbg !324 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_20.1.temp), !dbg !322 +// CHECK:STDOUT: call void @_CMake.OtherPackage(ptr %.loc7_20.1.temp), !dbg !322 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_28.1.temp), !dbg !323 +// CHECK:STDOUT: call void @_CMake.OtherPackage(ptr %.loc7_28.1.temp), !dbg !323 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_29.2.temp), !dbg !324 +// CHECK:STDOUT: call void @_CGeneric.OtherPackage.e43630e9a6c38c3f(ptr %.loc7_29.2.temp, ptr %.loc7_20.1.temp, ptr %.loc7_28.1.temp), !dbg !324 +// CHECK:STDOUT: call void @"_CSelfDestruct.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %.loc7_29.2.temp), !dbg !324 +// CHECK:STDOUT: call void @"_CSelfDestruct.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %.loc7_28.1.temp), !dbg !323 +// CHECK:STDOUT: call void @"_CSelfDestruct.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %.loc7_20.1.temp), !dbg !322 +// CHECK:STDOUT: ret void, !dbg !325 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_CMake.OtherPackage(ptr sret({ i32 })) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !214 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !326 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !216 +// CHECK:STDOUT: ret void, !dbg !328 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.a15077f50f3020c3:core.Destroy.Core"(ptr %self) #0 !dbg !218 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !330 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !220 +// CHECK:STDOUT: ret void, !dbg !332 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %self) #0 !dbg !222 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !334 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !224 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !336 +// CHECK:STDOUT: ret void, !dbg !336 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.a15077f50f3020c3:core.Destroy.Core"(ptr %self) #0 !dbg !338 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !340 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.a15077f50f3020c3:core.Destroy.Core"(ptr %self) #0 !dbg !342 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.a15077f50f3020c3:core.Destroy.Core"(ptr %self), !dbg !344 +// CHECK:STDOUT: ret void, !dbg !344 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %self) #0 !dbg !346 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !348 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %self) #0 !dbg !350 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %self), !dbg !352 +// CHECK:STDOUT: ret void, !dbg !352 // 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 @_CGeneric.OtherPackage.e43630e9a6c38c3f(ptr sret({ i32 }) %return, ptr %v1, ptr %v2) #0 !dbg !226 { -// CHECK:STDOUT: %temp = alloca { i32 }, align 4, !dbg !234 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp), !dbg !234 -// CHECK:STDOUT: call void @"_COp.Vector.OwningPackage:MulWith.84588f41d61dafba.Core"(ptr %temp, ptr %v2, i32 2), !dbg !234 -// CHECK:STDOUT: call void @"_COp.Vector.OwningPackage:AddWith.f941828044620367.Core"(ptr %return, ptr %v1, ptr %temp), !dbg !233 -// CHECK:STDOUT: call void @"_COp.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %temp), !dbg !234 -// CHECK:STDOUT: ret void, !dbg !235 +// CHECK:STDOUT: define linkonce_odr void @_CGeneric.OtherPackage.e43630e9a6c38c3f(ptr sret({ i32 }) %return, ptr %v1, ptr %v2) #0 !dbg !354 { +// CHECK:STDOUT: %temp = alloca { i32 }, align 4, !dbg !362 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp), !dbg !362 +// CHECK:STDOUT: call void @"_COp.Vector.OwningPackage:MulWith.84588f41d61dafba.Core"(ptr %temp, ptr %v2, i32 2), !dbg !362 +// CHECK:STDOUT: call void @"_COp.Vector.OwningPackage:AddWith.f941828044620367.Core"(ptr %return, ptr %v1, ptr %temp), !dbg !361 +// CHECK:STDOUT: call void @"_CSelfDestruct.d9636b4f2fbd64a7:core.Destroy.Core"(ptr %temp), !dbg !362 +// CHECK:STDOUT: ret void, !dbg !363 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @"_COp.Vector.OwningPackage:MulWith.84588f41d61dafba.Core"(ptr sret({ i32 }), ptr, i32) @@ -799,13 +1127,13 @@ fn CallGeneric() { // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives // CHECK:STDOUT: uselistorder ptr @_CMake.OtherPackage, { 1, 0 } -// CHECK:STDOUT: uselistorder ptr @"_COp.d9636b4f2fbd64a7:core.Destroy.Core", { 0, 3, 2, 1 } +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.d9636b4f2fbd64a7:core.Destroy.Core", { 0, 3, 2, 1 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 0, 3, 2, 1 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!208} +// CHECK:STDOUT: !llvm.dbg.cu = !{!320} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} @@ -818,33 +1146,49 @@ fn CallGeneric() { // CHECK:STDOUT: !39 = !DISubroutineType(types: !38) // CHECK:STDOUT: !40 = !{null, !7} // CHECK:STDOUT: !41 = !DISubroutineType(types: !40) -// CHECK:STDOUT: !108 = !{null} -// CHECK:STDOUT: !109 = !DISubroutineType(types: !108) -// CHECK:STDOUT: !193 = !DIFile(filename: "generic_different_package.carbon", directory: "") -// CHECK:STDOUT: !207 = !DIFile(filename: "indirect_different_package_via_generic_in_different_package.carbon", directory: "") -// CHECK:STDOUT: !208 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !207, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !209 = distinct !DISubprogram(name: "CallGeneric", linkageName: "_CCallGeneric.OtherPackage", scope: null, file: !207, line: 5, type: !109, spFlags: DISPFlagDefinition, unit: !208) -// CHECK:STDOUT: !210 = !DILocation(line: 7, column: 15, scope: !209) -// CHECK:STDOUT: !211 = !DILocation(line: 7, column: 23, scope: !209) -// CHECK:STDOUT: !212 = !DILocation(line: 7, column: 3, scope: !209) -// CHECK:STDOUT: !213 = !DILocation(line: 5, column: 1, scope: !209) -// CHECK:STDOUT: !214 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !207, line: 7, type: !39, spFlags: DISPFlagDefinition, unit: !208, retainedNodes: !217) -// CHECK:STDOUT: !215 = !DILocalVariable(arg: 1, scope: !214, type: !6) -// CHECK:STDOUT: !216 = !DILocation(line: 7, column: 3, scope: !214) -// CHECK:STDOUT: !217 = !{!215} -// CHECK:STDOUT: !218 = distinct !DISubprogram(name: "Op", linkageName: "_COp.a15077f50f3020c3:core.Destroy.Core", scope: null, file: !207, line: 7, type: !41, spFlags: DISPFlagDefinition, unit: !208, retainedNodes: !221) -// CHECK:STDOUT: !219 = !DILocalVariable(arg: 1, scope: !218, type: !7) -// CHECK:STDOUT: !220 = !DILocation(line: 7, column: 3, scope: !218) -// CHECK:STDOUT: !221 = !{!219} -// CHECK:STDOUT: !222 = distinct !DISubprogram(name: "Op", linkageName: "_COp.d9636b4f2fbd64a7:core.Destroy.Core", scope: null, file: !207, line: 7, type: !41, spFlags: DISPFlagDefinition, unit: !208, retainedNodes: !225) -// CHECK:STDOUT: !223 = !DILocalVariable(arg: 1, scope: !222, type: !7) -// CHECK:STDOUT: !224 = !DILocation(line: 7, column: 3, scope: !222) -// CHECK:STDOUT: !225 = !{!223} -// CHECK:STDOUT: !226 = distinct !DISubprogram(name: "Generic", linkageName: "_CGeneric.OtherPackage.e43630e9a6c38c3f", scope: null, file: !193, line: 5, type: !9, spFlags: DISPFlagDefinition, unit: !208, retainedNodes: !236) -// CHECK:STDOUT: !227 = !DILocalVariable(arg: 1, scope: !226, type: !7) -// CHECK:STDOUT: !228 = !DILocalVariable(arg: 2, scope: !226, type: !7) -// CHECK:STDOUT: !233 = !DILocation(line: 6, column: 10, scope: !226) -// CHECK:STDOUT: !234 = !DILocation(line: 6, column: 15, scope: !226) -// CHECK:STDOUT: !235 = !DILocation(line: 6, column: 3, scope: !226) -// CHECK:STDOUT: !236 = !{!227, !228} +// CHECK:STDOUT: !156 = !{null} +// CHECK:STDOUT: !157 = !DISubroutineType(types: !156) +// CHECK:STDOUT: !289 = !DIFile(filename: "generic_different_package.carbon", directory: "") +// CHECK:STDOUT: !319 = !DIFile(filename: "indirect_different_package_via_generic_in_different_package.carbon", directory: "") +// CHECK:STDOUT: !320 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !319, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !321 = distinct !DISubprogram(name: "CallGeneric", linkageName: "_CCallGeneric.OtherPackage", scope: null, file: !319, line: 5, type: !157, spFlags: DISPFlagDefinition, unit: !320) +// CHECK:STDOUT: !322 = !DILocation(line: 7, column: 15, scope: !321) +// CHECK:STDOUT: !323 = !DILocation(line: 7, column: 23, scope: !321) +// CHECK:STDOUT: !324 = !DILocation(line: 7, column: 3, scope: !321) +// CHECK:STDOUT: !325 = !DILocation(line: 5, column: 1, scope: !321) +// CHECK:STDOUT: !326 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !319, line: 7, type: !39, spFlags: DISPFlagDefinition, unit: !320, retainedNodes: !329) +// CHECK:STDOUT: !327 = !DILocalVariable(arg: 1, scope: !326, type: !6) +// CHECK:STDOUT: !328 = !DILocation(line: 7, column: 3, scope: !326) +// CHECK:STDOUT: !329 = !{!327} +// CHECK:STDOUT: !330 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !319, line: 7, type: !39, spFlags: DISPFlagDefinition, unit: !320, retainedNodes: !333) +// CHECK:STDOUT: !331 = !DILocalVariable(arg: 1, scope: !330, type: !6) +// CHECK:STDOUT: !332 = !DILocation(line: 7, column: 3, scope: !330) +// CHECK:STDOUT: !333 = !{!331} +// CHECK:STDOUT: !334 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !319, line: 7, type: !39, spFlags: DISPFlagDefinition, unit: !320, retainedNodes: !337) +// CHECK:STDOUT: !335 = !DILocalVariable(arg: 1, scope: !334, type: !6) +// CHECK:STDOUT: !336 = !DILocation(line: 7, column: 3, scope: !334) +// CHECK:STDOUT: !337 = !{!335} +// CHECK:STDOUT: !338 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.a15077f50f3020c3:core.Destroy.Core", scope: null, file: !319, line: 7, type: !41, spFlags: DISPFlagDefinition, unit: !320, retainedNodes: !341) +// CHECK:STDOUT: !339 = !DILocalVariable(arg: 1, scope: !338, type: !7) +// CHECK:STDOUT: !340 = !DILocation(line: 7, column: 3, scope: !338) +// CHECK:STDOUT: !341 = !{!339} +// CHECK:STDOUT: !342 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.a15077f50f3020c3:core.Destroy.Core", scope: null, file: !319, line: 7, type: !41, spFlags: DISPFlagDefinition, unit: !320, retainedNodes: !345) +// CHECK:STDOUT: !343 = !DILocalVariable(arg: 1, scope: !342, type: !7) +// CHECK:STDOUT: !344 = !DILocation(line: 7, column: 3, scope: !342) +// CHECK:STDOUT: !345 = !{!343} +// CHECK:STDOUT: !346 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.d9636b4f2fbd64a7:core.Destroy.Core", scope: null, file: !319, line: 7, type: !41, spFlags: DISPFlagDefinition, unit: !320, retainedNodes: !349) +// CHECK:STDOUT: !347 = !DILocalVariable(arg: 1, scope: !346, type: !7) +// CHECK:STDOUT: !348 = !DILocation(line: 7, column: 3, scope: !346) +// CHECK:STDOUT: !349 = !{!347} +// CHECK:STDOUT: !350 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.d9636b4f2fbd64a7:core.Destroy.Core", scope: null, file: !319, line: 7, type: !41, spFlags: DISPFlagDefinition, unit: !320, retainedNodes: !353) +// CHECK:STDOUT: !351 = !DILocalVariable(arg: 1, scope: !350, type: !7) +// CHECK:STDOUT: !352 = !DILocation(line: 7, column: 3, scope: !350) +// CHECK:STDOUT: !353 = !{!351} +// CHECK:STDOUT: !354 = distinct !DISubprogram(name: "Generic", linkageName: "_CGeneric.OtherPackage.e43630e9a6c38c3f", scope: null, file: !289, line: 5, type: !9, spFlags: DISPFlagDefinition, unit: !320, retainedNodes: !364) +// CHECK:STDOUT: !355 = !DILocalVariable(arg: 1, scope: !354, type: !7) +// CHECK:STDOUT: !356 = !DILocalVariable(arg: 2, scope: !354, type: !7) +// CHECK:STDOUT: !361 = !DILocation(line: 6, column: 10, scope: !354) +// CHECK:STDOUT: !362 = !DILocation(line: 6, column: 15, scope: !354) +// CHECK:STDOUT: !363 = !DILocation(line: 6, column: 3, scope: !354) +// CHECK:STDOUT: !364 = !{!355, !356} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/pointer/address_of_field.carbon b/toolchain/lower/testdata/pointer/address_of_field.carbon index 73e5c081d76d..a76b618a6525 100644 --- a/toolchain/lower/testdata/pointer/address_of_field.carbon +++ b/toolchain/lower/testdata/pointer/address_of_field.carbon @@ -35,22 +35,42 @@ fn F() { // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %s.var, ptr align 4 @struct.631.loc16_3, i64 8, i1 false), !dbg !29 // CHECK:STDOUT: %.loc17.b = getelementptr inbounds nuw { i32, i32 }, ptr %s.var, i32 0, i32 1, !dbg !32 // CHECK:STDOUT: call void @_CG.Main(ptr %.loc17.b), !dbg !34 -// CHECK:STDOUT: call void @"_COp.b4c762864cd9a02b:core.Destroy.Core"(ptr %s.var), !dbg !29 +// CHECK:STDOUT: call void @"_CSelfDestruct.b4c762864cd9a02b:core.Destroy.Core"(ptr %s.var), !dbg !29 // CHECK:STDOUT: ret void, !dbg !35 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !36 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !36 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !38 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.b4c762864cd9a02b:core.Destroy.Core"(ptr %self) #0 !dbg !40 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !40 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !42 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !44 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !46 +// CHECK:STDOUT: ret void, !dbg !46 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.b4c762864cd9a02b:core.Destroy.Core"(ptr %self) #0 !dbg !48 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !50 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.b4c762864cd9a02b:core.Destroy.Core"(ptr %self) #0 !dbg !52 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.b4c762864cd9a02b:core.Destroy.Core"(ptr %self), !dbg !54 +// CHECK:STDOUT: ret void, !dbg !54 +// 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: @@ -81,12 +101,24 @@ fn F() { // CHECK:STDOUT: !32 = !DILocation(line: 17, column: 6, scope: !28) // CHECK:STDOUT: !34 = !DILocation(line: 17, column: 3, scope: !28) // CHECK:STDOUT: !35 = !DILocation(line: 15, column: 1, scope: !28) -// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 16, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !39) +// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !18, line: 16, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !39) // CHECK:STDOUT: !37 = !DILocalVariable(arg: 1, scope: !36, type: !20) // CHECK:STDOUT: !38 = !DILocation(line: 16, column: 3, scope: !36) // CHECK:STDOUT: !39 = !{!37} -// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "Op", linkageName: "_COp.b4c762864cd9a02b:core.Destroy.Core", scope: null, file: !18, line: 16, type: !23, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !43) -// CHECK:STDOUT: !41 = !DILocalVariable(arg: 1, scope: !40, type: !21) +// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 16, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !43) +// CHECK:STDOUT: !41 = !DILocalVariable(arg: 1, scope: !40, type: !20) // CHECK:STDOUT: !42 = !DILocation(line: 16, column: 3, scope: !40) // CHECK:STDOUT: !43 = !{!41} +// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 16, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !47) +// CHECK:STDOUT: !45 = !DILocalVariable(arg: 1, scope: !44, type: !20) +// CHECK:STDOUT: !46 = !DILocation(line: 16, column: 3, scope: !44) +// CHECK:STDOUT: !47 = !{!45} +// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.b4c762864cd9a02b:core.Destroy.Core", scope: null, file: !18, line: 16, type: !23, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !51) +// CHECK:STDOUT: !49 = !DILocalVariable(arg: 1, scope: !48, type: !21) +// CHECK:STDOUT: !50 = !DILocation(line: 16, column: 3, scope: !48) +// CHECK:STDOUT: !51 = !{!49} +// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.b4c762864cd9a02b:core.Destroy.Core", scope: null, file: !18, line: 16, type: !23, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !55) +// CHECK:STDOUT: !53 = !DILocalVariable(arg: 1, scope: !52, type: !21) +// CHECK:STDOUT: !54 = !DILocation(line: 16, column: 3, scope: !52) +// CHECK:STDOUT: !55 = !{!53} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/pointer/address_of_unused.carbon b/toolchain/lower/testdata/pointer/address_of_unused.carbon index 228703cff432..b5248f1e6a02 100644 --- a/toolchain/lower/testdata/pointer/address_of_unused.carbon +++ b/toolchain/lower/testdata/pointer/address_of_unused.carbon @@ -25,16 +25,29 @@ fn F() { // CHECK:STDOUT: %n.var = alloca i32, align 4, !dbg !26 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %n.var), !dbg !26 // CHECK:STDOUT: store i32 0, ptr %n.var, align 4, !dbg !26 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %n.var), !dbg !26 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %n.var), !dbg !26 // CHECK:STDOUT: ret void, !dbg !30 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !31 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !31 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !33 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !35 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !37 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !39 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !41 +// CHECK:STDOUT: ret void, !dbg !41 +// 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: @@ -56,8 +69,16 @@ fn F() { // CHECK:STDOUT: !25 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !18, line: 13, type: !22, spFlags: DISPFlagDefinition, unit: !19) // CHECK:STDOUT: !26 = !DILocation(line: 14, column: 3, scope: !25) // CHECK:STDOUT: !30 = !DILocation(line: 13, column: 1, scope: !25) -// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 14, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !34) +// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !18, line: 14, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !34) // CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !31, type: !20) // CHECK:STDOUT: !33 = !DILocation(line: 14, column: 3, scope: !31) // CHECK:STDOUT: !34 = !{!32} +// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 14, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !38) +// CHECK:STDOUT: !36 = !DILocalVariable(arg: 1, scope: !35, type: !20) +// CHECK:STDOUT: !37 = !DILocation(line: 14, column: 3, scope: !35) +// CHECK:STDOUT: !38 = !{!36} +// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 14, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !42) +// CHECK:STDOUT: !40 = !DILocalVariable(arg: 1, scope: !39, type: !20) +// CHECK:STDOUT: !41 = !DILocation(line: 14, column: 3, scope: !39) +// CHECK:STDOUT: !42 = !{!40} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/pointer/basic.carbon b/toolchain/lower/testdata/pointer/basic.carbon index d69a5f66495b..d7500eee30d4 100644 --- a/toolchain/lower/testdata/pointer/basic.carbon +++ b/toolchain/lower/testdata/pointer/basic.carbon @@ -37,16 +37,29 @@ fn F() -> i32 { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %n.var), !dbg !40 // CHECK:STDOUT: store i32 0, ptr %n.var, align 4, !dbg !40 // CHECK:STDOUT: %G.call = call i32 @_CG.Main(ptr %n.var), !dbg !44 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %n.var), !dbg !40 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %n.var), !dbg !40 // CHECK:STDOUT: ret i32 %G.call, !dbg !45 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !46 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !46 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !48 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !50 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !52 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !54 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !56 +// CHECK:STDOUT: ret void, !dbg !56 +// 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: @@ -77,8 +90,16 @@ fn F() -> i32 { // CHECK:STDOUT: !40 = !DILocation(line: 18, column: 3, scope: !37) // CHECK:STDOUT: !44 = !DILocation(line: 19, column: 10, scope: !37) // CHECK:STDOUT: !45 = !DILocation(line: 19, column: 3, scope: !37) -// CHECK:STDOUT: !46 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 18, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !49) +// CHECK:STDOUT: !46 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !18, line: 18, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !49) // CHECK:STDOUT: !47 = !DILocalVariable(arg: 1, scope: !46, type: !20) // CHECK:STDOUT: !48 = !DILocation(line: 18, column: 3, scope: !46) // CHECK:STDOUT: !49 = !{!47} +// CHECK:STDOUT: !50 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 18, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !53) +// CHECK:STDOUT: !51 = !DILocalVariable(arg: 1, scope: !50, type: !20) +// CHECK:STDOUT: !52 = !DILocation(line: 18, column: 3, scope: !50) +// CHECK:STDOUT: !53 = !{!51} +// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 18, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !57) +// CHECK:STDOUT: !55 = !DILocalVariable(arg: 1, scope: !54, type: !20) +// CHECK:STDOUT: !56 = !DILocation(line: 18, column: 3, scope: !54) +// CHECK:STDOUT: !57 = !{!55} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/pointer/pointer_to_pointer.carbon b/toolchain/lower/testdata/pointer/pointer_to_pointer.carbon index 3c699381159d..eddee131d250 100644 --- a/toolchain/lower/testdata/pointer/pointer_to_pointer.carbon +++ b/toolchain/lower/testdata/pointer/pointer_to_pointer.carbon @@ -22,28 +22,44 @@ fn F(p: i32**) -> i32 { // CHECK:STDOUT: source_filename = "pointer_to_pointer.carbon" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CF.Main(ptr %p) #0 !dbg !24 { +// CHECK:STDOUT: define i32 @_CF.Main(ptr %p) #0 !dbg !26 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca ptr, align 8, !dbg !29 -// CHECK:STDOUT: %b.var = alloca ptr, align 8, !dbg !32 -// CHECK:STDOUT: %c.var = alloca ptr, align 8, !dbg !36 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !29 -// CHECK:STDOUT: store ptr %p, ptr %_.var, align 8, !dbg !29 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %b.var), !dbg !32 -// CHECK:STDOUT: %.loc15_17.2 = load ptr, ptr %p, align 8, !dbg !34 -// CHECK:STDOUT: store ptr %.loc15_17.2, ptr %b.var, align 8, !dbg !32 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !36 -// CHECK:STDOUT: store ptr %b.var, ptr %c.var, align 8, !dbg !36 -// CHECK:STDOUT: %.loc17_12 = load ptr, ptr %c.var, align 8, !dbg !40 -// CHECK:STDOUT: %.loc17_11.2 = load ptr, ptr %.loc17_12, align 8, !dbg !41 -// CHECK:STDOUT: %.loc17_10.2 = load i32, ptr %.loc17_11.2, align 4, !dbg !42 -// CHECK:STDOUT: ret i32 %.loc17_10.2, !dbg !43 +// CHECK:STDOUT: %_.var = alloca ptr, align 8, !dbg !31 +// CHECK:STDOUT: %b.var = alloca ptr, align 8, !dbg !34 +// CHECK:STDOUT: %c.var = alloca ptr, align 8, !dbg !38 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !31 +// CHECK:STDOUT: store ptr %p, ptr %_.var, align 8, !dbg !31 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %b.var), !dbg !34 +// CHECK:STDOUT: %.loc15_17.2 = load ptr, ptr %p, align 8, !dbg !36 +// CHECK:STDOUT: store ptr %.loc15_17.2, ptr %b.var, align 8, !dbg !34 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !38 +// CHECK:STDOUT: store ptr %b.var, ptr %c.var, align 8, !dbg !38 +// CHECK:STDOUT: %.loc17_12 = load ptr, ptr %c.var, align 8, !dbg !42 +// CHECK:STDOUT: %.loc17_11.2 = load ptr, ptr %.loc17_12, align 8, !dbg !43 +// CHECK:STDOUT: %.loc17_10.2 = load i32, ptr %.loc17_11.2, align 4, !dbg !44 +// CHECK:STDOUT: call void @"_CSelfDestruct.c36b1dfc1a44331c:core.Destroy.Core"(ptr %c.var), !dbg !38 +// CHECK:STDOUT: call void @"_CSelfDestruct.d088c7eb746488be:core.Destroy.Core"(ptr %b.var), !dbg !34 +// CHECK:STDOUT: call void @"_CSelfDestruct.c36b1dfc1a44331c:core.Destroy.Core"(ptr %_.var), !dbg !31 +// CHECK:STDOUT: ret i32 %.loc17_10.2, !dbg !45 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.c36b1dfc1a44331c:core.Destroy.Core"(ptr %self) #0 !dbg !47 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !49 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.d088c7eb746488be:core.Destroy.Core"(ptr %self) #0 !dbg !51 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !53 // 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: ; uselistorder directives +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.c36b1dfc1a44331c:core.Destroy.Core", { 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 2, 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -60,15 +76,25 @@ fn F(p: i32**) -> i32 { // CHECK:STDOUT: !21 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) // CHECK:STDOUT: !22 = !{!20, !21} // CHECK:STDOUT: !23 = !DISubroutineType(types: !22) -// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !18, line: 13, type: !23, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !44) -// CHECK:STDOUT: !25 = !DILocalVariable(arg: 1, scope: !24, type: !21) -// CHECK:STDOUT: !29 = !DILocation(line: 14, column: 3, scope: !24) -// CHECK:STDOUT: !32 = !DILocation(line: 15, column: 3, scope: !24) -// CHECK:STDOUT: !34 = !DILocation(line: 15, column: 17, scope: !24) -// CHECK:STDOUT: !36 = !DILocation(line: 16, column: 3, scope: !24) -// CHECK:STDOUT: !40 = !DILocation(line: 17, column: 12, scope: !24) -// CHECK:STDOUT: !41 = !DILocation(line: 17, column: 11, scope: !24) -// CHECK:STDOUT: !42 = !DILocation(line: 17, column: 10, scope: !24) -// CHECK:STDOUT: !43 = !DILocation(line: 17, column: 3, scope: !24) -// CHECK:STDOUT: !44 = !{!25} +// CHECK:STDOUT: !24 = !{null, !21} +// CHECK:STDOUT: !25 = !DISubroutineType(types: !24) +// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !18, line: 13, type: !23, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !46) +// CHECK:STDOUT: !27 = !DILocalVariable(arg: 1, scope: !26, type: !21) +// CHECK:STDOUT: !31 = !DILocation(line: 14, column: 3, scope: !26) +// CHECK:STDOUT: !34 = !DILocation(line: 15, column: 3, scope: !26) +// CHECK:STDOUT: !36 = !DILocation(line: 15, column: 17, scope: !26) +// CHECK:STDOUT: !38 = !DILocation(line: 16, column: 3, scope: !26) +// CHECK:STDOUT: !42 = !DILocation(line: 17, column: 12, scope: !26) +// CHECK:STDOUT: !43 = !DILocation(line: 17, column: 11, scope: !26) +// CHECK:STDOUT: !44 = !DILocation(line: 17, column: 10, scope: !26) +// CHECK:STDOUT: !45 = !DILocation(line: 17, column: 3, scope: !26) +// CHECK:STDOUT: !46 = !{!27} +// CHECK:STDOUT: !47 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.c36b1dfc1a44331c:core.Destroy.Core", scope: null, file: !18, line: 16, type: !25, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !50) +// CHECK:STDOUT: !48 = !DILocalVariable(arg: 1, scope: !47, type: !21) +// CHECK:STDOUT: !49 = !DILocation(line: 16, column: 3, scope: !47) +// CHECK:STDOUT: !50 = !{!48} +// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.d088c7eb746488be:core.Destroy.Core", scope: null, file: !18, line: 15, type: !25, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !54) +// CHECK:STDOUT: !52 = !DILocalVariable(arg: 1, scope: !51, type: !21) +// CHECK:STDOUT: !53 = !DILocation(line: 15, column: 3, scope: !51) +// CHECK:STDOUT: !54 = !{!52} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/primitives/numeric_literals.carbon b/toolchain/lower/testdata/primitives/numeric_literals.carbon index 6a5c5d2f20ba..a20cbc3bb8b0 100644 --- a/toolchain/lower/testdata/primitives/numeric_literals.carbon +++ b/toolchain/lower/testdata/primitives/numeric_literals.carbon @@ -55,35 +55,75 @@ fn F() { // CHECK:STDOUT: %.loc29_3.15.array.index = getelementptr inbounds [6 x double], ptr %_.var.loc22, i32 0, i64 4, !dbg !47 // CHECK:STDOUT: %.loc29_3.18.array.index = getelementptr inbounds [6 x double], ptr %_.var.loc22, i32 0, i64 5, !dbg !47 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %_.var.loc22, ptr align 8 @array.69b.loc22_3, i64 48, i1 false), !dbg !46 -// CHECK:STDOUT: call void @"_COp.2891f36f5aa8bde4:core.Destroy.Core"(ptr %_.var.loc22), !dbg !46 -// CHECK:STDOUT: call void @"_COp.88cc3346b7991af5:core.Destroy.Core"(ptr %_.var.loc16), !dbg !43 +// CHECK:STDOUT: call void @"_CSelfDestruct.2891f36f5aa8bde4:core.Destroy.Core"(ptr %_.var.loc22), !dbg !46 +// CHECK:STDOUT: call void @"_CSelfDestruct.88cc3346b7991af5:core.Destroy.Core"(ptr %_.var.loc16), !dbg !43 // CHECK:STDOUT: ret void, !dbg !49 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.dc14d4dd21801791:core.Destroy.Core"(ptr %self) #0 !dbg !50 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.7945ecba5c505fc0:core.Destroy.Core"(ptr %self) #0 !dbg !50 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !52 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.2891f36f5aa8bde4:core.Destroy.Core"(ptr %self) #0 !dbg !54 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.dc14d4dd21801791:core.Destroy.Core"(ptr %self) #0 !dbg !54 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !56 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !58 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.dc14d4dd21801791:core.Destroy.Core"(ptr %self) #0 !dbg !58 { // CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.dc14d4dd21801791:core.Destroy.Core"(ptr %self), !dbg !60 // CHECK:STDOUT: ret void, !dbg !60 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.88cc3346b7991af5:core.Destroy.Core"(ptr %self) #0 !dbg !62 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.2891f36f5aa8bde4:core.Destroy.Core"(ptr %self) #0 !dbg !62 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !64 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.2891f36f5aa8bde4:core.Destroy.Core"(ptr %self) #0 !dbg !66 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.2891f36f5aa8bde4:core.Destroy.Core"(ptr %self), !dbg !68 +// CHECK:STDOUT: ret void, !dbg !68 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !70 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !72 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !74 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !76 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !78 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !80 +// CHECK:STDOUT: ret void, !dbg !80 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.88cc3346b7991af5:core.Destroy.Core"(ptr %self) #0 !dbg !82 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !84 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.88cc3346b7991af5:core.Destroy.Core"(ptr %self) #0 !dbg !86 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.88cc3346b7991af5:core.Destroy.Core"(ptr %self), !dbg !88 +// CHECK:STDOUT: ret void, !dbg !88 +// 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: @@ -118,20 +158,44 @@ fn F() { // CHECK:STDOUT: !46 = !DILocation(line: 22, column: 3, scope: !42) // CHECK:STDOUT: !47 = !DILocation(line: 22, column: 26, scope: !42) // CHECK:STDOUT: !49 = !DILocation(line: 13, column: 1, scope: !42) -// CHECK:STDOUT: !50 = distinct !DISubprogram(name: "Op", linkageName: "_COp.dc14d4dd21801791:core.Destroy.Core", scope: null, file: !32, line: 22, type: !39, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !53) +// CHECK:STDOUT: !50 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.7945ecba5c505fc0:core.Destroy.Core", scope: null, file: !32, line: 22, type: !39, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !53) // CHECK:STDOUT: !51 = !DILocalVariable(arg: 1, scope: !50, type: !37) // CHECK:STDOUT: !52 = !DILocation(line: 22, column: 3, scope: !50) // CHECK:STDOUT: !53 = !{!51} -// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "Op", linkageName: "_COp.2891f36f5aa8bde4:core.Destroy.Core", scope: null, file: !32, line: 22, type: !39, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !57) +// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.dc14d4dd21801791:core.Destroy.Core", scope: null, file: !32, line: 22, type: !39, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !57) // CHECK:STDOUT: !55 = !DILocalVariable(arg: 1, scope: !54, type: !37) // CHECK:STDOUT: !56 = !DILocation(line: 22, column: 3, scope: !54) // CHECK:STDOUT: !57 = !{!55} -// CHECK:STDOUT: !58 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !32, line: 16, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !61) -// CHECK:STDOUT: !59 = !DILocalVariable(arg: 1, scope: !58, type: !34) -// CHECK:STDOUT: !60 = !DILocation(line: 16, column: 3, scope: !58) +// CHECK:STDOUT: !58 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.dc14d4dd21801791:core.Destroy.Core", scope: null, file: !32, line: 22, type: !39, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !61) +// CHECK:STDOUT: !59 = !DILocalVariable(arg: 1, scope: !58, type: !37) +// CHECK:STDOUT: !60 = !DILocation(line: 22, column: 3, scope: !58) // CHECK:STDOUT: !61 = !{!59} -// CHECK:STDOUT: !62 = distinct !DISubprogram(name: "Op", linkageName: "_COp.88cc3346b7991af5:core.Destroy.Core", scope: null, file: !32, line: 16, type: !39, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !65) +// CHECK:STDOUT: !62 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.2891f36f5aa8bde4:core.Destroy.Core", scope: null, file: !32, line: 22, type: !39, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !65) // CHECK:STDOUT: !63 = !DILocalVariable(arg: 1, scope: !62, type: !37) -// CHECK:STDOUT: !64 = !DILocation(line: 16, column: 3, scope: !62) +// CHECK:STDOUT: !64 = !DILocation(line: 22, column: 3, scope: !62) // CHECK:STDOUT: !65 = !{!63} +// CHECK:STDOUT: !66 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.2891f36f5aa8bde4:core.Destroy.Core", scope: null, file: !32, line: 22, type: !39, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !69) +// CHECK:STDOUT: !67 = !DILocalVariable(arg: 1, scope: !66, type: !37) +// CHECK:STDOUT: !68 = !DILocation(line: 22, column: 3, scope: !66) +// CHECK:STDOUT: !69 = !{!67} +// CHECK:STDOUT: !70 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !32, line: 16, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !73) +// CHECK:STDOUT: !71 = !DILocalVariable(arg: 1, scope: !70, type: !34) +// CHECK:STDOUT: !72 = !DILocation(line: 16, column: 3, scope: !70) +// CHECK:STDOUT: !73 = !{!71} +// CHECK:STDOUT: !74 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !32, line: 16, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !77) +// CHECK:STDOUT: !75 = !DILocalVariable(arg: 1, scope: !74, type: !34) +// CHECK:STDOUT: !76 = !DILocation(line: 16, column: 3, scope: !74) +// CHECK:STDOUT: !77 = !{!75} +// CHECK:STDOUT: !78 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !32, line: 16, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !81) +// CHECK:STDOUT: !79 = !DILocalVariable(arg: 1, scope: !78, type: !34) +// CHECK:STDOUT: !80 = !DILocation(line: 16, column: 3, scope: !78) +// CHECK:STDOUT: !81 = !{!79} +// CHECK:STDOUT: !82 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.88cc3346b7991af5:core.Destroy.Core", scope: null, file: !32, line: 16, type: !39, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !85) +// CHECK:STDOUT: !83 = !DILocalVariable(arg: 1, scope: !82, type: !37) +// CHECK:STDOUT: !84 = !DILocation(line: 16, column: 3, scope: !82) +// CHECK:STDOUT: !85 = !{!83} +// CHECK:STDOUT: !86 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.88cc3346b7991af5:core.Destroy.Core", scope: null, file: !32, line: 16, type: !39, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !89) +// CHECK:STDOUT: !87 = !DILocalVariable(arg: 1, scope: !86, type: !37) +// CHECK:STDOUT: !88 = !DILocation(line: 16, column: 3, scope: !86) +// CHECK:STDOUT: !89 = !{!87} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/primitives/optional.carbon b/toolchain/lower/testdata/primitives/optional.carbon index 50700c01e1cf..d6134f05f569 100644 --- a/toolchain/lower/testdata/primitives/optional.carbon +++ b/toolchain/lower/testdata/primitives/optional.carbon @@ -62,309 +62,425 @@ fn F(c: Core.Optional(C*)) -> Core.Optional(C*) { // CHECK:STDOUT: source_filename = "convert.carbon" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !16 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.d088c7eb746488be:core.Destroy.Core"(ptr %self) #0 !dbg !17 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !18 +// CHECK:STDOUT: ret void, !dbg !19 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CConvert.Main(ptr sret(<{ i32, i1 }>) %return, ptr %o) #0 !dbg !20 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !21 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Optional.HasValue.call = call i1 @_CHasValue.Optional.Core.6e9e957697159b53(ptr %o), !dbg !25 -// CHECK:STDOUT: br i1 %Optional.HasValue.call, label %if.then, label %if.else, !dbg !26 +// CHECK:STDOUT: ret void, !dbg !23 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !25 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !27 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !29 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !31 +// CHECK:STDOUT: ret void, !dbg !31 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define void @_CConvert.Main(ptr sret(<{ i32, i1 }>) %return, ptr %o) #0 !dbg !33 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %Optional.HasValue.call = call i1 @_CHasValue.Optional.Core.6e9e957697159b53(ptr %o), !dbg !38 +// CHECK:STDOUT: br i1 %Optional.HasValue.call, label %if.then, label %if.else, !dbg !39 // CHECK:STDOUT: // CHECK:STDOUT: if.then: ; preds = %entry -// CHECK:STDOUT: %Optional.Get.call = call ptr @_CGet.Optional.Core.6e9e957697159b53(ptr %o), !dbg !27 -// CHECK:STDOUT: %.loc5_12.2 = load i32, ptr %Optional.Get.call, align 4, !dbg !28 -// CHECK:STDOUT: call void @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.2c8515f957621a03"(ptr %return, i32 %.loc5_12.2), !dbg !29 -// CHECK:STDOUT: ret void, !dbg !29 +// CHECK:STDOUT: %Optional.Get.call = call ptr @_CGet.Optional.Core.6e9e957697159b53(ptr %o), !dbg !40 +// CHECK:STDOUT: %.loc5_12.2 = load i32, ptr %Optional.Get.call, align 4, !dbg !41 +// CHECK:STDOUT: call void @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.9eebcd25770b8843"(ptr %return, i32 %.loc5_12.2), !dbg !42 +// CHECK:STDOUT: ret void, !dbg !42 // CHECK:STDOUT: // CHECK:STDOUT: if.else: ; preds = %entry -// CHECK:STDOUT: call void @_CNone.Optional.Core.a7c05288d2ce28bc(ptr %return), !dbg !32 -// CHECK:STDOUT: ret void, !dbg !35 +// CHECK:STDOUT: call void @_CNone.Optional.Core.3530343734a6ea27(ptr %return), !dbg !45 +// CHECK:STDOUT: ret void, !dbg !48 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CAddOrRemoveConst.Main(i32 %a, i32 %b) #0 !dbg !37 { +// CHECK:STDOUT: define void @_CAddOrRemoveConst.Main(i32 %a, i32 %b) #0 !dbg !50 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var.loc11 = alloca <{ i32, i1 }>, align 4, !dbg !42 -// CHECK:STDOUT: %_.var.loc12 = alloca <{ i32, i1 }>, align 4, !dbg !45 -// CHECK:STDOUT: %_.var.loc13 = alloca <{ i32, i1 }>, align 4, !dbg !48 -// CHECK:STDOUT: %_.var.loc14 = alloca <{ i32, i1 }>, align 4, !dbg !51 -// CHECK:STDOUT: %_.var.loc15 = alloca <{ i32, i1 }>, align 4, !dbg !54 -// CHECK:STDOUT: %_.var.loc16 = alloca <{ i32, i1 }>, align 4, !dbg !57 -// CHECK:STDOUT: %_.var.loc17 = alloca <{ i32, i1 }>, align 4, !dbg !60 -// CHECK:STDOUT: %_.var.loc18 = alloca <{ i32, i1 }>, align 4, !dbg !63 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc11), !dbg !42 -// CHECK:STDOUT: call void @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.2c8515f957621a03"(ptr %_.var.loc11, i32 %a), !dbg !42 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc12), !dbg !45 -// CHECK:STDOUT: call void @"_CConvert.ef077c075a7e2432:ImplicitAs.ad22d1bbc0605210.Core.15c528b24e490d8c"(ptr %_.var.loc12, i32 %a), !dbg !45 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc13), !dbg !48 -// CHECK:STDOUT: call void @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.d95984c7180aeb4a"(ptr %_.var.loc13, i32 %a), !dbg !48 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc14), !dbg !51 -// CHECK:STDOUT: call void @"_CConvert.ef077c075a7e2432:ImplicitAs.ad22d1bbc0605210.Core.be8876292851c59c"(ptr %_.var.loc14, i32 %a), !dbg !51 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc15), !dbg !54 -// CHECK:STDOUT: call void @"_CConvert.c18e58a62bf591fb:ImplicitAs.eb057aa32837c84e.Core.15c528b24e490d8c"(ptr %_.var.loc15, i32 %b), !dbg !54 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc16), !dbg !57 -// CHECK:STDOUT: call void @"_CConvert.c18e58a62bf591fb:ImplicitAs.eb057aa32837c84e.Core.d0ddc3b29d345eab"(ptr %_.var.loc16, i32 %b), !dbg !57 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc17), !dbg !60 -// CHECK:STDOUT: call void @"_CConvert.c18e58a62bf591fb:ImplicitAs.eb057aa32837c84e.Core.be8876292851c59c"(ptr %_.var.loc17, i32 %b), !dbg !60 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc18), !dbg !63 -// CHECK:STDOUT: call void @"_CConvert.c18e58a62bf591fb:ImplicitAs.eb057aa32837c84e.Core.cab41ae108d94b57"(ptr %_.var.loc18, i32 %b), !dbg !63 -// CHECK:STDOUT: call void @"_COp.1e0fe05ed6c3473c:core.Destroy.Core"(ptr %_.var.loc18), !dbg !63 -// CHECK:STDOUT: call void @"_COp.7cc5a7ef6d8fa23a:core.Destroy.Core"(ptr %_.var.loc17), !dbg !60 -// CHECK:STDOUT: call void @"_COp.15cf99574c02f955:core.Destroy.Core"(ptr %_.var.loc16), !dbg !57 -// CHECK:STDOUT: call void @"_COp.6f767e5f4e4ccb02:core.Destroy.Core"(ptr %_.var.loc15), !dbg !54 -// CHECK:STDOUT: call void @"_COp.1e0fe05ed6c3473c:core.Destroy.Core"(ptr %_.var.loc14), !dbg !51 -// CHECK:STDOUT: call void @"_COp.7cc5a7ef6d8fa23a:core.Destroy.Core"(ptr %_.var.loc13), !dbg !48 -// CHECK:STDOUT: call void @"_COp.15cf99574c02f955:core.Destroy.Core"(ptr %_.var.loc12), !dbg !45 -// CHECK:STDOUT: call void @"_COp.6f767e5f4e4ccb02:core.Destroy.Core"(ptr %_.var.loc11), !dbg !42 -// CHECK:STDOUT: ret void, !dbg !66 +// CHECK:STDOUT: %_.var.loc11 = alloca <{ i32, i1 }>, align 4, !dbg !55 +// CHECK:STDOUT: %_.var.loc12 = alloca <{ i32, i1 }>, align 4, !dbg !58 +// CHECK:STDOUT: %_.var.loc13 = alloca <{ i32, i1 }>, align 4, !dbg !61 +// CHECK:STDOUT: %_.var.loc14 = alloca <{ i32, i1 }>, align 4, !dbg !64 +// CHECK:STDOUT: %_.var.loc15 = alloca <{ i32, i1 }>, align 4, !dbg !67 +// CHECK:STDOUT: %_.var.loc16 = alloca <{ i32, i1 }>, align 4, !dbg !70 +// CHECK:STDOUT: %_.var.loc17 = alloca <{ i32, i1 }>, align 4, !dbg !73 +// CHECK:STDOUT: %_.var.loc18 = alloca <{ i32, i1 }>, align 4, !dbg !76 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc11), !dbg !55 +// CHECK:STDOUT: call void @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.9eebcd25770b8843"(ptr %_.var.loc11, i32 %a), !dbg !55 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc12), !dbg !58 +// CHECK:STDOUT: call void @"_CConvert.ef077c075a7e2432:ImplicitAs.ad22d1bbc0605210.Core.27a2d1ef6dd68465"(ptr %_.var.loc12, i32 %a), !dbg !58 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc13), !dbg !61 +// CHECK:STDOUT: call void @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.5cec6441aa655224"(ptr %_.var.loc13, i32 %a), !dbg !61 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc14), !dbg !64 +// CHECK:STDOUT: call void @"_CConvert.ef077c075a7e2432:ImplicitAs.ad22d1bbc0605210.Core.bc0e935618dc3a96"(ptr %_.var.loc14, i32 %a), !dbg !64 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc15), !dbg !67 +// CHECK:STDOUT: call void @"_CConvert.c18e58a62bf591fb:ImplicitAs.eb057aa32837c84e.Core.27a2d1ef6dd68465"(ptr %_.var.loc15, i32 %b), !dbg !67 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc16), !dbg !70 +// CHECK:STDOUT: call void @"_CConvert.c18e58a62bf591fb:ImplicitAs.eb057aa32837c84e.Core.9f04190beae22821"(ptr %_.var.loc16, i32 %b), !dbg !70 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc17), !dbg !73 +// CHECK:STDOUT: call void @"_CConvert.c18e58a62bf591fb:ImplicitAs.eb057aa32837c84e.Core.bc0e935618dc3a96"(ptr %_.var.loc17, i32 %b), !dbg !73 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc18), !dbg !76 +// CHECK:STDOUT: call void @"_CConvert.c18e58a62bf591fb:ImplicitAs.eb057aa32837c84e.Core.342679e541375c77"(ptr %_.var.loc18, i32 %b), !dbg !76 +// CHECK:STDOUT: call void @"_CSelfDestruct.b90699303d3716f5:core.Destroy.Core"(ptr %_.var.loc18), !dbg !76 +// CHECK:STDOUT: call void @"_CSelfDestruct.60848ede08716e91:core.Destroy.Core"(ptr %_.var.loc17), !dbg !73 +// CHECK:STDOUT: call void @"_CSelfDestruct.65ac38c7f841b05c:core.Destroy.Core"(ptr %_.var.loc16), !dbg !70 +// CHECK:STDOUT: call void @"_CSelfDestruct.0acefe5e4ad33694:core.Destroy.Core"(ptr %_.var.loc15), !dbg !67 +// CHECK:STDOUT: call void @"_CSelfDestruct.b90699303d3716f5:core.Destroy.Core"(ptr %_.var.loc14), !dbg !64 +// CHECK:STDOUT: call void @"_CSelfDestruct.60848ede08716e91:core.Destroy.Core"(ptr %_.var.loc13), !dbg !61 +// CHECK:STDOUT: call void @"_CSelfDestruct.65ac38c7f841b05c:core.Destroy.Core"(ptr %_.var.loc12), !dbg !58 +// CHECK:STDOUT: call void @"_CSelfDestruct.0acefe5e4ad33694:core.Destroy.Core"(ptr %_.var.loc11), !dbg !55 +// CHECK:STDOUT: ret void, !dbg !79 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.6a8d754fe1453eab:core.Destroy.Core"(ptr %self) #0 !dbg !68 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.6a8d754fe1453eab:core.Destroy.Core"(ptr %self) #0 !dbg !81 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !70 +// CHECK:STDOUT: ret void, !dbg !83 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.96a347e4ca9c10e1:core.Destroy.Core"(ptr %self) #0 !dbg !72 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6a8d754fe1453eab:core.Destroy.Core"(ptr %self) #0 !dbg !85 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !74 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.6a8d754fe1453eab:core.Destroy.Core"(ptr %self), !dbg !87 +// CHECK:STDOUT: ret void, !dbg !87 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.dd541bd84ebf9286:core.Destroy.Core"(ptr %self) #0 !dbg !76 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.96a347e4ca9c10e1:core.Destroy.Core"(ptr %self) #0 !dbg !89 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !78 +// CHECK:STDOUT: ret void, !dbg !91 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.0676a9513e51e534:core.Destroy.Core"(ptr %self) #0 !dbg !80 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.96a347e4ca9c10e1:core.Destroy.Core"(ptr %self) #0 !dbg !93 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !82 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.96a347e4ca9c10e1:core.Destroy.Core"(ptr %self), !dbg !95 +// CHECK:STDOUT: ret void, !dbg !95 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.433638333cc50b5f:core.Destroy.Core"(ptr %self) #0 !dbg !84 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.ef6922493c513f55:core.Destroy.Core"(ptr %self) #0 !dbg !97 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !86 +// CHECK:STDOUT: ret void, !dbg !99 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.7cc5a7ef6d8fa23a:core.Destroy.Core"(ptr %self) #0 !dbg !88 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.ef6922493c513f55:core.Destroy.Core"(ptr %self) #0 !dbg !101 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !90 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.ef6922493c513f55:core.Destroy.Core"(ptr %self), !dbg !103 +// CHECK:STDOUT: ret void, !dbg !103 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.1e0fe05ed6c3473c:core.Destroy.Core"(ptr %self) #0 !dbg !92 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.48e0adf639fe7af4:core.Destroy.Core"(ptr %self) #0 !dbg !105 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !94 +// CHECK:STDOUT: ret void, !dbg !107 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.1d6a7672bf2f14c6:core.Destroy.Core"(ptr %self) #0 !dbg !96 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.6854f843fd23bc45:core.Destroy.Core"(ptr %self) #0 !dbg !109 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !98 +// CHECK:STDOUT: ret void, !dbg !111 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.c1dffdf44e31057b:core.Destroy.Core"(ptr %self) #0 !dbg !100 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6854f843fd23bc45:core.Destroy.Core"(ptr %self) #0 !dbg !113 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !102 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.6854f843fd23bc45:core.Destroy.Core"(ptr %self), !dbg !115 +// CHECK:STDOUT: ret void, !dbg !115 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.271d79a4f33942b3:core.Destroy.Core"(ptr %self) #0 !dbg !104 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.d81dc56afe745c8e:core.Destroy.Core"(ptr %self) #0 !dbg !117 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !106 +// CHECK:STDOUT: ret void, !dbg !119 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.99ef0e8e0bc11e6b:core.Destroy.Core"(ptr %self) #0 !dbg !108 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.d81dc56afe745c8e:core.Destroy.Core"(ptr %self) #0 !dbg !121 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !110 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.d81dc56afe745c8e:core.Destroy.Core"(ptr %self), !dbg !123 +// CHECK:STDOUT: ret void, !dbg !123 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.6f767e5f4e4ccb02:core.Destroy.Core"(ptr %self) #0 !dbg !112 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.60848ede08716e91:core.Destroy.Core"(ptr %self) #0 !dbg !125 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !114 +// CHECK:STDOUT: ret void, !dbg !127 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.15cf99574c02f955:core.Destroy.Core"(ptr %self) #0 !dbg !116 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.60848ede08716e91:core.Destroy.Core"(ptr %self) #0 !dbg !129 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !118 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.60848ede08716e91:core.Destroy.Core"(ptr %self), !dbg !131 +// CHECK:STDOUT: ret void, !dbg !131 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.6e9e957697159b53(ptr %self) #0 !dbg !121 { -// CHECK:STDOUT: %1 = call i1 @"_CHas.e8f8f92d3d08d149:OptionalStorage.Core.84588f41d61dafba"(ptr %self), !dbg !127 -// CHECK:STDOUT: ret i1 %1, !dbg !128 +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.b90699303d3716f5:core.Destroy.Core"(ptr %self) #0 !dbg !133 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !135 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CGet.Optional.Core.6e9e957697159b53(ptr %self) #0 !dbg !130 { -// CHECK:STDOUT: %1 = call ptr @"_CGet.e8f8f92d3d08d149:OptionalStorage.Core.84588f41d61dafba"(ptr %self), !dbg !136 -// CHECK:STDOUT: ret ptr %1, !dbg !137 +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.b90699303d3716f5:core.Destroy.Core"(ptr %self) #0 !dbg !137 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.b90699303d3716f5:core.Destroy.Core"(ptr %self), !dbg !139 +// CHECK:STDOUT: ret void, !dbg !139 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.2c8515f957621a03"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !139 { -// CHECK:STDOUT: call void @"_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.a7c05288d2ce28bc"(ptr %return, i32 %self), !dbg !144 -// CHECK:STDOUT: ret void, !dbg !145 +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.1d6a7672bf2f14c6:core.Destroy.Core"(ptr %self) #0 !dbg !141 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !143 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CNone.Optional.Core.a7c05288d2ce28bc(ptr sret(<{ i32, i1 }>) %return) #0 !dbg !147 { -// CHECK:STDOUT: call void @"_CNone.74becf39533834ee:OptionalStorage.Core.32f25dd70ba991cc"(ptr %return), !dbg !150 +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.1d6a7672bf2f14c6:core.Destroy.Core"(ptr %self) #0 !dbg !145 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.1d6a7672bf2f14c6:core.Destroy.Core"(ptr %self), !dbg !147 +// CHECK:STDOUT: ret void, !dbg !147 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.51569357b34b54dc:core.Destroy.Core"(ptr %self) #0 !dbg !149 { +// CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !151 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.51569357b34b54dc:core.Destroy.Core"(ptr %self) #0 !dbg !153 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.51569357b34b54dc:core.Destroy.Core"(ptr %self), !dbg !155 +// CHECK:STDOUT: ret void, !dbg !155 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f6a63055ea5a1824:core.Destroy.Core"(ptr %self) #0 !dbg !157 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !159 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f6a63055ea5a1824:core.Destroy.Core"(ptr %self) #0 !dbg !161 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f6a63055ea5a1824:core.Destroy.Core"(ptr %self), !dbg !163 +// CHECK:STDOUT: ret void, !dbg !163 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.9f155f365c9e4267:core.Destroy.Core"(ptr %self) #0 !dbg !165 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !167 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.9f155f365c9e4267:core.Destroy.Core"(ptr %self) #0 !dbg !169 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.9f155f365c9e4267:core.Destroy.Core"(ptr %self), !dbg !171 +// CHECK:STDOUT: ret void, !dbg !171 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.0acefe5e4ad33694:core.Destroy.Core"(ptr %self) #0 !dbg !173 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !175 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.0acefe5e4ad33694:core.Destroy.Core"(ptr %self) #0 !dbg !177 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.0acefe5e4ad33694:core.Destroy.Core"(ptr %self), !dbg !179 +// CHECK:STDOUT: ret void, !dbg !179 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.65ac38c7f841b05c:core.Destroy.Core"(ptr %self) #0 !dbg !181 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !183 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.65ac38c7f841b05c:core.Destroy.Core"(ptr %self) #0 !dbg !185 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.65ac38c7f841b05c:core.Destroy.Core"(ptr %self), !dbg !187 +// CHECK:STDOUT: ret void, !dbg !187 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.6e9e957697159b53(ptr %self) #0 !dbg !189 { +// CHECK:STDOUT: %1 = call i1 @"_CHas.e8f8f92d3d08d149:OptionalStorage.Core.84588f41d61dafba"(ptr %self), !dbg !195 +// CHECK:STDOUT: ret i1 %1, !dbg !196 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr ptr @_CGet.Optional.Core.6e9e957697159b53(ptr %self) #0 !dbg !198 { +// CHECK:STDOUT: %1 = call ptr @"_CGet.e8f8f92d3d08d149:OptionalStorage.Core.84588f41d61dafba"(ptr %self), !dbg !204 +// CHECK:STDOUT: ret ptr %1, !dbg !205 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.9eebcd25770b8843"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !207 { +// CHECK:STDOUT: call void @"_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.3530343734a6ea27"(ptr %return, i32 %self), !dbg !212 +// CHECK:STDOUT: ret void, !dbg !213 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @_CNone.Optional.Core.3530343734a6ea27(ptr sret(<{ i32, i1 }>) %return) #0 !dbg !215 { +// CHECK:STDOUT: call void @"_CNone.74becf39533834ee:OptionalStorage.Core.d4057e3ae48c02cc"(ptr %return), !dbg !218 +// CHECK:STDOUT: ret void, !dbg !219 +// 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 @"_CConvert.ef077c075a7e2432:ImplicitAs.ad22d1bbc0605210.Core.15c528b24e490d8c"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !153 { -// CHECK:STDOUT: call void @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.2c8515f957621a03"(ptr %return, i32 %self), !dbg !158 -// CHECK:STDOUT: ret void, !dbg !159 +// CHECK:STDOUT: define linkonce_odr void @"_CConvert.ef077c075a7e2432:ImplicitAs.ad22d1bbc0605210.Core.27a2d1ef6dd68465"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !221 { +// CHECK:STDOUT: call void @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.9eebcd25770b8843"(ptr %return, i32 %self), !dbg !226 +// CHECK:STDOUT: ret void, !dbg !227 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.d95984c7180aeb4a"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !161 { -// CHECK:STDOUT: call void @"_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.dddd9c9f66eb3452"(ptr %return, i32 %self), !dbg !166 -// CHECK:STDOUT: ret void, !dbg !167 +// CHECK:STDOUT: define linkonce_odr void @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.5cec6441aa655224"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !229 { +// CHECK:STDOUT: call void @"_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.dd5a2a74150e1fc7"(ptr %return, i32 %self), !dbg !234 +// CHECK:STDOUT: ret void, !dbg !235 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CConvert.ef077c075a7e2432:ImplicitAs.ad22d1bbc0605210.Core.be8876292851c59c"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !169 { -// CHECK:STDOUT: call void @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.d95984c7180aeb4a"(ptr %return, i32 %self), !dbg !174 -// CHECK:STDOUT: ret void, !dbg !175 +// CHECK:STDOUT: define linkonce_odr void @"_CConvert.ef077c075a7e2432:ImplicitAs.ad22d1bbc0605210.Core.bc0e935618dc3a96"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !237 { +// CHECK:STDOUT: call void @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.5cec6441aa655224"(ptr %return, i32 %self), !dbg !242 +// CHECK:STDOUT: ret void, !dbg !243 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CConvert.c18e58a62bf591fb:ImplicitAs.eb057aa32837c84e.Core.15c528b24e490d8c"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !177 { -// CHECK:STDOUT: call void @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.2c8515f957621a03"(ptr %return, i32 %self), !dbg !183 -// CHECK:STDOUT: ret void, !dbg !184 +// CHECK:STDOUT: define linkonce_odr void @"_CConvert.c18e58a62bf591fb:ImplicitAs.eb057aa32837c84e.Core.27a2d1ef6dd68465"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !245 { +// CHECK:STDOUT: call void @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.9eebcd25770b8843"(ptr %return, i32 %self), !dbg !251 +// CHECK:STDOUT: ret void, !dbg !252 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CConvert.c18e58a62bf591fb:ImplicitAs.eb057aa32837c84e.Core.d0ddc3b29d345eab"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !186 { -// CHECK:STDOUT: call void @"_CConvert.ef077c075a7e2432:ImplicitAs.ad22d1bbc0605210.Core.15c528b24e490d8c"(ptr %return, i32 %self), !dbg !192 -// CHECK:STDOUT: ret void, !dbg !193 +// CHECK:STDOUT: define linkonce_odr void @"_CConvert.c18e58a62bf591fb:ImplicitAs.eb057aa32837c84e.Core.9f04190beae22821"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !254 { +// CHECK:STDOUT: call void @"_CConvert.ef077c075a7e2432:ImplicitAs.ad22d1bbc0605210.Core.27a2d1ef6dd68465"(ptr %return, i32 %self), !dbg !260 +// CHECK:STDOUT: ret void, !dbg !261 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CConvert.c18e58a62bf591fb:ImplicitAs.eb057aa32837c84e.Core.be8876292851c59c"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !195 { -// CHECK:STDOUT: call void @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.d95984c7180aeb4a"(ptr %return, i32 %self), !dbg !201 -// CHECK:STDOUT: ret void, !dbg !202 +// CHECK:STDOUT: define linkonce_odr void @"_CConvert.c18e58a62bf591fb:ImplicitAs.eb057aa32837c84e.Core.bc0e935618dc3a96"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !263 { +// CHECK:STDOUT: call void @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.5cec6441aa655224"(ptr %return, i32 %self), !dbg !269 +// CHECK:STDOUT: ret void, !dbg !270 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CConvert.c18e58a62bf591fb:ImplicitAs.eb057aa32837c84e.Core.cab41ae108d94b57"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !204 { -// CHECK:STDOUT: call void @"_CConvert.ef077c075a7e2432:ImplicitAs.ad22d1bbc0605210.Core.be8876292851c59c"(ptr %return, i32 %self), !dbg !210 -// CHECK:STDOUT: ret void, !dbg !211 +// CHECK:STDOUT: define linkonce_odr void @"_CConvert.c18e58a62bf591fb:ImplicitAs.eb057aa32837c84e.Core.342679e541375c77"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !272 { +// CHECK:STDOUT: call void @"_CConvert.ef077c075a7e2432:ImplicitAs.ad22d1bbc0605210.Core.bc0e935618dc3a96"(ptr %return, i32 %self), !dbg !278 +// CHECK:STDOUT: ret void, !dbg !279 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @"_CHas.e8f8f92d3d08d149:OptionalStorage.Core.84588f41d61dafba"(ptr %value) #0 !dbg !213 { -// CHECK:STDOUT: %1 = icmp eq ptr %value, null, !dbg !219 -// CHECK:STDOUT: %2 = xor i1 %1, true, !dbg !220 -// CHECK:STDOUT: ret i1 %2, !dbg !221 +// CHECK:STDOUT: define linkonce_odr i1 @"_CHas.e8f8f92d3d08d149:OptionalStorage.Core.84588f41d61dafba"(ptr %value) #0 !dbg !281 { +// CHECK:STDOUT: %1 = icmp eq ptr %value, null, !dbg !287 +// CHECK:STDOUT: %2 = xor i1 %1, true, !dbg !288 +// CHECK:STDOUT: ret i1 %2, !dbg !289 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CGet.e8f8f92d3d08d149:OptionalStorage.Core.84588f41d61dafba"(ptr %value) #0 !dbg !223 { -// CHECK:STDOUT: ret ptr %value, !dbg !229 +// CHECK:STDOUT: define linkonce_odr ptr @"_CGet.e8f8f92d3d08d149:OptionalStorage.Core.84588f41d61dafba"(ptr %value) #0 !dbg !291 { +// CHECK:STDOUT: ret ptr %value, !dbg !297 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.a7c05288d2ce28bc"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !231 { -// CHECK:STDOUT: call void @_CSome.Optional.Core.a7c05288d2ce28bc(ptr %return, i32 %self), !dbg !237 -// CHECK:STDOUT: ret void, !dbg !238 +// CHECK:STDOUT: define linkonce_odr void @"_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.3530343734a6ea27"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !299 { +// CHECK:STDOUT: call void @_CSome.Optional.Core.3530343734a6ea27(ptr %return, i32 %self), !dbg !305 +// CHECK:STDOUT: ret void, !dbg !306 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CNone.74becf39533834ee:OptionalStorage.Core.32f25dd70ba991cc"(ptr sret(<{ i32, i1 }>) %return) #0 !dbg !240 { -// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 1, !dbg !247 -// CHECK:STDOUT: store i8 0, ptr %has_value, align 1, !dbg !247 -// CHECK:STDOUT: ret void, !dbg !248 +// CHECK:STDOUT: define linkonce_odr void @"_CNone.74becf39533834ee:OptionalStorage.Core.d4057e3ae48c02cc"(ptr sret(<{ i32, i1 }>) %return) #0 !dbg !308 { +// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 1, !dbg !315 +// CHECK:STDOUT: store i8 0, ptr %has_value, align 1, !dbg !315 +// CHECK:STDOUT: ret void, !dbg !316 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.dddd9c9f66eb3452"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !249 { -// CHECK:STDOUT: %temp = alloca i32, align 4, !dbg !254 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp), !dbg !254 -// CHECK:STDOUT: %1 = call i32 @"_CConvert.ef077c075a7e2432:ImplicitAs.ad22d1bbc0605210.Core.ba7abeb9eee545e2"(i32 %self), !dbg !254 -// CHECK:STDOUT: store i32 %1, ptr %temp, align 4, !dbg !254 -// CHECK:STDOUT: %2 = load i32, ptr %temp, align 4, !dbg !254 -// CHECK:STDOUT: call void @_CSome.Optional.Core.0ba9b301f5e251fb(ptr %return, i32 %2), !dbg !255 -// CHECK:STDOUT: call void @"_COp.6a8d754fe1453eab:core.Destroy.Core"(ptr %temp), !dbg !254 -// CHECK:STDOUT: ret void, !dbg !256 +// CHECK:STDOUT: define linkonce_odr void @"_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.dd5a2a74150e1fc7"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !317 { +// CHECK:STDOUT: %temp = alloca i32, align 4, !dbg !322 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp), !dbg !322 +// CHECK:STDOUT: %1 = call i32 @"_CConvert.ef077c075a7e2432:ImplicitAs.ad22d1bbc0605210.Core.ba7abeb9eee545e2"(i32 %self), !dbg !322 +// CHECK:STDOUT: store i32 %1, ptr %temp, align 4, !dbg !322 +// CHECK:STDOUT: %2 = load i32, ptr %temp, align 4, !dbg !322 +// CHECK:STDOUT: call void @_CSome.Optional.Core.00b00ea46fa3b046(ptr %return, i32 %2), !dbg !323 +// CHECK:STDOUT: call void @"_CSelfDestruct.6a8d754fe1453eab:core.Destroy.Core"(ptr %temp), !dbg !322 +// CHECK:STDOUT: ret void, !dbg !324 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSome.Optional.Core.a7c05288d2ce28bc(ptr sret(<{ i32, i1 }>) %return, i32 %value) #0 !dbg !258 { -// CHECK:STDOUT: call void @"_CSome.74becf39533834ee:OptionalStorage.Core.32f25dd70ba991cc"(ptr %return, i32 %value), !dbg !263 -// CHECK:STDOUT: ret void, !dbg !264 +// CHECK:STDOUT: define linkonce_odr void @_CSome.Optional.Core.3530343734a6ea27(ptr sret(<{ i32, i1 }>) %return, i32 %value) #0 !dbg !326 { +// CHECK:STDOUT: call void @"_CSome.74becf39533834ee:OptionalStorage.Core.d4057e3ae48c02cc"(ptr %return, i32 %value), !dbg !331 +// CHECK:STDOUT: ret void, !dbg !332 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @"_CConvert.ef077c075a7e2432:ImplicitAs.ad22d1bbc0605210.Core.ba7abeb9eee545e2"(i32 %self) #0 !dbg !266 { -// CHECK:STDOUT: %1 = call i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044"(i32 %self), !dbg !271 -// CHECK:STDOUT: ret i32 %1, !dbg !274 +// CHECK:STDOUT: define linkonce_odr i32 @"_CConvert.ef077c075a7e2432:ImplicitAs.ad22d1bbc0605210.Core.ba7abeb9eee545e2"(i32 %self) #0 !dbg !334 { +// CHECK:STDOUT: %1 = call i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044"(i32 %self), !dbg !339 +// CHECK:STDOUT: ret i32 %1, !dbg !342 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSome.Optional.Core.0ba9b301f5e251fb(ptr sret(<{ i32, i1 }>) %return, i32 %value) #0 !dbg !276 { -// CHECK:STDOUT: call void @"_CSome.74becf39533834ee:OptionalStorage.Core.075be0912516882a"(ptr %return, i32 %value), !dbg !281 -// CHECK:STDOUT: ret void, !dbg !282 +// CHECK:STDOUT: define linkonce_odr void @_CSome.Optional.Core.00b00ea46fa3b046(ptr sret(<{ i32, i1 }>) %return, i32 %value) #0 !dbg !344 { +// CHECK:STDOUT: call void @"_CSome.74becf39533834ee:OptionalStorage.Core.cd77d7fbcb14a7c2"(ptr %return, i32 %value), !dbg !349 +// CHECK:STDOUT: ret void, !dbg !350 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CSome.74becf39533834ee:OptionalStorage.Core.32f25dd70ba991cc"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !284 { -// CHECK:STDOUT: %value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 0, !dbg !293 -// CHECK:STDOUT: store i32 %self, ptr %value, align 4, !dbg !293 -// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 1, !dbg !295 -// CHECK:STDOUT: store i8 1, ptr %has_value, align 1, !dbg !295 -// CHECK:STDOUT: ret void, !dbg !296 +// CHECK:STDOUT: define linkonce_odr void @"_CSome.74becf39533834ee:OptionalStorage.Core.d4057e3ae48c02cc"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !352 { +// CHECK:STDOUT: %value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 0, !dbg !361 +// CHECK:STDOUT: store i32 %self, ptr %value, align 4, !dbg !361 +// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 1, !dbg !363 +// CHECK:STDOUT: store i8 1, ptr %has_value, align 1, !dbg !363 +// CHECK:STDOUT: ret void, !dbg !364 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044"(i32 %self) #0 !dbg !299 { -// CHECK:STDOUT: %1 = call i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self), !dbg !304 -// CHECK:STDOUT: ret i32 %1, !dbg !306 +// CHECK:STDOUT: define linkonce_odr i32 @"_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044"(i32 %self) #0 !dbg !367 { +// CHECK:STDOUT: %1 = call i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self), !dbg !372 +// CHECK:STDOUT: ret i32 %1, !dbg !374 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CSome.74becf39533834ee:OptionalStorage.Core.075be0912516882a"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !308 { -// CHECK:STDOUT: %value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 0, !dbg !317 -// CHECK:STDOUT: %1 = call i32 @"_COp.a7c16f707f533a23:Copy.Core.4d6ceefeb7f772f4"(i32 %self), !dbg !318 -// CHECK:STDOUT: store i32 %1, ptr %value, align 4, !dbg !317 -// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 1, !dbg !319 -// CHECK:STDOUT: store i8 1, ptr %has_value, align 1, !dbg !319 -// CHECK:STDOUT: ret void, !dbg !320 +// CHECK:STDOUT: define linkonce_odr void @"_CSome.74becf39533834ee:OptionalStorage.Core.cd77d7fbcb14a7c2"(ptr sret(<{ i32, i1 }>) %return, i32 %self) #0 !dbg !376 { +// CHECK:STDOUT: %value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 0, !dbg !385 +// CHECK:STDOUT: %1 = call i32 @"_COp.a7c16f707f533a23:Copy.Core.4d6ceefeb7f772f4"(i32 %self), !dbg !386 +// CHECK:STDOUT: store i32 %1, ptr %value, align 4, !dbg !385 +// CHECK:STDOUT: %has_value = getelementptr inbounds nuw <{ i32, i1 }>, ptr %return, i32 0, i32 1, !dbg !387 +// CHECK:STDOUT: store i8 1, ptr %has_value, align 1, !dbg !387 +// CHECK:STDOUT: ret void, !dbg !388 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self) #0 !dbg !322 { -// CHECK:STDOUT: ret i32 %self, !dbg !328 +// CHECK:STDOUT: define linkonce_odr i32 @"_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8"(i32 %self) #0 !dbg !390 { +// CHECK:STDOUT: ret i32 %self, !dbg !396 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @"_COp.a7c16f707f533a23:Copy.Core.4d6ceefeb7f772f4"(i32 %self) #0 !dbg !331 { -// CHECK:STDOUT: ret i32 %self, !dbg !338 +// CHECK:STDOUT: define linkonce_odr i32 @"_COp.a7c16f707f533a23:Copy.Core.4d6ceefeb7f772f4"(i32 %self) #0 !dbg !399 { +// CHECK:STDOUT: ret i32 %self, !dbg !406 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives -// CHECK:STDOUT: uselistorder ptr @"_COp.7cc5a7ef6d8fa23a:core.Destroy.Core", { 1, 0 } -// CHECK:STDOUT: uselistorder ptr @"_COp.1e0fe05ed6c3473c:core.Destroy.Core", { 1, 0 } -// CHECK:STDOUT: uselistorder ptr @"_COp.6f767e5f4e4ccb02:core.Destroy.Core", { 1, 0 } -// CHECK:STDOUT: uselistorder ptr @"_COp.15cf99574c02f955:core.Destroy.Core", { 1, 0 } -// CHECK:STDOUT: uselistorder ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.2c8515f957621a03", { 0, 1, 3, 2 } +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.60848ede08716e91:core.Destroy.Core", { 1, 0 } +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.b90699303d3716f5:core.Destroy.Core", { 1, 0 } +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.0acefe5e4ad33694:core.Destroy.Core", { 1, 0 } +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.65ac38c7f841b05c:core.Destroy.Core", { 1, 0 } +// CHECK:STDOUT: uselistorder ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.9eebcd25770b8843", { 0, 1, 3, 2 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 0, 8, 7, 6, 5, 4, 3, 2, 1 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -378,222 +494,290 @@ fn F(c: Core.Optional(C*)) -> Core.Optional(C*) { // CHECK:STDOUT: !4 = !DIFile(filename: "convert.carbon", directory: "") // CHECK:STDOUT: !5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !4, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) // CHECK:STDOUT: !6 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !7 = !{null, !6} -// CHECK:STDOUT: !8 = !DISubroutineType(types: !7) -// CHECK:STDOUT: !9 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !10 = !{!9, !9} +// CHECK:STDOUT: !7 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !8 = !{null, !7} +// CHECK:STDOUT: !9 = !DISubroutineType(types: !8) +// CHECK:STDOUT: !10 = !{null, !6} // CHECK:STDOUT: !11 = !DISubroutineType(types: !10) -// CHECK:STDOUT: !12 = !{null, !6, !6} +// CHECK:STDOUT: !12 = !{!7, !7} // CHECK:STDOUT: !13 = !DISubroutineType(types: !12) -// CHECK:STDOUT: !14 = !{null, !9} +// CHECK:STDOUT: !14 = !{null, !6, !6} // CHECK:STDOUT: !15 = !DISubroutineType(types: !14) -// CHECK:STDOUT: !16 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 3, type: !8, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !19) -// CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !16, type: !6) -// CHECK:STDOUT: !18 = !DILocation(line: 3, column: 39, scope: !16) -// CHECK:STDOUT: !19 = !{!17} -// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.Main", scope: null, file: !4, line: 3, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !36) -// CHECK:STDOUT: !21 = !DILocalVariable(arg: 1, scope: !20, type: !9) -// CHECK:STDOUT: !25 = !DILocation(line: 4, column: 7, scope: !20) -// CHECK:STDOUT: !26 = !DILocation(line: 4, column: 6, scope: !20) -// CHECK:STDOUT: !27 = !DILocation(line: 5, column: 13, scope: !20) -// CHECK:STDOUT: !28 = !DILocation(line: 5, column: 12, scope: !20) -// CHECK:STDOUT: !29 = !DILocation(line: 5, column: 5, scope: !20) -// CHECK:STDOUT: !30 = !{!9, !6} -// CHECK:STDOUT: !31 = !DISubroutineType(types: !30) -// CHECK:STDOUT: !32 = !DILocation(line: 7, column: 10, scope: !20) -// CHECK:STDOUT: !33 = !{!9} -// CHECK:STDOUT: !34 = !DISubroutineType(types: !33) -// CHECK:STDOUT: !35 = !DILocation(line: 7, column: 3, scope: !20) -// CHECK:STDOUT: !36 = !{!21} -// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "AddOrRemoveConst", linkageName: "_CAddOrRemoveConst.Main", scope: null, file: !4, line: 10, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !67) -// CHECK:STDOUT: !38 = !DILocalVariable(arg: 1, scope: !37, type: !6) -// CHECK:STDOUT: !39 = !DILocalVariable(arg: 2, scope: !37, type: !6) -// CHECK:STDOUT: !42 = !DILocation(line: 11, column: 3, scope: !37) -// CHECK:STDOUT: !45 = !DILocation(line: 12, column: 3, scope: !37) -// CHECK:STDOUT: !48 = !DILocation(line: 13, column: 3, scope: !37) -// CHECK:STDOUT: !51 = !DILocation(line: 14, column: 3, scope: !37) -// CHECK:STDOUT: !54 = !DILocation(line: 15, column: 3, scope: !37) -// CHECK:STDOUT: !57 = !DILocation(line: 16, column: 3, scope: !37) -// CHECK:STDOUT: !60 = !DILocation(line: 17, column: 3, scope: !37) -// CHECK:STDOUT: !63 = !DILocation(line: 18, column: 3, scope: !37) -// CHECK:STDOUT: !66 = !DILocation(line: 10, column: 1, scope: !37) -// CHECK:STDOUT: !67 = !{!38, !39} -// CHECK:STDOUT: !68 = distinct !DISubprogram(name: "Op", linkageName: "_COp.6a8d754fe1453eab:core.Destroy.Core", scope: null, file: !4, line: 13, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !71) -// CHECK:STDOUT: !69 = !DILocalVariable(arg: 1, scope: !68, type: !9) -// CHECK:STDOUT: !70 = !DILocation(line: 13, column: 10, scope: !68) -// CHECK:STDOUT: !71 = !{!69} -// CHECK:STDOUT: !72 = distinct !DISubprogram(name: "Op", linkageName: "_COp.96a347e4ca9c10e1:core.Destroy.Core", scope: null, file: !4, line: 18, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !75) -// CHECK:STDOUT: !73 = !DILocalVariable(arg: 1, scope: !72, type: !9) -// CHECK:STDOUT: !74 = !DILocation(line: 18, column: 3, scope: !72) -// CHECK:STDOUT: !75 = !{!73} -// CHECK:STDOUT: !76 = distinct !DISubprogram(name: "Op", linkageName: "_COp.dd541bd84ebf9286:core.Destroy.Core", scope: null, file: !4, line: 18, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !79) -// CHECK:STDOUT: !77 = !DILocalVariable(arg: 1, scope: !76, type: !9) -// CHECK:STDOUT: !78 = !DILocation(line: 18, column: 3, scope: !76) -// CHECK:STDOUT: !79 = !{!77} -// CHECK:STDOUT: !80 = distinct !DISubprogram(name: "Op", linkageName: "_COp.0676a9513e51e534:core.Destroy.Core", scope: null, file: !4, line: 18, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !83) -// CHECK:STDOUT: !81 = !DILocalVariable(arg: 1, scope: !80, type: !9) -// CHECK:STDOUT: !82 = !DILocation(line: 18, column: 3, scope: !80) -// CHECK:STDOUT: !83 = !{!81} -// CHECK:STDOUT: !84 = distinct !DISubprogram(name: "Op", linkageName: "_COp.433638333cc50b5f:core.Destroy.Core", scope: null, file: !4, line: 18, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !87) -// CHECK:STDOUT: !85 = !DILocalVariable(arg: 1, scope: !84, type: !9) -// CHECK:STDOUT: !86 = !DILocation(line: 18, column: 3, scope: !84) -// CHECK:STDOUT: !87 = !{!85} -// CHECK:STDOUT: !88 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7cc5a7ef6d8fa23a:core.Destroy.Core", scope: null, file: !4, line: 18, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !91) -// CHECK:STDOUT: !89 = !DILocalVariable(arg: 1, scope: !88, type: !9) -// CHECK:STDOUT: !90 = !DILocation(line: 18, column: 3, scope: !88) -// CHECK:STDOUT: !91 = !{!89} -// CHECK:STDOUT: !92 = distinct !DISubprogram(name: "Op", linkageName: "_COp.1e0fe05ed6c3473c:core.Destroy.Core", scope: null, file: !4, line: 18, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !95) -// CHECK:STDOUT: !93 = !DILocalVariable(arg: 1, scope: !92, type: !9) -// CHECK:STDOUT: !94 = !DILocation(line: 18, column: 3, scope: !92) -// CHECK:STDOUT: !95 = !{!93} -// CHECK:STDOUT: !96 = distinct !DISubprogram(name: "Op", linkageName: "_COp.1d6a7672bf2f14c6:core.Destroy.Core", scope: null, file: !4, line: 16, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !99) -// CHECK:STDOUT: !97 = !DILocalVariable(arg: 1, scope: !96, type: !9) -// CHECK:STDOUT: !98 = !DILocation(line: 16, column: 3, scope: !96) -// CHECK:STDOUT: !99 = !{!97} -// CHECK:STDOUT: !100 = distinct !DISubprogram(name: "Op", linkageName: "_COp.c1dffdf44e31057b:core.Destroy.Core", scope: null, file: !4, line: 16, type: !8, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !103) -// CHECK:STDOUT: !101 = !DILocalVariable(arg: 1, scope: !100, type: !6) -// CHECK:STDOUT: !102 = !DILocation(line: 16, column: 3, scope: !100) -// CHECK:STDOUT: !103 = !{!101} -// CHECK:STDOUT: !104 = distinct !DISubprogram(name: "Op", linkageName: "_COp.271d79a4f33942b3:core.Destroy.Core", scope: null, file: !4, line: 16, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !107) -// CHECK:STDOUT: !105 = !DILocalVariable(arg: 1, scope: !104, type: !9) -// CHECK:STDOUT: !106 = !DILocation(line: 16, column: 3, scope: !104) -// CHECK:STDOUT: !107 = !{!105} -// CHECK:STDOUT: !108 = distinct !DISubprogram(name: "Op", linkageName: "_COp.99ef0e8e0bc11e6b:core.Destroy.Core", scope: null, file: !4, line: 16, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !111) -// CHECK:STDOUT: !109 = !DILocalVariable(arg: 1, scope: !108, type: !9) -// CHECK:STDOUT: !110 = !DILocation(line: 16, column: 3, scope: !108) -// CHECK:STDOUT: !111 = !{!109} -// CHECK:STDOUT: !112 = distinct !DISubprogram(name: "Op", linkageName: "_COp.6f767e5f4e4ccb02:core.Destroy.Core", scope: null, file: !4, line: 16, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !115) -// CHECK:STDOUT: !113 = !DILocalVariable(arg: 1, scope: !112, type: !9) -// CHECK:STDOUT: !114 = !DILocation(line: 16, column: 3, scope: !112) -// CHECK:STDOUT: !115 = !{!113} -// CHECK:STDOUT: !116 = distinct !DISubprogram(name: "Op", linkageName: "_COp.15cf99574c02f955:core.Destroy.Core", scope: null, file: !4, line: 16, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !119) -// CHECK:STDOUT: !117 = !DILocalVariable(arg: 1, scope: !116, type: !9) -// CHECK:STDOUT: !118 = !DILocation(line: 16, column: 3, scope: !116) -// CHECK:STDOUT: !119 = !{!117} -// CHECK:STDOUT: !120 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") -// CHECK:STDOUT: !121 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.6e9e957697159b53", scope: null, file: !120, line: 36, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !129) -// CHECK:STDOUT: !122 = !DILocalVariable(arg: 1, scope: !121, type: !9) -// CHECK:STDOUT: !127 = !DILocation(line: 37, column: 12, scope: !121) -// CHECK:STDOUT: !128 = !DILocation(line: 37, column: 5, scope: !121) -// CHECK:STDOUT: !129 = !{!122} -// CHECK:STDOUT: !130 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.6e9e957697159b53", scope: null, file: !120, line: 39, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !138) -// CHECK:STDOUT: !131 = !DILocalVariable(arg: 1, scope: !130, type: !9) -// CHECK:STDOUT: !136 = !DILocation(line: 40, column: 12, scope: !130) -// CHECK:STDOUT: !137 = !DILocation(line: 40, column: 5, scope: !130) -// CHECK:STDOUT: !138 = !{!131} -// CHECK:STDOUT: !139 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.2c8515f957621a03", scope: null, file: !120, line: 105, type: !31, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !146) -// CHECK:STDOUT: !140 = !DILocalVariable(arg: 1, scope: !139, type: !6) -// CHECK:STDOUT: !144 = !DILocation(line: 106, column: 12, scope: !139) -// CHECK:STDOUT: !145 = !DILocation(line: 106, column: 5, scope: !139) -// CHECK:STDOUT: !146 = !{!140} -// CHECK:STDOUT: !147 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.a7c05288d2ce28bc", scope: null, file: !120, line: 30, type: !34, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !150 = !DILocation(line: 31, column: 12, scope: !147) -// CHECK:STDOUT: !151 = !DILocation(line: 31, column: 5, scope: !147) -// CHECK:STDOUT: !152 = !DIFile(filename: "{{.*}}/prelude/operators/as.carbon", directory: "") -// CHECK:STDOUT: !153 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.ef077c075a7e2432:ImplicitAs.ad22d1bbc0605210.Core.15c528b24e490d8c", scope: null, file: !152, line: 43, type: !31, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !160) +// CHECK:STDOUT: !16 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") +// CHECK:STDOUT: !17 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.d088c7eb746488be:core.Destroy.Core", scope: null, file: !16, line: 164, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !20) +// CHECK:STDOUT: !18 = !DILocalVariable(arg: 1, scope: !17, type: !7) +// CHECK:STDOUT: !19 = !DILocation(line: 164, column: 19, scope: !17) +// CHECK:STDOUT: !20 = !{!18} +// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !4, line: 3, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !24) +// CHECK:STDOUT: !22 = !DILocalVariable(arg: 1, scope: !21, type: !6) +// CHECK:STDOUT: !23 = !DILocation(line: 3, column: 39, scope: !21) +// CHECK:STDOUT: !24 = !{!22} +// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 3, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !28) +// CHECK:STDOUT: !26 = !DILocalVariable(arg: 1, scope: !25, type: !6) +// CHECK:STDOUT: !27 = !DILocation(line: 3, column: 39, scope: !25) +// CHECK:STDOUT: !28 = !{!26} +// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 3, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !32) +// CHECK:STDOUT: !30 = !DILocalVariable(arg: 1, scope: !29, type: !6) +// CHECK:STDOUT: !31 = !DILocation(line: 3, column: 39, scope: !29) +// CHECK:STDOUT: !32 = !{!30} +// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.Main", scope: null, file: !4, line: 3, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !49) +// CHECK:STDOUT: !34 = !DILocalVariable(arg: 1, scope: !33, type: !7) +// CHECK:STDOUT: !38 = !DILocation(line: 4, column: 7, scope: !33) +// CHECK:STDOUT: !39 = !DILocation(line: 4, column: 6, scope: !33) +// CHECK:STDOUT: !40 = !DILocation(line: 5, column: 13, scope: !33) +// CHECK:STDOUT: !41 = !DILocation(line: 5, column: 12, scope: !33) +// CHECK:STDOUT: !42 = !DILocation(line: 5, column: 5, scope: !33) +// CHECK:STDOUT: !43 = !{!7, !6} +// CHECK:STDOUT: !44 = !DISubroutineType(types: !43) +// CHECK:STDOUT: !45 = !DILocation(line: 7, column: 10, scope: !33) +// CHECK:STDOUT: !46 = !{!7} +// CHECK:STDOUT: !47 = !DISubroutineType(types: !46) +// CHECK:STDOUT: !48 = !DILocation(line: 7, column: 3, scope: !33) +// CHECK:STDOUT: !49 = !{!34} +// CHECK:STDOUT: !50 = distinct !DISubprogram(name: "AddOrRemoveConst", linkageName: "_CAddOrRemoveConst.Main", scope: null, file: !4, line: 10, type: !15, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !80) +// CHECK:STDOUT: !51 = !DILocalVariable(arg: 1, scope: !50, type: !6) +// CHECK:STDOUT: !52 = !DILocalVariable(arg: 2, scope: !50, type: !6) +// CHECK:STDOUT: !55 = !DILocation(line: 11, column: 3, scope: !50) +// CHECK:STDOUT: !58 = !DILocation(line: 12, column: 3, scope: !50) +// CHECK:STDOUT: !61 = !DILocation(line: 13, column: 3, scope: !50) +// CHECK:STDOUT: !64 = !DILocation(line: 14, column: 3, scope: !50) +// CHECK:STDOUT: !67 = !DILocation(line: 15, column: 3, scope: !50) +// CHECK:STDOUT: !70 = !DILocation(line: 16, column: 3, scope: !50) +// CHECK:STDOUT: !73 = !DILocation(line: 17, column: 3, scope: !50) +// CHECK:STDOUT: !76 = !DILocation(line: 18, column: 3, scope: !50) +// CHECK:STDOUT: !79 = !DILocation(line: 10, column: 1, scope: !50) +// CHECK:STDOUT: !80 = !{!51, !52} +// CHECK:STDOUT: !81 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.6a8d754fe1453eab:core.Destroy.Core", scope: null, file: !4, line: 13, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !84) +// CHECK:STDOUT: !82 = !DILocalVariable(arg: 1, scope: !81, type: !7) +// CHECK:STDOUT: !83 = !DILocation(line: 13, column: 10, scope: !81) +// CHECK:STDOUT: !84 = !{!82} +// CHECK:STDOUT: !85 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6a8d754fe1453eab:core.Destroy.Core", scope: null, file: !4, line: 13, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !88) +// CHECK:STDOUT: !86 = !DILocalVariable(arg: 1, scope: !85, type: !7) +// CHECK:STDOUT: !87 = !DILocation(line: 13, column: 10, scope: !85) +// CHECK:STDOUT: !88 = !{!86} +// CHECK:STDOUT: !89 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.96a347e4ca9c10e1:core.Destroy.Core", scope: null, file: !4, line: 18, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !92) +// CHECK:STDOUT: !90 = !DILocalVariable(arg: 1, scope: !89, type: !7) +// CHECK:STDOUT: !91 = !DILocation(line: 18, column: 3, scope: !89) +// CHECK:STDOUT: !92 = !{!90} +// CHECK:STDOUT: !93 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.96a347e4ca9c10e1:core.Destroy.Core", scope: null, file: !4, line: 18, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !96) +// CHECK:STDOUT: !94 = !DILocalVariable(arg: 1, scope: !93, type: !7) +// CHECK:STDOUT: !95 = !DILocation(line: 18, column: 3, scope: !93) +// CHECK:STDOUT: !96 = !{!94} +// CHECK:STDOUT: !97 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.ef6922493c513f55:core.Destroy.Core", scope: null, file: !4, line: 18, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !100) +// CHECK:STDOUT: !98 = !DILocalVariable(arg: 1, scope: !97, type: !7) +// CHECK:STDOUT: !99 = !DILocation(line: 18, column: 3, scope: !97) +// CHECK:STDOUT: !100 = !{!98} +// CHECK:STDOUT: !101 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.ef6922493c513f55:core.Destroy.Core", scope: null, file: !4, line: 18, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !104) +// CHECK:STDOUT: !102 = !DILocalVariable(arg: 1, scope: !101, type: !7) +// CHECK:STDOUT: !103 = !DILocation(line: 18, column: 3, scope: !101) +// CHECK:STDOUT: !104 = !{!102} +// CHECK:STDOUT: !105 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.48e0adf639fe7af4:core.Destroy.Core", scope: null, file: !4, line: 18, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !108) +// CHECK:STDOUT: !106 = !DILocalVariable(arg: 1, scope: !105, type: !7) +// CHECK:STDOUT: !107 = !DILocation(line: 18, column: 3, scope: !105) +// CHECK:STDOUT: !108 = !{!106} +// CHECK:STDOUT: !109 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.6854f843fd23bc45:core.Destroy.Core", scope: null, file: !4, line: 18, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !112) +// CHECK:STDOUT: !110 = !DILocalVariable(arg: 1, scope: !109, type: !7) +// CHECK:STDOUT: !111 = !DILocation(line: 18, column: 3, scope: !109) +// CHECK:STDOUT: !112 = !{!110} +// CHECK:STDOUT: !113 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6854f843fd23bc45:core.Destroy.Core", scope: null, file: !4, line: 18, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !116) +// CHECK:STDOUT: !114 = !DILocalVariable(arg: 1, scope: !113, type: !7) +// CHECK:STDOUT: !115 = !DILocation(line: 18, column: 3, scope: !113) +// CHECK:STDOUT: !116 = !{!114} +// CHECK:STDOUT: !117 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.d81dc56afe745c8e:core.Destroy.Core", scope: null, file: !4, line: 18, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !120) +// CHECK:STDOUT: !118 = !DILocalVariable(arg: 1, scope: !117, type: !7) +// CHECK:STDOUT: !119 = !DILocation(line: 18, column: 3, scope: !117) +// CHECK:STDOUT: !120 = !{!118} +// CHECK:STDOUT: !121 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.d81dc56afe745c8e:core.Destroy.Core", scope: null, file: !4, line: 18, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !124) +// CHECK:STDOUT: !122 = !DILocalVariable(arg: 1, scope: !121, type: !7) +// CHECK:STDOUT: !123 = !DILocation(line: 18, column: 3, scope: !121) +// CHECK:STDOUT: !124 = !{!122} +// CHECK:STDOUT: !125 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.60848ede08716e91:core.Destroy.Core", scope: null, file: !4, line: 18, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !128) +// CHECK:STDOUT: !126 = !DILocalVariable(arg: 1, scope: !125, type: !7) +// CHECK:STDOUT: !127 = !DILocation(line: 18, column: 3, scope: !125) +// CHECK:STDOUT: !128 = !{!126} +// CHECK:STDOUT: !129 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.60848ede08716e91:core.Destroy.Core", scope: null, file: !4, line: 18, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !132) +// CHECK:STDOUT: !130 = !DILocalVariable(arg: 1, scope: !129, type: !7) +// CHECK:STDOUT: !131 = !DILocation(line: 18, column: 3, scope: !129) +// CHECK:STDOUT: !132 = !{!130} +// CHECK:STDOUT: !133 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.b90699303d3716f5:core.Destroy.Core", scope: null, file: !4, line: 18, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !136) +// CHECK:STDOUT: !134 = !DILocalVariable(arg: 1, scope: !133, type: !7) +// CHECK:STDOUT: !135 = !DILocation(line: 18, column: 3, scope: !133) +// CHECK:STDOUT: !136 = !{!134} +// CHECK:STDOUT: !137 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.b90699303d3716f5:core.Destroy.Core", scope: null, file: !4, line: 18, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !140) +// CHECK:STDOUT: !138 = !DILocalVariable(arg: 1, scope: !137, type: !7) +// CHECK:STDOUT: !139 = !DILocation(line: 18, column: 3, scope: !137) +// CHECK:STDOUT: !140 = !{!138} +// CHECK:STDOUT: !141 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.1d6a7672bf2f14c6:core.Destroy.Core", scope: null, file: !4, line: 16, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !144) +// CHECK:STDOUT: !142 = !DILocalVariable(arg: 1, scope: !141, type: !7) +// CHECK:STDOUT: !143 = !DILocation(line: 16, column: 3, scope: !141) +// CHECK:STDOUT: !144 = !{!142} +// CHECK:STDOUT: !145 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.1d6a7672bf2f14c6:core.Destroy.Core", scope: null, file: !4, line: 16, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !148) +// CHECK:STDOUT: !146 = !DILocalVariable(arg: 1, scope: !145, type: !7) +// CHECK:STDOUT: !147 = !DILocation(line: 16, column: 3, scope: !145) +// CHECK:STDOUT: !148 = !{!146} +// CHECK:STDOUT: !149 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.51569357b34b54dc:core.Destroy.Core", scope: null, file: !4, line: 16, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !152) +// CHECK:STDOUT: !150 = !DILocalVariable(arg: 1, scope: !149, type: !6) +// CHECK:STDOUT: !151 = !DILocation(line: 16, column: 3, scope: !149) +// CHECK:STDOUT: !152 = !{!150} +// CHECK:STDOUT: !153 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.51569357b34b54dc:core.Destroy.Core", scope: null, file: !4, line: 16, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !156) // CHECK:STDOUT: !154 = !DILocalVariable(arg: 1, scope: !153, type: !6) -// CHECK:STDOUT: !158 = !DILocation(line: 43, column: 40, scope: !153) -// CHECK:STDOUT: !159 = !DILocation(line: 43, column: 33, scope: !153) -// CHECK:STDOUT: !160 = !{!154} -// CHECK:STDOUT: !161 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.d95984c7180aeb4a", scope: null, file: !120, line: 105, type: !31, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !168) -// CHECK:STDOUT: !162 = !DILocalVariable(arg: 1, scope: !161, type: !6) -// CHECK:STDOUT: !166 = !DILocation(line: 106, column: 12, scope: !161) -// CHECK:STDOUT: !167 = !DILocation(line: 106, column: 5, scope: !161) -// CHECK:STDOUT: !168 = !{!162} -// CHECK:STDOUT: !169 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.ef077c075a7e2432:ImplicitAs.ad22d1bbc0605210.Core.be8876292851c59c", scope: null, file: !152, line: 43, type: !31, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !176) -// CHECK:STDOUT: !170 = !DILocalVariable(arg: 1, scope: !169, type: !6) -// CHECK:STDOUT: !174 = !DILocation(line: 43, column: 40, scope: !169) -// CHECK:STDOUT: !175 = !DILocation(line: 43, column: 33, scope: !169) -// CHECK:STDOUT: !176 = !{!170} -// CHECK:STDOUT: !177 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.c18e58a62bf591fb:ImplicitAs.eb057aa32837c84e.Core.15c528b24e490d8c", scope: null, file: !152, line: 47, type: !31, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !185) -// CHECK:STDOUT: !178 = !DILocalVariable(arg: 1, scope: !177, type: !6) -// CHECK:STDOUT: !183 = !DILocation(line: 47, column: 34, scope: !177) -// CHECK:STDOUT: !184 = !DILocation(line: 47, column: 27, scope: !177) -// CHECK:STDOUT: !185 = !{!178} -// CHECK:STDOUT: !186 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.c18e58a62bf591fb:ImplicitAs.eb057aa32837c84e.Core.d0ddc3b29d345eab", scope: null, file: !152, line: 47, type: !31, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !194) -// CHECK:STDOUT: !187 = !DILocalVariable(arg: 1, scope: !186, type: !6) -// CHECK:STDOUT: !192 = !DILocation(line: 47, column: 34, scope: !186) -// CHECK:STDOUT: !193 = !DILocation(line: 47, column: 27, scope: !186) -// CHECK:STDOUT: !194 = !{!187} -// CHECK:STDOUT: !195 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.c18e58a62bf591fb:ImplicitAs.eb057aa32837c84e.Core.be8876292851c59c", scope: null, file: !152, line: 47, type: !31, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !203) -// CHECK:STDOUT: !196 = !DILocalVariable(arg: 1, scope: !195, type: !6) -// CHECK:STDOUT: !201 = !DILocation(line: 47, column: 34, scope: !195) -// CHECK:STDOUT: !202 = !DILocation(line: 47, column: 27, scope: !195) -// CHECK:STDOUT: !203 = !{!196} -// CHECK:STDOUT: !204 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.c18e58a62bf591fb:ImplicitAs.eb057aa32837c84e.Core.cab41ae108d94b57", scope: null, file: !152, line: 47, type: !31, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !212) -// CHECK:STDOUT: !205 = !DILocalVariable(arg: 1, scope: !204, type: !6) -// CHECK:STDOUT: !210 = !DILocation(line: 47, column: 34, scope: !204) -// CHECK:STDOUT: !211 = !DILocation(line: 47, column: 27, scope: !204) -// CHECK:STDOUT: !212 = !{!205} -// CHECK:STDOUT: !213 = distinct !DISubprogram(name: "Has", linkageName: "_CHas.e8f8f92d3d08d149:OptionalStorage.Core.84588f41d61dafba", scope: null, file: !120, line: 172, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !222) -// CHECK:STDOUT: !214 = !DILocalVariable(arg: 1, scope: !213, type: !9) -// CHECK:STDOUT: !219 = !DILocation(line: 173, column: 16, scope: !213) -// CHECK:STDOUT: !220 = !DILocation(line: 173, column: 12, scope: !213) -// CHECK:STDOUT: !221 = !DILocation(line: 173, column: 5, scope: !213) -// CHECK:STDOUT: !222 = !{!214} -// CHECK:STDOUT: !223 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.e8f8f92d3d08d149:OptionalStorage.Core.84588f41d61dafba", scope: null, file: !120, line: 175, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !230) -// CHECK:STDOUT: !224 = !DILocalVariable(arg: 1, scope: !223, type: !9) -// CHECK:STDOUT: !229 = !DILocation(line: 176, column: 5, scope: !223) -// CHECK:STDOUT: !230 = !{!224} -// CHECK:STDOUT: !231 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.a7c05288d2ce28bc", scope: null, file: !120, line: 80, type: !31, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !239) -// CHECK:STDOUT: !232 = !DILocalVariable(arg: 1, scope: !231, type: !6) -// CHECK:STDOUT: !237 = !DILocation(line: 81, column: 12, scope: !231) -// CHECK:STDOUT: !238 = !DILocation(line: 81, column: 5, scope: !231) -// CHECK:STDOUT: !239 = !{!232} -// CHECK:STDOUT: !240 = distinct !DISubprogram(name: "None", linkageName: "_CNone.74becf39533834ee:OptionalStorage.Core.32f25dd70ba991cc", scope: null, file: !120, line: 125, type: !34, spFlags: DISPFlagDefinition, unit: !5) -// CHECK:STDOUT: !247 = !DILocation(line: 128, column: 5, scope: !240) -// CHECK:STDOUT: !248 = !DILocation(line: 129, column: 5, scope: !240) -// CHECK:STDOUT: !249 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.dddd9c9f66eb3452", scope: null, file: !120, line: 87, type: !31, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !257) -// CHECK:STDOUT: !250 = !DILocalVariable(arg: 1, scope: !249, type: !6) -// CHECK:STDOUT: !254 = !DILocation(line: 88, column: 29, scope: !249) -// CHECK:STDOUT: !255 = !DILocation(line: 88, column: 12, scope: !249) -// CHECK:STDOUT: !256 = !DILocation(line: 88, column: 5, scope: !249) -// CHECK:STDOUT: !257 = !{!250} -// CHECK:STDOUT: !258 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.a7c05288d2ce28bc", scope: null, file: !120, line: 33, type: !31, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !265) -// CHECK:STDOUT: !259 = !DILocalVariable(arg: 1, scope: !258, type: !6) -// CHECK:STDOUT: !263 = !DILocation(line: 34, column: 12, scope: !258) -// CHECK:STDOUT: !264 = !DILocation(line: 34, column: 5, scope: !258) -// CHECK:STDOUT: !265 = !{!259} -// CHECK:STDOUT: !266 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.ef077c075a7e2432:ImplicitAs.ad22d1bbc0605210.Core.ba7abeb9eee545e2", scope: null, file: !152, line: 43, type: !31, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !275) -// CHECK:STDOUT: !267 = !DILocalVariable(arg: 1, scope: !266, type: !6) -// CHECK:STDOUT: !271 = !DILocation(line: 43, column: 40, scope: !266) -// CHECK:STDOUT: !272 = !{!6, !6} -// CHECK:STDOUT: !273 = !DISubroutineType(types: !272) -// CHECK:STDOUT: !274 = !DILocation(line: 43, column: 33, scope: !266) -// CHECK:STDOUT: !275 = !{!267} -// CHECK:STDOUT: !276 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.0ba9b301f5e251fb", scope: null, file: !120, line: 33, type: !31, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !283) -// CHECK:STDOUT: !277 = !DILocalVariable(arg: 1, scope: !276, type: !6) -// CHECK:STDOUT: !281 = !DILocation(line: 34, column: 12, scope: !276) -// CHECK:STDOUT: !282 = !DILocation(line: 34, column: 5, scope: !276) -// CHECK:STDOUT: !283 = !{!277} -// CHECK:STDOUT: !284 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.74becf39533834ee:OptionalStorage.Core.32f25dd70ba991cc", scope: null, file: !120, line: 131, type: !31, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !297) -// CHECK:STDOUT: !285 = !DILocalVariable(arg: 1, scope: !284, type: !6) -// CHECK:STDOUT: !293 = !DILocation(line: 137, column: 5, scope: !284) -// CHECK:STDOUT: !295 = !DILocation(line: 138, column: 5, scope: !284) -// CHECK:STDOUT: !296 = !DILocation(line: 139, column: 5, scope: !284) -// CHECK:STDOUT: !297 = !{!285} -// CHECK:STDOUT: !298 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "") -// CHECK:STDOUT: !299 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044", scope: null, file: !298, line: 64, type: !273, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !307) +// CHECK:STDOUT: !155 = !DILocation(line: 16, column: 3, scope: !153) +// CHECK:STDOUT: !156 = !{!154} +// CHECK:STDOUT: !157 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f6a63055ea5a1824:core.Destroy.Core", scope: null, file: !4, line: 16, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !160) +// CHECK:STDOUT: !158 = !DILocalVariable(arg: 1, scope: !157, type: !7) +// CHECK:STDOUT: !159 = !DILocation(line: 16, column: 3, scope: !157) +// CHECK:STDOUT: !160 = !{!158} +// CHECK:STDOUT: !161 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f6a63055ea5a1824:core.Destroy.Core", scope: null, file: !4, line: 16, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !164) +// CHECK:STDOUT: !162 = !DILocalVariable(arg: 1, scope: !161, type: !7) +// CHECK:STDOUT: !163 = !DILocation(line: 16, column: 3, scope: !161) +// CHECK:STDOUT: !164 = !{!162} +// CHECK:STDOUT: !165 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.9f155f365c9e4267:core.Destroy.Core", scope: null, file: !4, line: 16, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !168) +// CHECK:STDOUT: !166 = !DILocalVariable(arg: 1, scope: !165, type: !7) +// CHECK:STDOUT: !167 = !DILocation(line: 16, column: 3, scope: !165) +// CHECK:STDOUT: !168 = !{!166} +// CHECK:STDOUT: !169 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.9f155f365c9e4267:core.Destroy.Core", scope: null, file: !4, line: 16, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !172) +// CHECK:STDOUT: !170 = !DILocalVariable(arg: 1, scope: !169, type: !7) +// CHECK:STDOUT: !171 = !DILocation(line: 16, column: 3, scope: !169) +// CHECK:STDOUT: !172 = !{!170} +// CHECK:STDOUT: !173 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.0acefe5e4ad33694:core.Destroy.Core", scope: null, file: !4, line: 16, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !176) +// CHECK:STDOUT: !174 = !DILocalVariable(arg: 1, scope: !173, type: !7) +// CHECK:STDOUT: !175 = !DILocation(line: 16, column: 3, scope: !173) +// CHECK:STDOUT: !176 = !{!174} +// CHECK:STDOUT: !177 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.0acefe5e4ad33694:core.Destroy.Core", scope: null, file: !4, line: 16, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !180) +// CHECK:STDOUT: !178 = !DILocalVariable(arg: 1, scope: !177, type: !7) +// CHECK:STDOUT: !179 = !DILocation(line: 16, column: 3, scope: !177) +// CHECK:STDOUT: !180 = !{!178} +// CHECK:STDOUT: !181 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.65ac38c7f841b05c:core.Destroy.Core", scope: null, file: !4, line: 16, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !184) +// CHECK:STDOUT: !182 = !DILocalVariable(arg: 1, scope: !181, type: !7) +// CHECK:STDOUT: !183 = !DILocation(line: 16, column: 3, scope: !181) +// CHECK:STDOUT: !184 = !{!182} +// CHECK:STDOUT: !185 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.65ac38c7f841b05c:core.Destroy.Core", scope: null, file: !4, line: 16, type: !9, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !188) +// CHECK:STDOUT: !186 = !DILocalVariable(arg: 1, scope: !185, type: !7) +// CHECK:STDOUT: !187 = !DILocation(line: 16, column: 3, scope: !185) +// CHECK:STDOUT: !188 = !{!186} +// CHECK:STDOUT: !189 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.6e9e957697159b53", scope: null, file: !16, line: 36, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !197) +// CHECK:STDOUT: !190 = !DILocalVariable(arg: 1, scope: !189, type: !7) +// CHECK:STDOUT: !195 = !DILocation(line: 37, column: 12, scope: !189) +// CHECK:STDOUT: !196 = !DILocation(line: 37, column: 5, scope: !189) +// CHECK:STDOUT: !197 = !{!190} +// CHECK:STDOUT: !198 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.6e9e957697159b53", scope: null, file: !16, line: 39, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !206) +// CHECK:STDOUT: !199 = !DILocalVariable(arg: 1, scope: !198, type: !7) +// CHECK:STDOUT: !204 = !DILocation(line: 40, column: 12, scope: !198) +// CHECK:STDOUT: !205 = !DILocation(line: 40, column: 5, scope: !198) +// CHECK:STDOUT: !206 = !{!199} +// CHECK:STDOUT: !207 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.9eebcd25770b8843", scope: null, file: !16, line: 105, type: !44, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !214) +// CHECK:STDOUT: !208 = !DILocalVariable(arg: 1, scope: !207, type: !6) +// CHECK:STDOUT: !212 = !DILocation(line: 106, column: 12, scope: !207) +// CHECK:STDOUT: !213 = !DILocation(line: 106, column: 5, scope: !207) +// CHECK:STDOUT: !214 = !{!208} +// CHECK:STDOUT: !215 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.3530343734a6ea27", scope: null, file: !16, line: 30, type: !47, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !218 = !DILocation(line: 31, column: 12, scope: !215) +// CHECK:STDOUT: !219 = !DILocation(line: 31, column: 5, scope: !215) +// CHECK:STDOUT: !220 = !DIFile(filename: "{{.*}}/prelude/operators/as.carbon", directory: "") +// CHECK:STDOUT: !221 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.ef077c075a7e2432:ImplicitAs.ad22d1bbc0605210.Core.27a2d1ef6dd68465", scope: null, file: !220, line: 43, type: !44, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !228) +// CHECK:STDOUT: !222 = !DILocalVariable(arg: 1, scope: !221, type: !6) +// CHECK:STDOUT: !226 = !DILocation(line: 43, column: 40, scope: !221) +// CHECK:STDOUT: !227 = !DILocation(line: 43, column: 33, scope: !221) +// CHECK:STDOUT: !228 = !{!222} +// CHECK:STDOUT: !229 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.5cec6441aa655224", scope: null, file: !16, line: 105, type: !44, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !236) +// CHECK:STDOUT: !230 = !DILocalVariable(arg: 1, scope: !229, type: !6) +// CHECK:STDOUT: !234 = !DILocation(line: 106, column: 12, scope: !229) +// CHECK:STDOUT: !235 = !DILocation(line: 106, column: 5, scope: !229) +// CHECK:STDOUT: !236 = !{!230} +// CHECK:STDOUT: !237 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.ef077c075a7e2432:ImplicitAs.ad22d1bbc0605210.Core.bc0e935618dc3a96", scope: null, file: !220, line: 43, type: !44, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !244) +// CHECK:STDOUT: !238 = !DILocalVariable(arg: 1, scope: !237, type: !6) +// CHECK:STDOUT: !242 = !DILocation(line: 43, column: 40, scope: !237) +// CHECK:STDOUT: !243 = !DILocation(line: 43, column: 33, scope: !237) +// CHECK:STDOUT: !244 = !{!238} +// CHECK:STDOUT: !245 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.c18e58a62bf591fb:ImplicitAs.eb057aa32837c84e.Core.27a2d1ef6dd68465", scope: null, file: !220, line: 47, type: !44, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !253) +// CHECK:STDOUT: !246 = !DILocalVariable(arg: 1, scope: !245, type: !6) +// CHECK:STDOUT: !251 = !DILocation(line: 47, column: 34, scope: !245) +// CHECK:STDOUT: !252 = !DILocation(line: 47, column: 27, scope: !245) +// CHECK:STDOUT: !253 = !{!246} +// CHECK:STDOUT: !254 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.c18e58a62bf591fb:ImplicitAs.eb057aa32837c84e.Core.9f04190beae22821", scope: null, file: !220, line: 47, type: !44, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !262) +// CHECK:STDOUT: !255 = !DILocalVariable(arg: 1, scope: !254, type: !6) +// CHECK:STDOUT: !260 = !DILocation(line: 47, column: 34, scope: !254) +// CHECK:STDOUT: !261 = !DILocation(line: 47, column: 27, scope: !254) +// CHECK:STDOUT: !262 = !{!255} +// CHECK:STDOUT: !263 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.c18e58a62bf591fb:ImplicitAs.eb057aa32837c84e.Core.bc0e935618dc3a96", scope: null, file: !220, line: 47, type: !44, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !271) +// CHECK:STDOUT: !264 = !DILocalVariable(arg: 1, scope: !263, type: !6) +// CHECK:STDOUT: !269 = !DILocation(line: 47, column: 34, scope: !263) +// CHECK:STDOUT: !270 = !DILocation(line: 47, column: 27, scope: !263) +// CHECK:STDOUT: !271 = !{!264} +// CHECK:STDOUT: !272 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.c18e58a62bf591fb:ImplicitAs.eb057aa32837c84e.Core.342679e541375c77", scope: null, file: !220, line: 47, type: !44, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !280) +// CHECK:STDOUT: !273 = !DILocalVariable(arg: 1, scope: !272, type: !6) +// CHECK:STDOUT: !278 = !DILocation(line: 47, column: 34, scope: !272) +// CHECK:STDOUT: !279 = !DILocation(line: 47, column: 27, scope: !272) +// CHECK:STDOUT: !280 = !{!273} +// CHECK:STDOUT: !281 = distinct !DISubprogram(name: "Has", linkageName: "_CHas.e8f8f92d3d08d149:OptionalStorage.Core.84588f41d61dafba", scope: null, file: !16, line: 172, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !290) +// CHECK:STDOUT: !282 = !DILocalVariable(arg: 1, scope: !281, type: !7) +// CHECK:STDOUT: !287 = !DILocation(line: 173, column: 16, scope: !281) +// CHECK:STDOUT: !288 = !DILocation(line: 173, column: 12, scope: !281) +// CHECK:STDOUT: !289 = !DILocation(line: 173, column: 5, scope: !281) +// CHECK:STDOUT: !290 = !{!282} +// CHECK:STDOUT: !291 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.e8f8f92d3d08d149:OptionalStorage.Core.84588f41d61dafba", scope: null, file: !16, line: 175, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !298) +// CHECK:STDOUT: !292 = !DILocalVariable(arg: 1, scope: !291, type: !7) +// CHECK:STDOUT: !297 = !DILocation(line: 176, column: 5, scope: !291) +// CHECK:STDOUT: !298 = !{!292} +// CHECK:STDOUT: !299 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.3530343734a6ea27", scope: null, file: !16, line: 80, type: !44, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !307) // CHECK:STDOUT: !300 = !DILocalVariable(arg: 1, scope: !299, type: !6) -// CHECK:STDOUT: !304 = !DILocation(line: 66, column: 17, scope: !299) -// CHECK:STDOUT: !306 = !DILocation(line: 66, column: 5, scope: !299) +// CHECK:STDOUT: !305 = !DILocation(line: 81, column: 12, scope: !299) +// CHECK:STDOUT: !306 = !DILocation(line: 81, column: 5, scope: !299) // CHECK:STDOUT: !307 = !{!300} -// CHECK:STDOUT: !308 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.74becf39533834ee:OptionalStorage.Core.075be0912516882a", scope: null, file: !120, line: 131, type: !31, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !321) -// CHECK:STDOUT: !309 = !DILocalVariable(arg: 1, scope: !308, type: !6) -// CHECK:STDOUT: !317 = !DILocation(line: 137, column: 5, scope: !308) -// CHECK:STDOUT: !318 = !DILocation(line: 137, column: 28, scope: !308) -// CHECK:STDOUT: !319 = !DILocation(line: 138, column: 5, scope: !308) -// CHECK:STDOUT: !320 = !DILocation(line: 139, column: 5, scope: !308) -// CHECK:STDOUT: !321 = !{!309} -// CHECK:STDOUT: !322 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !298, line: 59, type: !273, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !329) -// CHECK:STDOUT: !323 = !DILocalVariable(arg: 1, scope: !322, type: !6) -// CHECK:STDOUT: !328 = !DILocation(line: 59, column: 28, scope: !322) -// CHECK:STDOUT: !329 = !{!323} -// CHECK:STDOUT: !330 = !DIFile(filename: "{{.*}}/prelude/copy.carbon", directory: "") -// CHECK:STDOUT: !331 = distinct !DISubprogram(name: "Op", linkageName: "_COp.a7c16f707f533a23:Copy.Core.4d6ceefeb7f772f4", scope: null, file: !330, line: 23, type: !31, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !339) -// CHECK:STDOUT: !332 = !DILocalVariable(arg: 1, scope: !331, type: !6) -// CHECK:STDOUT: !338 = !DILocation(line: 23, column: 25, scope: !331) -// CHECK:STDOUT: !339 = !{!332} +// CHECK:STDOUT: !308 = distinct !DISubprogram(name: "None", linkageName: "_CNone.74becf39533834ee:OptionalStorage.Core.d4057e3ae48c02cc", scope: null, file: !16, line: 125, type: !47, spFlags: DISPFlagDefinition, unit: !5) +// CHECK:STDOUT: !315 = !DILocation(line: 128, column: 5, scope: !308) +// CHECK:STDOUT: !316 = !DILocation(line: 129, column: 5, scope: !308) +// CHECK:STDOUT: !317 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.dd5a2a74150e1fc7", scope: null, file: !16, line: 87, type: !44, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !325) +// CHECK:STDOUT: !318 = !DILocalVariable(arg: 1, scope: !317, type: !6) +// CHECK:STDOUT: !322 = !DILocation(line: 88, column: 29, scope: !317) +// CHECK:STDOUT: !323 = !DILocation(line: 88, column: 12, scope: !317) +// CHECK:STDOUT: !324 = !DILocation(line: 88, column: 5, scope: !317) +// CHECK:STDOUT: !325 = !{!318} +// CHECK:STDOUT: !326 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.3530343734a6ea27", scope: null, file: !16, line: 33, type: !44, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !333) +// CHECK:STDOUT: !327 = !DILocalVariable(arg: 1, scope: !326, type: !6) +// CHECK:STDOUT: !331 = !DILocation(line: 34, column: 12, scope: !326) +// CHECK:STDOUT: !332 = !DILocation(line: 34, column: 5, scope: !326) +// CHECK:STDOUT: !333 = !{!327} +// CHECK:STDOUT: !334 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.ef077c075a7e2432:ImplicitAs.ad22d1bbc0605210.Core.ba7abeb9eee545e2", scope: null, file: !220, line: 43, type: !44, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !343) +// CHECK:STDOUT: !335 = !DILocalVariable(arg: 1, scope: !334, type: !6) +// CHECK:STDOUT: !339 = !DILocation(line: 43, column: 40, scope: !334) +// CHECK:STDOUT: !340 = !{!6, !6} +// CHECK:STDOUT: !341 = !DISubroutineType(types: !340) +// CHECK:STDOUT: !342 = !DILocation(line: 43, column: 33, scope: !334) +// CHECK:STDOUT: !343 = !{!335} +// CHECK:STDOUT: !344 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.00b00ea46fa3b046", scope: null, file: !16, line: 33, type: !44, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !351) +// CHECK:STDOUT: !345 = !DILocalVariable(arg: 1, scope: !344, type: !6) +// CHECK:STDOUT: !349 = !DILocation(line: 34, column: 12, scope: !344) +// CHECK:STDOUT: !350 = !DILocation(line: 34, column: 5, scope: !344) +// CHECK:STDOUT: !351 = !{!345} +// CHECK:STDOUT: !352 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.74becf39533834ee:OptionalStorage.Core.d4057e3ae48c02cc", scope: null, file: !16, line: 131, type: !44, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !365) +// CHECK:STDOUT: !353 = !DILocalVariable(arg: 1, scope: !352, type: !6) +// CHECK:STDOUT: !361 = !DILocation(line: 137, column: 5, scope: !352) +// CHECK:STDOUT: !363 = !DILocation(line: 138, column: 5, scope: !352) +// CHECK:STDOUT: !364 = !DILocation(line: 139, column: 5, scope: !352) +// CHECK:STDOUT: !365 = !{!353} +// CHECK:STDOUT: !366 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "") +// CHECK:STDOUT: !367 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.45e1f8de18643ddf:ImplicitAs.0bc6489996802dd4.Core.bb469f8924cce044", scope: null, file: !366, line: 64, type: !341, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !375) +// CHECK:STDOUT: !368 = !DILocalVariable(arg: 1, scope: !367, type: !6) +// CHECK:STDOUT: !372 = !DILocation(line: 66, column: 17, scope: !367) +// CHECK:STDOUT: !374 = !DILocation(line: 66, column: 5, scope: !367) +// CHECK:STDOUT: !375 = !{!368} +// CHECK:STDOUT: !376 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.74becf39533834ee:OptionalStorage.Core.cd77d7fbcb14a7c2", scope: null, file: !16, line: 131, type: !44, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !389) +// CHECK:STDOUT: !377 = !DILocalVariable(arg: 1, scope: !376, type: !6) +// CHECK:STDOUT: !385 = !DILocation(line: 137, column: 5, scope: !376) +// CHECK:STDOUT: !386 = !DILocation(line: 137, column: 28, scope: !376) +// CHECK:STDOUT: !387 = !DILocation(line: 138, column: 5, scope: !376) +// CHECK:STDOUT: !388 = !DILocation(line: 139, column: 5, scope: !376) +// CHECK:STDOUT: !389 = !{!377} +// CHECK:STDOUT: !390 = distinct !DISubprogram(name: "AsInt", linkageName: "_CAsInt.Int.9452f4c51951679b.Core:AnyInt.Core.be1e879c1ad406d8", scope: null, file: !366, line: 59, type: !341, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !397) +// CHECK:STDOUT: !391 = !DILocalVariable(arg: 1, scope: !390, type: !6) +// CHECK:STDOUT: !396 = !DILocation(line: 59, column: 28, scope: !390) +// CHECK:STDOUT: !397 = !{!391} +// CHECK:STDOUT: !398 = !DIFile(filename: "{{.*}}/prelude/copy.carbon", directory: "") +// CHECK:STDOUT: !399 = distinct !DISubprogram(name: "Op", linkageName: "_COp.a7c16f707f533a23:Copy.Core.4d6ceefeb7f772f4", scope: null, file: !398, line: 23, type: !44, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !407) +// CHECK:STDOUT: !400 = !DILocalVariable(arg: 1, scope: !399, type: !6) +// CHECK:STDOUT: !406 = !DILocation(line: 23, column: 25, scope: !399) +// CHECK:STDOUT: !407 = !{!400} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'copy.carbon' @@ -602,134 +786,74 @@ fn F(c: Core.Optional(C*)) -> Core.Optional(C*) { // CHECK:STDOUT: declare void @"_COp.Copyable.Main:Copy.Core"(ptr sret({}), ptr) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.bb3dd30fa3a4aa62:core.Destroy.Core"(ptr %self) #0 !dbg !342 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %self) #0 !dbg !410 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !344 +// CHECK:STDOUT: ret void, !dbg !412 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF.Main(ptr sret({ {}, i1 }) %return, ptr %c) #0 !dbg !346 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.bb3dd30fa3a4aa62:core.Destroy.Core"(ptr %self) #0 !dbg !414 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @"_COp.Optional.24b7347a93330e68.Core:Copy.Core.b03b221dea5a68ac"(ptr %return, ptr %c), !dbg !351 -// CHECK:STDOUT: ret void, !dbg !352 +// CHECK:STDOUT: ret void, !dbg !416 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_COp.Optional.24b7347a93330e68.Core:Copy.Core.b03b221dea5a68ac"(ptr sret({ {}, i1 }) %return, ptr %self) #0 !dbg !354 { -// CHECK:STDOUT: call void @"_CCopy.5d6f3f3a4b44a8f1:OptionalStorage.Core.14f4319dcea949ad"(ptr %return, ptr %self), !dbg !360 -// CHECK:STDOUT: ret void, !dbg !361 +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.bb3dd30fa3a4aa62:core.Destroy.Core"(ptr %self) #0 !dbg !418 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.bb3dd30fa3a4aa62:core.Destroy.Core"(ptr %self), !dbg !420 +// CHECK:STDOUT: ret void, !dbg !420 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CCopy.5d6f3f3a4b44a8f1:OptionalStorage.Core.14f4319dcea949ad"(ptr sret({ {}, i1 }) %return, ptr %value) #0 !dbg !363 { -// CHECK:STDOUT: %1 = call i1 @"_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.14f4319dcea949ad"(ptr %value), !dbg !369 -// CHECK:STDOUT: br i1 %1, label %2, label %3, !dbg !370 +// CHECK:STDOUT: define void @_CF.Main(ptr sret({ {}, i1 }) %return, ptr %c) #0 !dbg !422 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_COp.Optional.24b7347a93330e68.Core:Copy.Core.a2b7303f9ef09f31"(ptr %return, ptr %c), !dbg !427 +// CHECK:STDOUT: ret void, !dbg !428 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @"_COp.Optional.24b7347a93330e68.Core:Copy.Core.a2b7303f9ef09f31"(ptr sret({ {}, i1 }) %return, ptr %self) #0 !dbg !430 { +// CHECK:STDOUT: call void @"_CCopy.5d6f3f3a4b44a8f1:OptionalStorage.Core.d34df0287397e90c"(ptr %return, ptr %self), !dbg !436 +// CHECK:STDOUT: ret void, !dbg !437 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr void @"_CCopy.5d6f3f3a4b44a8f1:OptionalStorage.Core.d34df0287397e90c"(ptr sret({ {}, i1 }) %return, ptr %value) #0 !dbg !439 { +// CHECK:STDOUT: %1 = call i1 @"_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.d34df0287397e90c"(ptr %value), !dbg !445 +// CHECK:STDOUT: br i1 %1, label %2, label %3, !dbg !446 // CHECK:STDOUT: // CHECK:STDOUT: 2: ; preds = %0 -// CHECK:STDOUT: %value1 = getelementptr inbounds nuw { {}, i1 }, ptr %value, i32 0, i32 0, !dbg !371 -// CHECK:STDOUT: call void @"_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.14f4319dcea949ad"(ptr %return, ptr %value1), !dbg !372 -// CHECK:STDOUT: ret void, !dbg !373 +// CHECK:STDOUT: %value1 = getelementptr inbounds nuw { {}, i1 }, ptr %value, i32 0, i32 0, !dbg !447 +// CHECK:STDOUT: call void @"_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.d34df0287397e90c"(ptr %return, ptr %value1), !dbg !448 +// CHECK:STDOUT: ret void, !dbg !449 // CHECK:STDOUT: // CHECK:STDOUT: 3: ; preds = %0 -// CHECK:STDOUT: call void @"_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.14f4319dcea949ad"(ptr %return), !dbg !374 -// CHECK:STDOUT: ret void, !dbg !375 +// CHECK:STDOUT: call void @"_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.d34df0287397e90c"(ptr %return), !dbg !450 +// CHECK:STDOUT: ret void, !dbg !451 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @"_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.14f4319dcea949ad"(ptr %value) #0 !dbg !377 { -// CHECK:STDOUT: %has_value = getelementptr inbounds nuw { {}, i1 }, ptr %value, i32 0, i32 1, !dbg !382 -// CHECK:STDOUT: %1 = load i8, ptr %has_value, align 1, !dbg !382 -// CHECK:STDOUT: %2 = trunc i8 %1 to i1, !dbg !382 -// CHECK:STDOUT: ret i1 %2, !dbg !383 +// CHECK:STDOUT: define linkonce_odr i1 @"_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.d34df0287397e90c"(ptr %value) #0 !dbg !453 { +// CHECK:STDOUT: %has_value = getelementptr inbounds nuw { {}, i1 }, ptr %value, i32 0, i32 1, !dbg !458 +// CHECK:STDOUT: %1 = load i8, ptr %has_value, align 1, !dbg !458 +// CHECK:STDOUT: %2 = trunc i8 %1 to i1, !dbg !458 +// CHECK:STDOUT: ret i1 %2, !dbg !459 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.14f4319dcea949ad"(ptr sret({ {}, i1 }) %return, ptr %self) #0 !dbg !385 { -// CHECK:STDOUT: %value = getelementptr inbounds nuw { {}, i1 }, ptr %return, i32 0, i32 0, !dbg !394 -// CHECK:STDOUT: call void @"_COp.Copyable.Main:Copy.Core"(ptr %value, ptr %self), !dbg !395 -// CHECK:STDOUT: %has_value = getelementptr inbounds nuw { {}, i1 }, ptr %return, i32 0, i32 1, !dbg !396 -// CHECK:STDOUT: store i8 1, ptr %has_value, align 1, !dbg !396 -// CHECK:STDOUT: ret void, !dbg !397 +// CHECK:STDOUT: define linkonce_odr void @"_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.d34df0287397e90c"(ptr sret({ {}, i1 }) %return, ptr %self) #0 !dbg !461 { +// CHECK:STDOUT: %value = getelementptr inbounds nuw { {}, i1 }, ptr %return, i32 0, i32 0, !dbg !470 +// CHECK:STDOUT: call void @"_COp.Copyable.Main:Copy.Core"(ptr %value, ptr %self), !dbg !471 +// CHECK:STDOUT: %has_value = getelementptr inbounds nuw { {}, i1 }, ptr %return, i32 0, i32 1, !dbg !472 +// CHECK:STDOUT: store i8 1, ptr %has_value, align 1, !dbg !472 +// CHECK:STDOUT: ret void, !dbg !473 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.14f4319dcea949ad"(ptr sret({ {}, i1 }) %return) #0 !dbg !399 { -// CHECK:STDOUT: %has_value = getelementptr inbounds nuw { {}, i1 }, ptr %return, i32 0, i32 1, !dbg !406 -// CHECK:STDOUT: store i8 0, ptr %has_value, align 1, !dbg !406 -// CHECK:STDOUT: ret void, !dbg !407 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: attributes #0 = { nounwind } -// CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!341} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} -// CHECK:STDOUT: -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !9 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !10 = !{!9, !9} -// CHECK:STDOUT: !11 = !DISubroutineType(types: !10) -// CHECK:STDOUT: !14 = !{null, !9} -// CHECK:STDOUT: !15 = !DISubroutineType(types: !14) -// CHECK:STDOUT: !33 = !{!9} -// CHECK:STDOUT: !34 = !DISubroutineType(types: !33) -// CHECK:STDOUT: !120 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") -// CHECK:STDOUT: !340 = !DIFile(filename: "copy.carbon", directory: "") -// CHECK:STDOUT: !341 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !340, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !342 = distinct !DISubprogram(name: "Op", linkageName: "_COp.bb3dd30fa3a4aa62:core.Destroy.Core", scope: null, file: !340, line: 9, type: !15, spFlags: DISPFlagDefinition, unit: !341, retainedNodes: !345) -// CHECK:STDOUT: !343 = !DILocalVariable(arg: 1, scope: !342, type: !9) -// CHECK:STDOUT: !344 = !DILocation(line: 9, column: 9, scope: !342) -// CHECK:STDOUT: !345 = !{!343} -// CHECK:STDOUT: !346 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !340, line: 9, type: !11, spFlags: DISPFlagDefinition, unit: !341, retainedNodes: !353) -// CHECK:STDOUT: !347 = !DILocalVariable(arg: 1, scope: !346, type: !9) -// CHECK:STDOUT: !351 = !DILocation(line: 11, column: 10, scope: !346) -// CHECK:STDOUT: !352 = !DILocation(line: 11, column: 3, scope: !346) -// CHECK:STDOUT: !353 = !{!347} -// CHECK:STDOUT: !354 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Optional.24b7347a93330e68.Core:Copy.Core.b03b221dea5a68ac", scope: null, file: !120, line: 50, type: !11, spFlags: DISPFlagDefinition, unit: !341, retainedNodes: !362) -// CHECK:STDOUT: !355 = !DILocalVariable(arg: 1, scope: !354, type: !9) -// CHECK:STDOUT: !360 = !DILocation(line: 51, column: 12, scope: !354) -// CHECK:STDOUT: !361 = !DILocation(line: 51, column: 5, scope: !354) -// CHECK:STDOUT: !362 = !{!355} -// CHECK:STDOUT: !363 = distinct !DISubprogram(name: "Copy", linkageName: "_CCopy.5d6f3f3a4b44a8f1:OptionalStorage.Core.14f4319dcea949ad", scope: null, file: !120, line: 147, type: !11, spFlags: DISPFlagDefinition, unit: !341, retainedNodes: !376) -// CHECK:STDOUT: !364 = !DILocalVariable(arg: 1, scope: !363, type: !9) -// CHECK:STDOUT: !369 = !DILocation(line: 148, column: 9, scope: !363) -// CHECK:STDOUT: !370 = !DILocation(line: 148, column: 8, scope: !363) -// CHECK:STDOUT: !371 = !DILocation(line: 149, column: 15, scope: !363) -// CHECK:STDOUT: !372 = !DILocation(line: 149, column: 14, scope: !363) -// CHECK:STDOUT: !373 = !DILocation(line: 149, column: 7, scope: !363) -// CHECK:STDOUT: !374 = !DILocation(line: 151, column: 14, scope: !363) -// CHECK:STDOUT: !375 = !DILocation(line: 151, column: 7, scope: !363) -// CHECK:STDOUT: !376 = !{!364} -// CHECK:STDOUT: !377 = distinct !DISubprogram(name: "Has", linkageName: "_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.14f4319dcea949ad", scope: null, file: !120, line: 141, type: !11, spFlags: DISPFlagDefinition, unit: !341, retainedNodes: !384) -// CHECK:STDOUT: !378 = !DILocalVariable(arg: 1, scope: !377, type: !9) -// CHECK:STDOUT: !382 = !DILocation(line: 142, column: 12, scope: !377) -// CHECK:STDOUT: !383 = !DILocation(line: 142, column: 5, scope: !377) -// CHECK:STDOUT: !384 = !{!378} -// CHECK:STDOUT: !385 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.14f4319dcea949ad", scope: null, file: !120, line: 131, type: !11, spFlags: DISPFlagDefinition, unit: !341, retainedNodes: !398) -// CHECK:STDOUT: !386 = !DILocalVariable(arg: 1, scope: !385, type: !9) -// CHECK:STDOUT: !394 = !DILocation(line: 137, column: 5, scope: !385) -// CHECK:STDOUT: !395 = !DILocation(line: 137, column: 28, scope: !385) -// CHECK:STDOUT: !396 = !DILocation(line: 138, column: 5, scope: !385) -// CHECK:STDOUT: !397 = !DILocation(line: 139, column: 5, scope: !385) -// CHECK:STDOUT: !398 = !{!386} -// CHECK:STDOUT: !399 = distinct !DISubprogram(name: "None", linkageName: "_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.14f4319dcea949ad", scope: null, file: !120, line: 125, type: !34, spFlags: DISPFlagDefinition, unit: !341) -// CHECK:STDOUT: !406 = !DILocation(line: 128, column: 5, scope: !399) -// CHECK:STDOUT: !407 = !DILocation(line: 129, column: 5, scope: !399) -// CHECK:STDOUT: -// CHECK:STDOUT: ; --- -// CHECK:STDOUT: ; ModuleID = 'copy_pointer.carbon' -// CHECK:STDOUT: source_filename = "copy_pointer.carbon" -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define ptr @_CF.Main(ptr %c) #0 !dbg !410 { -// CHECK:STDOUT: entry: -// CHECK:STDOUT: %Optional.as.Copy.impl.Op.call = call ptr @"_COp.Optional.24b7347a93330e68.Core:Copy.Core.3e2e92aa38469608"(ptr %c), !dbg !415 -// CHECK:STDOUT: ret ptr %Optional.as.Copy.impl.Op.call, !dbg !416 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_COp.Optional.24b7347a93330e68.Core:Copy.Core.3e2e92aa38469608"(ptr %self) #0 !dbg !418 { -// CHECK:STDOUT: ret ptr %self, !dbg !425 +// CHECK:STDOUT: define linkonce_odr void @"_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.d34df0287397e90c"(ptr sret({ {}, i1 }) %return) #0 !dbg !475 { +// CHECK:STDOUT: %has_value = getelementptr inbounds nuw { {}, i1 }, ptr %return, i32 0, i32 1, !dbg !482 +// CHECK:STDOUT: store i8 0, ptr %has_value, align 1, !dbg !482 +// CHECK:STDOUT: ret void, !dbg !483 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -739,19 +863,112 @@ fn F(c: Core.Optional(C*)) -> Core.Optional(C*) { // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !9 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !10 = !{!9, !9} -// CHECK:STDOUT: !11 = !DISubroutineType(types: !10) -// CHECK:STDOUT: !120 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") -// CHECK:STDOUT: !408 = !DIFile(filename: "copy_pointer.carbon", directory: "") +// CHECK:STDOUT: !7 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !8 = !{null, !7} +// CHECK:STDOUT: !9 = !DISubroutineType(types: !8) +// CHECK:STDOUT: !12 = !{!7, !7} +// CHECK:STDOUT: !13 = !DISubroutineType(types: !12) +// CHECK:STDOUT: !16 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") +// CHECK:STDOUT: !46 = !{!7} +// CHECK:STDOUT: !47 = !DISubroutineType(types: !46) +// CHECK:STDOUT: !408 = !DIFile(filename: "copy.carbon", directory: "") // CHECK:STDOUT: !409 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !408, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !410 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !408, line: 5, type: !11, spFlags: DISPFlagDefinition, unit: !409, retainedNodes: !417) -// CHECK:STDOUT: !411 = !DILocalVariable(arg: 1, scope: !410, type: !9) -// CHECK:STDOUT: !415 = !DILocation(line: 6, column: 10, scope: !410) -// CHECK:STDOUT: !416 = !DILocation(line: 6, column: 3, scope: !410) -// CHECK:STDOUT: !417 = !{!411} -// CHECK:STDOUT: !418 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Optional.24b7347a93330e68.Core:Copy.Core.3e2e92aa38469608", scope: null, file: !120, line: 50, type: !11, spFlags: DISPFlagDefinition, unit: !409, retainedNodes: !426) -// CHECK:STDOUT: !419 = !DILocalVariable(arg: 1, scope: !418, type: !9) -// CHECK:STDOUT: !425 = !DILocation(line: 51, column: 5, scope: !418) -// CHECK:STDOUT: !426 = !{!419} +// CHECK:STDOUT: !410 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !408, line: 9, type: !9, spFlags: DISPFlagDefinition, unit: !409, retainedNodes: !413) +// CHECK:STDOUT: !411 = !DILocalVariable(arg: 1, scope: !410, type: !7) +// CHECK:STDOUT: !412 = !DILocation(line: 9, column: 9, scope: !410) +// CHECK:STDOUT: !413 = !{!411} +// CHECK:STDOUT: !414 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.bb3dd30fa3a4aa62:core.Destroy.Core", scope: null, file: !408, line: 9, type: !9, spFlags: DISPFlagDefinition, unit: !409, retainedNodes: !417) +// CHECK:STDOUT: !415 = !DILocalVariable(arg: 1, scope: !414, type: !7) +// CHECK:STDOUT: !416 = !DILocation(line: 9, column: 9, scope: !414) +// CHECK:STDOUT: !417 = !{!415} +// CHECK:STDOUT: !418 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.bb3dd30fa3a4aa62:core.Destroy.Core", scope: null, file: !408, line: 9, type: !9, spFlags: DISPFlagDefinition, unit: !409, retainedNodes: !421) +// CHECK:STDOUT: !419 = !DILocalVariable(arg: 1, scope: !418, type: !7) +// CHECK:STDOUT: !420 = !DILocation(line: 9, column: 9, scope: !418) +// CHECK:STDOUT: !421 = !{!419} +// CHECK:STDOUT: !422 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !408, line: 9, type: !13, spFlags: DISPFlagDefinition, unit: !409, retainedNodes: !429) +// CHECK:STDOUT: !423 = !DILocalVariable(arg: 1, scope: !422, type: !7) +// CHECK:STDOUT: !427 = !DILocation(line: 11, column: 10, scope: !422) +// CHECK:STDOUT: !428 = !DILocation(line: 11, column: 3, scope: !422) +// CHECK:STDOUT: !429 = !{!423} +// CHECK:STDOUT: !430 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Optional.24b7347a93330e68.Core:Copy.Core.a2b7303f9ef09f31", scope: null, file: !16, line: 50, type: !13, spFlags: DISPFlagDefinition, unit: !409, retainedNodes: !438) +// CHECK:STDOUT: !431 = !DILocalVariable(arg: 1, scope: !430, type: !7) +// CHECK:STDOUT: !436 = !DILocation(line: 51, column: 12, scope: !430) +// CHECK:STDOUT: !437 = !DILocation(line: 51, column: 5, scope: !430) +// CHECK:STDOUT: !438 = !{!431} +// CHECK:STDOUT: !439 = distinct !DISubprogram(name: "Copy", linkageName: "_CCopy.5d6f3f3a4b44a8f1:OptionalStorage.Core.d34df0287397e90c", scope: null, file: !16, line: 147, type: !13, spFlags: DISPFlagDefinition, unit: !409, retainedNodes: !452) +// CHECK:STDOUT: !440 = !DILocalVariable(arg: 1, scope: !439, type: !7) +// CHECK:STDOUT: !445 = !DILocation(line: 148, column: 9, scope: !439) +// CHECK:STDOUT: !446 = !DILocation(line: 148, column: 8, scope: !439) +// CHECK:STDOUT: !447 = !DILocation(line: 149, column: 15, scope: !439) +// CHECK:STDOUT: !448 = !DILocation(line: 149, column: 14, scope: !439) +// CHECK:STDOUT: !449 = !DILocation(line: 149, column: 7, scope: !439) +// CHECK:STDOUT: !450 = !DILocation(line: 151, column: 14, scope: !439) +// CHECK:STDOUT: !451 = !DILocation(line: 151, column: 7, scope: !439) +// CHECK:STDOUT: !452 = !{!440} +// CHECK:STDOUT: !453 = distinct !DISubprogram(name: "Has", linkageName: "_CHas.5d6f3f3a4b44a8f1:OptionalStorage.Core.d34df0287397e90c", scope: null, file: !16, line: 141, type: !13, spFlags: DISPFlagDefinition, unit: !409, retainedNodes: !460) +// CHECK:STDOUT: !454 = !DILocalVariable(arg: 1, scope: !453, type: !7) +// CHECK:STDOUT: !458 = !DILocation(line: 142, column: 12, scope: !453) +// CHECK:STDOUT: !459 = !DILocation(line: 142, column: 5, scope: !453) +// CHECK:STDOUT: !460 = !{!454} +// CHECK:STDOUT: !461 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.5d6f3f3a4b44a8f1:OptionalStorage.Core.d34df0287397e90c", scope: null, file: !16, line: 131, type: !13, spFlags: DISPFlagDefinition, unit: !409, retainedNodes: !474) +// CHECK:STDOUT: !462 = !DILocalVariable(arg: 1, scope: !461, type: !7) +// CHECK:STDOUT: !470 = !DILocation(line: 137, column: 5, scope: !461) +// CHECK:STDOUT: !471 = !DILocation(line: 137, column: 28, scope: !461) +// CHECK:STDOUT: !472 = !DILocation(line: 138, column: 5, scope: !461) +// CHECK:STDOUT: !473 = !DILocation(line: 139, column: 5, scope: !461) +// CHECK:STDOUT: !474 = !{!462} +// CHECK:STDOUT: !475 = distinct !DISubprogram(name: "None", linkageName: "_CNone.5d6f3f3a4b44a8f1:OptionalStorage.Core.d34df0287397e90c", scope: null, file: !16, line: 125, type: !47, spFlags: DISPFlagDefinition, unit: !409) +// CHECK:STDOUT: !482 = !DILocation(line: 128, column: 5, scope: !475) +// CHECK:STDOUT: !483 = !DILocation(line: 129, column: 5, scope: !475) +// CHECK:STDOUT: +// CHECK:STDOUT: ; --- +// CHECK:STDOUT: ; ModuleID = 'copy_pointer.carbon' +// CHECK:STDOUT: source_filename = "copy_pointer.carbon" +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6b633cf020343e69:core.Destroy.Core"(ptr %self) #0 !dbg !486 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !488 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define ptr @_CF.Main(ptr %c) #0 !dbg !490 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: %Optional.as.Copy.impl.Op.call = call ptr @"_COp.Optional.24b7347a93330e68.Core:Copy.Core.3e2e92aa38469608"(ptr %c), !dbg !495 +// CHECK:STDOUT: ret ptr %Optional.as.Copy.impl.Op.call, !dbg !496 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define linkonce_odr ptr @"_COp.Optional.24b7347a93330e68.Core:Copy.Core.3e2e92aa38469608"(ptr %self) #0 !dbg !498 { +// CHECK:STDOUT: ret ptr %self, !dbg !505 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: attributes #0 = { nounwind } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!485} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !7 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !8 = !{null, !7} +// CHECK:STDOUT: !9 = !DISubroutineType(types: !8) +// CHECK:STDOUT: !12 = !{!7, !7} +// CHECK:STDOUT: !13 = !DISubroutineType(types: !12) +// CHECK:STDOUT: !16 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") +// CHECK:STDOUT: !484 = !DIFile(filename: "copy_pointer.carbon", directory: "") +// CHECK:STDOUT: !485 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !484, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !486 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6b633cf020343e69:core.Destroy.Core", scope: null, file: !16, line: 164, type: !9, spFlags: DISPFlagDefinition, unit: !485, retainedNodes: !489) +// CHECK:STDOUT: !487 = !DILocalVariable(arg: 1, scope: !486, type: !7) +// CHECK:STDOUT: !488 = !DILocation(line: 164, column: 19, scope: !486) +// CHECK:STDOUT: !489 = !{!487} +// CHECK:STDOUT: !490 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !484, line: 5, type: !13, spFlags: DISPFlagDefinition, unit: !485, retainedNodes: !497) +// CHECK:STDOUT: !491 = !DILocalVariable(arg: 1, scope: !490, type: !7) +// CHECK:STDOUT: !495 = !DILocation(line: 6, column: 10, scope: !490) +// CHECK:STDOUT: !496 = !DILocation(line: 6, column: 3, scope: !490) +// CHECK:STDOUT: !497 = !{!491} +// CHECK:STDOUT: !498 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Optional.24b7347a93330e68.Core:Copy.Core.3e2e92aa38469608", scope: null, file: !16, line: 50, type: !13, spFlags: DISPFlagDefinition, unit: !485, retainedNodes: !506) +// CHECK:STDOUT: !499 = !DILocalVariable(arg: 1, scope: !498, type: !7) +// CHECK:STDOUT: !505 = !DILocation(line: 51, column: 5, scope: !498) +// CHECK:STDOUT: !506 = !{!499} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/return/return_var_byval.carbon b/toolchain/lower/testdata/return/return_var_byval.carbon index 183c9f867da3..155734d33ad5 100644 --- a/toolchain/lower/testdata/return/return_var_byval.carbon +++ b/toolchain/lower/testdata/return/return_var_byval.carbon @@ -26,16 +26,29 @@ fn Main() -> i32 { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %x.var), !dbg !28 // CHECK:STDOUT: store i32 0, ptr %x.var, align 4, !dbg !28 // CHECK:STDOUT: %.loc14_17 = load i32, ptr %x.var, align 4, !dbg !29 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %x.var), !dbg !28 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %x.var), !dbg !28 // CHECK:STDOUT: ret i32 %.loc14_17, !dbg !31 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !32 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !32 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !34 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !36 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !38 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !40 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !42 +// CHECK:STDOUT: ret void, !dbg !42 +// 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: @@ -58,8 +71,16 @@ fn Main() -> i32 { // CHECK:STDOUT: !28 = !DILocation(line: 14, column: 12, scope: !25) // CHECK:STDOUT: !29 = !DILocation(line: 14, column: 16, scope: !25) // CHECK:STDOUT: !31 = !DILocation(line: 15, column: 3, scope: !25) -// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 14, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !35) +// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !18, line: 14, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !35) // CHECK:STDOUT: !33 = !DILocalVariable(arg: 1, scope: !32, type: !20) // CHECK:STDOUT: !34 = !DILocation(line: 14, column: 12, scope: !32) // CHECK:STDOUT: !35 = !{!33} +// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 14, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !39) +// CHECK:STDOUT: !37 = !DILocalVariable(arg: 1, scope: !36, type: !20) +// CHECK:STDOUT: !38 = !DILocation(line: 14, column: 12, scope: !36) +// CHECK:STDOUT: !39 = !{!37} +// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 14, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !43) +// CHECK:STDOUT: !41 = !DILocalVariable(arg: 1, scope: !40, type: !20) +// CHECK:STDOUT: !42 = !DILocation(line: 14, column: 12, scope: !40) +// CHECK:STDOUT: !43 = !{!41} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/return/var.carbon b/toolchain/lower/testdata/return/var.carbon index 9ffa9d8fb6c2..252290abbbd3 100644 --- a/toolchain/lower/testdata/return/var.carbon +++ b/toolchain/lower/testdata/return/var.carbon @@ -26,16 +26,29 @@ fn Main() -> i32 { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %x.var), !dbg !28 // CHECK:STDOUT: store i32 0, ptr %x.var, align 4, !dbg !28 // CHECK:STDOUT: %.loc15 = load i32, ptr %x.var, align 4, !dbg !30 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %x.var), !dbg !28 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %x.var), !dbg !28 // CHECK:STDOUT: ret i32 %.loc15, !dbg !31 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !32 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !32 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !34 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !36 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !38 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !40 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !42 +// CHECK:STDOUT: ret void, !dbg !42 +// 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: @@ -58,8 +71,16 @@ fn Main() -> i32 { // CHECK:STDOUT: !28 = !DILocation(line: 14, column: 3, scope: !25) // CHECK:STDOUT: !30 = !DILocation(line: 15, column: 10, scope: !25) // CHECK:STDOUT: !31 = !DILocation(line: 15, column: 3, scope: !25) -// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 14, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !35) +// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !18, line: 14, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !35) // CHECK:STDOUT: !33 = !DILocalVariable(arg: 1, scope: !32, type: !20) // CHECK:STDOUT: !34 = !DILocation(line: 14, column: 3, scope: !32) // CHECK:STDOUT: !35 = !{!33} +// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 14, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !39) +// CHECK:STDOUT: !37 = !DILocalVariable(arg: 1, scope: !36, type: !20) +// CHECK:STDOUT: !38 = !DILocation(line: 14, column: 3, scope: !36) +// CHECK:STDOUT: !39 = !{!37} +// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 14, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !43) +// CHECK:STDOUT: !41 = !DILocalVariable(arg: 1, scope: !40, type: !20) +// CHECK:STDOUT: !42 = !DILocation(line: 14, column: 3, scope: !40) +// CHECK:STDOUT: !43 = !{!41} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/struct/empty.carbon b/toolchain/lower/testdata/struct/empty.carbon index 90fa3691a301..adc4b4493716 100644 --- a/toolchain/lower/testdata/struct/empty.carbon +++ b/toolchain/lower/testdata/struct/empty.carbon @@ -21,19 +21,28 @@ fn Run() -> i32 { // CHECK:STDOUT: source_filename = "empty.carbon" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @main() #0 !dbg !23 { +// CHECK:STDOUT: define i32 @main() #0 !dbg !26 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %x.var = alloca {}, align 1, !dbg !26 -// CHECK:STDOUT: %_.var = alloca {}, align 1, !dbg !28 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %x.var), !dbg !26 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !28 -// CHECK:STDOUT: ret i32 0, !dbg !31 +// CHECK:STDOUT: %x.var = alloca {}, align 1, !dbg !29 +// CHECK:STDOUT: %_.var = alloca {}, align 1, !dbg !31 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %x.var), !dbg !29 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !31 +// CHECK:STDOUT: call void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %_.var), !dbg !31 +// CHECK:STDOUT: call void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %x.var), !dbg !29 +// CHECK:STDOUT: ret i32 0, !dbg !34 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %self) #0 !dbg !35 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !37 // 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: ; uselistorder directives +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", { 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -49,8 +58,15 @@ fn Run() -> i32 { // CHECK:STDOUT: !20 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) // CHECK:STDOUT: !21 = !{!20} // CHECK:STDOUT: !22 = !DISubroutineType(types: !21) -// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "Run", linkageName: "main", scope: null, file: !18, line: 13, type: !22, spFlags: DISPFlagDefinition, unit: !19) -// CHECK:STDOUT: !26 = !DILocation(line: 14, column: 3, scope: !23) -// CHECK:STDOUT: !28 = !DILocation(line: 15, column: 3, scope: !23) -// CHECK:STDOUT: !31 = !DILocation(line: 16, column: 3, scope: !23) +// CHECK:STDOUT: !23 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !24 = !{null, !23} +// CHECK:STDOUT: !25 = !DISubroutineType(types: !24) +// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "Run", linkageName: "main", scope: null, file: !18, line: 13, type: !22, spFlags: DISPFlagDefinition, unit: !19) +// CHECK:STDOUT: !29 = !DILocation(line: 14, column: 3, scope: !26) +// CHECK:STDOUT: !31 = !DILocation(line: 15, column: 3, scope: !26) +// CHECK:STDOUT: !34 = !DILocation(line: 16, column: 3, scope: !26) +// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !18, line: 15, type: !25, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !38) +// CHECK:STDOUT: !36 = !DILocalVariable(arg: 1, scope: !35, type: !23) +// CHECK:STDOUT: !37 = !DILocation(line: 15, column: 3, scope: !35) +// CHECK:STDOUT: !38 = !{!36} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/struct/layout.carbon b/toolchain/lower/testdata/struct/layout.carbon index 4f44858a78fa..12242868ddbf 100644 --- a/toolchain/lower/testdata/struct/layout.carbon +++ b/toolchain/lower/testdata/struct/layout.carbon @@ -90,22 +90,42 @@ fn F() { // CHECK:STDOUT: call void @_CG.Main(ptr %.loc9.y), !dbg !36 // CHECK:STDOUT: %.loc10.z = getelementptr inbounds nuw { i32, i32, i32 }, ptr %no_padding.var, i32 0, i32 2, !dbg !37 // CHECK:STDOUT: call void @_CG.Main(ptr %.loc10.z), !dbg !39 -// CHECK:STDOUT: call void @"_COp.cc12b768126bed5c:core.Destroy.Core"(ptr %no_padding.var), !dbg !29 +// CHECK:STDOUT: call void @"_CSelfDestruct.cc12b768126bed5c:core.Destroy.Core"(ptr %no_padding.var), !dbg !29 // CHECK:STDOUT: ret void, !dbg !40 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !41 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !41 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !43 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.cc12b768126bed5c:core.Destroy.Core"(ptr %self) #0 !dbg !45 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !45 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !47 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !49 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !51 +// CHECK:STDOUT: ret void, !dbg !51 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.cc12b768126bed5c:core.Destroy.Core"(ptr %self) #0 !dbg !53 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !55 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cc12b768126bed5c:core.Destroy.Core"(ptr %self) #0 !dbg !57 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.cc12b768126bed5c:core.Destroy.Core"(ptr %self), !dbg !59 +// CHECK:STDOUT: ret void, !dbg !59 +// 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: @@ -136,14 +156,26 @@ fn F() { // CHECK:STDOUT: !37 = !DILocation(line: 10, column: 6, scope: !28) // CHECK:STDOUT: !39 = !DILocation(line: 10, column: 3, scope: !28) // CHECK:STDOUT: !40 = !DILocation(line: 5, column: 1, scope: !28) -// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 7, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !44) +// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !18, line: 7, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !44) // CHECK:STDOUT: !42 = !DILocalVariable(arg: 1, scope: !41, type: !20) // CHECK:STDOUT: !43 = !DILocation(line: 7, column: 3, scope: !41) // CHECK:STDOUT: !44 = !{!42} -// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "Op", linkageName: "_COp.cc12b768126bed5c:core.Destroy.Core", scope: null, file: !18, line: 7, type: !23, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !48) -// CHECK:STDOUT: !46 = !DILocalVariable(arg: 1, scope: !45, type: !21) +// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 7, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !48) +// CHECK:STDOUT: !46 = !DILocalVariable(arg: 1, scope: !45, type: !20) // CHECK:STDOUT: !47 = !DILocation(line: 7, column: 3, scope: !45) // CHECK:STDOUT: !48 = !{!46} +// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 7, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !52) +// CHECK:STDOUT: !50 = !DILocalVariable(arg: 1, scope: !49, type: !20) +// CHECK:STDOUT: !51 = !DILocation(line: 7, column: 3, scope: !49) +// CHECK:STDOUT: !52 = !{!50} +// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.cc12b768126bed5c:core.Destroy.Core", scope: null, file: !18, line: 7, type: !23, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !56) +// CHECK:STDOUT: !54 = !DILocalVariable(arg: 1, scope: !53, type: !21) +// CHECK:STDOUT: !55 = !DILocation(line: 7, column: 3, scope: !53) +// CHECK:STDOUT: !56 = !{!54} +// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cc12b768126bed5c:core.Destroy.Core", scope: null, file: !18, line: 7, type: !23, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !60) +// CHECK:STDOUT: !58 = !DILocalVariable(arg: 1, scope: !57, type: !21) +// CHECK:STDOUT: !59 = !DILocation(line: 7, column: 3, scope: !57) +// CHECK:STDOUT: !60 = !{!58} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'avoid_tail_padding.carbon' @@ -152,26 +184,52 @@ fn F() { // CHECK:STDOUT: declare void @_CG.Main(ptr) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !51 { +// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !63 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %avoid_tail_padding.var = alloca <{ ptr, i32 }>, align 8, !dbg !52 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %avoid_tail_padding.var), !dbg !52 -// CHECK:STDOUT: %.loc8.y = getelementptr inbounds nuw <{ ptr, i32 }>, ptr %avoid_tail_padding.var, i32 0, i32 1, !dbg !54 -// CHECK:STDOUT: call void @_CG.Main(ptr %.loc8.y), !dbg !56 -// CHECK:STDOUT: call void @"_COp.90798694d9a177e6:core.Destroy.Core"(ptr %avoid_tail_padding.var), !dbg !52 -// CHECK:STDOUT: ret void, !dbg !57 +// CHECK:STDOUT: %avoid_tail_padding.var = alloca <{ ptr, i32 }>, align 8, !dbg !64 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %avoid_tail_padding.var), !dbg !64 +// CHECK:STDOUT: %.loc8.y = getelementptr inbounds nuw <{ ptr, i32 }>, ptr %avoid_tail_padding.var, i32 0, i32 1, !dbg !66 +// CHECK:STDOUT: call void @_CG.Main(ptr %.loc8.y), !dbg !68 +// CHECK:STDOUT: call void @"_CSelfDestruct.90798694d9a177e6:core.Destroy.Core"(ptr %avoid_tail_padding.var), !dbg !64 +// CHECK:STDOUT: ret void, !dbg !69 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !58 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.8436f795915f0543:core.Destroy.Core"(ptr %self) #0 !dbg !70 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !60 +// CHECK:STDOUT: ret void, !dbg !72 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.90798694d9a177e6:core.Destroy.Core"(ptr %self) #0 !dbg !62 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !74 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !64 +// CHECK:STDOUT: ret void, !dbg !76 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !78 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !80 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !82 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !84 +// CHECK:STDOUT: ret void, !dbg !84 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.90798694d9a177e6:core.Destroy.Core"(ptr %self) #0 !dbg !86 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !88 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.90798694d9a177e6:core.Destroy.Core"(ptr %self) #0 !dbg !90 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.90798694d9a177e6:core.Destroy.Core"(ptr %self), !dbg !92 +// CHECK:STDOUT: ret void, !dbg !92 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -180,7 +238,7 @@ fn F() { // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!50} +// CHECK:STDOUT: !llvm.dbg.cu = !{!62} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} @@ -193,21 +251,37 @@ fn F() { // CHECK:STDOUT: !25 = !DISubroutineType(types: !24) // CHECK:STDOUT: !26 = !{null, !20} // CHECK:STDOUT: !27 = !DISubroutineType(types: !26) -// CHECK:STDOUT: !49 = !DIFile(filename: "avoid_tail_padding.carbon", directory: "") -// CHECK:STDOUT: !50 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !49, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !49, line: 5, type: !25, spFlags: DISPFlagDefinition, unit: !50) -// CHECK:STDOUT: !52 = !DILocation(line: 7, column: 3, scope: !51) -// CHECK:STDOUT: !54 = !DILocation(line: 8, column: 6, scope: !51) -// CHECK:STDOUT: !56 = !DILocation(line: 8, column: 3, scope: !51) -// CHECK:STDOUT: !57 = !DILocation(line: 5, column: 1, scope: !51) -// CHECK:STDOUT: !58 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !49, line: 7, type: !27, spFlags: DISPFlagDefinition, unit: !50, retainedNodes: !61) -// CHECK:STDOUT: !59 = !DILocalVariable(arg: 1, scope: !58, type: !20) -// CHECK:STDOUT: !60 = !DILocation(line: 7, column: 3, scope: !58) -// CHECK:STDOUT: !61 = !{!59} -// CHECK:STDOUT: !62 = distinct !DISubprogram(name: "Op", linkageName: "_COp.90798694d9a177e6:core.Destroy.Core", scope: null, file: !49, line: 7, type: !23, spFlags: DISPFlagDefinition, unit: !50, retainedNodes: !65) -// CHECK:STDOUT: !63 = !DILocalVariable(arg: 1, scope: !62, type: !21) -// CHECK:STDOUT: !64 = !DILocation(line: 7, column: 3, scope: !62) -// CHECK:STDOUT: !65 = !{!63} +// CHECK:STDOUT: !61 = !DIFile(filename: "avoid_tail_padding.carbon", directory: "") +// CHECK:STDOUT: !62 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !61, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !63 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !61, line: 5, type: !25, spFlags: DISPFlagDefinition, unit: !62) +// CHECK:STDOUT: !64 = !DILocation(line: 7, column: 3, scope: !63) +// CHECK:STDOUT: !66 = !DILocation(line: 8, column: 6, scope: !63) +// CHECK:STDOUT: !68 = !DILocation(line: 8, column: 3, scope: !63) +// CHECK:STDOUT: !69 = !DILocation(line: 5, column: 1, scope: !63) +// CHECK:STDOUT: !70 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.8436f795915f0543:core.Destroy.Core", scope: null, file: !61, line: 7, type: !23, spFlags: DISPFlagDefinition, unit: !62, retainedNodes: !73) +// CHECK:STDOUT: !71 = !DILocalVariable(arg: 1, scope: !70, type: !21) +// CHECK:STDOUT: !72 = !DILocation(line: 7, column: 3, scope: !70) +// CHECK:STDOUT: !73 = !{!71} +// CHECK:STDOUT: !74 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !61, line: 7, type: !27, spFlags: DISPFlagDefinition, unit: !62, retainedNodes: !77) +// CHECK:STDOUT: !75 = !DILocalVariable(arg: 1, scope: !74, type: !20) +// CHECK:STDOUT: !76 = !DILocation(line: 7, column: 3, scope: !74) +// CHECK:STDOUT: !77 = !{!75} +// CHECK:STDOUT: !78 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !61, line: 7, type: !27, spFlags: DISPFlagDefinition, unit: !62, retainedNodes: !81) +// CHECK:STDOUT: !79 = !DILocalVariable(arg: 1, scope: !78, type: !20) +// CHECK:STDOUT: !80 = !DILocation(line: 7, column: 3, scope: !78) +// CHECK:STDOUT: !81 = !{!79} +// CHECK:STDOUT: !82 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !61, line: 7, type: !27, spFlags: DISPFlagDefinition, unit: !62, retainedNodes: !85) +// CHECK:STDOUT: !83 = !DILocalVariable(arg: 1, scope: !82, type: !20) +// CHECK:STDOUT: !84 = !DILocation(line: 7, column: 3, scope: !82) +// CHECK:STDOUT: !85 = !{!83} +// CHECK:STDOUT: !86 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.90798694d9a177e6:core.Destroy.Core", scope: null, file: !61, line: 7, type: !23, spFlags: DISPFlagDefinition, unit: !62, retainedNodes: !89) +// CHECK:STDOUT: !87 = !DILocalVariable(arg: 1, scope: !86, type: !21) +// CHECK:STDOUT: !88 = !DILocation(line: 7, column: 3, scope: !86) +// CHECK:STDOUT: !89 = !{!87} +// CHECK:STDOUT: !90 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.90798694d9a177e6:core.Destroy.Core", scope: null, file: !61, line: 7, type: !23, spFlags: DISPFlagDefinition, unit: !62, retainedNodes: !93) +// CHECK:STDOUT: !91 = !DILocalVariable(arg: 1, scope: !90, type: !21) +// CHECK:STDOUT: !92 = !DILocation(line: 7, column: 3, scope: !90) +// CHECK:STDOUT: !93 = !{!91} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'use_tail_padding.carbon' @@ -216,35 +290,68 @@ fn F() { // CHECK:STDOUT: declare void @_CG.Main(ptr) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !68 { +// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !96 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %use_tail_padding.var = alloca { <{ ptr, i32 }>, i32 }, align 8, !dbg !69 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %use_tail_padding.var), !dbg !69 -// CHECK:STDOUT: %.loc9_22.a = getelementptr inbounds nuw { <{ ptr, i32 }>, i32 }, ptr %use_tail_padding.var, i32 0, i32 0, !dbg !71 -// CHECK:STDOUT: %.loc9_24.y = getelementptr inbounds nuw <{ ptr, i32 }>, ptr %.loc9_22.a, i32 0, i32 1, !dbg !71 -// CHECK:STDOUT: call void @_CG.Main(ptr %.loc9_24.y), !dbg !73 -// CHECK:STDOUT: %.loc10.b = getelementptr inbounds nuw { <{ ptr, i32 }>, i32 }, ptr %use_tail_padding.var, i32 0, i32 1, !dbg !74 -// CHECK:STDOUT: call void @_CG.Main(ptr %.loc10.b), !dbg !76 -// CHECK:STDOUT: call void @"_COp.3862e4ac11efcf1c:core.Destroy.Core"(ptr %use_tail_padding.var), !dbg !69 -// CHECK:STDOUT: ret void, !dbg !77 +// CHECK:STDOUT: %use_tail_padding.var = alloca { <{ ptr, i32 }>, i32 }, align 8, !dbg !97 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %use_tail_padding.var), !dbg !97 +// CHECK:STDOUT: %.loc9_22.a = getelementptr inbounds nuw { <{ ptr, i32 }>, i32 }, ptr %use_tail_padding.var, i32 0, i32 0, !dbg !99 +// CHECK:STDOUT: %.loc9_24.y = getelementptr inbounds nuw <{ ptr, i32 }>, ptr %.loc9_22.a, i32 0, i32 1, !dbg !99 +// CHECK:STDOUT: call void @_CG.Main(ptr %.loc9_24.y), !dbg !101 +// CHECK:STDOUT: %.loc10.b = getelementptr inbounds nuw { <{ ptr, i32 }>, i32 }, ptr %use_tail_padding.var, i32 0, i32 1, !dbg !102 +// CHECK:STDOUT: call void @_CG.Main(ptr %.loc10.b), !dbg !104 +// CHECK:STDOUT: call void @"_CSelfDestruct.3862e4ac11efcf1c:core.Destroy.Core"(ptr %use_tail_padding.var), !dbg !97 +// CHECK:STDOUT: ret void, !dbg !105 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !78 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.8436f795915f0543:core.Destroy.Core"(ptr %self) #0 !dbg !106 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !80 +// CHECK:STDOUT: ret void, !dbg !108 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.90798694d9a177e6:core.Destroy.Core"(ptr %self) #0 !dbg !82 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !110 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !84 +// CHECK:STDOUT: ret void, !dbg !112 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.3862e4ac11efcf1c:core.Destroy.Core"(ptr %self) #0 !dbg !86 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !114 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !88 +// CHECK:STDOUT: ret void, !dbg !116 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !118 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !120 +// CHECK:STDOUT: ret void, !dbg !120 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.90798694d9a177e6:core.Destroy.Core"(ptr %self) #0 !dbg !122 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !124 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.90798694d9a177e6:core.Destroy.Core"(ptr %self) #0 !dbg !126 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.90798694d9a177e6:core.Destroy.Core"(ptr %self), !dbg !128 +// CHECK:STDOUT: ret void, !dbg !128 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.3862e4ac11efcf1c:core.Destroy.Core"(ptr %self) #0 !dbg !130 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !132 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.3862e4ac11efcf1c:core.Destroy.Core"(ptr %self) #0 !dbg !134 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.3862e4ac11efcf1c:core.Destroy.Core"(ptr %self), !dbg !136 +// CHECK:STDOUT: ret void, !dbg !136 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -253,7 +360,7 @@ fn F() { // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!67} +// CHECK:STDOUT: !llvm.dbg.cu = !{!95} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} @@ -266,27 +373,47 @@ fn F() { // CHECK:STDOUT: !25 = !DISubroutineType(types: !24) // CHECK:STDOUT: !26 = !{null, !20} // CHECK:STDOUT: !27 = !DISubroutineType(types: !26) -// CHECK:STDOUT: !66 = !DIFile(filename: "use_tail_padding.carbon", directory: "") -// CHECK:STDOUT: !67 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !66, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !68 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !66, line: 5, type: !25, spFlags: DISPFlagDefinition, unit: !67) -// CHECK:STDOUT: !69 = !DILocation(line: 8, column: 3, scope: !68) -// CHECK:STDOUT: !71 = !DILocation(line: 9, column: 6, scope: !68) -// CHECK:STDOUT: !73 = !DILocation(line: 9, column: 3, scope: !68) -// CHECK:STDOUT: !74 = !DILocation(line: 10, column: 6, scope: !68) -// CHECK:STDOUT: !76 = !DILocation(line: 10, column: 3, scope: !68) -// CHECK:STDOUT: !77 = !DILocation(line: 5, column: 1, scope: !68) -// CHECK:STDOUT: !78 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !66, line: 8, type: !27, spFlags: DISPFlagDefinition, unit: !67, retainedNodes: !81) -// CHECK:STDOUT: !79 = !DILocalVariable(arg: 1, scope: !78, type: !20) -// CHECK:STDOUT: !80 = !DILocation(line: 8, column: 3, scope: !78) -// CHECK:STDOUT: !81 = !{!79} -// CHECK:STDOUT: !82 = distinct !DISubprogram(name: "Op", linkageName: "_COp.90798694d9a177e6:core.Destroy.Core", scope: null, file: !66, line: 8, type: !23, spFlags: DISPFlagDefinition, unit: !67, retainedNodes: !85) -// CHECK:STDOUT: !83 = !DILocalVariable(arg: 1, scope: !82, type: !21) -// CHECK:STDOUT: !84 = !DILocation(line: 8, column: 3, scope: !82) -// CHECK:STDOUT: !85 = !{!83} -// CHECK:STDOUT: !86 = distinct !DISubprogram(name: "Op", linkageName: "_COp.3862e4ac11efcf1c:core.Destroy.Core", scope: null, file: !66, line: 8, type: !23, spFlags: DISPFlagDefinition, unit: !67, retainedNodes: !89) -// CHECK:STDOUT: !87 = !DILocalVariable(arg: 1, scope: !86, type: !21) -// CHECK:STDOUT: !88 = !DILocation(line: 8, column: 3, scope: !86) -// CHECK:STDOUT: !89 = !{!87} +// CHECK:STDOUT: !94 = !DIFile(filename: "use_tail_padding.carbon", directory: "") +// CHECK:STDOUT: !95 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !94, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !96 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !94, line: 5, type: !25, spFlags: DISPFlagDefinition, unit: !95) +// CHECK:STDOUT: !97 = !DILocation(line: 8, column: 3, scope: !96) +// CHECK:STDOUT: !99 = !DILocation(line: 9, column: 6, scope: !96) +// CHECK:STDOUT: !101 = !DILocation(line: 9, column: 3, scope: !96) +// CHECK:STDOUT: !102 = !DILocation(line: 10, column: 6, scope: !96) +// CHECK:STDOUT: !104 = !DILocation(line: 10, column: 3, scope: !96) +// CHECK:STDOUT: !105 = !DILocation(line: 5, column: 1, scope: !96) +// CHECK:STDOUT: !106 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.8436f795915f0543:core.Destroy.Core", scope: null, file: !94, line: 8, type: !23, spFlags: DISPFlagDefinition, unit: !95, retainedNodes: !109) +// CHECK:STDOUT: !107 = !DILocalVariable(arg: 1, scope: !106, type: !21) +// CHECK:STDOUT: !108 = !DILocation(line: 8, column: 3, scope: !106) +// CHECK:STDOUT: !109 = !{!107} +// CHECK:STDOUT: !110 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !94, line: 8, type: !27, spFlags: DISPFlagDefinition, unit: !95, retainedNodes: !113) +// CHECK:STDOUT: !111 = !DILocalVariable(arg: 1, scope: !110, type: !20) +// CHECK:STDOUT: !112 = !DILocation(line: 8, column: 3, scope: !110) +// CHECK:STDOUT: !113 = !{!111} +// CHECK:STDOUT: !114 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !94, line: 8, type: !27, spFlags: DISPFlagDefinition, unit: !95, retainedNodes: !117) +// CHECK:STDOUT: !115 = !DILocalVariable(arg: 1, scope: !114, type: !20) +// CHECK:STDOUT: !116 = !DILocation(line: 8, column: 3, scope: !114) +// CHECK:STDOUT: !117 = !{!115} +// CHECK:STDOUT: !118 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !94, line: 8, type: !27, spFlags: DISPFlagDefinition, unit: !95, retainedNodes: !121) +// CHECK:STDOUT: !119 = !DILocalVariable(arg: 1, scope: !118, type: !20) +// CHECK:STDOUT: !120 = !DILocation(line: 8, column: 3, scope: !118) +// CHECK:STDOUT: !121 = !{!119} +// CHECK:STDOUT: !122 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.90798694d9a177e6:core.Destroy.Core", scope: null, file: !94, line: 8, type: !23, spFlags: DISPFlagDefinition, unit: !95, retainedNodes: !125) +// CHECK:STDOUT: !123 = !DILocalVariable(arg: 1, scope: !122, type: !21) +// CHECK:STDOUT: !124 = !DILocation(line: 8, column: 3, scope: !122) +// CHECK:STDOUT: !125 = !{!123} +// CHECK:STDOUT: !126 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.90798694d9a177e6:core.Destroy.Core", scope: null, file: !94, line: 8, type: !23, spFlags: DISPFlagDefinition, unit: !95, retainedNodes: !129) +// CHECK:STDOUT: !127 = !DILocalVariable(arg: 1, scope: !126, type: !21) +// CHECK:STDOUT: !128 = !DILocation(line: 8, column: 3, scope: !126) +// CHECK:STDOUT: !129 = !{!127} +// CHECK:STDOUT: !130 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.3862e4ac11efcf1c:core.Destroy.Core", scope: null, file: !94, line: 8, type: !23, spFlags: DISPFlagDefinition, unit: !95, retainedNodes: !133) +// CHECK:STDOUT: !131 = !DILocalVariable(arg: 1, scope: !130, type: !21) +// CHECK:STDOUT: !132 = !DILocation(line: 8, column: 3, scope: !130) +// CHECK:STDOUT: !133 = !{!131} +// CHECK:STDOUT: !134 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.3862e4ac11efcf1c:core.Destroy.Core", scope: null, file: !94, line: 8, type: !23, spFlags: DISPFlagDefinition, unit: !95, retainedNodes: !137) +// CHECK:STDOUT: !135 = !DILocalVariable(arg: 1, scope: !134, type: !21) +// CHECK:STDOUT: !136 = !DILocation(line: 8, column: 3, scope: !134) +// CHECK:STDOUT: !137 = !{!135} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'implicit_padding.carbon' @@ -295,35 +422,68 @@ fn F() { // CHECK:STDOUT: declare void @_CG.Main(ptr) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !92 { +// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !140 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %implicit_padding.var = alloca { <{ ptr, i32 }>, ptr }, align 8, !dbg !93 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %implicit_padding.var), !dbg !93 -// CHECK:STDOUT: %.loc9_22.a = getelementptr inbounds nuw { <{ ptr, i32 }>, ptr }, ptr %implicit_padding.var, i32 0, i32 0, !dbg !95 -// CHECK:STDOUT: %.loc9_24.x = getelementptr inbounds nuw <{ ptr, i32 }>, ptr %.loc9_22.a, i32 0, i32 0, !dbg !95 -// CHECK:STDOUT: call void @_CG.Main(ptr %.loc9_24.x), !dbg !97 -// CHECK:STDOUT: %.loc10.b = getelementptr inbounds nuw { <{ ptr, i32 }>, ptr }, ptr %implicit_padding.var, i32 0, i32 1, !dbg !98 -// CHECK:STDOUT: call void @_CG.Main(ptr %.loc10.b), !dbg !100 -// CHECK:STDOUT: call void @"_COp.fb4d9eb13d71ce13:core.Destroy.Core"(ptr %implicit_padding.var), !dbg !93 -// CHECK:STDOUT: ret void, !dbg !101 +// CHECK:STDOUT: %implicit_padding.var = alloca { <{ ptr, i32 }>, ptr }, align 8, !dbg !141 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %implicit_padding.var), !dbg !141 +// CHECK:STDOUT: %.loc9_22.a = getelementptr inbounds nuw { <{ ptr, i32 }>, ptr }, ptr %implicit_padding.var, i32 0, i32 0, !dbg !143 +// CHECK:STDOUT: %.loc9_24.x = getelementptr inbounds nuw <{ ptr, i32 }>, ptr %.loc9_22.a, i32 0, i32 0, !dbg !143 +// CHECK:STDOUT: call void @_CG.Main(ptr %.loc9_24.x), !dbg !145 +// CHECK:STDOUT: %.loc10.b = getelementptr inbounds nuw { <{ ptr, i32 }>, ptr }, ptr %implicit_padding.var, i32 0, i32 1, !dbg !146 +// CHECK:STDOUT: call void @_CG.Main(ptr %.loc10.b), !dbg !148 +// CHECK:STDOUT: call void @"_CSelfDestruct.fb4d9eb13d71ce13:core.Destroy.Core"(ptr %implicit_padding.var), !dbg !141 +// CHECK:STDOUT: ret void, !dbg !149 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !102 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.8436f795915f0543:core.Destroy.Core"(ptr %self) #0 !dbg !150 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !104 +// CHECK:STDOUT: ret void, !dbg !152 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.90798694d9a177e6:core.Destroy.Core"(ptr %self) #0 !dbg !106 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !154 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !108 +// CHECK:STDOUT: ret void, !dbg !156 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.fb4d9eb13d71ce13:core.Destroy.Core"(ptr %self) #0 !dbg !110 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !158 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !112 +// CHECK:STDOUT: ret void, !dbg !160 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !162 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !164 +// CHECK:STDOUT: ret void, !dbg !164 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.90798694d9a177e6:core.Destroy.Core"(ptr %self) #0 !dbg !166 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !168 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.90798694d9a177e6:core.Destroy.Core"(ptr %self) #0 !dbg !170 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.90798694d9a177e6:core.Destroy.Core"(ptr %self), !dbg !172 +// CHECK:STDOUT: ret void, !dbg !172 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.fb4d9eb13d71ce13:core.Destroy.Core"(ptr %self) #0 !dbg !174 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !176 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.fb4d9eb13d71ce13:core.Destroy.Core"(ptr %self) #0 !dbg !178 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.fb4d9eb13d71ce13:core.Destroy.Core"(ptr %self), !dbg !180 +// CHECK:STDOUT: ret void, !dbg !180 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -332,7 +492,7 @@ fn F() { // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!91} +// CHECK:STDOUT: !llvm.dbg.cu = !{!139} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} @@ -345,27 +505,47 @@ fn F() { // CHECK:STDOUT: !25 = !DISubroutineType(types: !24) // CHECK:STDOUT: !26 = !{null, !20} // CHECK:STDOUT: !27 = !DISubroutineType(types: !26) -// CHECK:STDOUT: !90 = !DIFile(filename: "implicit_padding.carbon", directory: "") -// CHECK:STDOUT: !91 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !90, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !92 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !90, line: 5, type: !25, spFlags: DISPFlagDefinition, unit: !91) -// CHECK:STDOUT: !93 = !DILocation(line: 8, column: 3, scope: !92) -// CHECK:STDOUT: !95 = !DILocation(line: 9, column: 6, scope: !92) -// CHECK:STDOUT: !97 = !DILocation(line: 9, column: 3, scope: !92) -// CHECK:STDOUT: !98 = !DILocation(line: 10, column: 6, scope: !92) -// CHECK:STDOUT: !100 = !DILocation(line: 10, column: 3, scope: !92) -// CHECK:STDOUT: !101 = !DILocation(line: 5, column: 1, scope: !92) -// CHECK:STDOUT: !102 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !90, line: 8, type: !27, spFlags: DISPFlagDefinition, unit: !91, retainedNodes: !105) -// CHECK:STDOUT: !103 = !DILocalVariable(arg: 1, scope: !102, type: !20) -// CHECK:STDOUT: !104 = !DILocation(line: 8, column: 3, scope: !102) -// CHECK:STDOUT: !105 = !{!103} -// CHECK:STDOUT: !106 = distinct !DISubprogram(name: "Op", linkageName: "_COp.90798694d9a177e6:core.Destroy.Core", scope: null, file: !90, line: 8, type: !23, spFlags: DISPFlagDefinition, unit: !91, retainedNodes: !109) -// CHECK:STDOUT: !107 = !DILocalVariable(arg: 1, scope: !106, type: !21) -// CHECK:STDOUT: !108 = !DILocation(line: 8, column: 3, scope: !106) -// CHECK:STDOUT: !109 = !{!107} -// CHECK:STDOUT: !110 = distinct !DISubprogram(name: "Op", linkageName: "_COp.fb4d9eb13d71ce13:core.Destroy.Core", scope: null, file: !90, line: 8, type: !23, spFlags: DISPFlagDefinition, unit: !91, retainedNodes: !113) -// CHECK:STDOUT: !111 = !DILocalVariable(arg: 1, scope: !110, type: !21) -// CHECK:STDOUT: !112 = !DILocation(line: 8, column: 3, scope: !110) -// CHECK:STDOUT: !113 = !{!111} +// CHECK:STDOUT: !138 = !DIFile(filename: "implicit_padding.carbon", directory: "") +// CHECK:STDOUT: !139 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !138, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !140 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !138, line: 5, type: !25, spFlags: DISPFlagDefinition, unit: !139) +// CHECK:STDOUT: !141 = !DILocation(line: 8, column: 3, scope: !140) +// CHECK:STDOUT: !143 = !DILocation(line: 9, column: 6, scope: !140) +// CHECK:STDOUT: !145 = !DILocation(line: 9, column: 3, scope: !140) +// CHECK:STDOUT: !146 = !DILocation(line: 10, column: 6, scope: !140) +// CHECK:STDOUT: !148 = !DILocation(line: 10, column: 3, scope: !140) +// CHECK:STDOUT: !149 = !DILocation(line: 5, column: 1, scope: !140) +// CHECK:STDOUT: !150 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.8436f795915f0543:core.Destroy.Core", scope: null, file: !138, line: 8, type: !23, spFlags: DISPFlagDefinition, unit: !139, retainedNodes: !153) +// CHECK:STDOUT: !151 = !DILocalVariable(arg: 1, scope: !150, type: !21) +// CHECK:STDOUT: !152 = !DILocation(line: 8, column: 3, scope: !150) +// CHECK:STDOUT: !153 = !{!151} +// CHECK:STDOUT: !154 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !138, line: 8, type: !27, spFlags: DISPFlagDefinition, unit: !139, retainedNodes: !157) +// CHECK:STDOUT: !155 = !DILocalVariable(arg: 1, scope: !154, type: !20) +// CHECK:STDOUT: !156 = !DILocation(line: 8, column: 3, scope: !154) +// CHECK:STDOUT: !157 = !{!155} +// CHECK:STDOUT: !158 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !138, line: 8, type: !27, spFlags: DISPFlagDefinition, unit: !139, retainedNodes: !161) +// CHECK:STDOUT: !159 = !DILocalVariable(arg: 1, scope: !158, type: !20) +// CHECK:STDOUT: !160 = !DILocation(line: 8, column: 3, scope: !158) +// CHECK:STDOUT: !161 = !{!159} +// CHECK:STDOUT: !162 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !138, line: 8, type: !27, spFlags: DISPFlagDefinition, unit: !139, retainedNodes: !165) +// CHECK:STDOUT: !163 = !DILocalVariable(arg: 1, scope: !162, type: !20) +// CHECK:STDOUT: !164 = !DILocation(line: 8, column: 3, scope: !162) +// CHECK:STDOUT: !165 = !{!163} +// CHECK:STDOUT: !166 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.90798694d9a177e6:core.Destroy.Core", scope: null, file: !138, line: 8, type: !23, spFlags: DISPFlagDefinition, unit: !139, retainedNodes: !169) +// CHECK:STDOUT: !167 = !DILocalVariable(arg: 1, scope: !166, type: !21) +// CHECK:STDOUT: !168 = !DILocation(line: 8, column: 3, scope: !166) +// CHECK:STDOUT: !169 = !{!167} +// CHECK:STDOUT: !170 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.90798694d9a177e6:core.Destroy.Core", scope: null, file: !138, line: 8, type: !23, spFlags: DISPFlagDefinition, unit: !139, retainedNodes: !173) +// CHECK:STDOUT: !171 = !DILocalVariable(arg: 1, scope: !170, type: !21) +// CHECK:STDOUT: !172 = !DILocation(line: 8, column: 3, scope: !170) +// CHECK:STDOUT: !173 = !{!171} +// CHECK:STDOUT: !174 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.fb4d9eb13d71ce13:core.Destroy.Core", scope: null, file: !138, line: 8, type: !23, spFlags: DISPFlagDefinition, unit: !139, retainedNodes: !177) +// CHECK:STDOUT: !175 = !DILocalVariable(arg: 1, scope: !174, type: !21) +// CHECK:STDOUT: !176 = !DILocation(line: 8, column: 3, scope: !174) +// CHECK:STDOUT: !177 = !{!175} +// CHECK:STDOUT: !178 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.fb4d9eb13d71ce13:core.Destroy.Core", scope: null, file: !138, line: 8, type: !23, spFlags: DISPFlagDefinition, unit: !139, retainedNodes: !181) +// CHECK:STDOUT: !179 = !DILocalVariable(arg: 1, scope: !178, type: !21) +// CHECK:STDOUT: !180 = !DILocation(line: 8, column: 3, scope: !178) +// CHECK:STDOUT: !181 = !{!179} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'insert_padding.carbon' @@ -374,32 +554,65 @@ fn F() { // CHECK:STDOUT: declare void @_CG.Main(ptr) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !116 { +// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !184 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %insert_padding.var = alloca <{ <{ { i32, i32, i32 }, [4 x i8] }>, ptr, i32 }>, align 8, !dbg !117 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %insert_padding.var), !dbg !117 -// CHECK:STDOUT: %.loc10.b = getelementptr inbounds nuw <{ <{ { i32, i32, i32 }, [4 x i8] }>, ptr, i32 }>, ptr %insert_padding.var, i32 0, i32 1, !dbg !119 -// CHECK:STDOUT: call void @_CG.Main(ptr %.loc10.b), !dbg !121 -// CHECK:STDOUT: call void @"_COp.b496992173693e26:core.Destroy.Core"(ptr %insert_padding.var), !dbg !117 -// CHECK:STDOUT: ret void, !dbg !122 +// CHECK:STDOUT: %insert_padding.var = alloca <{ <{ { i32, i32, i32 }, [4 x i8] }>, ptr, i32 }>, align 8, !dbg !185 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %insert_padding.var), !dbg !185 +// CHECK:STDOUT: %.loc10.b = getelementptr inbounds nuw <{ <{ { i32, i32, i32 }, [4 x i8] }>, ptr, i32 }>, ptr %insert_padding.var, i32 0, i32 1, !dbg !187 +// CHECK:STDOUT: call void @_CG.Main(ptr %.loc10.b), !dbg !189 +// CHECK:STDOUT: call void @"_CSelfDestruct.b496992173693e26:core.Destroy.Core"(ptr %insert_padding.var), !dbg !185 +// CHECK:STDOUT: ret void, !dbg !190 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !123 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !191 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !125 +// CHECK:STDOUT: ret void, !dbg !193 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.cc12b768126bed5c:core.Destroy.Core"(ptr %self) #0 !dbg !127 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !195 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !129 +// CHECK:STDOUT: ret void, !dbg !197 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.b496992173693e26:core.Destroy.Core"(ptr %self) #0 !dbg !131 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !199 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !133 +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !201 +// CHECK:STDOUT: ret void, !dbg !201 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.cc12b768126bed5c:core.Destroy.Core"(ptr %self) #0 !dbg !203 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !205 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cc12b768126bed5c:core.Destroy.Core"(ptr %self) #0 !dbg !207 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.cc12b768126bed5c:core.Destroy.Core"(ptr %self), !dbg !209 +// CHECK:STDOUT: ret void, !dbg !209 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.8436f795915f0543:core.Destroy.Core"(ptr %self) #0 !dbg !211 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !213 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.b496992173693e26:core.Destroy.Core"(ptr %self) #0 !dbg !215 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !217 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.b496992173693e26:core.Destroy.Core"(ptr %self) #0 !dbg !219 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.b496992173693e26:core.Destroy.Core"(ptr %self), !dbg !221 +// CHECK:STDOUT: ret void, !dbg !221 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -408,7 +621,7 @@ fn F() { // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!115} +// CHECK:STDOUT: !llvm.dbg.cu = !{!183} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} @@ -421,23 +634,43 @@ fn F() { // CHECK:STDOUT: !25 = !DISubroutineType(types: !24) // CHECK:STDOUT: !26 = !{null, !20} // CHECK:STDOUT: !27 = !DISubroutineType(types: !26) -// CHECK:STDOUT: !114 = !DIFile(filename: "insert_padding.carbon", directory: "") -// CHECK:STDOUT: !115 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !114, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !116 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !114, line: 5, type: !25, spFlags: DISPFlagDefinition, unit: !115) -// CHECK:STDOUT: !117 = !DILocation(line: 9, column: 3, scope: !116) -// CHECK:STDOUT: !119 = !DILocation(line: 10, column: 6, scope: !116) -// CHECK:STDOUT: !121 = !DILocation(line: 10, column: 3, scope: !116) -// CHECK:STDOUT: !122 = !DILocation(line: 5, column: 1, scope: !116) -// CHECK:STDOUT: !123 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !114, line: 9, type: !27, spFlags: DISPFlagDefinition, unit: !115, retainedNodes: !126) -// CHECK:STDOUT: !124 = !DILocalVariable(arg: 1, scope: !123, type: !20) -// CHECK:STDOUT: !125 = !DILocation(line: 9, column: 3, scope: !123) -// CHECK:STDOUT: !126 = !{!124} -// CHECK:STDOUT: !127 = distinct !DISubprogram(name: "Op", linkageName: "_COp.cc12b768126bed5c:core.Destroy.Core", scope: null, file: !114, line: 9, type: !23, spFlags: DISPFlagDefinition, unit: !115, retainedNodes: !130) -// CHECK:STDOUT: !128 = !DILocalVariable(arg: 1, scope: !127, type: !21) -// CHECK:STDOUT: !129 = !DILocation(line: 9, column: 3, scope: !127) -// CHECK:STDOUT: !130 = !{!128} -// CHECK:STDOUT: !131 = distinct !DISubprogram(name: "Op", linkageName: "_COp.b496992173693e26:core.Destroy.Core", scope: null, file: !114, line: 9, type: !23, spFlags: DISPFlagDefinition, unit: !115, retainedNodes: !134) -// CHECK:STDOUT: !132 = !DILocalVariable(arg: 1, scope: !131, type: !21) -// CHECK:STDOUT: !133 = !DILocation(line: 9, column: 3, scope: !131) -// CHECK:STDOUT: !134 = !{!132} +// CHECK:STDOUT: !182 = !DIFile(filename: "insert_padding.carbon", directory: "") +// CHECK:STDOUT: !183 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !182, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !184 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !182, line: 5, type: !25, spFlags: DISPFlagDefinition, unit: !183) +// CHECK:STDOUT: !185 = !DILocation(line: 9, column: 3, scope: !184) +// CHECK:STDOUT: !187 = !DILocation(line: 10, column: 6, scope: !184) +// CHECK:STDOUT: !189 = !DILocation(line: 10, column: 3, scope: !184) +// CHECK:STDOUT: !190 = !DILocation(line: 5, column: 1, scope: !184) +// CHECK:STDOUT: !191 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !182, line: 9, type: !27, spFlags: DISPFlagDefinition, unit: !183, retainedNodes: !194) +// CHECK:STDOUT: !192 = !DILocalVariable(arg: 1, scope: !191, type: !20) +// CHECK:STDOUT: !193 = !DILocation(line: 9, column: 3, scope: !191) +// CHECK:STDOUT: !194 = !{!192} +// CHECK:STDOUT: !195 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !182, line: 9, type: !27, spFlags: DISPFlagDefinition, unit: !183, retainedNodes: !198) +// CHECK:STDOUT: !196 = !DILocalVariable(arg: 1, scope: !195, type: !20) +// CHECK:STDOUT: !197 = !DILocation(line: 9, column: 3, scope: !195) +// CHECK:STDOUT: !198 = !{!196} +// CHECK:STDOUT: !199 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !182, line: 9, type: !27, spFlags: DISPFlagDefinition, unit: !183, retainedNodes: !202) +// CHECK:STDOUT: !200 = !DILocalVariable(arg: 1, scope: !199, type: !20) +// CHECK:STDOUT: !201 = !DILocation(line: 9, column: 3, scope: !199) +// CHECK:STDOUT: !202 = !{!200} +// CHECK:STDOUT: !203 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.cc12b768126bed5c:core.Destroy.Core", scope: null, file: !182, line: 9, type: !23, spFlags: DISPFlagDefinition, unit: !183, retainedNodes: !206) +// CHECK:STDOUT: !204 = !DILocalVariable(arg: 1, scope: !203, type: !21) +// CHECK:STDOUT: !205 = !DILocation(line: 9, column: 3, scope: !203) +// CHECK:STDOUT: !206 = !{!204} +// CHECK:STDOUT: !207 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cc12b768126bed5c:core.Destroy.Core", scope: null, file: !182, line: 9, type: !23, spFlags: DISPFlagDefinition, unit: !183, retainedNodes: !210) +// CHECK:STDOUT: !208 = !DILocalVariable(arg: 1, scope: !207, type: !21) +// CHECK:STDOUT: !209 = !DILocation(line: 9, column: 3, scope: !207) +// CHECK:STDOUT: !210 = !{!208} +// CHECK:STDOUT: !211 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.8436f795915f0543:core.Destroy.Core", scope: null, file: !182, line: 9, type: !23, spFlags: DISPFlagDefinition, unit: !183, retainedNodes: !214) +// CHECK:STDOUT: !212 = !DILocalVariable(arg: 1, scope: !211, type: !21) +// CHECK:STDOUT: !213 = !DILocation(line: 9, column: 3, scope: !211) +// CHECK:STDOUT: !214 = !{!212} +// CHECK:STDOUT: !215 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.b496992173693e26:core.Destroy.Core", scope: null, file: !182, line: 9, type: !23, spFlags: DISPFlagDefinition, unit: !183, retainedNodes: !218) +// CHECK:STDOUT: !216 = !DILocalVariable(arg: 1, scope: !215, type: !21) +// CHECK:STDOUT: !217 = !DILocation(line: 9, column: 3, scope: !215) +// CHECK:STDOUT: !218 = !{!216} +// CHECK:STDOUT: !219 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.b496992173693e26:core.Destroy.Core", scope: null, file: !182, line: 9, type: !23, spFlags: DISPFlagDefinition, unit: !183, retainedNodes: !222) +// CHECK:STDOUT: !220 = !DILocalVariable(arg: 1, scope: !219, type: !21) +// CHECK:STDOUT: !221 = !DILocation(line: 9, column: 3, scope: !219) +// CHECK:STDOUT: !222 = !{!220} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/struct/member_access.carbon b/toolchain/lower/testdata/struct/member_access.carbon index 448ea3eedeec..14d68669ad6e 100644 --- a/toolchain/lower/testdata/struct/member_access.carbon +++ b/toolchain/lower/testdata/struct/member_access.carbon @@ -40,30 +40,63 @@ fn Run() -> i32 { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !51 // CHECK:STDOUT: %.loc16 = load i32, ptr %y.var, align 4, !dbg !52 // CHECK:STDOUT: store i32 %.loc16, ptr %_.var, align 4, !dbg !51 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %_.var), !dbg !51 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %y.var), !dbg !48 -// CHECK:STDOUT: call void @"_COp.09c9bb256d6f25f6:core.Destroy.Core"(ptr %x.var), !dbg !45 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %_.var), !dbg !51 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %y.var), !dbg !48 +// CHECK:STDOUT: call void @"_CSelfDestruct.09c9bb256d6f25f6:core.Destroy.Core"(ptr %x.var), !dbg !45 // CHECK:STDOUT: ret i32 0, !dbg !54 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !55 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !55 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !57 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.dc14d4dd21801791:core.Destroy.Core"(ptr %self) #0 !dbg !59 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !59 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !61 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.09c9bb256d6f25f6:core.Destroy.Core"(ptr %self) #0 !dbg !63 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !63 { // CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !65 // CHECK:STDOUT: ret void, !dbg !65 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.7945ecba5c505fc0:core.Destroy.Core"(ptr %self) #0 !dbg !67 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !69 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.dc14d4dd21801791:core.Destroy.Core"(ptr %self) #0 !dbg !71 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !73 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.dc14d4dd21801791:core.Destroy.Core"(ptr %self) #0 !dbg !75 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.dc14d4dd21801791:core.Destroy.Core"(ptr %self), !dbg !77 +// CHECK:STDOUT: ret void, !dbg !77 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.09c9bb256d6f25f6:core.Destroy.Core"(ptr %self) #0 !dbg !79 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !81 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.09c9bb256d6f25f6:core.Destroy.Core"(ptr %self) #0 !dbg !83 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.09c9bb256d6f25f6:core.Destroy.Core"(ptr %self), !dbg !85 +// CHECK:STDOUT: ret void, !dbg !85 +// 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: @@ -71,7 +104,7 @@ fn Run() -> i32 { // 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: ; uselistorder directives -// CHECK:STDOUT: uselistorder ptr @"_COp.f58524831c37807e:core.Destroy.Core", { 1, 0 } +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core", { 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 2, 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -100,16 +133,36 @@ fn Run() -> i32 { // CHECK:STDOUT: !51 = !DILocation(line: 16, column: 3, scope: !42) // CHECK:STDOUT: !52 = !DILocation(line: 16, column: 16, scope: !42) // CHECK:STDOUT: !54 = !DILocation(line: 17, column: 3, scope: !42) -// CHECK:STDOUT: !55 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !32, line: 16, type: !38, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !58) +// CHECK:STDOUT: !55 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !32, line: 16, type: !38, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !58) // CHECK:STDOUT: !56 = !DILocalVariable(arg: 1, scope: !55, type: !34) // CHECK:STDOUT: !57 = !DILocation(line: 16, column: 3, scope: !55) // CHECK:STDOUT: !58 = !{!56} -// CHECK:STDOUT: !59 = distinct !DISubprogram(name: "Op", linkageName: "_COp.dc14d4dd21801791:core.Destroy.Core", scope: null, file: !32, line: 14, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !62) -// CHECK:STDOUT: !60 = !DILocalVariable(arg: 1, scope: !59, type: !39) -// CHECK:STDOUT: !61 = !DILocation(line: 14, column: 3, scope: !59) +// CHECK:STDOUT: !59 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !32, line: 16, type: !38, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !62) +// CHECK:STDOUT: !60 = !DILocalVariable(arg: 1, scope: !59, type: !34) +// CHECK:STDOUT: !61 = !DILocation(line: 16, column: 3, scope: !59) // CHECK:STDOUT: !62 = !{!60} -// CHECK:STDOUT: !63 = distinct !DISubprogram(name: "Op", linkageName: "_COp.09c9bb256d6f25f6:core.Destroy.Core", scope: null, file: !32, line: 14, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !66) -// CHECK:STDOUT: !64 = !DILocalVariable(arg: 1, scope: !63, type: !39) -// CHECK:STDOUT: !65 = !DILocation(line: 14, column: 3, scope: !63) +// CHECK:STDOUT: !63 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !32, line: 16, type: !38, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !66) +// CHECK:STDOUT: !64 = !DILocalVariable(arg: 1, scope: !63, type: !34) +// CHECK:STDOUT: !65 = !DILocation(line: 16, column: 3, scope: !63) // CHECK:STDOUT: !66 = !{!64} +// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.7945ecba5c505fc0:core.Destroy.Core", scope: null, file: !32, line: 14, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !70) +// CHECK:STDOUT: !68 = !DILocalVariable(arg: 1, scope: !67, type: !39) +// CHECK:STDOUT: !69 = !DILocation(line: 14, column: 3, scope: !67) +// CHECK:STDOUT: !70 = !{!68} +// CHECK:STDOUT: !71 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.dc14d4dd21801791:core.Destroy.Core", scope: null, file: !32, line: 14, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !74) +// CHECK:STDOUT: !72 = !DILocalVariable(arg: 1, scope: !71, type: !39) +// CHECK:STDOUT: !73 = !DILocation(line: 14, column: 3, scope: !71) +// CHECK:STDOUT: !74 = !{!72} +// CHECK:STDOUT: !75 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.dc14d4dd21801791:core.Destroy.Core", scope: null, file: !32, line: 14, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !78) +// CHECK:STDOUT: !76 = !DILocalVariable(arg: 1, scope: !75, type: !39) +// CHECK:STDOUT: !77 = !DILocation(line: 14, column: 3, scope: !75) +// CHECK:STDOUT: !78 = !{!76} +// CHECK:STDOUT: !79 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.09c9bb256d6f25f6:core.Destroy.Core", scope: null, file: !32, line: 14, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !82) +// CHECK:STDOUT: !80 = !DILocalVariable(arg: 1, scope: !79, type: !39) +// CHECK:STDOUT: !81 = !DILocation(line: 14, column: 3, scope: !79) +// CHECK:STDOUT: !82 = !{!80} +// CHECK:STDOUT: !83 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.09c9bb256d6f25f6:core.Destroy.Core", scope: null, file: !32, line: 14, type: !41, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !86) +// CHECK:STDOUT: !84 = !DILocalVariable(arg: 1, scope: !83, type: !39) +// CHECK:STDOUT: !85 = !DILocation(line: 14, column: 3, scope: !83) +// CHECK:STDOUT: !86 = !{!84} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/struct/nested_struct_in_place.carbon b/toolchain/lower/testdata/struct/nested_struct_in_place.carbon index dbf33167be5e..5629c46b8413 100644 --- a/toolchain/lower/testdata/struct/nested_struct_in_place.carbon +++ b/toolchain/lower/testdata/struct/nested_struct_in_place.carbon @@ -31,28 +31,55 @@ fn G() { // CHECK:STDOUT: call void @_CF.Main(ptr %.loc16_74.1.a), !dbg !33 // CHECK:STDOUT: %.loc16_74.2.b = getelementptr inbounds nuw { { i32, i32, i32 }, { i32, i32, i32 } }, ptr %_.var, i32 0, i32 1, !dbg !32 // CHECK:STDOUT: call void @_CF.Main(ptr %.loc16_74.2.b), !dbg !34 -// CHECK:STDOUT: call void @"_COp.2a02704bde23204a:core.Destroy.Core"(ptr %_.var), !dbg !31 +// CHECK:STDOUT: call void @"_CSelfDestruct.2a02704bde23204a:core.Destroy.Core"(ptr %_.var), !dbg !31 // CHECK:STDOUT: ret void, !dbg !36 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !37 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !37 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !39 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.555b1314256372b8:core.Destroy.Core"(ptr %self) #0 !dbg !41 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !41 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !43 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.2a02704bde23204a:core.Destroy.Core"(ptr %self) #0 !dbg !45 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !45 { // CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !47 // CHECK:STDOUT: ret void, !dbg !47 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.555b1314256372b8:core.Destroy.Core"(ptr %self) #0 !dbg !49 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !51 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.555b1314256372b8:core.Destroy.Core"(ptr %self) #0 !dbg !53 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.555b1314256372b8:core.Destroy.Core"(ptr %self), !dbg !55 +// CHECK:STDOUT: ret void, !dbg !55 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.2a02704bde23204a:core.Destroy.Core"(ptr %self) #0 !dbg !57 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !59 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.2a02704bde23204a:core.Destroy.Core"(ptr %self) #0 !dbg !61 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.2a02704bde23204a:core.Destroy.Core"(ptr %self), !dbg !63 +// CHECK:STDOUT: ret void, !dbg !63 +// 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: @@ -80,16 +107,32 @@ fn G() { // CHECK:STDOUT: !33 = !DILocation(line: 16, column: 61, scope: !30) // CHECK:STDOUT: !34 = !DILocation(line: 16, column: 71, scope: !30) // CHECK:STDOUT: !36 = !DILocation(line: 15, column: 1, scope: !30) -// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 16, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !40) +// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !18, line: 16, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !40) // CHECK:STDOUT: !38 = !DILocalVariable(arg: 1, scope: !37, type: !20) // CHECK:STDOUT: !39 = !DILocation(line: 16, column: 3, scope: !37) // CHECK:STDOUT: !40 = !{!38} -// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "Op", linkageName: "_COp.555b1314256372b8:core.Destroy.Core", scope: null, file: !18, line: 16, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !44) -// CHECK:STDOUT: !42 = !DILocalVariable(arg: 1, scope: !41, type: !21) +// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 16, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !44) +// CHECK:STDOUT: !42 = !DILocalVariable(arg: 1, scope: !41, type: !20) // CHECK:STDOUT: !43 = !DILocation(line: 16, column: 3, scope: !41) // CHECK:STDOUT: !44 = !{!42} -// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "Op", linkageName: "_COp.2a02704bde23204a:core.Destroy.Core", scope: null, file: !18, line: 16, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !48) -// CHECK:STDOUT: !46 = !DILocalVariable(arg: 1, scope: !45, type: !21) +// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 16, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !48) +// CHECK:STDOUT: !46 = !DILocalVariable(arg: 1, scope: !45, type: !20) // CHECK:STDOUT: !47 = !DILocation(line: 16, column: 3, scope: !45) // CHECK:STDOUT: !48 = !{!46} +// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.555b1314256372b8:core.Destroy.Core", scope: null, file: !18, line: 16, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !52) +// CHECK:STDOUT: !50 = !DILocalVariable(arg: 1, scope: !49, type: !21) +// CHECK:STDOUT: !51 = !DILocation(line: 16, column: 3, scope: !49) +// CHECK:STDOUT: !52 = !{!50} +// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.555b1314256372b8:core.Destroy.Core", scope: null, file: !18, line: 16, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !56) +// CHECK:STDOUT: !54 = !DILocalVariable(arg: 1, scope: !53, type: !21) +// CHECK:STDOUT: !55 = !DILocation(line: 16, column: 3, scope: !53) +// CHECK:STDOUT: !56 = !{!54} +// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.2a02704bde23204a:core.Destroy.Core", scope: null, file: !18, line: 16, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !60) +// CHECK:STDOUT: !58 = !DILocalVariable(arg: 1, scope: !57, type: !21) +// CHECK:STDOUT: !59 = !DILocation(line: 16, column: 3, scope: !57) +// CHECK:STDOUT: !60 = !{!58} +// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.2a02704bde23204a:core.Destroy.Core", scope: null, file: !18, line: 16, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !64) +// CHECK:STDOUT: !62 = !DILocalVariable(arg: 1, scope: !61, type: !21) +// CHECK:STDOUT: !63 = !DILocation(line: 16, column: 3, scope: !61) +// CHECK:STDOUT: !64 = !{!62} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/struct/one_entry.carbon b/toolchain/lower/testdata/struct/one_entry.carbon index 29f5f769c3dc..32c8dc33b6f8 100644 --- a/toolchain/lower/testdata/struct/one_entry.carbon +++ b/toolchain/lower/testdata/struct/one_entry.carbon @@ -32,28 +32,48 @@ fn Run() -> i32 { // CHECK:STDOUT: %.loc15_22.2 = load i32, ptr %.loc15_22.1.a, align 4, !dbg !34 // CHECK:STDOUT: %.loc15_22.3.struct.init = insertvalue { i32 } poison, i32 %.loc15_22.2, 0, !dbg !34 // CHECK:STDOUT: store { i32 } %.loc15_22.3.struct.init, ptr %_.var, align 4, !dbg !33 -// CHECK:STDOUT: call void @"_COp.a9280e8bea6fc5f9:core.Destroy.Core"(ptr %_.var), !dbg !33 -// CHECK:STDOUT: call void @"_COp.a9280e8bea6fc5f9:core.Destroy.Core"(ptr %x.var), !dbg !31 +// CHECK:STDOUT: call void @"_CSelfDestruct.a9280e8bea6fc5f9:core.Destroy.Core"(ptr %_.var), !dbg !33 +// CHECK:STDOUT: call void @"_CSelfDestruct.a9280e8bea6fc5f9:core.Destroy.Core"(ptr %x.var), !dbg !31 // CHECK:STDOUT: ret i32 0, !dbg !36 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !37 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !37 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !39 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.a9280e8bea6fc5f9:core.Destroy.Core"(ptr %self) #0 !dbg !41 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !41 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !43 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !45 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !47 +// CHECK:STDOUT: ret void, !dbg !47 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.a9280e8bea6fc5f9:core.Destroy.Core"(ptr %self) #0 !dbg !49 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !51 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.a9280e8bea6fc5f9:core.Destroy.Core"(ptr %self) #0 !dbg !53 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.a9280e8bea6fc5f9:core.Destroy.Core"(ptr %self), !dbg !55 +// CHECK:STDOUT: ret void, !dbg !55 +// 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: ; uselistorder directives -// CHECK:STDOUT: uselistorder ptr @"_COp.a9280e8bea6fc5f9:core.Destroy.Core", { 1, 0 } +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.a9280e8bea6fc5f9:core.Destroy.Core", { 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -79,12 +99,24 @@ fn Run() -> i32 { // CHECK:STDOUT: !33 = !DILocation(line: 15, column: 3, scope: !28) // CHECK:STDOUT: !34 = !DILocation(line: 15, column: 22, scope: !28) // CHECK:STDOUT: !36 = !DILocation(line: 16, column: 3, scope: !28) -// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 15, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !40) +// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !18, line: 15, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !40) // CHECK:STDOUT: !38 = !DILocalVariable(arg: 1, scope: !37, type: !20) // CHECK:STDOUT: !39 = !DILocation(line: 15, column: 3, scope: !37) // CHECK:STDOUT: !40 = !{!38} -// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "Op", linkageName: "_COp.a9280e8bea6fc5f9:core.Destroy.Core", scope: null, file: !18, line: 15, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !44) -// CHECK:STDOUT: !42 = !DILocalVariable(arg: 1, scope: !41, type: !25) +// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 15, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !44) +// CHECK:STDOUT: !42 = !DILocalVariable(arg: 1, scope: !41, type: !20) // CHECK:STDOUT: !43 = !DILocation(line: 15, column: 3, scope: !41) // CHECK:STDOUT: !44 = !{!42} +// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 15, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !48) +// CHECK:STDOUT: !46 = !DILocalVariable(arg: 1, scope: !45, type: !20) +// CHECK:STDOUT: !47 = !DILocation(line: 15, column: 3, scope: !45) +// CHECK:STDOUT: !48 = !{!46} +// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.a9280e8bea6fc5f9:core.Destroy.Core", scope: null, file: !18, line: 15, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !52) +// CHECK:STDOUT: !50 = !DILocalVariable(arg: 1, scope: !49, type: !25) +// CHECK:STDOUT: !51 = !DILocation(line: 15, column: 3, scope: !49) +// CHECK:STDOUT: !52 = !{!50} +// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.a9280e8bea6fc5f9:core.Destroy.Core", scope: null, file: !18, line: 15, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !56) +// CHECK:STDOUT: !54 = !DILocalVariable(arg: 1, scope: !53, type: !25) +// CHECK:STDOUT: !55 = !DILocation(line: 15, column: 3, scope: !53) +// CHECK:STDOUT: !56 = !{!54} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/struct/two_entries.carbon b/toolchain/lower/testdata/struct/two_entries.carbon index de8383bf6dcf..514c0ad0b095 100644 --- a/toolchain/lower/testdata/struct/two_entries.carbon +++ b/toolchain/lower/testdata/struct/two_entries.carbon @@ -40,23 +40,43 @@ fn Run() -> i32 { // CHECK:STDOUT: %.loc15_31.6 = load i32, ptr %.loc15_31.5.b, align 4, !dbg !35 // CHECK:STDOUT: %.loc15_31.7.b = getelementptr inbounds nuw { i32, i32 }, ptr %_.var, i32 0, i32 1, !dbg !35 // CHECK:STDOUT: store i32 %.loc15_31.6, ptr %.loc15_31.7.b, align 4, !dbg !35 -// CHECK:STDOUT: call void @"_COp.b4c762864cd9a02b:core.Destroy.Core"(ptr %_.var), !dbg !34 -// CHECK:STDOUT: call void @"_COp.b4c762864cd9a02b:core.Destroy.Core"(ptr %x.var), !dbg !31 +// CHECK:STDOUT: call void @"_CSelfDestruct.b4c762864cd9a02b:core.Destroy.Core"(ptr %_.var), !dbg !34 +// CHECK:STDOUT: call void @"_CSelfDestruct.b4c762864cd9a02b:core.Destroy.Core"(ptr %x.var), !dbg !31 // CHECK:STDOUT: ret i32 0, !dbg !37 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !38 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !38 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !40 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.b4c762864cd9a02b:core.Destroy.Core"(ptr %self) #0 !dbg !42 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !42 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !44 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !46 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !48 +// CHECK:STDOUT: ret void, !dbg !48 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.b4c762864cd9a02b:core.Destroy.Core"(ptr %self) #0 !dbg !50 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !52 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.b4c762864cd9a02b:core.Destroy.Core"(ptr %self) #0 !dbg !54 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.b4c762864cd9a02b:core.Destroy.Core"(ptr %self), !dbg !56 +// CHECK:STDOUT: ret void, !dbg !56 +// 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: @@ -64,7 +84,7 @@ fn Run() -> i32 { // 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: ; uselistorder directives -// CHECK:STDOUT: uselistorder ptr @"_COp.b4c762864cd9a02b:core.Destroy.Core", { 1, 0 } +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.b4c762864cd9a02b:core.Destroy.Core", { 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -91,12 +111,24 @@ fn Run() -> i32 { // CHECK:STDOUT: !34 = !DILocation(line: 15, column: 3, scope: !28) // CHECK:STDOUT: !35 = !DILocation(line: 15, column: 31, scope: !28) // CHECK:STDOUT: !37 = !DILocation(line: 16, column: 3, scope: !28) -// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 15, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !41) +// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !18, line: 15, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !41) // CHECK:STDOUT: !39 = !DILocalVariable(arg: 1, scope: !38, type: !20) // CHECK:STDOUT: !40 = !DILocation(line: 15, column: 3, scope: !38) // CHECK:STDOUT: !41 = !{!39} -// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "Op", linkageName: "_COp.b4c762864cd9a02b:core.Destroy.Core", scope: null, file: !18, line: 15, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !45) -// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !42, type: !25) +// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 15, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !45) +// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !42, type: !20) // CHECK:STDOUT: !44 = !DILocation(line: 15, column: 3, scope: !42) // CHECK:STDOUT: !45 = !{!43} +// CHECK:STDOUT: !46 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 15, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !49) +// CHECK:STDOUT: !47 = !DILocalVariable(arg: 1, scope: !46, type: !20) +// CHECK:STDOUT: !48 = !DILocation(line: 15, column: 3, scope: !46) +// CHECK:STDOUT: !49 = !{!47} +// CHECK:STDOUT: !50 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.b4c762864cd9a02b:core.Destroy.Core", scope: null, file: !18, line: 15, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !53) +// CHECK:STDOUT: !51 = !DILocalVariable(arg: 1, scope: !50, type: !25) +// CHECK:STDOUT: !52 = !DILocation(line: 15, column: 3, scope: !50) +// CHECK:STDOUT: !53 = !{!51} +// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.b4c762864cd9a02b:core.Destroy.Core", scope: null, file: !18, line: 15, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !57) +// CHECK:STDOUT: !55 = !DILocalVariable(arg: 1, scope: !54, type: !25) +// CHECK:STDOUT: !56 = !DILocation(line: 15, column: 3, scope: !54) +// CHECK:STDOUT: !57 = !{!55} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/template/merging.carbon b/toolchain/lower/testdata/template/merging.carbon index e6f1117dbf30..38d6c67ca92f 100644 --- a/toolchain/lower/testdata/template/merging.carbon +++ b/toolchain/lower/testdata/template/merging.carbon @@ -200,99 +200,126 @@ fn CallCallF(a: A, b: B) { // CHECK:STDOUT: %.loc34_11.2.temp = alloca {}, align 1, !dbg !54 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc32_11.2.temp), !dbg !50 // CHECK:STDOUT: call void @_CCallBF.Main.a6a60dfee2d7d273(ptr @B.val.loc8_45), !dbg !51 -// CHECK:STDOUT: call void @"_COp.8c4b83ecd900f1ea:core.Destroy.Core"(ptr @B.val), !dbg !50 +// CHECK:STDOUT: call void @"_CSelfDestruct.8c4b83ecd900f1ea:core.Destroy.Core"(ptr @B.val), !dbg !50 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc33_11.2.temp), !dbg !52 // CHECK:STDOUT: call void @_CCallBF.Main.9522ff908e97e267(ptr @C.val.loc33_13.3), !dbg !53 -// CHECK:STDOUT: call void @"_COp.08d9e38b928ba575:core.Destroy.Core"(ptr @C.val), !dbg !52 +// CHECK:STDOUT: call void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr @C.val), !dbg !52 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc34_11.2.temp), !dbg !54 // CHECK:STDOUT: call void @_CCallBF.Main.931317eeae6ffe17(ptr @D.val.loc34_13.3), !dbg !55 -// CHECK:STDOUT: call void @"_COp.a50fd899f969e609:core.Destroy.Core"(ptr @D.val), !dbg !54 +// CHECK:STDOUT: call void @"_CSelfDestruct.a50fd899f969e609:core.Destroy.Core"(ptr @D.val), !dbg !54 // CHECK:STDOUT: ret void, !dbg !56 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %self) #0 !dbg !57 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %self) #0 !dbg !57 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !59 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !61 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %self) #0 !dbg !61 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !63 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.a50fd899f969e609:core.Destroy.Core"(ptr %self) #0 !dbg !65 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %self) #0 !dbg !65 { // CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.8c4b83ecd900f1ea:core.Destroy.Core"(ptr %self), !dbg !67 // CHECK:STDOUT: ret void, !dbg !67 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !69 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !71 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !73 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core"(ptr %self), !dbg !75 +// CHECK:STDOUT: ret void, !dbg !75 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.a50fd899f969e609:core.Destroy.Core"(ptr %self) #0 !dbg !77 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !79 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.a50fd899f969e609:core.Destroy.Core"(ptr %self) #0 !dbg !81 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.a50fd899f969e609:core.Destroy.Core"(ptr %self), !dbg !83 +// CHECK:STDOUT: ret void, !dbg !83 +// 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 @_CInitAndCallF.Main.bd4fb75a414fe858() #0 !dbg !69 { +// CHECK:STDOUT: define linkonce_odr void @_CInitAndCallF.Main.bd4fb75a414fe858() #0 !dbg !85 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CF.A.Main(ptr @A.val.A.val), !dbg !70 -// CHECK:STDOUT: ret void, !dbg !71 +// CHECK:STDOUT: call void @_CF.A.Main(ptr @A.val.A.val), !dbg !86 +// CHECK:STDOUT: ret void, !dbg !87 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CInitAndCallF.Main.a6a60dfee2d7d273() #0 !dbg !72 { +// CHECK:STDOUT: define linkonce_odr void @_CInitAndCallF.Main.a6a60dfee2d7d273() #0 !dbg !88 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CF.B.Main(ptr @B.val.loc8_45), !dbg !73 -// CHECK:STDOUT: ret void, !dbg !74 +// CHECK:STDOUT: call void @_CF.B.Main(ptr @B.val.loc8_45), !dbg !89 +// CHECK:STDOUT: ret void, !dbg !90 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CInitAndCallF.Main.9522ff908e97e267() #0 !dbg !75 { +// CHECK:STDOUT: define linkonce_odr void @_CInitAndCallF.Main.9522ff908e97e267() #0 !dbg !91 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.2a64a1.4.temp = alloca {}, align 1, !dbg !77 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.2a64a1.4.temp), !dbg !77 -// CHECK:STDOUT: call void @"_CConvert.C.Main:ImplicitAs.a6a60dfee2d7d273.Core"(ptr %.2a64a1.4.temp, ptr @C.val.loc33_13.3), !dbg !77 -// CHECK:STDOUT: call void @_CF.B.Main(ptr %.2a64a1.4.temp), !dbg !76 -// CHECK:STDOUT: ret void, !dbg !78 +// CHECK:STDOUT: %.2a64a1.4.temp = alloca {}, align 1, !dbg !93 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.2a64a1.4.temp), !dbg !93 +// CHECK:STDOUT: call void @"_CConvert.C.Main:ImplicitAs.a6a60dfee2d7d273.Core"(ptr %.2a64a1.4.temp, ptr @C.val.loc33_13.3), !dbg !93 +// CHECK:STDOUT: call void @_CF.B.Main(ptr %.2a64a1.4.temp), !dbg !92 +// CHECK:STDOUT: ret void, !dbg !94 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CInitAndCallF.Main.931317eeae6ffe17() #0 !dbg !79 { +// CHECK:STDOUT: define linkonce_odr void @_CInitAndCallF.Main.931317eeae6ffe17() #0 !dbg !95 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.2a64a1.3.temp = alloca {}, align 1, !dbg !81 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.2a64a1.3.temp), !dbg !81 -// CHECK:STDOUT: call void @"_CConvert.D.Main:ImplicitAs.a6a60dfee2d7d273.Core"(ptr %.2a64a1.3.temp, ptr @D.val.loc34_13.3), !dbg !81 -// CHECK:STDOUT: call void @_CF.B.Main(ptr %.2a64a1.3.temp), !dbg !80 -// CHECK:STDOUT: ret void, !dbg !82 +// CHECK:STDOUT: %.2a64a1.3.temp = alloca {}, align 1, !dbg !97 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.2a64a1.3.temp), !dbg !97 +// CHECK:STDOUT: call void @"_CConvert.D.Main:ImplicitAs.a6a60dfee2d7d273.Core"(ptr %.2a64a1.3.temp, ptr @D.val.loc34_13.3), !dbg !97 +// CHECK:STDOUT: call void @_CF.B.Main(ptr %.2a64a1.3.temp), !dbg !96 +// CHECK:STDOUT: ret void, !dbg !98 // 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 !83 { +// CHECK:STDOUT: define linkonce_odr void @_CCallBF.Main.a6a60dfee2d7d273(ptr %x) #0 !dbg !99 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CF.B.Main(ptr %x), !dbg !86 -// CHECK:STDOUT: ret void, !dbg !87 +// CHECK:STDOUT: call void @_CF.B.Main(ptr %x), !dbg !102 +// CHECK:STDOUT: ret void, !dbg !103 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CCallBF.Main.9522ff908e97e267(ptr %x) #0 !dbg !89 { +// CHECK:STDOUT: define linkonce_odr void @_CCallBF.Main.9522ff908e97e267(ptr %x) #0 !dbg !105 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.2a64a1.2.temp = alloca {}, align 1, !dbg !92 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.2a64a1.2.temp), !dbg !92 -// CHECK:STDOUT: call void @"_CConvert.C.Main:ImplicitAs.a6a60dfee2d7d273.Core"(ptr %.2a64a1.2.temp, ptr %x), !dbg !92 -// CHECK:STDOUT: call void @_CF.B.Main(ptr %.2a64a1.2.temp), !dbg !92 -// CHECK:STDOUT: ret void, !dbg !93 +// CHECK:STDOUT: %.2a64a1.2.temp = alloca {}, align 1, !dbg !108 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.2a64a1.2.temp), !dbg !108 +// CHECK:STDOUT: call void @"_CConvert.C.Main:ImplicitAs.a6a60dfee2d7d273.Core"(ptr %.2a64a1.2.temp, ptr %x), !dbg !108 +// CHECK:STDOUT: call void @_CF.B.Main(ptr %.2a64a1.2.temp), !dbg !108 +// CHECK:STDOUT: ret void, !dbg !109 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CCallBF.Main.931317eeae6ffe17(ptr %x) #0 !dbg !95 { +// CHECK:STDOUT: define linkonce_odr void @_CCallBF.Main.931317eeae6ffe17(ptr %x) #0 !dbg !111 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.2a64a1.1.temp = alloca {}, align 1, !dbg !98 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.2a64a1.1.temp), !dbg !98 -// CHECK:STDOUT: call void @"_CConvert.D.Main:ImplicitAs.a6a60dfee2d7d273.Core"(ptr %.2a64a1.1.temp, ptr %x), !dbg !98 -// CHECK:STDOUT: call void @_CF.B.Main(ptr %.2a64a1.1.temp), !dbg !98 -// CHECK:STDOUT: ret void, !dbg !99 +// CHECK:STDOUT: %.2a64a1.1.temp = alloca {}, align 1, !dbg !114 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.2a64a1.1.temp), !dbg !114 +// CHECK:STDOUT: call void @"_CConvert.D.Main:ImplicitAs.a6a60dfee2d7d273.Core"(ptr %.2a64a1.1.temp, ptr %x), !dbg !114 +// CHECK:STDOUT: call void @_CF.B.Main(ptr %.2a64a1.1.temp), !dbg !114 +// CHECK:STDOUT: ret void, !dbg !115 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -338,47 +365,63 @@ fn CallCallF(a: A, b: B) { // CHECK:STDOUT: !54 = !DILocation(line: 34, column: 10, scope: !49) // CHECK:STDOUT: !55 = !DILocation(line: 34, column: 3, scope: !49) // CHECK:STDOUT: !56 = !DILocation(line: 31, column: 1, scope: !49) -// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "Op", linkageName: "_COp.8c4b83ecd900f1ea:core.Destroy.Core", scope: null, file: !22, line: 32, type: !26, spFlags: DISPFlagDefinition, unit: !23, retainedNodes: !60) +// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !22, line: 32, type: !26, spFlags: DISPFlagDefinition, unit: !23, retainedNodes: !60) // CHECK:STDOUT: !58 = !DILocalVariable(arg: 1, scope: !57, type: !24) // CHECK:STDOUT: !59 = !DILocation(line: 32, column: 10, scope: !57) // CHECK:STDOUT: !60 = !{!58} -// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "Op", linkageName: "_COp.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !22, line: 33, type: !26, spFlags: DISPFlagDefinition, unit: !23, retainedNodes: !64) +// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.8c4b83ecd900f1ea:core.Destroy.Core", scope: null, file: !22, line: 32, type: !26, spFlags: DISPFlagDefinition, unit: !23, retainedNodes: !64) // CHECK:STDOUT: !62 = !DILocalVariable(arg: 1, scope: !61, type: !24) -// CHECK:STDOUT: !63 = !DILocation(line: 33, column: 10, scope: !61) +// CHECK:STDOUT: !63 = !DILocation(line: 32, column: 10, scope: !61) // CHECK:STDOUT: !64 = !{!62} -// CHECK:STDOUT: !65 = distinct !DISubprogram(name: "Op", linkageName: "_COp.a50fd899f969e609:core.Destroy.Core", scope: null, file: !22, line: 34, type: !26, spFlags: DISPFlagDefinition, unit: !23, retainedNodes: !68) +// CHECK:STDOUT: !65 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.8c4b83ecd900f1ea:core.Destroy.Core", scope: null, file: !22, line: 32, type: !26, spFlags: DISPFlagDefinition, unit: !23, retainedNodes: !68) // CHECK:STDOUT: !66 = !DILocalVariable(arg: 1, scope: !65, type: !24) -// CHECK:STDOUT: !67 = !DILocation(line: 34, column: 10, scope: !65) +// CHECK:STDOUT: !67 = !DILocation(line: 32, column: 10, scope: !65) // CHECK:STDOUT: !68 = !{!66} -// CHECK:STDOUT: !69 = distinct !DISubprogram(name: "InitAndCallF", linkageName: "_CInitAndCallF.Main.bd4fb75a414fe858", scope: null, file: !22, line: 18, type: !7, spFlags: DISPFlagDefinition, unit: !23) -// CHECK:STDOUT: !70 = !DILocation(line: 18, column: 37, scope: !69) -// CHECK:STDOUT: !71 = !DILocation(line: 18, column: 1, scope: !69) -// CHECK:STDOUT: !72 = distinct !DISubprogram(name: "InitAndCallF", linkageName: "_CInitAndCallF.Main.a6a60dfee2d7d273", scope: null, file: !22, line: 18, type: !7, spFlags: DISPFlagDefinition, unit: !23) -// CHECK:STDOUT: !73 = !DILocation(line: 18, column: 37, scope: !72) -// CHECK:STDOUT: !74 = !DILocation(line: 18, column: 1, scope: !72) -// CHECK:STDOUT: !75 = distinct !DISubprogram(name: "InitAndCallF", linkageName: "_CInitAndCallF.Main.9522ff908e97e267", scope: null, file: !22, line: 18, type: !7, spFlags: DISPFlagDefinition, unit: !23) -// CHECK:STDOUT: !76 = !DILocation(line: 18, column: 37, scope: !75) -// CHECK:STDOUT: !77 = !DILocation(line: 0, scope: !75) -// CHECK:STDOUT: !78 = !DILocation(line: 18, column: 1, scope: !75) -// CHECK:STDOUT: !79 = distinct !DISubprogram(name: "InitAndCallF", linkageName: "_CInitAndCallF.Main.931317eeae6ffe17", 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: "CallBF", linkageName: "_CCallBF.Main.a6a60dfee2d7d273", scope: null, file: !22, line: 27, type: !26, spFlags: DISPFlagDefinition, unit: !23, retainedNodes: !88) -// CHECK:STDOUT: !84 = !DILocalVariable(arg: 1, scope: !83, type: !24) -// CHECK:STDOUT: !86 = !DILocation(line: 28, column: 3, scope: !83) -// CHECK:STDOUT: !87 = !DILocation(line: 27, column: 1, scope: !83) -// CHECK:STDOUT: !88 = !{!84} -// CHECK:STDOUT: !89 = distinct !DISubprogram(name: "CallBF", linkageName: "_CCallBF.Main.9522ff908e97e267", scope: null, file: !22, line: 27, type: !26, spFlags: DISPFlagDefinition, unit: !23, retainedNodes: !94) -// CHECK:STDOUT: !90 = !DILocalVariable(arg: 1, scope: !89, type: !24) -// CHECK:STDOUT: !92 = !DILocation(line: 28, column: 3, scope: !89) -// CHECK:STDOUT: !93 = !DILocation(line: 27, column: 1, scope: !89) -// CHECK:STDOUT: !94 = !{!90} -// CHECK:STDOUT: !95 = distinct !DISubprogram(name: "CallBF", linkageName: "_CCallBF.Main.931317eeae6ffe17", scope: null, file: !22, line: 27, type: !26, spFlags: DISPFlagDefinition, unit: !23, retainedNodes: !100) -// CHECK:STDOUT: !96 = !DILocalVariable(arg: 1, scope: !95, type: !24) -// CHECK:STDOUT: !98 = !DILocation(line: 28, column: 3, scope: !95) -// CHECK:STDOUT: !99 = !DILocation(line: 27, column: 1, scope: !95) -// CHECK:STDOUT: !100 = !{!96} +// CHECK:STDOUT: !69 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !22, line: 33, type: !26, spFlags: DISPFlagDefinition, unit: !23, retainedNodes: !72) +// CHECK:STDOUT: !70 = !DILocalVariable(arg: 1, scope: !69, type: !24) +// CHECK:STDOUT: !71 = !DILocation(line: 33, column: 10, scope: !69) +// CHECK:STDOUT: !72 = !{!70} +// CHECK:STDOUT: !73 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !22, line: 33, type: !26, spFlags: DISPFlagDefinition, unit: !23, retainedNodes: !76) +// CHECK:STDOUT: !74 = !DILocalVariable(arg: 1, scope: !73, type: !24) +// CHECK:STDOUT: !75 = !DILocation(line: 33, column: 10, scope: !73) +// CHECK:STDOUT: !76 = !{!74} +// CHECK:STDOUT: !77 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.a50fd899f969e609:core.Destroy.Core", scope: null, file: !22, line: 34, type: !26, spFlags: DISPFlagDefinition, unit: !23, retainedNodes: !80) +// CHECK:STDOUT: !78 = !DILocalVariable(arg: 1, scope: !77, type: !24) +// CHECK:STDOUT: !79 = !DILocation(line: 34, column: 10, scope: !77) +// CHECK:STDOUT: !80 = !{!78} +// CHECK:STDOUT: !81 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.a50fd899f969e609:core.Destroy.Core", scope: null, file: !22, line: 34, type: !26, spFlags: DISPFlagDefinition, unit: !23, retainedNodes: !84) +// CHECK:STDOUT: !82 = !DILocalVariable(arg: 1, scope: !81, type: !24) +// CHECK:STDOUT: !83 = !DILocation(line: 34, column: 10, scope: !81) +// CHECK:STDOUT: !84 = !{!82} +// CHECK:STDOUT: !85 = distinct !DISubprogram(name: "InitAndCallF", linkageName: "_CInitAndCallF.Main.bd4fb75a414fe858", scope: null, file: !22, line: 18, type: !7, spFlags: DISPFlagDefinition, unit: !23) +// CHECK:STDOUT: !86 = !DILocation(line: 18, column: 37, scope: !85) +// CHECK:STDOUT: !87 = !DILocation(line: 18, column: 1, scope: !85) +// CHECK:STDOUT: !88 = distinct !DISubprogram(name: "InitAndCallF", linkageName: "_CInitAndCallF.Main.a6a60dfee2d7d273", scope: null, file: !22, line: 18, type: !7, spFlags: DISPFlagDefinition, unit: !23) +// CHECK:STDOUT: !89 = !DILocation(line: 18, column: 37, scope: !88) +// CHECK:STDOUT: !90 = !DILocation(line: 18, column: 1, scope: !88) +// CHECK:STDOUT: !91 = distinct !DISubprogram(name: "InitAndCallF", linkageName: "_CInitAndCallF.Main.9522ff908e97e267", scope: null, file: !22, line: 18, type: !7, spFlags: DISPFlagDefinition, unit: !23) +// CHECK:STDOUT: !92 = !DILocation(line: 18, column: 37, scope: !91) +// CHECK:STDOUT: !93 = !DILocation(line: 0, scope: !91) +// CHECK:STDOUT: !94 = !DILocation(line: 18, column: 1, scope: !91) +// CHECK:STDOUT: !95 = distinct !DISubprogram(name: "InitAndCallF", linkageName: "_CInitAndCallF.Main.931317eeae6ffe17", scope: null, file: !22, line: 18, type: !7, spFlags: DISPFlagDefinition, unit: !23) +// CHECK:STDOUT: !96 = !DILocation(line: 18, column: 37, scope: !95) +// CHECK:STDOUT: !97 = !DILocation(line: 0, scope: !95) +// CHECK:STDOUT: !98 = !DILocation(line: 18, column: 1, scope: !95) +// CHECK:STDOUT: !99 = distinct !DISubprogram(name: "CallBF", linkageName: "_CCallBF.Main.a6a60dfee2d7d273", 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: !105 = distinct !DISubprogram(name: "CallBF", linkageName: "_CCallBF.Main.9522ff908e97e267", scope: null, file: !22, line: 27, type: !26, spFlags: DISPFlagDefinition, unit: !23, retainedNodes: !110) +// CHECK:STDOUT: !106 = !DILocalVariable(arg: 1, scope: !105, type: !24) +// CHECK:STDOUT: !108 = !DILocation(line: 28, column: 3, scope: !105) +// CHECK:STDOUT: !109 = !DILocation(line: 27, column: 1, scope: !105) +// CHECK:STDOUT: !110 = !{!106} +// CHECK:STDOUT: !111 = distinct !DISubprogram(name: "CallBF", linkageName: "_CCallBF.Main.931317eeae6ffe17", scope: null, file: !22, line: 27, type: !26, spFlags: DISPFlagDefinition, unit: !23, retainedNodes: !116) +// CHECK:STDOUT: !112 = !DILocalVariable(arg: 1, scope: !111, type: !24) +// CHECK:STDOUT: !114 = !DILocation(line: 28, column: 3, scope: !111) +// CHECK:STDOUT: !115 = !DILocation(line: 27, column: 1, scope: !111) +// CHECK:STDOUT: !116 = !{!112} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'no_merge_convert_one_arg.carbon' @@ -387,65 +430,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 !105 { +// CHECK:STDOUT: define void @"_CConvert.B.Main:ImplicitAs.bd4fb75a414fe858.Core"(ptr sret({}) %return, ptr %self) #0 !dbg !121 { // 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 !110 -// CHECK:STDOUT: ret void, !dbg !110 +// 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 !126 +// CHECK:STDOUT: ret void, !dbg !126 // 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 !112 { +// CHECK:STDOUT: define void @_CCallCallF.Main(ptr %a, ptr %b) #0 !dbg !128 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CCallF.Main.2877a42045e01a3b(ptr %a, ptr %a), !dbg !119 -// CHECK:STDOUT: call void @_CCallF.Main.d01354a0ad5f3687(ptr %a, ptr %b), !dbg !122 -// CHECK:STDOUT: call void @_CCallF.Main.37b67b83fe9ed3dd(ptr %b, ptr %a), !dbg !125 -// CHECK:STDOUT: call void @_CCallF.Main.7096323a0fb88cc3(ptr %b, ptr %b), !dbg !128 -// CHECK:STDOUT: ret void, !dbg !129 +// CHECK:STDOUT: call void @_CCallF.Main.2877a42045e01a3b(ptr %a, ptr %a), !dbg !135 +// CHECK:STDOUT: call void @_CCallF.Main.d01354a0ad5f3687(ptr %a, ptr %b), !dbg !138 +// CHECK:STDOUT: call void @_CCallF.Main.37b67b83fe9ed3dd(ptr %b, ptr %a), !dbg !141 +// CHECK:STDOUT: call void @_CCallF.Main.7096323a0fb88cc3(ptr %b, ptr %b), !dbg !144 +// CHECK:STDOUT: ret void, !dbg !145 // 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 !131 { +// CHECK:STDOUT: define linkonce_odr void @_CCallF.Main.2877a42045e01a3b(ptr %x, ptr %y) #0 !dbg !147 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CF.Main(ptr %x, ptr %y), !dbg !138 -// CHECK:STDOUT: ret void, !dbg !139 +// CHECK:STDOUT: call void @_CF.Main(ptr %x, ptr %y), !dbg !154 +// CHECK:STDOUT: ret void, !dbg !155 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CCallF.Main.d01354a0ad5f3687(ptr %x, ptr %y) #0 !dbg !141 { +// CHECK:STDOUT: define linkonce_odr void @_CCallF.Main.d01354a0ad5f3687(ptr %x, ptr %y) #0 !dbg !157 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.9745c1.4.temp = alloca {}, align 1, !dbg !148 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.9745c1.4.temp), !dbg !148 -// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.bd4fb75a414fe858.Core"(ptr %.9745c1.4.temp, ptr %y), !dbg !148 -// CHECK:STDOUT: call void @_CF.Main(ptr %x, ptr %.9745c1.4.temp), !dbg !148 -// CHECK:STDOUT: ret void, !dbg !149 +// CHECK:STDOUT: %.9745c1.4.temp = alloca {}, align 1, !dbg !164 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.9745c1.4.temp), !dbg !164 +// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.bd4fb75a414fe858.Core"(ptr %.9745c1.4.temp, ptr %y), !dbg !164 +// CHECK:STDOUT: call void @_CF.Main(ptr %x, ptr %.9745c1.4.temp), !dbg !164 +// CHECK:STDOUT: ret void, !dbg !165 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CCallF.Main.37b67b83fe9ed3dd(ptr %x, ptr %y) #0 !dbg !151 { +// CHECK:STDOUT: define linkonce_odr void @_CCallF.Main.37b67b83fe9ed3dd(ptr %x, ptr %y) #0 !dbg !167 { // CHECK:STDOUT: entry: -// 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 !158 -// CHECK:STDOUT: ret void, !dbg !159 +// CHECK:STDOUT: %.9745c1.3.temp = alloca {}, align 1, !dbg !174 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.9745c1.3.temp), !dbg !174 +// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.bd4fb75a414fe858.Core"(ptr %.9745c1.3.temp, ptr %x), !dbg !174 +// CHECK:STDOUT: call void @_CF.Main(ptr %.9745c1.3.temp, ptr %y), !dbg !174 +// CHECK:STDOUT: ret void, !dbg !175 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CCallF.Main.7096323a0fb88cc3(ptr %x, ptr %y) #0 !dbg !161 { +// CHECK:STDOUT: define linkonce_odr void @_CCallF.Main.7096323a0fb88cc3(ptr %x, ptr %y) #0 !dbg !177 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.9745c1.1.temp = alloca {}, align 1, !dbg !168 -// CHECK:STDOUT: %.9745c1.2.temp = alloca {}, align 1, !dbg !168 -// 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 !168 -// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.bd4fb75a414fe858.Core"(ptr %.9745c1.2.temp, ptr %y), !dbg !168 -// CHECK:STDOUT: call void @_CF.Main(ptr %.9745c1.1.temp, ptr %.9745c1.2.temp), !dbg !168 -// CHECK:STDOUT: ret void, !dbg !169 +// CHECK:STDOUT: %.9745c1.1.temp = alloca {}, align 1, !dbg !184 +// CHECK:STDOUT: %.9745c1.2.temp = alloca {}, align 1, !dbg !184 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.9745c1.1.temp), !dbg !184 +// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.bd4fb75a414fe858.Core"(ptr %.9745c1.1.temp, ptr %x), !dbg !184 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.9745c1.2.temp), !dbg !184 +// CHECK:STDOUT: call void @"_CConvert.B.Main:ImplicitAs.bd4fb75a414fe858.Core"(ptr %.9745c1.2.temp, ptr %y), !dbg !184 +// CHECK:STDOUT: call void @_CF.Main(ptr %.9745c1.1.temp, ptr %.9745c1.2.temp), !dbg !184 +// CHECK:STDOUT: ret void, !dbg !185 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -457,7 +500,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 = !{!102} +// CHECK:STDOUT: !llvm.dbg.cu = !{!118} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} @@ -465,45 +508,45 @@ 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: !101 = !DIFile(filename: "no_merge_convert_one_arg.carbon", directory: "") -// CHECK:STDOUT: !102 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !101, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !103 = !{null, !24, !24} -// CHECK:STDOUT: !104 = !DISubroutineType(types: !103) -// CHECK:STDOUT: !105 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.B.Main:ImplicitAs.bd4fb75a414fe858.Core", scope: null, file: !101, line: 6, type: !28, spFlags: DISPFlagDefinition, unit: !102, retainedNodes: !111) -// CHECK:STDOUT: !106 = !DILocalVariable(arg: 1, scope: !105, type: !24) -// CHECK:STDOUT: !110 = !DILocation(line: 6, column: 36, scope: !105) -// CHECK:STDOUT: !111 = !{!106} -// CHECK:STDOUT: !112 = distinct !DISubprogram(name: "CallCallF", linkageName: "_CCallCallF.Main", scope: null, file: !101, line: 16, type: !104, spFlags: DISPFlagDefinition, unit: !102, retainedNodes: !130) -// CHECK:STDOUT: !113 = !DILocalVariable(arg: 1, scope: !112, type: !24) -// CHECK:STDOUT: !114 = !DILocalVariable(arg: 2, scope: !112, type: !24) -// CHECK:STDOUT: !119 = !DILocation(line: 17, column: 3, scope: !112) -// CHECK:STDOUT: !122 = !DILocation(line: 18, column: 3, scope: !112) -// CHECK:STDOUT: !125 = !DILocation(line: 19, column: 3, scope: !112) -// CHECK:STDOUT: !128 = !DILocation(line: 20, column: 3, scope: !112) -// CHECK:STDOUT: !129 = !DILocation(line: 16, column: 1, scope: !112) -// CHECK:STDOUT: !130 = !{!113, !114} -// CHECK:STDOUT: !131 = distinct !DISubprogram(name: "CallF", linkageName: "_CCallF.Main.2877a42045e01a3b", scope: null, file: !101, line: 12, type: !104, spFlags: DISPFlagDefinition, unit: !102, retainedNodes: !140) -// CHECK:STDOUT: !132 = !DILocalVariable(arg: 1, scope: !131, type: !24) -// CHECK:STDOUT: !133 = !DILocalVariable(arg: 2, scope: !131, type: !24) -// CHECK:STDOUT: !138 = !DILocation(line: 13, column: 3, scope: !131) -// CHECK:STDOUT: !139 = !DILocation(line: 12, column: 1, scope: !131) -// CHECK:STDOUT: !140 = !{!132, !133} -// CHECK:STDOUT: !141 = distinct !DISubprogram(name: "CallF", linkageName: "_CCallF.Main.d01354a0ad5f3687", scope: null, file: !101, line: 12, type: !104, spFlags: DISPFlagDefinition, unit: !102, retainedNodes: !150) -// CHECK:STDOUT: !142 = !DILocalVariable(arg: 1, scope: !141, type: !24) -// CHECK:STDOUT: !143 = !DILocalVariable(arg: 2, scope: !141, type: !24) -// CHECK:STDOUT: !148 = !DILocation(line: 13, column: 3, scope: !141) -// CHECK:STDOUT: !149 = !DILocation(line: 12, column: 1, scope: !141) -// CHECK:STDOUT: !150 = !{!142, !143} -// CHECK:STDOUT: !151 = distinct !DISubprogram(name: "CallF", linkageName: "_CCallF.Main.37b67b83fe9ed3dd", scope: null, file: !101, line: 12, type: !104, spFlags: DISPFlagDefinition, unit: !102, retainedNodes: !160) -// CHECK:STDOUT: !152 = !DILocalVariable(arg: 1, scope: !151, type: !24) -// CHECK:STDOUT: !153 = !DILocalVariable(arg: 2, scope: !151, type: !24) -// CHECK:STDOUT: !158 = !DILocation(line: 13, column: 3, scope: !151) -// CHECK:STDOUT: !159 = !DILocation(line: 12, column: 1, scope: !151) -// CHECK:STDOUT: !160 = !{!152, !153} -// CHECK:STDOUT: !161 = distinct !DISubprogram(name: "CallF", linkageName: "_CCallF.Main.7096323a0fb88cc3", scope: null, file: !101, line: 12, type: !104, spFlags: DISPFlagDefinition, unit: !102, retainedNodes: !170) -// CHECK:STDOUT: !162 = !DILocalVariable(arg: 1, scope: !161, type: !24) -// CHECK:STDOUT: !163 = !DILocalVariable(arg: 2, scope: !161, type: !24) -// CHECK:STDOUT: !168 = !DILocation(line: 13, column: 3, scope: !161) -// CHECK:STDOUT: !169 = !DILocation(line: 12, column: 1, scope: !161) -// CHECK:STDOUT: !170 = !{!162, !163} +// CHECK:STDOUT: !117 = !DIFile(filename: "no_merge_convert_one_arg.carbon", directory: "") +// CHECK:STDOUT: !118 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !117, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !119 = !{null, !24, !24} +// CHECK:STDOUT: !120 = !DISubroutineType(types: !119) +// CHECK:STDOUT: !121 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.B.Main:ImplicitAs.bd4fb75a414fe858.Core", scope: null, file: !117, line: 6, type: !28, spFlags: DISPFlagDefinition, unit: !118, retainedNodes: !127) +// CHECK:STDOUT: !122 = !DILocalVariable(arg: 1, scope: !121, type: !24) +// CHECK:STDOUT: !126 = !DILocation(line: 6, column: 36, scope: !121) +// CHECK:STDOUT: !127 = !{!122} +// CHECK:STDOUT: !128 = distinct !DISubprogram(name: "CallCallF", linkageName: "_CCallCallF.Main", scope: null, file: !117, line: 16, type: !120, spFlags: DISPFlagDefinition, unit: !118, retainedNodes: !146) +// CHECK:STDOUT: !129 = !DILocalVariable(arg: 1, scope: !128, type: !24) +// CHECK:STDOUT: !130 = !DILocalVariable(arg: 2, scope: !128, type: !24) +// CHECK:STDOUT: !135 = !DILocation(line: 17, column: 3, scope: !128) +// CHECK:STDOUT: !138 = !DILocation(line: 18, column: 3, scope: !128) +// CHECK:STDOUT: !141 = !DILocation(line: 19, column: 3, scope: !128) +// CHECK:STDOUT: !144 = !DILocation(line: 20, column: 3, scope: !128) +// CHECK:STDOUT: !145 = !DILocation(line: 16, column: 1, scope: !128) +// CHECK:STDOUT: !146 = !{!129, !130} +// CHECK:STDOUT: !147 = distinct !DISubprogram(name: "CallF", linkageName: "_CCallF.Main.2877a42045e01a3b", scope: null, file: !117, line: 12, type: !120, spFlags: DISPFlagDefinition, unit: !118, retainedNodes: !156) +// CHECK:STDOUT: !148 = !DILocalVariable(arg: 1, scope: !147, type: !24) +// CHECK:STDOUT: !149 = !DILocalVariable(arg: 2, scope: !147, type: !24) +// CHECK:STDOUT: !154 = !DILocation(line: 13, column: 3, scope: !147) +// CHECK:STDOUT: !155 = !DILocation(line: 12, column: 1, scope: !147) +// CHECK:STDOUT: !156 = !{!148, !149} +// CHECK:STDOUT: !157 = distinct !DISubprogram(name: "CallF", linkageName: "_CCallF.Main.d01354a0ad5f3687", scope: null, file: !117, line: 12, type: !120, spFlags: DISPFlagDefinition, unit: !118, retainedNodes: !166) +// CHECK:STDOUT: !158 = !DILocalVariable(arg: 1, scope: !157, type: !24) +// CHECK:STDOUT: !159 = !DILocalVariable(arg: 2, scope: !157, type: !24) +// CHECK:STDOUT: !164 = !DILocation(line: 13, column: 3, scope: !157) +// CHECK:STDOUT: !165 = !DILocation(line: 12, column: 1, scope: !157) +// CHECK:STDOUT: !166 = !{!158, !159} +// CHECK:STDOUT: !167 = distinct !DISubprogram(name: "CallF", linkageName: "_CCallF.Main.37b67b83fe9ed3dd", scope: null, file: !117, line: 12, type: !120, spFlags: DISPFlagDefinition, unit: !118, retainedNodes: !176) +// CHECK:STDOUT: !168 = !DILocalVariable(arg: 1, scope: !167, type: !24) +// CHECK:STDOUT: !169 = !DILocalVariable(arg: 2, scope: !167, type: !24) +// CHECK:STDOUT: !174 = !DILocation(line: 13, column: 3, scope: !167) +// CHECK:STDOUT: !175 = !DILocation(line: 12, column: 1, scope: !167) +// CHECK:STDOUT: !176 = !{!168, !169} +// CHECK:STDOUT: !177 = distinct !DISubprogram(name: "CallF", linkageName: "_CCallF.Main.7096323a0fb88cc3", scope: null, file: !117, line: 12, type: !120, spFlags: DISPFlagDefinition, unit: !118, retainedNodes: !186) +// CHECK:STDOUT: !178 = !DILocalVariable(arg: 1, scope: !177, type: !24) +// CHECK:STDOUT: !179 = !DILocalVariable(arg: 2, scope: !177, type: !24) +// CHECK:STDOUT: !184 = !DILocation(line: 13, column: 3, scope: !177) +// CHECK:STDOUT: !185 = !DILocation(line: 12, column: 1, scope: !177) +// CHECK:STDOUT: !186 = !{!178, !179} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/tuple/access/element_access.carbon b/toolchain/lower/testdata/tuple/access/element_access.carbon index 623029875088..141d14b49af0 100644 --- a/toolchain/lower/testdata/tuple/access/element_access.carbon +++ b/toolchain/lower/testdata/tuple/access/element_access.carbon @@ -42,24 +42,44 @@ fn Run() -> i32 { // CHECK:STDOUT: %tuple.elem2.loc16.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 2, !dbg !38 // CHECK:STDOUT: %.loc16 = load i32, ptr %tuple.elem2.loc16.tuple.elem, align 4, !dbg !38 // CHECK:STDOUT: store i32 %.loc16, ptr %_.var.loc16, align 4, !dbg !37 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %_.var.loc16), !dbg !37 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %_.var.loc15), !dbg !34 -// CHECK:STDOUT: call void @"_COp.555b1314256372b8:core.Destroy.Core"(ptr %a.var), !dbg !31 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %_.var.loc16), !dbg !37 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %_.var.loc15), !dbg !34 +// CHECK:STDOUT: call void @"_CSelfDestruct.555b1314256372b8:core.Destroy.Core"(ptr %a.var), !dbg !31 // CHECK:STDOUT: ret i32 0, !dbg !40 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !41 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !41 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !43 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.555b1314256372b8:core.Destroy.Core"(ptr %self) #0 !dbg !45 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !45 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !47 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !49 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !51 +// CHECK:STDOUT: ret void, !dbg !51 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.555b1314256372b8:core.Destroy.Core"(ptr %self) #0 !dbg !53 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !55 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.555b1314256372b8:core.Destroy.Core"(ptr %self) #0 !dbg !57 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.555b1314256372b8:core.Destroy.Core"(ptr %self), !dbg !59 +// CHECK:STDOUT: ret void, !dbg !59 +// 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: @@ -67,7 +87,7 @@ fn Run() -> i32 { // 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: ; uselistorder directives -// CHECK:STDOUT: uselistorder ptr @"_COp.f58524831c37807e:core.Destroy.Core", { 1, 0 } +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core", { 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 2, 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -96,12 +116,24 @@ fn Run() -> i32 { // CHECK:STDOUT: !37 = !DILocation(line: 16, column: 3, scope: !28) // CHECK:STDOUT: !38 = !DILocation(line: 16, column: 16, scope: !28) // CHECK:STDOUT: !40 = !DILocation(line: 17, column: 3, scope: !28) -// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 16, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !44) +// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !18, line: 16, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !44) // CHECK:STDOUT: !42 = !DILocalVariable(arg: 1, scope: !41, type: !20) // CHECK:STDOUT: !43 = !DILocation(line: 16, column: 3, scope: !41) // CHECK:STDOUT: !44 = !{!42} -// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "Op", linkageName: "_COp.555b1314256372b8:core.Destroy.Core", scope: null, file: !18, line: 14, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !48) -// CHECK:STDOUT: !46 = !DILocalVariable(arg: 1, scope: !45, type: !25) -// CHECK:STDOUT: !47 = !DILocation(line: 14, column: 3, scope: !45) +// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 16, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !48) +// CHECK:STDOUT: !46 = !DILocalVariable(arg: 1, scope: !45, type: !20) +// CHECK:STDOUT: !47 = !DILocation(line: 16, column: 3, scope: !45) // CHECK:STDOUT: !48 = !{!46} +// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 16, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !52) +// CHECK:STDOUT: !50 = !DILocalVariable(arg: 1, scope: !49, type: !20) +// CHECK:STDOUT: !51 = !DILocation(line: 16, column: 3, scope: !49) +// CHECK:STDOUT: !52 = !{!50} +// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.555b1314256372b8:core.Destroy.Core", scope: null, file: !18, line: 14, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !56) +// CHECK:STDOUT: !54 = !DILocalVariable(arg: 1, scope: !53, type: !25) +// CHECK:STDOUT: !55 = !DILocation(line: 14, column: 3, scope: !53) +// CHECK:STDOUT: !56 = !{!54} +// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.555b1314256372b8:core.Destroy.Core", scope: null, file: !18, line: 14, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !60) +// CHECK:STDOUT: !58 = !DILocalVariable(arg: 1, scope: !57, type: !25) +// CHECK:STDOUT: !59 = !DILocation(line: 14, column: 3, scope: !57) +// CHECK:STDOUT: !60 = !{!58} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/tuple/access/return_value_access.carbon b/toolchain/lower/testdata/tuple/access/return_value_access.carbon index 1affb6ab2e85..228619853160 100644 --- a/toolchain/lower/testdata/tuple/access/return_value_access.carbon +++ b/toolchain/lower/testdata/tuple/access/return_value_access.carbon @@ -42,23 +42,43 @@ fn Run() { // CHECK:STDOUT: %tuple.elem1.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %.loc16_18.1.temp, i32 0, i32 1, !dbg !37 // CHECK:STDOUT: %.loc16_19 = load i32, ptr %tuple.elem1.tuple.elem, align 4, !dbg !37 // CHECK:STDOUT: store i32 %.loc16_19, ptr %_.var, align 4, !dbg !36 -// CHECK:STDOUT: call void @"_COp.e554695bf635d9c1:core.Destroy.Core"(ptr %.loc16_18.1.temp), !dbg !37 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %_.var), !dbg !36 +// CHECK:STDOUT: call void @"_CSelfDestruct.e554695bf635d9c1:core.Destroy.Core"(ptr %.loc16_18.1.temp), !dbg !37 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %_.var), !dbg !36 // CHECK:STDOUT: ret i32 0, !dbg !39 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !40 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !40 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !42 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.e554695bf635d9c1:core.Destroy.Core"(ptr %self) #0 !dbg !44 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !44 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !46 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !48 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !50 +// CHECK:STDOUT: ret void, !dbg !50 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.e554695bf635d9c1:core.Destroy.Core"(ptr %self) #0 !dbg !52 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !54 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.e554695bf635d9c1:core.Destroy.Core"(ptr %self) #0 !dbg !56 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.e554695bf635d9c1:core.Destroy.Core"(ptr %self), !dbg !58 +// CHECK:STDOUT: ret void, !dbg !58 +// 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: @@ -95,12 +115,24 @@ fn Run() { // CHECK:STDOUT: !36 = !DILocation(line: 16, column: 3, scope: !35) // CHECK:STDOUT: !37 = !DILocation(line: 16, column: 16, scope: !35) // CHECK:STDOUT: !39 = !DILocation(line: 15, column: 1, scope: !35) -// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 16, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !43) +// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !18, line: 16, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !43) // CHECK:STDOUT: !41 = !DILocalVariable(arg: 1, scope: !40, type: !20) // CHECK:STDOUT: !42 = !DILocation(line: 16, column: 16, scope: !40) // CHECK:STDOUT: !43 = !{!41} -// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "Op", linkageName: "_COp.e554695bf635d9c1:core.Destroy.Core", scope: null, file: !18, line: 16, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !47) -// CHECK:STDOUT: !45 = !DILocalVariable(arg: 1, scope: !44, type: !21) +// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 16, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !47) +// CHECK:STDOUT: !45 = !DILocalVariable(arg: 1, scope: !44, type: !20) // CHECK:STDOUT: !46 = !DILocation(line: 16, column: 16, scope: !44) // CHECK:STDOUT: !47 = !{!45} +// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 16, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !51) +// CHECK:STDOUT: !49 = !DILocalVariable(arg: 1, scope: !48, type: !20) +// CHECK:STDOUT: !50 = !DILocation(line: 16, column: 16, scope: !48) +// CHECK:STDOUT: !51 = !{!49} +// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.e554695bf635d9c1:core.Destroy.Core", scope: null, file: !18, line: 16, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !55) +// CHECK:STDOUT: !53 = !DILocalVariable(arg: 1, scope: !52, type: !21) +// CHECK:STDOUT: !54 = !DILocation(line: 16, column: 16, scope: !52) +// CHECK:STDOUT: !55 = !{!53} +// CHECK:STDOUT: !56 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.e554695bf635d9c1:core.Destroy.Core", scope: null, file: !18, line: 16, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !59) +// CHECK:STDOUT: !57 = !DILocalVariable(arg: 1, scope: !56, type: !21) +// CHECK:STDOUT: !58 = !DILocation(line: 16, column: 16, scope: !56) +// CHECK:STDOUT: !59 = !{!57} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/tuple/empty.carbon b/toolchain/lower/testdata/tuple/empty.carbon index 2a60000c80d7..e96e4083a561 100644 --- a/toolchain/lower/testdata/tuple/empty.carbon +++ b/toolchain/lower/testdata/tuple/empty.carbon @@ -21,19 +21,28 @@ fn Run() -> i32 { // CHECK:STDOUT: source_filename = "empty.carbon" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @main() #0 !dbg !23 { +// CHECK:STDOUT: define i32 @main() #0 !dbg !26 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %x.var = alloca {}, align 1, !dbg !26 -// CHECK:STDOUT: %_.var = alloca {}, align 1, !dbg !28 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %x.var), !dbg !26 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !28 -// CHECK:STDOUT: ret i32 0, !dbg !31 +// CHECK:STDOUT: %x.var = alloca {}, align 1, !dbg !29 +// CHECK:STDOUT: %_.var = alloca {}, align 1, !dbg !31 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %x.var), !dbg !29 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !31 +// CHECK:STDOUT: call void @"_CSelfDestruct.61ea2aba74ab3bf1:core.Destroy.Core"(ptr %_.var), !dbg !31 +// CHECK:STDOUT: call void @"_CSelfDestruct.61ea2aba74ab3bf1:core.Destroy.Core"(ptr %x.var), !dbg !29 +// CHECK:STDOUT: ret i32 0, !dbg !34 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.61ea2aba74ab3bf1:core.Destroy.Core"(ptr %self) #0 !dbg !35 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !37 // 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: ; uselistorder directives +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.61ea2aba74ab3bf1:core.Destroy.Core", { 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -49,8 +58,15 @@ fn Run() -> i32 { // CHECK:STDOUT: !20 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) // CHECK:STDOUT: !21 = !{!20} // CHECK:STDOUT: !22 = !DISubroutineType(types: !21) -// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "Run", linkageName: "main", scope: null, file: !18, line: 13, type: !22, spFlags: DISPFlagDefinition, unit: !19) -// CHECK:STDOUT: !26 = !DILocation(line: 14, column: 3, scope: !23) -// CHECK:STDOUT: !28 = !DILocation(line: 15, column: 3, scope: !23) -// CHECK:STDOUT: !31 = !DILocation(line: 16, column: 3, scope: !23) +// CHECK:STDOUT: !23 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !24 = !{null, !23} +// CHECK:STDOUT: !25 = !DISubroutineType(types: !24) +// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "Run", linkageName: "main", scope: null, file: !18, line: 13, type: !22, spFlags: DISPFlagDefinition, unit: !19) +// CHECK:STDOUT: !29 = !DILocation(line: 14, column: 3, scope: !26) +// CHECK:STDOUT: !31 = !DILocation(line: 15, column: 3, scope: !26) +// CHECK:STDOUT: !34 = !DILocation(line: 16, column: 3, scope: !26) +// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.61ea2aba74ab3bf1:core.Destroy.Core", scope: null, file: !18, line: 15, type: !25, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !38) +// CHECK:STDOUT: !36 = !DILocalVariable(arg: 1, scope: !35, type: !23) +// CHECK:STDOUT: !37 = !DILocation(line: 15, column: 3, scope: !35) +// CHECK:STDOUT: !38 = !{!36} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/tuple/nested_tuple_in_place.carbon b/toolchain/lower/testdata/tuple/nested_tuple_in_place.carbon index 6acb92520837..7be9aa7f8a16 100644 --- a/toolchain/lower/testdata/tuple/nested_tuple_in_place.carbon +++ b/toolchain/lower/testdata/tuple/nested_tuple_in_place.carbon @@ -31,28 +31,55 @@ fn G() { // CHECK:STDOUT: call void @_CF.Main(ptr %tuple.elem0.tuple.elem), !dbg !33 // CHECK:STDOUT: %tuple.elem1.tuple.elem = getelementptr inbounds nuw { { i32, i32, i32 }, { i32, i32, i32 } }, ptr %_.var, i32 0, i32 1, !dbg !32 // CHECK:STDOUT: call void @_CF.Main(ptr %tuple.elem1.tuple.elem), !dbg !34 -// CHECK:STDOUT: call void @"_COp.0159eff107255368:core.Destroy.Core"(ptr %_.var), !dbg !31 +// CHECK:STDOUT: call void @"_CSelfDestruct.0159eff107255368:core.Destroy.Core"(ptr %_.var), !dbg !31 // CHECK:STDOUT: ret void, !dbg !36 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !37 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !37 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !39 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.555b1314256372b8:core.Destroy.Core"(ptr %self) #0 !dbg !41 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !41 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !43 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.0159eff107255368:core.Destroy.Core"(ptr %self) #0 !dbg !45 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !45 { // CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !47 // CHECK:STDOUT: ret void, !dbg !47 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.555b1314256372b8:core.Destroy.Core"(ptr %self) #0 !dbg !49 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !51 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.555b1314256372b8:core.Destroy.Core"(ptr %self) #0 !dbg !53 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.555b1314256372b8:core.Destroy.Core"(ptr %self), !dbg !55 +// CHECK:STDOUT: ret void, !dbg !55 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.0159eff107255368:core.Destroy.Core"(ptr %self) #0 !dbg !57 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !59 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.0159eff107255368:core.Destroy.Core"(ptr %self) #0 !dbg !61 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.0159eff107255368:core.Destroy.Core"(ptr %self), !dbg !63 +// CHECK:STDOUT: ret void, !dbg !63 +// 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: @@ -80,16 +107,32 @@ fn G() { // CHECK:STDOUT: !33 = !DILocation(line: 16, column: 48, scope: !30) // CHECK:STDOUT: !34 = !DILocation(line: 16, column: 53, scope: !30) // CHECK:STDOUT: !36 = !DILocation(line: 15, column: 1, scope: !30) -// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 16, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !40) +// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !18, line: 16, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !40) // CHECK:STDOUT: !38 = !DILocalVariable(arg: 1, scope: !37, type: !20) // CHECK:STDOUT: !39 = !DILocation(line: 16, column: 3, scope: !37) // CHECK:STDOUT: !40 = !{!38} -// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "Op", linkageName: "_COp.555b1314256372b8:core.Destroy.Core", scope: null, file: !18, line: 16, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !44) -// CHECK:STDOUT: !42 = !DILocalVariable(arg: 1, scope: !41, type: !21) +// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 16, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !44) +// CHECK:STDOUT: !42 = !DILocalVariable(arg: 1, scope: !41, type: !20) // CHECK:STDOUT: !43 = !DILocation(line: 16, column: 3, scope: !41) // CHECK:STDOUT: !44 = !{!42} -// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "Op", linkageName: "_COp.0159eff107255368:core.Destroy.Core", scope: null, file: !18, line: 16, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !48) -// CHECK:STDOUT: !46 = !DILocalVariable(arg: 1, scope: !45, type: !21) +// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 16, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !48) +// CHECK:STDOUT: !46 = !DILocalVariable(arg: 1, scope: !45, type: !20) // CHECK:STDOUT: !47 = !DILocation(line: 16, column: 3, scope: !45) // CHECK:STDOUT: !48 = !{!46} +// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.555b1314256372b8:core.Destroy.Core", scope: null, file: !18, line: 16, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !52) +// CHECK:STDOUT: !50 = !DILocalVariable(arg: 1, scope: !49, type: !21) +// CHECK:STDOUT: !51 = !DILocation(line: 16, column: 3, scope: !49) +// CHECK:STDOUT: !52 = !{!50} +// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.555b1314256372b8:core.Destroy.Core", scope: null, file: !18, line: 16, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !56) +// CHECK:STDOUT: !54 = !DILocalVariable(arg: 1, scope: !53, type: !21) +// CHECK:STDOUT: !55 = !DILocation(line: 16, column: 3, scope: !53) +// CHECK:STDOUT: !56 = !{!54} +// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.0159eff107255368:core.Destroy.Core", scope: null, file: !18, line: 16, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !60) +// CHECK:STDOUT: !58 = !DILocalVariable(arg: 1, scope: !57, type: !21) +// CHECK:STDOUT: !59 = !DILocation(line: 16, column: 3, scope: !57) +// CHECK:STDOUT: !60 = !{!58} +// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.0159eff107255368:core.Destroy.Core", scope: null, file: !18, line: 16, type: !29, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !64) +// CHECK:STDOUT: !62 = !DILocalVariable(arg: 1, scope: !61, type: !21) +// CHECK:STDOUT: !63 = !DILocation(line: 16, column: 3, scope: !61) +// CHECK:STDOUT: !64 = !{!62} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/tuple/one_entry.carbon b/toolchain/lower/testdata/tuple/one_entry.carbon index 345354874ce9..58e2f2281110 100644 --- a/toolchain/lower/testdata/tuple/one_entry.carbon +++ b/toolchain/lower/testdata/tuple/one_entry.carbon @@ -32,28 +32,48 @@ fn Run() -> i32 { // CHECK:STDOUT: %.loc15_20.1 = load i32, ptr %tuple.elem0.tuple.elem, align 4, !dbg !34 // CHECK:STDOUT: %.loc15_20.2.tuple.init = insertvalue { i32 } poison, i32 %.loc15_20.1, 0, !dbg !34 // CHECK:STDOUT: store { i32 } %.loc15_20.2.tuple.init, ptr %_.var, align 4, !dbg !33 -// CHECK:STDOUT: call void @"_COp.a8a56634ea0bfe88:core.Destroy.Core"(ptr %_.var), !dbg !33 -// CHECK:STDOUT: call void @"_COp.a8a56634ea0bfe88:core.Destroy.Core"(ptr %x.var), !dbg !31 +// CHECK:STDOUT: call void @"_CSelfDestruct.a8a56634ea0bfe88:core.Destroy.Core"(ptr %_.var), !dbg !33 +// CHECK:STDOUT: call void @"_CSelfDestruct.a8a56634ea0bfe88:core.Destroy.Core"(ptr %x.var), !dbg !31 // CHECK:STDOUT: ret i32 0, !dbg !36 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !37 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !37 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !39 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.a8a56634ea0bfe88:core.Destroy.Core"(ptr %self) #0 !dbg !41 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !41 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !43 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !45 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !47 +// CHECK:STDOUT: ret void, !dbg !47 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.a8a56634ea0bfe88:core.Destroy.Core"(ptr %self) #0 !dbg !49 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !51 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.a8a56634ea0bfe88:core.Destroy.Core"(ptr %self) #0 !dbg !53 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.a8a56634ea0bfe88:core.Destroy.Core"(ptr %self), !dbg !55 +// CHECK:STDOUT: ret void, !dbg !55 +// 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: ; uselistorder directives -// CHECK:STDOUT: uselistorder ptr @"_COp.a8a56634ea0bfe88:core.Destroy.Core", { 1, 0 } +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.a8a56634ea0bfe88:core.Destroy.Core", { 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -79,12 +99,24 @@ fn Run() -> i32 { // CHECK:STDOUT: !33 = !DILocation(line: 15, column: 3, scope: !28) // CHECK:STDOUT: !34 = !DILocation(line: 15, column: 20, scope: !28) // CHECK:STDOUT: !36 = !DILocation(line: 16, column: 3, scope: !28) -// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 15, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !40) +// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !18, line: 15, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !40) // CHECK:STDOUT: !38 = !DILocalVariable(arg: 1, scope: !37, type: !20) // CHECK:STDOUT: !39 = !DILocation(line: 15, column: 3, scope: !37) // CHECK:STDOUT: !40 = !{!38} -// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "Op", linkageName: "_COp.a8a56634ea0bfe88:core.Destroy.Core", scope: null, file: !18, line: 15, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !44) -// CHECK:STDOUT: !42 = !DILocalVariable(arg: 1, scope: !41, type: !25) +// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 15, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !44) +// CHECK:STDOUT: !42 = !DILocalVariable(arg: 1, scope: !41, type: !20) // CHECK:STDOUT: !43 = !DILocation(line: 15, column: 3, scope: !41) // CHECK:STDOUT: !44 = !{!42} +// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 15, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !48) +// CHECK:STDOUT: !46 = !DILocalVariable(arg: 1, scope: !45, type: !20) +// CHECK:STDOUT: !47 = !DILocation(line: 15, column: 3, scope: !45) +// CHECK:STDOUT: !48 = !{!46} +// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.a8a56634ea0bfe88:core.Destroy.Core", scope: null, file: !18, line: 15, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !52) +// CHECK:STDOUT: !50 = !DILocalVariable(arg: 1, scope: !49, type: !25) +// CHECK:STDOUT: !51 = !DILocation(line: 15, column: 3, scope: !49) +// CHECK:STDOUT: !52 = !{!50} +// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.a8a56634ea0bfe88:core.Destroy.Core", scope: null, file: !18, line: 15, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !56) +// CHECK:STDOUT: !54 = !DILocalVariable(arg: 1, scope: !53, type: !25) +// CHECK:STDOUT: !55 = !DILocation(line: 15, column: 3, scope: !53) +// CHECK:STDOUT: !56 = !{!54} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/tuple/two_entries.carbon b/toolchain/lower/testdata/tuple/two_entries.carbon index 2366a548c1ed..b0233151aca7 100644 --- a/toolchain/lower/testdata/tuple/two_entries.carbon +++ b/toolchain/lower/testdata/tuple/two_entries.carbon @@ -40,23 +40,43 @@ fn Run() -> i32 { // CHECK:STDOUT: %.loc15_23.3 = load i32, ptr %tuple.elem1.loc15_23.1.tuple.elem, align 4, !dbg !35 // CHECK:STDOUT: %tuple.elem1.loc15_23.2.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %_.var, i32 0, i32 1, !dbg !35 // CHECK:STDOUT: store i32 %.loc15_23.3, ptr %tuple.elem1.loc15_23.2.tuple.elem, align 4, !dbg !35 -// CHECK:STDOUT: call void @"_COp.e554695bf635d9c1:core.Destroy.Core"(ptr %_.var), !dbg !34 -// CHECK:STDOUT: call void @"_COp.e554695bf635d9c1:core.Destroy.Core"(ptr %x.var), !dbg !31 +// CHECK:STDOUT: call void @"_CSelfDestruct.e554695bf635d9c1:core.Destroy.Core"(ptr %_.var), !dbg !34 +// CHECK:STDOUT: call void @"_CSelfDestruct.e554695bf635d9c1:core.Destroy.Core"(ptr %x.var), !dbg !31 // CHECK:STDOUT: ret i32 0, !dbg !37 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !38 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !38 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !40 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.e554695bf635d9c1:core.Destroy.Core"(ptr %self) #0 !dbg !42 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !42 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !44 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !46 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !48 +// CHECK:STDOUT: ret void, !dbg !48 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.e554695bf635d9c1:core.Destroy.Core"(ptr %self) #0 !dbg !50 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !52 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.e554695bf635d9c1:core.Destroy.Core"(ptr %self) #0 !dbg !54 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.e554695bf635d9c1:core.Destroy.Core"(ptr %self), !dbg !56 +// CHECK:STDOUT: ret void, !dbg !56 +// 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: @@ -64,7 +84,7 @@ fn Run() -> i32 { // 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: ; uselistorder directives -// CHECK:STDOUT: uselistorder ptr @"_COp.e554695bf635d9c1:core.Destroy.Core", { 1, 0 } +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.e554695bf635d9c1:core.Destroy.Core", { 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -91,12 +111,24 @@ fn Run() -> i32 { // CHECK:STDOUT: !34 = !DILocation(line: 15, column: 3, scope: !28) // CHECK:STDOUT: !35 = !DILocation(line: 15, column: 23, scope: !28) // CHECK:STDOUT: !37 = !DILocation(line: 16, column: 3, scope: !28) -// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 15, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !41) +// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !18, line: 15, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !41) // CHECK:STDOUT: !39 = !DILocalVariable(arg: 1, scope: !38, type: !20) // CHECK:STDOUT: !40 = !DILocation(line: 15, column: 3, scope: !38) // CHECK:STDOUT: !41 = !{!39} -// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "Op", linkageName: "_COp.e554695bf635d9c1:core.Destroy.Core", scope: null, file: !18, line: 15, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !45) -// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !42, type: !25) +// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 15, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !45) +// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !42, type: !20) // CHECK:STDOUT: !44 = !DILocation(line: 15, column: 3, scope: !42) // CHECK:STDOUT: !45 = !{!43} +// CHECK:STDOUT: !46 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 15, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !49) +// CHECK:STDOUT: !47 = !DILocalVariable(arg: 1, scope: !46, type: !20) +// CHECK:STDOUT: !48 = !DILocation(line: 15, column: 3, scope: !46) +// CHECK:STDOUT: !49 = !{!47} +// CHECK:STDOUT: !50 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.e554695bf635d9c1:core.Destroy.Core", scope: null, file: !18, line: 15, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !53) +// CHECK:STDOUT: !51 = !DILocalVariable(arg: 1, scope: !50, type: !25) +// CHECK:STDOUT: !52 = !DILocation(line: 15, column: 3, scope: !50) +// CHECK:STDOUT: !53 = !{!51} +// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.e554695bf635d9c1:core.Destroy.Core", scope: null, file: !18, line: 15, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !57) +// CHECK:STDOUT: !55 = !DILocalVariable(arg: 1, scope: !54, type: !25) +// CHECK:STDOUT: !56 = !DILocation(line: 15, column: 3, scope: !54) +// CHECK:STDOUT: !57 = !{!55} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/tuple/value_formation.carbon b/toolchain/lower/testdata/tuple/value_formation.carbon index d935a3cd0d45..b1973546d251 100644 --- a/toolchain/lower/testdata/tuple/value_formation.carbon +++ b/toolchain/lower/testdata/tuple/value_formation.carbon @@ -66,28 +66,48 @@ fn F() { // CHECK:STDOUT: %tuple.loc18_108 = getelementptr inbounds nuw { ptr, ptr }, ptr %tuple.loc18_10, i32 0, i32 1, !dbg !35 // CHECK:STDOUT: store ptr %tuple.loc18_9, ptr %tuple.loc18_108, align 8, !dbg !35 // CHECK:STDOUT: call void @_CG.Main(ptr %tuple.loc18_10), !dbg !36 -// CHECK:STDOUT: call void @"_COp.555b1314256372b8:core.Destroy.Core"(ptr %b.var), !dbg !31 -// CHECK:STDOUT: call void @"_COp.555b1314256372b8:core.Destroy.Core"(ptr %a.var), !dbg !29 +// CHECK:STDOUT: call void @"_CSelfDestruct.555b1314256372b8:core.Destroy.Core"(ptr %b.var), !dbg !31 +// CHECK:STDOUT: call void @"_CSelfDestruct.555b1314256372b8:core.Destroy.Core"(ptr %a.var), !dbg !29 // CHECK:STDOUT: ret void, !dbg !37 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !38 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !38 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !40 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.555b1314256372b8:core.Destroy.Core"(ptr %self) #0 !dbg !42 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !42 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !44 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !46 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !48 +// CHECK:STDOUT: ret void, !dbg !48 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.555b1314256372b8:core.Destroy.Core"(ptr %self) #0 !dbg !50 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !52 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.555b1314256372b8:core.Destroy.Core"(ptr %self) #0 !dbg !54 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.555b1314256372b8:core.Destroy.Core"(ptr %self), !dbg !56 +// CHECK:STDOUT: ret void, !dbg !56 +// 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: ; uselistorder directives -// CHECK:STDOUT: uselistorder ptr @"_COp.555b1314256372b8:core.Destroy.Core", { 1, 0 } +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.555b1314256372b8:core.Destroy.Core", { 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 4, 3, 2, 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -116,12 +136,24 @@ fn F() { // CHECK:STDOUT: !35 = !DILocation(line: 18, column: 5, scope: !28) // CHECK:STDOUT: !36 = !DILocation(line: 18, column: 3, scope: !28) // CHECK:STDOUT: !37 = !DILocation(line: 15, column: 1, scope: !28) -// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 17, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !41) +// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !18, line: 17, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !41) // CHECK:STDOUT: !39 = !DILocalVariable(arg: 1, scope: !38, type: !20) // CHECK:STDOUT: !40 = !DILocation(line: 17, column: 3, scope: !38) // CHECK:STDOUT: !41 = !{!39} -// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "Op", linkageName: "_COp.555b1314256372b8:core.Destroy.Core", scope: null, file: !18, line: 17, type: !23, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !45) -// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !42, type: !21) +// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 17, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !45) +// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !42, type: !20) // CHECK:STDOUT: !44 = !DILocation(line: 17, column: 3, scope: !42) // CHECK:STDOUT: !45 = !{!43} +// CHECK:STDOUT: !46 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 17, type: !27, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !49) +// CHECK:STDOUT: !47 = !DILocalVariable(arg: 1, scope: !46, type: !20) +// CHECK:STDOUT: !48 = !DILocation(line: 17, column: 3, scope: !46) +// CHECK:STDOUT: !49 = !{!47} +// CHECK:STDOUT: !50 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.555b1314256372b8:core.Destroy.Core", scope: null, file: !18, line: 17, type: !23, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !53) +// CHECK:STDOUT: !51 = !DILocalVariable(arg: 1, scope: !50, type: !21) +// CHECK:STDOUT: !52 = !DILocation(line: 17, column: 3, scope: !50) +// CHECK:STDOUT: !53 = !{!51} +// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.555b1314256372b8:core.Destroy.Core", scope: null, file: !18, line: 17, type: !23, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !57) +// CHECK:STDOUT: !55 = !DILocalVariable(arg: 1, scope: !54, type: !21) +// CHECK:STDOUT: !56 = !DILocation(line: 17, column: 3, scope: !54) +// CHECK:STDOUT: !57 = !{!55} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/var/destroy_control_flow.carbon b/toolchain/lower/testdata/var/destroy_control_flow.carbon index e08290bf25ac..179ac621fefc 100644 --- a/toolchain/lower/testdata/var/destroy_control_flow.carbon +++ b/toolchain/lower/testdata/var/destroy_control_flow.carbon @@ -165,23 +165,36 @@ fn WhileContinue(cond: bool) { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %b.var), !dbg !54 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %b.var, ptr align 1 @Destructible.val.loc6_3, i64 0, i1 false), !dbg !54 // CHECK:STDOUT: call void @_CUse.Main(ptr %b.var), !dbg !58 -// CHECK:STDOUT: call void @"_COp.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %b.var), !dbg !54 +// CHECK:STDOUT: call void @"_CSelfDestruct.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %b.var), !dbg !54 // CHECK:STDOUT: br label %if.else, !dbg !59 // CHECK:STDOUT: // CHECK:STDOUT: if.else: ; preds = %if.then, %entry // CHECK:STDOUT: call void @_CUse.Main(ptr %a.var), !dbg !62 -// CHECK:STDOUT: call void @"_COp.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %a.var), !dbg !47 +// CHECK:STDOUT: call void @"_CSelfDestruct.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %a.var), !dbg !47 // CHECK:STDOUT: ret void, !dbg !63 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_CUse.Main(ptr) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %self) #0 !dbg !65 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %self) #0 !dbg !65 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !67 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %self) #0 !dbg !69 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !71 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %self) #0 !dbg !73 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %self), !dbg !75 +// CHECK:STDOUT: ret void, !dbg !75 +// 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: @@ -190,7 +203,7 @@ fn WhileContinue(cond: bool) { // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives // CHECK:STDOUT: uselistorder ptr @_CUse.Main, { 2, 1, 0 } -// CHECK:STDOUT: uselistorder ptr @"_COp.c3fcb3d93f31df0e:core.Destroy.Core", { 1, 0 } +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.c3fcb3d93f31df0e:core.Destroy.Core", { 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.memcpy.p0.p0.i64, { 1, 0 } // CHECK:STDOUT: @@ -218,10 +231,18 @@ fn WhileContinue(cond: bool) { // CHECK:STDOUT: !62 = !DILocation(line: 12, column: 3, scope: !44) // CHECK:STDOUT: !63 = !DILocation(line: 5, column: 1, scope: !44) // CHECK:STDOUT: !64 = !{!45} -// CHECK:STDOUT: !65 = distinct !DISubprogram(name: "Op", linkageName: "_COp.c3fcb3d93f31df0e:core.Destroy.Core", scope: null, file: !42, line: 9, type: !36, spFlags: DISPFlagDefinition, unit: !43, retainedNodes: !68) +// CHECK:STDOUT: !65 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !42, line: 9, type: !36, spFlags: DISPFlagDefinition, unit: !43, retainedNodes: !68) // CHECK:STDOUT: !66 = !DILocalVariable(arg: 1, scope: !65, type: !34) // CHECK:STDOUT: !67 = !DILocation(line: 9, column: 5, scope: !65) // CHECK:STDOUT: !68 = !{!66} +// CHECK:STDOUT: !69 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.c3fcb3d93f31df0e:core.Destroy.Core", scope: null, file: !42, line: 9, type: !36, spFlags: DISPFlagDefinition, unit: !43, retainedNodes: !72) +// CHECK:STDOUT: !70 = !DILocalVariable(arg: 1, scope: !69, type: !34) +// CHECK:STDOUT: !71 = !DILocation(line: 9, column: 5, scope: !69) +// CHECK:STDOUT: !72 = !{!70} +// CHECK:STDOUT: !73 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.c3fcb3d93f31df0e:core.Destroy.Core", scope: null, file: !42, line: 9, type: !36, spFlags: DISPFlagDefinition, unit: !43, retainedNodes: !76) +// CHECK:STDOUT: !74 = !DILocalVariable(arg: 1, scope: !73, type: !34) +// CHECK:STDOUT: !75 = !DILocation(line: 9, column: 5, scope: !73) +// CHECK:STDOUT: !76 = !{!74} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'if_else.carbon' @@ -230,42 +251,55 @@ fn WhileContinue(cond: bool) { // CHECK:STDOUT: @Destructible.val.loc6_3 = internal constant {} zeroinitializer // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CIfElse.Main(i1 %cond) #0 !dbg !71 { +// CHECK:STDOUT: define void @_CIfElse.Main(i1 %cond) #0 !dbg !79 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %a.var = alloca {}, align 1, !dbg !74 -// CHECK:STDOUT: %b.var = alloca {}, align 1, !dbg !81 -// CHECK:STDOUT: %c.var = alloca {}, align 1, !dbg !87 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !74 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %a.var, ptr align 1 @Destructible.val.loc6_3, i64 0, i1 false), !dbg !74 -// CHECK:STDOUT: call void @_CUse.Main(ptr %a.var), !dbg !78 -// CHECK:STDOUT: br i1 %cond, label %if.then, label %if.else, !dbg !80 +// CHECK:STDOUT: %a.var = alloca {}, align 1, !dbg !82 +// CHECK:STDOUT: %b.var = alloca {}, align 1, !dbg !89 +// CHECK:STDOUT: %c.var = alloca {}, align 1, !dbg !95 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !82 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %a.var, ptr align 1 @Destructible.val.loc6_3, i64 0, i1 false), !dbg !82 +// CHECK:STDOUT: call void @_CUse.Main(ptr %a.var), !dbg !86 +// CHECK:STDOUT: br i1 %cond, label %if.then, label %if.else, !dbg !88 // CHECK:STDOUT: // CHECK:STDOUT: if.then: ; preds = %entry -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %b.var), !dbg !81 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %b.var, ptr align 1 @Destructible.val.loc6_3, i64 0, i1 false), !dbg !81 -// CHECK:STDOUT: call void @_CUse.Main(ptr %b.var), !dbg !85 -// CHECK:STDOUT: call void @"_COp.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %b.var), !dbg !81 -// CHECK:STDOUT: br label %if.done, !dbg !86 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %b.var), !dbg !89 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %b.var, ptr align 1 @Destructible.val.loc6_3, i64 0, i1 false), !dbg !89 +// CHECK:STDOUT: call void @_CUse.Main(ptr %b.var), !dbg !93 +// CHECK:STDOUT: call void @"_CSelfDestruct.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %b.var), !dbg !89 +// CHECK:STDOUT: br label %if.done, !dbg !94 // CHECK:STDOUT: // CHECK:STDOUT: if.else: ; preds = %entry -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !87 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %c.var, ptr align 1 @Destructible.val.loc6_3, i64 0, i1 false), !dbg !87 -// CHECK:STDOUT: call void @_CUse.Main(ptr %c.var), !dbg !91 -// CHECK:STDOUT: call void @"_COp.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %c.var), !dbg !87 -// CHECK:STDOUT: br label %if.done, !dbg !86 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !95 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %c.var, ptr align 1 @Destructible.val.loc6_3, i64 0, i1 false), !dbg !95 +// CHECK:STDOUT: call void @_CUse.Main(ptr %c.var), !dbg !99 +// CHECK:STDOUT: call void @"_CSelfDestruct.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %c.var), !dbg !95 +// CHECK:STDOUT: br label %if.done, !dbg !94 // CHECK:STDOUT: // CHECK:STDOUT: if.done: ; preds = %if.else, %if.then -// CHECK:STDOUT: call void @_CUse.Main(ptr %a.var), !dbg !94 -// CHECK:STDOUT: call void @"_COp.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %a.var), !dbg !74 -// CHECK:STDOUT: ret void, !dbg !95 +// CHECK:STDOUT: call void @_CUse.Main(ptr %a.var), !dbg !102 +// CHECK:STDOUT: call void @"_CSelfDestruct.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %a.var), !dbg !82 +// CHECK:STDOUT: ret void, !dbg !103 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_CUse.Main(ptr) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %self) #0 !dbg !97 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %self) #0 !dbg !105 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !99 +// CHECK:STDOUT: ret void, !dbg !107 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %self) #0 !dbg !109 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !111 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %self) #0 !dbg !113 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %self), !dbg !115 +// CHECK:STDOUT: ret void, !dbg !115 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -276,14 +310,14 @@ fn WhileContinue(cond: bool) { // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives // CHECK:STDOUT: uselistorder ptr @_CUse.Main, { 3, 2, 1, 0 } -// CHECK:STDOUT: uselistorder ptr @"_COp.c3fcb3d93f31df0e:core.Destroy.Core", { 2, 1, 0 } +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.c3fcb3d93f31df0e:core.Destroy.Core", { 2, 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 2, 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.memcpy.p0.p0.i64, { 2, 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!70} +// CHECK:STDOUT: !llvm.dbg.cu = !{!78} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} @@ -291,25 +325,33 @@ fn WhileContinue(cond: bool) { // CHECK:STDOUT: !34 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) // CHECK:STDOUT: !35 = !{null, !34} // CHECK:STDOUT: !36 = !DISubroutineType(types: !35) -// CHECK:STDOUT: !69 = !DIFile(filename: "if_else.carbon", directory: "") -// CHECK:STDOUT: !70 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !69, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !71 = distinct !DISubprogram(name: "IfElse", linkageName: "_CIfElse.Main", scope: null, file: !69, line: 5, type: !36, spFlags: DISPFlagDefinition, unit: !70, retainedNodes: !96) -// CHECK:STDOUT: !72 = !DILocalVariable(arg: 1, scope: !71, type: !34) -// CHECK:STDOUT: !74 = !DILocation(line: 6, column: 3, scope: !71) -// CHECK:STDOUT: !78 = !DILocation(line: 7, column: 3, scope: !71) -// CHECK:STDOUT: !80 = !DILocation(line: 8, column: 6, scope: !71) -// CHECK:STDOUT: !81 = !DILocation(line: 9, column: 5, scope: !71) -// CHECK:STDOUT: !85 = !DILocation(line: 10, column: 5, scope: !71) -// CHECK:STDOUT: !86 = !DILocation(line: 8, column: 3, scope: !71) -// CHECK:STDOUT: !87 = !DILocation(line: 12, column: 5, scope: !71) -// CHECK:STDOUT: !91 = !DILocation(line: 13, column: 5, scope: !71) -// CHECK:STDOUT: !94 = !DILocation(line: 15, column: 3, scope: !71) -// CHECK:STDOUT: !95 = !DILocation(line: 5, column: 1, scope: !71) -// CHECK:STDOUT: !96 = !{!72} -// CHECK:STDOUT: !97 = distinct !DISubprogram(name: "Op", linkageName: "_COp.c3fcb3d93f31df0e:core.Destroy.Core", scope: null, file: !69, line: 9, type: !36, spFlags: DISPFlagDefinition, unit: !70, retainedNodes: !100) -// CHECK:STDOUT: !98 = !DILocalVariable(arg: 1, scope: !97, type: !34) -// CHECK:STDOUT: !99 = !DILocation(line: 9, column: 5, scope: !97) -// CHECK:STDOUT: !100 = !{!98} +// CHECK:STDOUT: !77 = !DIFile(filename: "if_else.carbon", directory: "") +// CHECK:STDOUT: !78 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !77, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !79 = distinct !DISubprogram(name: "IfElse", linkageName: "_CIfElse.Main", scope: null, file: !77, line: 5, type: !36, spFlags: DISPFlagDefinition, unit: !78, retainedNodes: !104) +// CHECK:STDOUT: !80 = !DILocalVariable(arg: 1, scope: !79, type: !34) +// CHECK:STDOUT: !82 = !DILocation(line: 6, column: 3, scope: !79) +// CHECK:STDOUT: !86 = !DILocation(line: 7, column: 3, scope: !79) +// CHECK:STDOUT: !88 = !DILocation(line: 8, column: 6, scope: !79) +// CHECK:STDOUT: !89 = !DILocation(line: 9, column: 5, scope: !79) +// CHECK:STDOUT: !93 = !DILocation(line: 10, column: 5, scope: !79) +// CHECK:STDOUT: !94 = !DILocation(line: 8, column: 3, scope: !79) +// CHECK:STDOUT: !95 = !DILocation(line: 12, column: 5, scope: !79) +// CHECK:STDOUT: !99 = !DILocation(line: 13, column: 5, scope: !79) +// CHECK:STDOUT: !102 = !DILocation(line: 15, column: 3, scope: !79) +// CHECK:STDOUT: !103 = !DILocation(line: 5, column: 1, scope: !79) +// CHECK:STDOUT: !104 = !{!80} +// CHECK:STDOUT: !105 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !77, line: 9, type: !36, spFlags: DISPFlagDefinition, unit: !78, retainedNodes: !108) +// CHECK:STDOUT: !106 = !DILocalVariable(arg: 1, scope: !105, type: !34) +// CHECK:STDOUT: !107 = !DILocation(line: 9, column: 5, scope: !105) +// CHECK:STDOUT: !108 = !{!106} +// CHECK:STDOUT: !109 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.c3fcb3d93f31df0e:core.Destroy.Core", scope: null, file: !77, line: 9, type: !36, spFlags: DISPFlagDefinition, unit: !78, retainedNodes: !112) +// CHECK:STDOUT: !110 = !DILocalVariable(arg: 1, scope: !109, type: !34) +// CHECK:STDOUT: !111 = !DILocation(line: 9, column: 5, scope: !109) +// CHECK:STDOUT: !112 = !{!110} +// CHECK:STDOUT: !113 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.c3fcb3d93f31df0e:core.Destroy.Core", scope: null, file: !77, line: 9, type: !36, spFlags: DISPFlagDefinition, unit: !78, retainedNodes: !116) +// CHECK:STDOUT: !114 = !DILocalVariable(arg: 1, scope: !113, type: !34) +// CHECK:STDOUT: !115 = !DILocation(line: 9, column: 5, scope: !113) +// CHECK:STDOUT: !116 = !{!114} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'if_return.carbon' @@ -318,34 +360,47 @@ fn WhileContinue(cond: bool) { // CHECK:STDOUT: @Destructible.val.loc6_3 = internal constant {} zeroinitializer // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CIfReturn.Main(i1 %cond) #0 !dbg !103 { +// CHECK:STDOUT: define void @_CIfReturn.Main(i1 %cond) #0 !dbg !119 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %a.var = alloca {}, align 1, !dbg !106 -// CHECK:STDOUT: %b.var = alloca {}, align 1, !dbg !113 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !106 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %a.var, ptr align 1 @Destructible.val.loc6_3, i64 0, i1 false), !dbg !106 -// CHECK:STDOUT: call void @_CUse.Main(ptr %a.var), !dbg !110 -// CHECK:STDOUT: br i1 %cond, label %if.then, label %if.else, !dbg !112 +// CHECK:STDOUT: %a.var = alloca {}, align 1, !dbg !122 +// CHECK:STDOUT: %b.var = alloca {}, align 1, !dbg !129 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !122 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %a.var, ptr align 1 @Destructible.val.loc6_3, i64 0, i1 false), !dbg !122 +// CHECK:STDOUT: call void @_CUse.Main(ptr %a.var), !dbg !126 +// CHECK:STDOUT: br i1 %cond, label %if.then, label %if.else, !dbg !128 // CHECK:STDOUT: // CHECK:STDOUT: if.then: ; preds = %entry -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %b.var), !dbg !113 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %b.var, ptr align 1 @Destructible.val.loc6_3, i64 0, i1 false), !dbg !113 -// CHECK:STDOUT: call void @_CUse.Main(ptr %b.var), !dbg !117 -// CHECK:STDOUT: call void @"_COp.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %b.var), !dbg !113 -// CHECK:STDOUT: call void @"_COp.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %a.var), !dbg !106 -// CHECK:STDOUT: ret void, !dbg !118 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %b.var), !dbg !129 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %b.var, ptr align 1 @Destructible.val.loc6_3, i64 0, i1 false), !dbg !129 +// CHECK:STDOUT: call void @_CUse.Main(ptr %b.var), !dbg !133 +// CHECK:STDOUT: call void @"_CSelfDestruct.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %b.var), !dbg !129 +// CHECK:STDOUT: call void @"_CSelfDestruct.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %a.var), !dbg !122 +// CHECK:STDOUT: ret void, !dbg !134 // CHECK:STDOUT: // CHECK:STDOUT: if.else: ; preds = %entry -// CHECK:STDOUT: call void @"_COp.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %a.var), !dbg !106 -// CHECK:STDOUT: ret void, !dbg !119 +// CHECK:STDOUT: call void @"_CSelfDestruct.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %a.var), !dbg !122 +// CHECK:STDOUT: ret void, !dbg !135 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_CUse.Main(ptr) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %self) #0 !dbg !121 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %self) #0 !dbg !137 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !123 +// CHECK:STDOUT: ret void, !dbg !139 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %self) #0 !dbg !141 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !143 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %self) #0 !dbg !145 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %self), !dbg !147 +// CHECK:STDOUT: ret void, !dbg !147 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -356,14 +411,14 @@ fn WhileContinue(cond: bool) { // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives // CHECK:STDOUT: uselistorder ptr @_CUse.Main, { 1, 0 } -// CHECK:STDOUT: uselistorder ptr @"_COp.c3fcb3d93f31df0e:core.Destroy.Core", { 2, 1, 0 } +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.c3fcb3d93f31df0e:core.Destroy.Core", { 2, 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.memcpy.p0.p0.i64, { 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!102} +// CHECK:STDOUT: !llvm.dbg.cu = !{!118} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} @@ -371,22 +426,30 @@ fn WhileContinue(cond: bool) { // CHECK:STDOUT: !34 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) // CHECK:STDOUT: !35 = !{null, !34} // CHECK:STDOUT: !36 = !DISubroutineType(types: !35) -// CHECK:STDOUT: !101 = !DIFile(filename: "if_return.carbon", directory: "") -// CHECK:STDOUT: !102 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !101, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !103 = distinct !DISubprogram(name: "IfReturn", linkageName: "_CIfReturn.Main", scope: null, file: !101, line: 5, type: !36, spFlags: DISPFlagDefinition, unit: !102, retainedNodes: !120) -// CHECK:STDOUT: !104 = !DILocalVariable(arg: 1, scope: !103, type: !34) -// CHECK:STDOUT: !106 = !DILocation(line: 6, column: 3, scope: !103) -// CHECK:STDOUT: !110 = !DILocation(line: 7, column: 3, scope: !103) -// CHECK:STDOUT: !112 = !DILocation(line: 8, column: 6, scope: !103) -// CHECK:STDOUT: !113 = !DILocation(line: 9, column: 5, scope: !103) -// CHECK:STDOUT: !117 = !DILocation(line: 10, column: 5, scope: !103) -// CHECK:STDOUT: !118 = !DILocation(line: 11, column: 5, scope: !103) -// CHECK:STDOUT: !119 = !DILocation(line: 5, column: 1, scope: !103) -// CHECK:STDOUT: !120 = !{!104} -// CHECK:STDOUT: !121 = distinct !DISubprogram(name: "Op", linkageName: "_COp.c3fcb3d93f31df0e:core.Destroy.Core", scope: null, file: !101, line: 9, type: !36, spFlags: DISPFlagDefinition, unit: !102, retainedNodes: !124) -// CHECK:STDOUT: !122 = !DILocalVariable(arg: 1, scope: !121, type: !34) -// CHECK:STDOUT: !123 = !DILocation(line: 9, column: 5, scope: !121) -// CHECK:STDOUT: !124 = !{!122} +// CHECK:STDOUT: !117 = !DIFile(filename: "if_return.carbon", directory: "") +// CHECK:STDOUT: !118 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !117, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !119 = distinct !DISubprogram(name: "IfReturn", linkageName: "_CIfReturn.Main", scope: null, file: !117, line: 5, type: !36, spFlags: DISPFlagDefinition, unit: !118, retainedNodes: !136) +// CHECK:STDOUT: !120 = !DILocalVariable(arg: 1, scope: !119, type: !34) +// CHECK:STDOUT: !122 = !DILocation(line: 6, column: 3, scope: !119) +// CHECK:STDOUT: !126 = !DILocation(line: 7, column: 3, scope: !119) +// CHECK:STDOUT: !128 = !DILocation(line: 8, column: 6, scope: !119) +// CHECK:STDOUT: !129 = !DILocation(line: 9, column: 5, scope: !119) +// CHECK:STDOUT: !133 = !DILocation(line: 10, column: 5, scope: !119) +// CHECK:STDOUT: !134 = !DILocation(line: 11, column: 5, scope: !119) +// CHECK:STDOUT: !135 = !DILocation(line: 5, column: 1, scope: !119) +// CHECK:STDOUT: !136 = !{!120} +// CHECK:STDOUT: !137 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !117, line: 9, type: !36, spFlags: DISPFlagDefinition, unit: !118, retainedNodes: !140) +// CHECK:STDOUT: !138 = !DILocalVariable(arg: 1, scope: !137, type: !34) +// CHECK:STDOUT: !139 = !DILocation(line: 9, column: 5, scope: !137) +// CHECK:STDOUT: !140 = !{!138} +// CHECK:STDOUT: !141 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.c3fcb3d93f31df0e:core.Destroy.Core", scope: null, file: !117, line: 9, type: !36, spFlags: DISPFlagDefinition, unit: !118, retainedNodes: !144) +// CHECK:STDOUT: !142 = !DILocalVariable(arg: 1, scope: !141, type: !34) +// CHECK:STDOUT: !143 = !DILocation(line: 9, column: 5, scope: !141) +// CHECK:STDOUT: !144 = !{!142} +// CHECK:STDOUT: !145 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.c3fcb3d93f31df0e:core.Destroy.Core", scope: null, file: !117, line: 9, type: !36, spFlags: DISPFlagDefinition, unit: !118, retainedNodes: !148) +// CHECK:STDOUT: !146 = !DILocalVariable(arg: 1, scope: !145, type: !34) +// CHECK:STDOUT: !147 = !DILocation(line: 9, column: 5, scope: !145) +// CHECK:STDOUT: !148 = !{!146} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'while_break.carbon' @@ -395,50 +458,63 @@ fn WhileContinue(cond: bool) { // CHECK:STDOUT: @Destructible.val.loc6_3 = internal constant {} zeroinitializer // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CWhileBreak.Main(i1 %cond) #0 !dbg !127 { +// CHECK:STDOUT: define void @_CWhileBreak.Main(i1 %cond) #0 !dbg !151 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %a.var = alloca {}, align 1, !dbg !130 -// CHECK:STDOUT: %b.var = alloca {}, align 1, !dbg !140 -// CHECK:STDOUT: %c.var = alloca {}, align 1, !dbg !147 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !130 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %a.var, ptr align 1 @Destructible.val.loc6_3, i64 0, i1 false), !dbg !130 -// CHECK:STDOUT: call void @_CUse.Main(ptr %a.var), !dbg !134 -// CHECK:STDOUT: br label %while.cond, !dbg !135 +// CHECK:STDOUT: %a.var = alloca {}, align 1, !dbg !154 +// CHECK:STDOUT: %b.var = alloca {}, align 1, !dbg !164 +// CHECK:STDOUT: %c.var = alloca {}, align 1, !dbg !171 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !154 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %a.var, ptr align 1 @Destructible.val.loc6_3, i64 0, i1 false), !dbg !154 +// CHECK:STDOUT: call void @_CUse.Main(ptr %a.var), !dbg !158 +// CHECK:STDOUT: br label %while.cond, !dbg !159 // CHECK:STDOUT: // CHECK:STDOUT: while.cond: ; preds = %if.else, %entry -// CHECK:STDOUT: br i1 %cond, label %while.body, label %while.done, !dbg !135 +// CHECK:STDOUT: br i1 %cond, label %while.body, label %while.done, !dbg !159 // CHECK:STDOUT: // CHECK:STDOUT: while.body: ; preds = %while.cond -// CHECK:STDOUT: call void @_CUse.Main(ptr %a.var), !dbg !139 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %b.var), !dbg !140 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %b.var, ptr align 1 @Destructible.val.loc6_3, i64 0, i1 false), !dbg !140 -// CHECK:STDOUT: call void @_CUse.Main(ptr %b.var), !dbg !144 -// CHECK:STDOUT: br i1 %cond, label %if.then, label %if.else, !dbg !146 +// CHECK:STDOUT: call void @_CUse.Main(ptr %a.var), !dbg !163 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %b.var), !dbg !164 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %b.var, ptr align 1 @Destructible.val.loc6_3, i64 0, i1 false), !dbg !164 +// CHECK:STDOUT: call void @_CUse.Main(ptr %b.var), !dbg !168 +// CHECK:STDOUT: br i1 %cond, label %if.then, label %if.else, !dbg !170 // CHECK:STDOUT: // CHECK:STDOUT: if.then: ; preds = %while.body -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !147 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %c.var, ptr align 1 @Destructible.val.loc6_3, i64 0, i1 false), !dbg !147 -// CHECK:STDOUT: call void @_CUse.Main(ptr %c.var), !dbg !151 -// CHECK:STDOUT: call void @"_COp.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %c.var), !dbg !147 -// CHECK:STDOUT: call void @"_COp.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %b.var), !dbg !140 -// CHECK:STDOUT: br label %while.done, !dbg !152 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !171 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %c.var, ptr align 1 @Destructible.val.loc6_3, i64 0, i1 false), !dbg !171 +// CHECK:STDOUT: call void @_CUse.Main(ptr %c.var), !dbg !175 +// CHECK:STDOUT: call void @"_CSelfDestruct.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %c.var), !dbg !171 +// CHECK:STDOUT: call void @"_CSelfDestruct.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %b.var), !dbg !164 +// CHECK:STDOUT: br label %while.done, !dbg !176 // CHECK:STDOUT: // CHECK:STDOUT: if.else: ; preds = %while.body -// CHECK:STDOUT: call void @"_COp.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %b.var), !dbg !140 -// CHECK:STDOUT: br label %while.cond, !dbg !153 +// CHECK:STDOUT: call void @"_CSelfDestruct.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %b.var), !dbg !164 +// CHECK:STDOUT: br label %while.cond, !dbg !177 // CHECK:STDOUT: // CHECK:STDOUT: while.done: ; preds = %if.then, %while.cond -// CHECK:STDOUT: call void @_CUse.Main(ptr %a.var), !dbg !156 -// CHECK:STDOUT: call void @"_COp.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %a.var), !dbg !130 -// CHECK:STDOUT: ret void, !dbg !157 +// CHECK:STDOUT: call void @_CUse.Main(ptr %a.var), !dbg !180 +// CHECK:STDOUT: call void @"_CSelfDestruct.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %a.var), !dbg !154 +// CHECK:STDOUT: ret void, !dbg !181 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_CUse.Main(ptr) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %self) #0 !dbg !159 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %self) #0 !dbg !183 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !161 +// CHECK:STDOUT: ret void, !dbg !185 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %self) #0 !dbg !187 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !189 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %self) #0 !dbg !191 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %self), !dbg !193 +// CHECK:STDOUT: ret void, !dbg !193 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -449,14 +525,14 @@ fn WhileContinue(cond: bool) { // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives // CHECK:STDOUT: uselistorder ptr @_CUse.Main, { 4, 3, 2, 1, 0 } -// CHECK:STDOUT: uselistorder ptr @"_COp.c3fcb3d93f31df0e:core.Destroy.Core", { 3, 2, 1, 0 } +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.c3fcb3d93f31df0e:core.Destroy.Core", { 3, 2, 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 2, 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.memcpy.p0.p0.i64, { 2, 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!126} +// CHECK:STDOUT: !llvm.dbg.cu = !{!150} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} @@ -464,28 +540,36 @@ fn WhileContinue(cond: bool) { // CHECK:STDOUT: !34 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) // CHECK:STDOUT: !35 = !{null, !34} // CHECK:STDOUT: !36 = !DISubroutineType(types: !35) -// CHECK:STDOUT: !125 = !DIFile(filename: "while_break.carbon", directory: "") -// CHECK:STDOUT: !126 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !125, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !127 = distinct !DISubprogram(name: "WhileBreak", linkageName: "_CWhileBreak.Main", scope: null, file: !125, line: 5, type: !36, spFlags: DISPFlagDefinition, unit: !126, retainedNodes: !158) -// CHECK:STDOUT: !128 = !DILocalVariable(arg: 1, scope: !127, type: !34) -// CHECK:STDOUT: !130 = !DILocation(line: 6, column: 3, scope: !127) -// CHECK:STDOUT: !134 = !DILocation(line: 7, column: 3, scope: !127) -// CHECK:STDOUT: !135 = !DILocation(line: 8, column: 9, scope: !127) -// CHECK:STDOUT: !139 = !DILocation(line: 9, column: 5, scope: !127) -// CHECK:STDOUT: !140 = !DILocation(line: 10, column: 5, scope: !127) -// CHECK:STDOUT: !144 = !DILocation(line: 11, column: 5, scope: !127) -// CHECK:STDOUT: !146 = !DILocation(line: 12, column: 8, scope: !127) -// CHECK:STDOUT: !147 = !DILocation(line: 13, column: 7, scope: !127) -// CHECK:STDOUT: !151 = !DILocation(line: 14, column: 7, scope: !127) -// CHECK:STDOUT: !152 = !DILocation(line: 15, column: 7, scope: !127) -// CHECK:STDOUT: !153 = !DILocation(line: 8, column: 3, scope: !127) -// CHECK:STDOUT: !156 = !DILocation(line: 18, column: 3, scope: !127) -// CHECK:STDOUT: !157 = !DILocation(line: 5, column: 1, scope: !127) -// CHECK:STDOUT: !158 = !{!128} -// CHECK:STDOUT: !159 = distinct !DISubprogram(name: "Op", linkageName: "_COp.c3fcb3d93f31df0e:core.Destroy.Core", scope: null, file: !125, line: 13, type: !36, spFlags: DISPFlagDefinition, unit: !126, retainedNodes: !162) -// CHECK:STDOUT: !160 = !DILocalVariable(arg: 1, scope: !159, type: !34) -// CHECK:STDOUT: !161 = !DILocation(line: 13, column: 7, scope: !159) -// CHECK:STDOUT: !162 = !{!160} +// CHECK:STDOUT: !149 = !DIFile(filename: "while_break.carbon", directory: "") +// CHECK:STDOUT: !150 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !149, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !151 = distinct !DISubprogram(name: "WhileBreak", linkageName: "_CWhileBreak.Main", scope: null, file: !149, line: 5, type: !36, spFlags: DISPFlagDefinition, unit: !150, retainedNodes: !182) +// CHECK:STDOUT: !152 = !DILocalVariable(arg: 1, scope: !151, type: !34) +// CHECK:STDOUT: !154 = !DILocation(line: 6, column: 3, scope: !151) +// CHECK:STDOUT: !158 = !DILocation(line: 7, column: 3, scope: !151) +// CHECK:STDOUT: !159 = !DILocation(line: 8, column: 9, scope: !151) +// CHECK:STDOUT: !163 = !DILocation(line: 9, column: 5, scope: !151) +// CHECK:STDOUT: !164 = !DILocation(line: 10, column: 5, scope: !151) +// CHECK:STDOUT: !168 = !DILocation(line: 11, column: 5, scope: !151) +// CHECK:STDOUT: !170 = !DILocation(line: 12, column: 8, scope: !151) +// CHECK:STDOUT: !171 = !DILocation(line: 13, column: 7, scope: !151) +// CHECK:STDOUT: !175 = !DILocation(line: 14, column: 7, scope: !151) +// CHECK:STDOUT: !176 = !DILocation(line: 15, column: 7, scope: !151) +// CHECK:STDOUT: !177 = !DILocation(line: 8, column: 3, scope: !151) +// CHECK:STDOUT: !180 = !DILocation(line: 18, column: 3, scope: !151) +// CHECK:STDOUT: !181 = !DILocation(line: 5, column: 1, scope: !151) +// CHECK:STDOUT: !182 = !{!152} +// CHECK:STDOUT: !183 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !149, line: 13, type: !36, spFlags: DISPFlagDefinition, unit: !150, retainedNodes: !186) +// CHECK:STDOUT: !184 = !DILocalVariable(arg: 1, scope: !183, type: !34) +// CHECK:STDOUT: !185 = !DILocation(line: 13, column: 7, scope: !183) +// CHECK:STDOUT: !186 = !{!184} +// CHECK:STDOUT: !187 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.c3fcb3d93f31df0e:core.Destroy.Core", scope: null, file: !149, line: 13, type: !36, spFlags: DISPFlagDefinition, unit: !150, retainedNodes: !190) +// CHECK:STDOUT: !188 = !DILocalVariable(arg: 1, scope: !187, type: !34) +// CHECK:STDOUT: !189 = !DILocation(line: 13, column: 7, scope: !187) +// CHECK:STDOUT: !190 = !{!188} +// CHECK:STDOUT: !191 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.c3fcb3d93f31df0e:core.Destroy.Core", scope: null, file: !149, line: 13, type: !36, spFlags: DISPFlagDefinition, unit: !150, retainedNodes: !194) +// CHECK:STDOUT: !192 = !DILocalVariable(arg: 1, scope: !191, type: !34) +// CHECK:STDOUT: !193 = !DILocation(line: 13, column: 7, scope: !191) +// CHECK:STDOUT: !194 = !{!192} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'while_continue.carbon' @@ -494,50 +578,63 @@ fn WhileContinue(cond: bool) { // CHECK:STDOUT: @Destructible.val.loc6_3 = internal constant {} zeroinitializer // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CWhileContinue.Main(i1 %cond) #0 !dbg !165 { +// CHECK:STDOUT: define void @_CWhileContinue.Main(i1 %cond) #0 !dbg !197 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %a.var = alloca {}, align 1, !dbg !168 -// CHECK:STDOUT: %b.var = alloca {}, align 1, !dbg !178 -// CHECK:STDOUT: %c.var = alloca {}, align 1, !dbg !185 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !168 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %a.var, ptr align 1 @Destructible.val.loc6_3, i64 0, i1 false), !dbg !168 -// CHECK:STDOUT: call void @_CUse.Main(ptr %a.var), !dbg !172 -// CHECK:STDOUT: br label %while.cond, !dbg !173 +// CHECK:STDOUT: %a.var = alloca {}, align 1, !dbg !200 +// CHECK:STDOUT: %b.var = alloca {}, align 1, !dbg !210 +// CHECK:STDOUT: %c.var = alloca {}, align 1, !dbg !217 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !200 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %a.var, ptr align 1 @Destructible.val.loc6_3, i64 0, i1 false), !dbg !200 +// CHECK:STDOUT: call void @_CUse.Main(ptr %a.var), !dbg !204 +// CHECK:STDOUT: br label %while.cond, !dbg !205 // CHECK:STDOUT: // CHECK:STDOUT: while.cond: ; preds = %if.else, %if.then, %entry -// CHECK:STDOUT: br i1 %cond, label %while.body, label %while.done, !dbg !173 +// CHECK:STDOUT: br i1 %cond, label %while.body, label %while.done, !dbg !205 // CHECK:STDOUT: // CHECK:STDOUT: while.body: ; preds = %while.cond -// CHECK:STDOUT: call void @_CUse.Main(ptr %a.var), !dbg !177 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %b.var), !dbg !178 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %b.var, ptr align 1 @Destructible.val.loc6_3, i64 0, i1 false), !dbg !178 -// CHECK:STDOUT: call void @_CUse.Main(ptr %b.var), !dbg !182 -// CHECK:STDOUT: br i1 %cond, label %if.then, label %if.else, !dbg !184 +// CHECK:STDOUT: call void @_CUse.Main(ptr %a.var), !dbg !209 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %b.var), !dbg !210 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %b.var, ptr align 1 @Destructible.val.loc6_3, i64 0, i1 false), !dbg !210 +// CHECK:STDOUT: call void @_CUse.Main(ptr %b.var), !dbg !214 +// CHECK:STDOUT: br i1 %cond, label %if.then, label %if.else, !dbg !216 // CHECK:STDOUT: // CHECK:STDOUT: if.then: ; preds = %while.body -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !185 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %c.var, ptr align 1 @Destructible.val.loc6_3, i64 0, i1 false), !dbg !185 -// CHECK:STDOUT: call void @_CUse.Main(ptr %c.var), !dbg !189 -// CHECK:STDOUT: call void @"_COp.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %c.var), !dbg !185 -// CHECK:STDOUT: call void @"_COp.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %b.var), !dbg !178 -// CHECK:STDOUT: br label %while.cond, !dbg !190 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !217 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %c.var, ptr align 1 @Destructible.val.loc6_3, i64 0, i1 false), !dbg !217 +// CHECK:STDOUT: call void @_CUse.Main(ptr %c.var), !dbg !221 +// CHECK:STDOUT: call void @"_CSelfDestruct.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %c.var), !dbg !217 +// CHECK:STDOUT: call void @"_CSelfDestruct.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %b.var), !dbg !210 +// CHECK:STDOUT: br label %while.cond, !dbg !222 // CHECK:STDOUT: // CHECK:STDOUT: if.else: ; preds = %while.body -// CHECK:STDOUT: call void @"_COp.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %b.var), !dbg !178 -// CHECK:STDOUT: br label %while.cond, !dbg !191 +// CHECK:STDOUT: call void @"_CSelfDestruct.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %b.var), !dbg !210 +// CHECK:STDOUT: br label %while.cond, !dbg !223 // CHECK:STDOUT: // CHECK:STDOUT: while.done: ; preds = %while.cond -// CHECK:STDOUT: call void @_CUse.Main(ptr %a.var), !dbg !194 -// CHECK:STDOUT: call void @"_COp.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %a.var), !dbg !168 -// CHECK:STDOUT: ret void, !dbg !195 +// CHECK:STDOUT: call void @_CUse.Main(ptr %a.var), !dbg !226 +// CHECK:STDOUT: call void @"_CSelfDestruct.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %a.var), !dbg !200 +// CHECK:STDOUT: ret void, !dbg !227 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_CUse.Main(ptr) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %self) #0 !dbg !197 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %self) #0 !dbg !229 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !199 +// CHECK:STDOUT: ret void, !dbg !231 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %self) #0 !dbg !233 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !235 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %self) #0 !dbg !237 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.c3fcb3d93f31df0e:core.Destroy.Core"(ptr %self), !dbg !239 +// CHECK:STDOUT: ret void, !dbg !239 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -548,14 +645,14 @@ fn WhileContinue(cond: bool) { // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives // CHECK:STDOUT: uselistorder ptr @_CUse.Main, { 4, 3, 2, 1, 0 } -// CHECK:STDOUT: uselistorder ptr @"_COp.c3fcb3d93f31df0e:core.Destroy.Core", { 3, 2, 1, 0 } +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.c3fcb3d93f31df0e:core.Destroy.Core", { 3, 2, 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 2, 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.memcpy.p0.p0.i64, { 2, 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!164} +// CHECK:STDOUT: !llvm.dbg.cu = !{!196} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} @@ -563,26 +660,34 @@ fn WhileContinue(cond: bool) { // CHECK:STDOUT: !34 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) // CHECK:STDOUT: !35 = !{null, !34} // CHECK:STDOUT: !36 = !DISubroutineType(types: !35) -// CHECK:STDOUT: !163 = !DIFile(filename: "while_continue.carbon", directory: "") -// CHECK:STDOUT: !164 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !163, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !165 = distinct !DISubprogram(name: "WhileContinue", linkageName: "_CWhileContinue.Main", scope: null, file: !163, line: 5, type: !36, spFlags: DISPFlagDefinition, unit: !164, retainedNodes: !196) -// CHECK:STDOUT: !166 = !DILocalVariable(arg: 1, scope: !165, type: !34) -// CHECK:STDOUT: !168 = !DILocation(line: 6, column: 3, scope: !165) -// CHECK:STDOUT: !172 = !DILocation(line: 7, column: 3, scope: !165) -// CHECK:STDOUT: !173 = !DILocation(line: 8, column: 9, scope: !165) -// CHECK:STDOUT: !177 = !DILocation(line: 9, column: 5, scope: !165) -// CHECK:STDOUT: !178 = !DILocation(line: 10, column: 5, scope: !165) -// CHECK:STDOUT: !182 = !DILocation(line: 11, column: 5, scope: !165) -// CHECK:STDOUT: !184 = !DILocation(line: 12, column: 8, scope: !165) -// CHECK:STDOUT: !185 = !DILocation(line: 13, column: 7, scope: !165) -// CHECK:STDOUT: !189 = !DILocation(line: 14, column: 7, scope: !165) -// CHECK:STDOUT: !190 = !DILocation(line: 15, column: 7, scope: !165) -// CHECK:STDOUT: !191 = !DILocation(line: 8, column: 3, scope: !165) -// CHECK:STDOUT: !194 = !DILocation(line: 18, column: 3, scope: !165) -// CHECK:STDOUT: !195 = !DILocation(line: 5, column: 1, scope: !165) -// CHECK:STDOUT: !196 = !{!166} -// CHECK:STDOUT: !197 = distinct !DISubprogram(name: "Op", linkageName: "_COp.c3fcb3d93f31df0e:core.Destroy.Core", scope: null, file: !163, line: 13, type: !36, spFlags: DISPFlagDefinition, unit: !164, retainedNodes: !200) +// CHECK:STDOUT: !195 = !DIFile(filename: "while_continue.carbon", directory: "") +// CHECK:STDOUT: !196 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !195, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !197 = distinct !DISubprogram(name: "WhileContinue", linkageName: "_CWhileContinue.Main", scope: null, file: !195, line: 5, type: !36, spFlags: DISPFlagDefinition, unit: !196, retainedNodes: !228) // CHECK:STDOUT: !198 = !DILocalVariable(arg: 1, scope: !197, type: !34) -// CHECK:STDOUT: !199 = !DILocation(line: 13, column: 7, scope: !197) -// CHECK:STDOUT: !200 = !{!198} +// CHECK:STDOUT: !200 = !DILocation(line: 6, column: 3, scope: !197) +// CHECK:STDOUT: !204 = !DILocation(line: 7, column: 3, scope: !197) +// CHECK:STDOUT: !205 = !DILocation(line: 8, column: 9, scope: !197) +// CHECK:STDOUT: !209 = !DILocation(line: 9, column: 5, scope: !197) +// CHECK:STDOUT: !210 = !DILocation(line: 10, column: 5, scope: !197) +// CHECK:STDOUT: !214 = !DILocation(line: 11, column: 5, scope: !197) +// CHECK:STDOUT: !216 = !DILocation(line: 12, column: 8, scope: !197) +// CHECK:STDOUT: !217 = !DILocation(line: 13, column: 7, scope: !197) +// CHECK:STDOUT: !221 = !DILocation(line: 14, column: 7, scope: !197) +// CHECK:STDOUT: !222 = !DILocation(line: 15, column: 7, scope: !197) +// CHECK:STDOUT: !223 = !DILocation(line: 8, column: 3, scope: !197) +// CHECK:STDOUT: !226 = !DILocation(line: 18, column: 3, scope: !197) +// CHECK:STDOUT: !227 = !DILocation(line: 5, column: 1, scope: !197) +// CHECK:STDOUT: !228 = !{!198} +// CHECK:STDOUT: !229 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !195, line: 13, type: !36, spFlags: DISPFlagDefinition, unit: !196, retainedNodes: !232) +// CHECK:STDOUT: !230 = !DILocalVariable(arg: 1, scope: !229, type: !34) +// CHECK:STDOUT: !231 = !DILocation(line: 13, column: 7, scope: !229) +// CHECK:STDOUT: !232 = !{!230} +// CHECK:STDOUT: !233 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.c3fcb3d93f31df0e:core.Destroy.Core", scope: null, file: !195, line: 13, type: !36, spFlags: DISPFlagDefinition, unit: !196, retainedNodes: !236) +// CHECK:STDOUT: !234 = !DILocalVariable(arg: 1, scope: !233, type: !34) +// CHECK:STDOUT: !235 = !DILocation(line: 13, column: 7, scope: !233) +// CHECK:STDOUT: !236 = !{!234} +// CHECK:STDOUT: !237 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.c3fcb3d93f31df0e:core.Destroy.Core", scope: null, file: !195, line: 13, type: !36, spFlags: DISPFlagDefinition, unit: !196, retainedNodes: !240) +// CHECK:STDOUT: !238 = !DILocalVariable(arg: 1, scope: !237, type: !34) +// CHECK:STDOUT: !239 = !DILocation(line: 13, column: 7, scope: !237) +// CHECK:STDOUT: !240 = !{!238} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/var/local.carbon b/toolchain/lower/testdata/var/local.carbon index b9a9e8c6de92..62c096488c5a 100644 --- a/toolchain/lower/testdata/var/local.carbon +++ b/toolchain/lower/testdata/var/local.carbon @@ -41,16 +41,29 @@ fn G() -> (i32, i32, i32) { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %x.var), !dbg !28 // CHECK:STDOUT: store i32 1, ptr %x.var, align 4, !dbg !28 // CHECK:STDOUT: %.loc6 = load i32, ptr %x.var, align 4, !dbg !30 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %x.var), !dbg !28 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %x.var), !dbg !28 // CHECK:STDOUT: ret i32 %.loc6, !dbg !31 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !32 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !32 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !34 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !36 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !38 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !40 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !42 +// CHECK:STDOUT: ret void, !dbg !42 +// 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: @@ -73,10 +86,18 @@ fn G() -> (i32, i32, i32) { // CHECK:STDOUT: !28 = !DILocation(line: 5, column: 3, scope: !25) // CHECK:STDOUT: !30 = !DILocation(line: 6, column: 10, scope: !25) // CHECK:STDOUT: !31 = !DILocation(line: 6, column: 3, scope: !25) -// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !35) +// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !18, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !35) // CHECK:STDOUT: !33 = !DILocalVariable(arg: 1, scope: !32, type: !20) // CHECK:STDOUT: !34 = !DILocation(line: 5, column: 3, scope: !32) // CHECK:STDOUT: !35 = !{!33} +// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !39) +// CHECK:STDOUT: !37 = !DILocalVariable(arg: 1, scope: !36, type: !20) +// CHECK:STDOUT: !38 = !DILocation(line: 5, column: 3, scope: !36) +// CHECK:STDOUT: !39 = !{!37} +// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !43) +// CHECK:STDOUT: !41 = !DILocalVariable(arg: 1, scope: !40, type: !20) +// CHECK:STDOUT: !42 = !DILocation(line: 5, column: 3, scope: !40) +// CHECK:STDOUT: !43 = !{!41} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'eval_init_in_place.carbon' @@ -85,47 +106,67 @@ fn G() -> (i32, i32, i32) { // CHECK:STDOUT: @tuple.479.loc4_50 = internal constant { i32, i32, i32 } { i32 1, i32 2, i32 3 } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF.Main(ptr sret({ i32, i32, i32 }) %return) #0 !dbg !43 { +// CHECK:STDOUT: define void @_CF.Main(ptr sret({ i32, i32, i32 }) %return) #0 !dbg !51 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %tuple.elem0.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %return, i32 0, i32 0, !dbg !46 -// CHECK:STDOUT: %tuple.elem1.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %return, i32 0, i32 1, !dbg !46 -// CHECK:STDOUT: %tuple.elem2.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %return, i32 0, i32 2, !dbg !46 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %return, ptr align 4 @tuple.479.loc4_50, i64 12, i1 false), !dbg !47 -// CHECK:STDOUT: ret void, !dbg !47 +// CHECK:STDOUT: %tuple.elem0.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %return, i32 0, i32 0, !dbg !54 +// CHECK:STDOUT: %tuple.elem1.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %return, i32 0, i32 1, !dbg !54 +// CHECK:STDOUT: %tuple.elem2.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %return, i32 0, i32 2, !dbg !54 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %return, ptr align 4 @tuple.479.loc4_50, i64 12, i1 false), !dbg !55 +// CHECK:STDOUT: ret void, !dbg !55 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CG.Main(ptr sret({ i32, i32, i32 }) %return) #0 !dbg !48 { +// CHECK:STDOUT: define void @_CG.Main(ptr sret({ i32, i32, i32 }) %return) #0 !dbg !56 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %a.var = alloca { i32, i32, i32 }, align 4, !dbg !51 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !51 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %a.var, ptr align 4 @tuple.479.loc4_50, i64 12, i1 false), !dbg !51 -// CHECK:STDOUT: %tuple.elem0.loc8_10.1.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 0, !dbg !53 -// CHECK:STDOUT: %.loc8_10.1 = load i32, ptr %tuple.elem0.loc8_10.1.tuple.elem, align 4, !dbg !53 -// CHECK:STDOUT: %tuple.elem0.loc8_10.2.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %return, i32 0, i32 0, !dbg !53 -// CHECK:STDOUT: store i32 %.loc8_10.1, ptr %tuple.elem0.loc8_10.2.tuple.elem, align 4, !dbg !53 -// CHECK:STDOUT: %tuple.elem1.loc8_10.1.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 1, !dbg !53 -// CHECK:STDOUT: %.loc8_10.3 = load i32, ptr %tuple.elem1.loc8_10.1.tuple.elem, align 4, !dbg !53 -// CHECK:STDOUT: %tuple.elem1.loc8_10.2.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %return, i32 0, i32 1, !dbg !53 -// CHECK:STDOUT: store i32 %.loc8_10.3, ptr %tuple.elem1.loc8_10.2.tuple.elem, align 4, !dbg !53 -// CHECK:STDOUT: %tuple.elem2.loc8_10.1.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 2, !dbg !53 -// CHECK:STDOUT: %.loc8_10.5 = load i32, ptr %tuple.elem2.loc8_10.1.tuple.elem, align 4, !dbg !53 -// CHECK:STDOUT: %tuple.elem2.loc8_10.2.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %return, i32 0, i32 2, !dbg !53 -// CHECK:STDOUT: store i32 %.loc8_10.5, ptr %tuple.elem2.loc8_10.2.tuple.elem, align 4, !dbg !53 -// CHECK:STDOUT: call void @"_COp.555b1314256372b8:core.Destroy.Core"(ptr %a.var), !dbg !51 -// CHECK:STDOUT: ret void, !dbg !54 +// CHECK:STDOUT: %a.var = alloca { i32, i32, i32 }, align 4, !dbg !59 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !59 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %a.var, ptr align 4 @tuple.479.loc4_50, i64 12, i1 false), !dbg !59 +// CHECK:STDOUT: %tuple.elem0.loc8_10.1.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 0, !dbg !61 +// CHECK:STDOUT: %.loc8_10.1 = load i32, ptr %tuple.elem0.loc8_10.1.tuple.elem, align 4, !dbg !61 +// CHECK:STDOUT: %tuple.elem0.loc8_10.2.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %return, i32 0, i32 0, !dbg !61 +// CHECK:STDOUT: store i32 %.loc8_10.1, ptr %tuple.elem0.loc8_10.2.tuple.elem, align 4, !dbg !61 +// CHECK:STDOUT: %tuple.elem1.loc8_10.1.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 1, !dbg !61 +// CHECK:STDOUT: %.loc8_10.3 = load i32, ptr %tuple.elem1.loc8_10.1.tuple.elem, align 4, !dbg !61 +// CHECK:STDOUT: %tuple.elem1.loc8_10.2.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %return, i32 0, i32 1, !dbg !61 +// CHECK:STDOUT: store i32 %.loc8_10.3, ptr %tuple.elem1.loc8_10.2.tuple.elem, align 4, !dbg !61 +// CHECK:STDOUT: %tuple.elem2.loc8_10.1.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 2, !dbg !61 +// CHECK:STDOUT: %.loc8_10.5 = load i32, ptr %tuple.elem2.loc8_10.1.tuple.elem, align 4, !dbg !61 +// CHECK:STDOUT: %tuple.elem2.loc8_10.2.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %return, i32 0, i32 2, !dbg !61 +// CHECK:STDOUT: store i32 %.loc8_10.5, ptr %tuple.elem2.loc8_10.2.tuple.elem, align 4, !dbg !61 +// CHECK:STDOUT: call void @"_CSelfDestruct.555b1314256372b8:core.Destroy.Core"(ptr %a.var), !dbg !59 +// CHECK:STDOUT: ret void, !dbg !62 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !55 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !63 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !57 +// CHECK:STDOUT: ret void, !dbg !65 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.555b1314256372b8:core.Destroy.Core"(ptr %self) #0 !dbg !59 { +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !67 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !61 +// CHECK:STDOUT: ret void, !dbg !69 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !71 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !73 +// CHECK:STDOUT: ret void, !dbg !73 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.555b1314256372b8:core.Destroy.Core"(ptr %self) #0 !dbg !75 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !77 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.555b1314256372b8:core.Destroy.Core"(ptr %self) #0 !dbg !79 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.555b1314256372b8:core.Destroy.Core"(ptr %self), !dbg !81 +// CHECK:STDOUT: ret void, !dbg !81 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -140,7 +181,7 @@ fn G() -> (i32, i32, i32) { // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!37} +// CHECK:STDOUT: !llvm.dbg.cu = !{!45} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} @@ -148,26 +189,38 @@ fn G() -> (i32, i32, i32) { // CHECK:STDOUT: !20 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) // CHECK:STDOUT: !23 = !{null, !20} // CHECK:STDOUT: !24 = !DISubroutineType(types: !23) -// CHECK:STDOUT: !36 = !DIFile(filename: "eval_init_in_place.carbon", directory: "") -// CHECK:STDOUT: !37 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !36, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !38 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !39 = !{!38} -// CHECK:STDOUT: !40 = !DISubroutineType(types: !39) -// CHECK:STDOUT: !41 = !{null, !38} -// CHECK:STDOUT: !42 = !DISubroutineType(types: !41) -// CHECK:STDOUT: !43 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !36, line: 4, type: !40, spFlags: DISPFlagDefinition, unit: !37) -// CHECK:STDOUT: !46 = !DILocation(line: 4, column: 41, scope: !43) -// CHECK:STDOUT: !47 = !DILocation(line: 4, column: 34, scope: !43) -// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !36, line: 6, type: !40, spFlags: DISPFlagDefinition, unit: !37) -// CHECK:STDOUT: !51 = !DILocation(line: 7, column: 3, scope: !48) -// CHECK:STDOUT: !53 = !DILocation(line: 8, column: 10, scope: !48) -// CHECK:STDOUT: !54 = !DILocation(line: 8, column: 3, scope: !48) -// CHECK:STDOUT: !55 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !36, line: 7, type: !24, spFlags: DISPFlagDefinition, unit: !37, retainedNodes: !58) -// CHECK:STDOUT: !56 = !DILocalVariable(arg: 1, scope: !55, type: !20) -// CHECK:STDOUT: !57 = !DILocation(line: 7, column: 3, scope: !55) -// CHECK:STDOUT: !58 = !{!56} -// CHECK:STDOUT: !59 = distinct !DISubprogram(name: "Op", linkageName: "_COp.555b1314256372b8:core.Destroy.Core", scope: null, file: !36, line: 7, type: !42, spFlags: DISPFlagDefinition, unit: !37, retainedNodes: !62) -// CHECK:STDOUT: !60 = !DILocalVariable(arg: 1, scope: !59, type: !38) -// CHECK:STDOUT: !61 = !DILocation(line: 7, column: 3, scope: !59) -// CHECK:STDOUT: !62 = !{!60} +// CHECK:STDOUT: !44 = !DIFile(filename: "eval_init_in_place.carbon", directory: "") +// CHECK:STDOUT: !45 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !44, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !46 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !47 = !{!46} +// CHECK:STDOUT: !48 = !DISubroutineType(types: !47) +// CHECK:STDOUT: !49 = !{null, !46} +// CHECK:STDOUT: !50 = !DISubroutineType(types: !49) +// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !44, line: 4, type: !48, spFlags: DISPFlagDefinition, unit: !45) +// CHECK:STDOUT: !54 = !DILocation(line: 4, column: 41, scope: !51) +// CHECK:STDOUT: !55 = !DILocation(line: 4, column: 34, scope: !51) +// CHECK:STDOUT: !56 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !44, line: 6, type: !48, spFlags: DISPFlagDefinition, unit: !45) +// CHECK:STDOUT: !59 = !DILocation(line: 7, column: 3, scope: !56) +// CHECK:STDOUT: !61 = !DILocation(line: 8, column: 10, scope: !56) +// CHECK:STDOUT: !62 = !DILocation(line: 8, column: 3, scope: !56) +// CHECK:STDOUT: !63 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !44, line: 7, type: !24, spFlags: DISPFlagDefinition, unit: !45, retainedNodes: !66) +// CHECK:STDOUT: !64 = !DILocalVariable(arg: 1, scope: !63, type: !20) +// CHECK:STDOUT: !65 = !DILocation(line: 7, column: 3, scope: !63) +// CHECK:STDOUT: !66 = !{!64} +// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !44, line: 7, type: !24, spFlags: DISPFlagDefinition, unit: !45, retainedNodes: !70) +// CHECK:STDOUT: !68 = !DILocalVariable(arg: 1, scope: !67, type: !20) +// CHECK:STDOUT: !69 = !DILocation(line: 7, column: 3, scope: !67) +// CHECK:STDOUT: !70 = !{!68} +// CHECK:STDOUT: !71 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !44, line: 7, type: !24, spFlags: DISPFlagDefinition, unit: !45, retainedNodes: !74) +// CHECK:STDOUT: !72 = !DILocalVariable(arg: 1, scope: !71, type: !20) +// CHECK:STDOUT: !73 = !DILocation(line: 7, column: 3, scope: !71) +// CHECK:STDOUT: !74 = !{!72} +// CHECK:STDOUT: !75 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.555b1314256372b8:core.Destroy.Core", scope: null, file: !44, line: 7, type: !50, spFlags: DISPFlagDefinition, unit: !45, retainedNodes: !78) +// CHECK:STDOUT: !76 = !DILocalVariable(arg: 1, scope: !75, type: !46) +// CHECK:STDOUT: !77 = !DILocation(line: 7, column: 3, scope: !75) +// CHECK:STDOUT: !78 = !{!76} +// CHECK:STDOUT: !79 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.555b1314256372b8:core.Destroy.Core", scope: null, file: !44, line: 7, type: !50, spFlags: DISPFlagDefinition, unit: !45, retainedNodes: !82) +// CHECK:STDOUT: !80 = !DILocalVariable(arg: 1, scope: !79, type: !46) +// CHECK:STDOUT: !81 = !DILocation(line: 7, column: 3, scope: !79) +// CHECK:STDOUT: !82 = !{!80} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/var/nested.carbon b/toolchain/lower/testdata/var/nested.carbon index f26315371d78..bd6b336fd1f7 100644 --- a/toolchain/lower/testdata/var/nested.carbon +++ b/toolchain/lower/testdata/var/nested.carbon @@ -41,26 +41,39 @@ fn Run() -> i32 { // CHECK:STDOUT: store i32 %.loc16, ptr %b.var, align 4, !dbg !31 // CHECK:STDOUT: %.loc17 = load i32, ptr %b.var, align 4, !dbg !35 // CHECK:STDOUT: store i32 %.loc17, ptr %a.var, align 4, !dbg !34 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %b.var), !dbg !31 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %b.var), !dbg !31 // CHECK:STDOUT: br label %while.cond, !dbg !36 // CHECK:STDOUT: // CHECK:STDOUT: while.done: ; preds = %while.cond // CHECK:STDOUT: %.loc19 = load i32, ptr %a.var, align 4, !dbg !37 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %a.var), !dbg !28 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %a.var), !dbg !28 // CHECK:STDOUT: ret i32 %.loc19, !dbg !38 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !39 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !39 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !41 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !43 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !45 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !47 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !49 +// CHECK:STDOUT: ret void, !dbg !49 +// 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: ; uselistorder directives -// CHECK:STDOUT: uselistorder ptr @"_COp.f58524831c37807e:core.Destroy.Core", { 1, 0 } +// CHECK:STDOUT: uselistorder ptr @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core", { 1, 0 } // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -88,8 +101,16 @@ fn Run() -> i32 { // CHECK:STDOUT: !36 = !DILocation(line: 15, column: 3, scope: !25) // CHECK:STDOUT: !37 = !DILocation(line: 19, column: 10, scope: !25) // CHECK:STDOUT: !38 = !DILocation(line: 19, column: 3, scope: !25) -// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 16, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !42) +// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !18, line: 16, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !42) // CHECK:STDOUT: !40 = !DILocalVariable(arg: 1, scope: !39, type: !20) // CHECK:STDOUT: !41 = !DILocation(line: 16, column: 5, scope: !39) // CHECK:STDOUT: !42 = !{!40} +// CHECK:STDOUT: !43 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 16, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !46) +// CHECK:STDOUT: !44 = !DILocalVariable(arg: 1, scope: !43, type: !20) +// CHECK:STDOUT: !45 = !DILocation(line: 16, column: 5, scope: !43) +// CHECK:STDOUT: !46 = !{!44} +// CHECK:STDOUT: !47 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !18, line: 16, type: !24, spFlags: DISPFlagDefinition, unit: !19, retainedNodes: !50) +// CHECK:STDOUT: !48 = !DILocalVariable(arg: 1, scope: !47, type: !20) +// CHECK:STDOUT: !49 = !DILocation(line: 16, column: 5, scope: !47) +// CHECK:STDOUT: !50 = !{!48} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/var/param.carbon b/toolchain/lower/testdata/var/param.carbon index f05d9f34606f..d77ba0090f52 100644 --- a/toolchain/lower/testdata/var/param.carbon +++ b/toolchain/lower/testdata/var/param.carbon @@ -63,16 +63,29 @@ fn G() { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !16 // CHECK:STDOUT: call void @_CMake.C.Main(ptr %c.var), !dbg !17 // CHECK:STDOUT: call void @_CF.Main(ptr %c.var), !dbg !18 -// CHECK:STDOUT: call void @"_COp.08d9e38b928ba575:core.Destroy.Core"(ptr %c.var), !dbg !16 +// CHECK:STDOUT: call void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr %c.var), !dbg !16 // CHECK:STDOUT: ret void, !dbg !19 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !20 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %self) #0 !dbg !20 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !22 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !24 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !26 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !28 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core"(ptr %self), !dbg !30 +// CHECK:STDOUT: ret void, !dbg !30 +// 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: @@ -96,10 +109,18 @@ fn G() { // CHECK:STDOUT: !17 = !DILocation(line: 16, column: 5, scope: !15) // CHECK:STDOUT: !18 = !DILocation(line: 16, column: 3, scope: !15) // CHECK:STDOUT: !19 = !DILocation(line: 15, column: 1, scope: !15) -// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "Op", linkageName: "_COp.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !6, line: 13, type: !10, spFlags: DISPFlagDefinition, unit: !7, retainedNodes: !23) +// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !6, line: 13, type: !10, spFlags: DISPFlagDefinition, unit: !7, retainedNodes: !23) // CHECK:STDOUT: !21 = !DILocalVariable(arg: 1, scope: !20, type: !8) // CHECK:STDOUT: !22 = !DILocation(line: 13, column: 6, scope: !20) // CHECK:STDOUT: !23 = !{!21} +// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !6, line: 13, type: !10, spFlags: DISPFlagDefinition, unit: !7, retainedNodes: !27) +// CHECK:STDOUT: !25 = !DILocalVariable(arg: 1, scope: !24, type: !8) +// CHECK:STDOUT: !26 = !DILocation(line: 13, column: 6, scope: !24) +// CHECK:STDOUT: !27 = !{!25} +// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !6, line: 13, type: !10, spFlags: DISPFlagDefinition, unit: !7, retainedNodes: !31) +// CHECK:STDOUT: !29 = !DILocalVariable(arg: 1, scope: !28, type: !8) +// CHECK:STDOUT: !30 = !DILocation(line: 13, column: 6, scope: !28) +// CHECK:STDOUT: !31 = !{!29} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'struct_literal_cleanup.carbon' @@ -112,20 +133,33 @@ fn G() { // CHECK:STDOUT: declare void @_CF.Main(ptr) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CG.Main() #0 !dbg !26 { +// CHECK:STDOUT: define void @_CG.Main() #0 !dbg !34 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %c.var = alloca {}, align 1, !dbg !27 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !27 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %c.var, ptr align 1 @C.val.loc11, i64 0, i1 false), !dbg !27 -// CHECK:STDOUT: call void @_CF.Main(ptr %c.var), !dbg !28 -// CHECK:STDOUT: call void @"_COp.08d9e38b928ba575:core.Destroy.Core"(ptr %c.var), !dbg !27 -// CHECK:STDOUT: ret void, !dbg !29 +// CHECK:STDOUT: %c.var = alloca {}, align 1, !dbg !35 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !35 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %c.var, ptr align 1 @C.val.loc11, i64 0, i1 false), !dbg !35 +// CHECK:STDOUT: call void @_CF.Main(ptr %c.var), !dbg !36 +// CHECK:STDOUT: call void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr %c.var), !dbg !35 +// CHECK:STDOUT: ret void, !dbg !37 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !30 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %self) #0 !dbg !38 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !32 +// CHECK:STDOUT: ret void, !dbg !40 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !42 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !44 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core"(ptr %self) #0 !dbg !46 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core"(ptr %self), !dbg !48 +// CHECK:STDOUT: ret void, !dbg !48 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -137,7 +171,7 @@ fn G() { // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!25} +// CHECK:STDOUT: !llvm.dbg.cu = !{!33} // CHECK:STDOUT: !llvm.module.flags = !{!2, !3} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} @@ -147,14 +181,22 @@ fn G() { // CHECK:STDOUT: !10 = !DISubroutineType(types: !9) // CHECK:STDOUT: !13 = !{null} // CHECK:STDOUT: !14 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !24 = !DIFile(filename: "struct_literal_cleanup.carbon", directory: "") -// CHECK:STDOUT: !25 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !24, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !24, line: 13, type: !14, spFlags: DISPFlagDefinition, unit: !25) -// CHECK:STDOUT: !27 = !DILocation(line: 11, column: 6, scope: !26) -// CHECK:STDOUT: !28 = !DILocation(line: 14, column: 3, scope: !26) -// CHECK:STDOUT: !29 = !DILocation(line: 13, column: 1, scope: !26) -// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "Op", linkageName: "_COp.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !24, line: 11, type: !10, spFlags: DISPFlagDefinition, unit: !25, retainedNodes: !33) -// CHECK:STDOUT: !31 = !DILocalVariable(arg: 1, scope: !30, type: !8) -// CHECK:STDOUT: !32 = !DILocation(line: 11, column: 6, scope: !30) -// CHECK:STDOUT: !33 = !{!31} +// CHECK:STDOUT: !32 = !DIFile(filename: "struct_literal_cleanup.carbon", directory: "") +// CHECK:STDOUT: !33 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !32, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !34 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !32, line: 13, type: !14, spFlags: DISPFlagDefinition, unit: !33) +// CHECK:STDOUT: !35 = !DILocation(line: 11, column: 6, scope: !34) +// CHECK:STDOUT: !36 = !DILocation(line: 14, column: 3, scope: !34) +// CHECK:STDOUT: !37 = !DILocation(line: 13, column: 1, scope: !34) +// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !32, line: 11, type: !10, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !41) +// CHECK:STDOUT: !39 = !DILocalVariable(arg: 1, scope: !38, type: !8) +// CHECK:STDOUT: !40 = !DILocation(line: 11, column: 6, scope: !38) +// CHECK:STDOUT: !41 = !{!39} +// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !32, line: 11, type: !10, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !45) +// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !42, type: !8) +// CHECK:STDOUT: !44 = !DILocation(line: 11, column: 6, scope: !42) +// CHECK:STDOUT: !45 = !{!43} +// CHECK:STDOUT: !46 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.08d9e38b928ba575:core.Destroy.Core", scope: null, file: !32, line: 11, type: !10, spFlags: DISPFlagDefinition, unit: !33, retainedNodes: !49) +// CHECK:STDOUT: !47 = !DILocalVariable(arg: 1, scope: !46, type: !8) +// CHECK:STDOUT: !48 = !DILocation(line: 11, column: 6, scope: !46) +// CHECK:STDOUT: !49 = !{!47} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/var/uninitialized.carbon b/toolchain/lower/testdata/var/uninitialized.carbon index e15c4a94ae35..ac6f844fee3d 100644 --- a/toolchain/lower/testdata/var/uninitialized.carbon +++ b/toolchain/lower/testdata/var/uninitialized.carbon @@ -42,23 +42,77 @@ fn Run() { // CHECK:STDOUT: store i8 poison, ptr %e.var, align 1, !dbg !23 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %f.var), !dbg !25 // CHECK:STDOUT: store ptr poison, ptr %f.var, align 8, !dbg !25 -// CHECK:STDOUT: call void @"_COp.dc14d4dd21801791:core.Destroy.Core"(ptr %b.var), !dbg !17 -// CHECK:STDOUT: call void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %a.var), !dbg !15 +// CHECK:STDOUT: call void @"_CSelfDestruct.d088c7eb746488be:core.Destroy.Core"(ptr %f.var), !dbg !25 +// CHECK:STDOUT: call void @"_CSelfDestruct.48e0adf639fe7af4:core.Destroy.Core"(ptr %e.var), !dbg !23 +// CHECK:STDOUT: call void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %d.var), !dbg !21 +// CHECK:STDOUT: call void @"_CSelfDestruct.61ea2aba74ab3bf1:core.Destroy.Core"(ptr %c.var), !dbg !19 +// CHECK:STDOUT: call void @"_CSelfDestruct.dc14d4dd21801791:core.Destroy.Core"(ptr %b.var), !dbg !17 +// CHECK:STDOUT: call void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %a.var), !dbg !15 // CHECK:STDOUT: ret i32 0, !dbg !27 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.dc14d4dd21801791:core.Destroy.Core"(ptr %self) #0 !dbg !28 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.d088c7eb746488be:core.Destroy.Core"(ptr %self) #0 !dbg !28 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !30 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !32 { +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.48e0adf639fe7af4:core.Destroy.Core"(ptr %self) #0 !dbg !32 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !34 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.cb8adced19392b99:core.Destroy.Core"(ptr %self) #0 !dbg !36 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !38 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.61ea2aba74ab3bf1:core.Destroy.Core"(ptr %self) #0 !dbg !40 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !42 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.7945ecba5c505fc0:core.Destroy.Core"(ptr %self) #0 !dbg !44 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !46 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.dc14d4dd21801791:core.Destroy.Core"(ptr %self) #0 !dbg !48 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !50 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.dc14d4dd21801791:core.Destroy.Core"(ptr %self) #0 !dbg !52 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.dc14d4dd21801791:core.Destroy.Core"(ptr %self), !dbg !54 +// CHECK:STDOUT: ret void, !dbg !54 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core"(ptr %self) #0 !dbg !56 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !58 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !60 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: ret void, !dbg !62 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nounwind +// CHECK:STDOUT: define weak_odr void @"_CSelfDestruct.f58524831c37807e:core.Destroy.Core"(ptr %self) #0 !dbg !64 { +// CHECK:STDOUT: entry: +// CHECK:STDOUT: call void @"_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core"(ptr %self), !dbg !66 +// CHECK:STDOUT: ret void, !dbg !66 +// 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: @@ -91,12 +145,44 @@ fn Run() { // CHECK:STDOUT: !23 = !DILocation(line: 18, column: 3, scope: !14) // CHECK:STDOUT: !25 = !DILocation(line: 19, column: 3, scope: !14) // CHECK:STDOUT: !27 = !DILocation(line: 13, column: 1, scope: !14) -// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "Op", linkageName: "_COp.dc14d4dd21801791:core.Destroy.Core", scope: null, file: !4, line: 15, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !31) +// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.d088c7eb746488be:core.Destroy.Core", scope: null, file: !4, line: 19, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !31) // CHECK:STDOUT: !29 = !DILocalVariable(arg: 1, scope: !28, type: !9) -// CHECK:STDOUT: !30 = !DILocation(line: 15, column: 3, scope: !28) +// CHECK:STDOUT: !30 = !DILocation(line: 19, column: 3, scope: !28) // CHECK:STDOUT: !31 = !{!29} -// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 14, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !35) -// CHECK:STDOUT: !33 = !DILocalVariable(arg: 1, scope: !32, type: !6) -// CHECK:STDOUT: !34 = !DILocation(line: 14, column: 3, scope: !32) +// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.48e0adf639fe7af4:core.Destroy.Core", scope: null, file: !4, line: 18, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !35) +// CHECK:STDOUT: !33 = !DILocalVariable(arg: 1, scope: !32, type: !9) +// CHECK:STDOUT: !34 = !DILocation(line: 18, column: 3, scope: !32) // CHECK:STDOUT: !35 = !{!33} +// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.cb8adced19392b99:core.Destroy.Core", scope: null, file: !4, line: 17, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !39) +// CHECK:STDOUT: !37 = !DILocalVariable(arg: 1, scope: !36, type: !9) +// CHECK:STDOUT: !38 = !DILocation(line: 17, column: 3, scope: !36) +// CHECK:STDOUT: !39 = !{!37} +// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.61ea2aba74ab3bf1:core.Destroy.Core", scope: null, file: !4, line: 16, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !43) +// CHECK:STDOUT: !41 = !DILocalVariable(arg: 1, scope: !40, type: !9) +// CHECK:STDOUT: !42 = !DILocation(line: 16, column: 3, scope: !40) +// CHECK:STDOUT: !43 = !{!41} +// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.7945ecba5c505fc0:core.Destroy.Core", scope: null, file: !4, line: 15, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !47) +// CHECK:STDOUT: !45 = !DILocalVariable(arg: 1, scope: !44, type: !9) +// CHECK:STDOUT: !46 = !DILocation(line: 15, column: 3, scope: !44) +// CHECK:STDOUT: !47 = !{!45} +// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.dc14d4dd21801791:core.Destroy.Core", scope: null, file: !4, line: 15, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !51) +// CHECK:STDOUT: !49 = !DILocalVariable(arg: 1, scope: !48, type: !9) +// CHECK:STDOUT: !50 = !DILocation(line: 15, column: 3, scope: !48) +// CHECK:STDOUT: !51 = !{!49} +// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.dc14d4dd21801791:core.Destroy.Core", scope: null, file: !4, line: 15, type: !11, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !55) +// CHECK:STDOUT: !53 = !DILocalVariable(arg: 1, scope: !52, type: !9) +// CHECK:STDOUT: !54 = !DILocation(line: 15, column: 3, scope: !52) +// CHECK:STDOUT: !55 = !{!53} +// CHECK:STDOUT: !56 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.6dae29ece9a708c4:core.Destroy.Core", scope: null, file: !4, line: 14, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !59) +// CHECK:STDOUT: !57 = !DILocalVariable(arg: 1, scope: !56, type: !6) +// CHECK:STDOUT: !58 = !DILocation(line: 14, column: 3, scope: !56) +// CHECK:STDOUT: !59 = !{!57} +// CHECK:STDOUT: !60 = distinct !DISubprogram(name: "SubobjectDestroy", linkageName: "_CSubobjectDestroy.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 14, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !63) +// CHECK:STDOUT: !61 = !DILocalVariable(arg: 1, scope: !60, type: !6) +// CHECK:STDOUT: !62 = !DILocation(line: 14, column: 3, scope: !60) +// CHECK:STDOUT: !63 = !{!61} +// CHECK:STDOUT: !64 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.f58524831c37807e:core.Destroy.Core", scope: null, file: !4, line: 14, type: !13, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !67) +// CHECK:STDOUT: !65 = !DILocalVariable(arg: 1, scope: !64, type: !6) +// CHECK:STDOUT: !66 = !DILocation(line: 14, column: 3, scope: !64) +// CHECK:STDOUT: !67 = !{!65} // CHECK:STDOUT: diff --git a/toolchain/testing/testdata/min_prelude/parts/destroy.carbon b/toolchain/testing/testdata/min_prelude/parts/destroy.carbon index 142787fc7bae..8ebd26463e29 100644 --- a/toolchain/testing/testdata/min_prelude/parts/destroy.carbon +++ b/toolchain/testing/testdata/min_prelude/parts/destroy.carbon @@ -6,14 +6,33 @@ package Core library "prelude/parts/destroy"; -// TODO: Add `Destructor`, as in: -// interface Destructor { -// private fn Op(ref self); +// TODO: uncomment when `require impls` adds a witness table entry. +// interface SubobjectDestroy { +// final fn Op(ref self) = "subobject.destroy"; // } -// Destroys objects. This will invoke `Destructor` impls recursively on members; -// it does not deallocate memory. interface Destroy { - // TODO: This should be `final fn Op(ref self) = "type.destroy"`. + // TODO: uncomment when `require impls` adds a witness table entry. + // require impls SubobjectDestroy; + + // TODO: change `Self` to `partial Self`. fn Op(ref self); + + // TODO: remove when `require impls` adds a witness table entry. + final fn SubobjectDestroy(unused ref self) { + // This function body is ignored by the toolchain. We can't use + // a built-in because the compiler treats it as an error. We + // should address this at some point, but it's not a high + // priority right now. + } + + final fn SelfDestruct(ref self) { + self.Op(); + self.SubobjectDestroy(); + } } + +// TODO: uncomment when `require impls` adds a witness table entry. +// impl forall [T: SubobjectDestroy] partial T as Destroy { +// alias Op = T.Op; +// }